compiler/libec; ecere: Support for checking platform as a compile time constant
[sdk] / compiler / bootstrap / libec / bootstrap / pass15.c
1 /* Code generated from eC source file: pass15.ec */
2 #if defined(_WIN32)
3 #define __runtimePlatform 1
4 #elif defined(__APPLE__)
5 #define __runtimePlatform 3
6 #else
7 #define __runtimePlatform 2
8 #endif
9 #if defined(__GNUC__)
10 typedef long long int64;
11 typedef unsigned long long uint64;
12 #ifndef _WIN32
13 #define __declspec(x)
14 #endif
15 #elif defined(__TINYC__)
16 #include <stdarg.h>
17 #define __builtin_va_list va_list
18 #define __builtin_va_start va_start
19 #define __builtin_va_end va_end
20 #ifdef _WIN32
21 #define strcasecmp stricmp
22 #define strncasecmp strnicmp
23 #define __declspec(x) __attribute__((x))
24 #else
25 #define __declspec(x)
26 #endif
27 typedef long long int64;
28 typedef unsigned long long uint64;
29 #else
30 typedef __int64 int64;
31 typedef unsigned __int64 uint64;
32 #endif
33 #ifdef __BIG_ENDIAN__
34 #define __ENDIAN_PAD(x) (8 - (x))
35 #else
36 #define __ENDIAN_PAD(x) 0
37 #endif
38 #include <stdint.h>
39 #include <sys/types.h>
40
41 #if /*defined(_W64) || */(defined(__WORDSIZE) && __WORDSIZE == 8) || defined(__x86_64__)
42 #define _64BIT 1
43 #else
44 #define _64BIT 0
45 #endif
46
47 #define arch_PointerSize                  sizeof(void *)
48 #define structSize_Instance               (_64BIT ? 24 : 12)
49 #define structSize_Module                 (_64BIT ? 560 : 300)
50 #define structSize_NamedLink64            (_64BIT ? 32 : 24)
51
52 struct __ecereNameSpace__ecere__com__Instance;
53
54 extern void *  __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
55
56 extern void *  __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
57
58 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew(void *  memory, unsigned int size);
59
60 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew0(void *  memory, unsigned int size);
61
62 extern void __ecereNameSpace__ecere__com__eSystem_Delete(void *  memory);
63
64 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BTNode;
65
66 struct __ecereNameSpace__ecere__sys__BTNode;
67
68 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BinaryTree;
69
70 struct __ecereNameSpace__ecere__sys__BinaryTree
71 {
72 struct __ecereNameSpace__ecere__sys__BTNode * root;
73 int count;
74 int (*  CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
75 void (*  FreeKey)(void *  key);
76 } __attribute__ ((gcc_struct));
77
78 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldList;
79
80 struct __ecereNameSpace__ecere__sys__OldList
81 {
82 void *  first;
83 void *  last;
84 int count;
85 unsigned int offset;
86 unsigned int circ;
87 } __attribute__ ((gcc_struct));
88
89 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Method;
90
91 struct __ecereNameSpace__ecere__com__Method
92 {
93 const char *  name;
94 struct __ecereNameSpace__ecere__com__Method * parent;
95 struct __ecereNameSpace__ecere__com__Method * left;
96 struct __ecereNameSpace__ecere__com__Method * right;
97 int depth;
98 int (*  function)();
99 int vid;
100 int type;
101 struct __ecereNameSpace__ecere__com__Class * _class;
102 void *  symbol;
103 const char *  dataTypeString;
104 struct Type * dataType;
105 int memberAccess;
106 } __attribute__ ((gcc_struct));
107
108 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Property;
109
110 struct __ecereNameSpace__ecere__com__Property
111 {
112 struct __ecereNameSpace__ecere__com__Property * prev;
113 struct __ecereNameSpace__ecere__com__Property * next;
114 const char *  name;
115 unsigned int isProperty;
116 int memberAccess;
117 int id;
118 struct __ecereNameSpace__ecere__com__Class * _class;
119 const char *  dataTypeString;
120 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
121 struct Type * dataType;
122 void (*  Set)(void * , int);
123 int (*  Get)(void * );
124 unsigned int (*  IsSet)(void * );
125 void *  data;
126 void *  symbol;
127 int vid;
128 unsigned int conversion;
129 unsigned int watcherOffset;
130 const char *  category;
131 unsigned int compiled;
132 unsigned int selfWatchable;
133 unsigned int isWatchable;
134 } __attribute__ ((gcc_struct));
135
136 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_CodePosition;
137
138 struct CodePosition
139 {
140 int line;
141 int charPos;
142 int pos;
143 int included;
144 } __attribute__ ((gcc_struct));
145
146 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Location;
147
148 struct Location
149 {
150 struct CodePosition start;
151 struct CodePosition end;
152 } __attribute__ ((gcc_struct));
153
154 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attrib;
155
156 struct Attrib;
157
158 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ExtDecl;
159
160 struct ExtDecl
161 {
162 struct Location loc;
163 int type;
164 union
165 {
166 char * s;
167 struct Attrib * attr;
168 } __attribute__ ((gcc_struct)) __anon1;
169 } __attribute__ ((gcc_struct));
170
171 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDefinition;
172
173 struct ClassDefinition
174 {
175 struct ClassDefinition * prev;
176 struct ClassDefinition * next;
177 struct Location loc;
178 struct Specifier * _class;
179 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
180 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
181 struct Symbol * symbol;
182 struct Location blockStart;
183 struct Location nameLoc;
184 int endid;
185 int declMode;
186 unsigned int deleteWatchable;
187 } __attribute__ ((gcc_struct));
188
189 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
190
191 struct Context
192 {
193 struct Context * parent;
194 struct __ecereNameSpace__ecere__sys__BinaryTree types;
195 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
196 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
197 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
198 int nextID;
199 int simpleID;
200 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
201 struct ClassDefinition * classDef;
202 unsigned int templateTypesOnly;
203 unsigned int hasNameSpace;
204 } __attribute__ ((gcc_struct));
205
206 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
207
208 struct Instantiation
209 {
210 struct Instantiation * prev;
211 struct Instantiation * next;
212 struct Location loc;
213 struct Specifier * _class;
214 struct Expression * exp;
215 struct __ecereNameSpace__ecere__sys__OldList *  members;
216 struct Symbol * symbol;
217 unsigned int fullSet;
218 unsigned int isConstant;
219 unsigned char *  data;
220 struct Location nameLoc;
221 struct Location insideLoc;
222 unsigned int built;
223 } __attribute__ ((gcc_struct));
224
225 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declaration;
226
227 struct Declaration
228 {
229 struct Declaration * prev;
230 struct Declaration * next;
231 struct Location loc;
232 int type;
233 union
234 {
235 struct
236 {
237 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
238 struct __ecereNameSpace__ecere__sys__OldList *  declarators;
239 } __attribute__ ((gcc_struct)) __anon1;
240 struct Instantiation * inst;
241 struct
242 {
243 struct Identifier * id;
244 struct Expression * exp;
245 } __attribute__ ((gcc_struct)) __anon2;
246 } __attribute__ ((gcc_struct)) __anon1;
247 struct Specifier * extStorage;
248 struct Symbol * symbol;
249 int declMode;
250 } __attribute__ ((gcc_struct));
251
252 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Statement;
253
254 struct Statement
255 {
256 struct Statement * prev;
257 struct Statement * next;
258 struct Location loc;
259 int type;
260 union
261 {
262 struct __ecereNameSpace__ecere__sys__OldList *  expressions;
263 struct
264 {
265 struct Identifier * id;
266 struct Statement * stmt;
267 } __attribute__ ((gcc_struct)) labeled;
268 struct
269 {
270 struct Expression * exp;
271 struct Statement * stmt;
272 } __attribute__ ((gcc_struct)) caseStmt;
273 struct
274 {
275 struct __ecereNameSpace__ecere__sys__OldList * declarations;
276 struct __ecereNameSpace__ecere__sys__OldList * statements;
277 struct Context * context;
278 unsigned int isSwitch;
279 } __attribute__ ((gcc_struct)) compound;
280 struct
281 {
282 struct __ecereNameSpace__ecere__sys__OldList * exp;
283 struct Statement * stmt;
284 struct Statement * elseStmt;
285 } __attribute__ ((gcc_struct)) ifStmt;
286 struct
287 {
288 struct __ecereNameSpace__ecere__sys__OldList * exp;
289 struct Statement * stmt;
290 } __attribute__ ((gcc_struct)) switchStmt;
291 struct
292 {
293 struct __ecereNameSpace__ecere__sys__OldList * exp;
294 struct Statement * stmt;
295 } __attribute__ ((gcc_struct)) whileStmt;
296 struct
297 {
298 struct __ecereNameSpace__ecere__sys__OldList * exp;
299 struct Statement * stmt;
300 } __attribute__ ((gcc_struct)) doWhile;
301 struct
302 {
303 struct Statement * init;
304 struct Statement * check;
305 struct __ecereNameSpace__ecere__sys__OldList * increment;
306 struct Statement * stmt;
307 } __attribute__ ((gcc_struct)) forStmt;
308 struct
309 {
310 struct Identifier * id;
311 } __attribute__ ((gcc_struct)) gotoStmt;
312 struct
313 {
314 struct Specifier * spec;
315 char * statements;
316 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
317 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
318 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
319 } __attribute__ ((gcc_struct)) asmStmt;
320 struct
321 {
322 struct Expression * watcher;
323 struct Expression * object;
324 struct __ecereNameSpace__ecere__sys__OldList * watches;
325 } __attribute__ ((gcc_struct)) _watch;
326 struct
327 {
328 struct Identifier * id;
329 struct __ecereNameSpace__ecere__sys__OldList * exp;
330 struct __ecereNameSpace__ecere__sys__OldList * filter;
331 struct Statement * stmt;
332 } __attribute__ ((gcc_struct)) forEachStmt;
333 struct Declaration * decl;
334 } __attribute__ ((gcc_struct)) __anon1;
335 } __attribute__ ((gcc_struct));
336
337 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
338
339 struct TypeName
340 {
341 struct TypeName * prev;
342 struct TypeName * next;
343 struct Location loc;
344 struct __ecereNameSpace__ecere__sys__OldList *  qualifiers;
345 struct Declarator * declarator;
346 int classObjectType;
347 struct Expression * bitCount;
348 } __attribute__ ((gcc_struct));
349
350 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Initializer;
351
352 struct Initializer
353 {
354 struct Initializer * prev;
355 struct Initializer * next;
356 struct Location loc;
357 int type;
358 union
359 {
360 struct Expression * exp;
361 struct __ecereNameSpace__ecere__sys__OldList *  list;
362 } __attribute__ ((gcc_struct)) __anon1;
363 unsigned int isConstant;
364 struct Identifier * id;
365 } __attribute__ ((gcc_struct));
366
367 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
368
369 struct __ecereNameSpace__ecere__com__DataValue
370 {
371 union
372 {
373 char c;
374 unsigned char uc;
375 short s;
376 unsigned short us;
377 int i;
378 unsigned int ui;
379 void *  p;
380 float f;
381 double d;
382 long long i64;
383 uint64 ui64;
384 } __attribute__ ((gcc_struct)) __anon1;
385 } __attribute__ ((gcc_struct));
386
387 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
388
389 struct Expression
390 {
391 struct Expression * prev;
392 struct Expression * next;
393 struct Location loc;
394 int type;
395 union
396 {
397 struct
398 {
399 char *  constant;
400 struct Identifier * identifier;
401 } __attribute__ ((gcc_struct)) __anon1;
402 struct Statement * compound;
403 struct Instantiation * instance;
404 struct
405 {
406 char *  string;
407 unsigned int intlString;
408 } __attribute__ ((gcc_struct)) __anon2;
409 struct __ecereNameSpace__ecere__sys__OldList *  list;
410 struct
411 {
412 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
413 struct Declarator * decl;
414 } __attribute__ ((gcc_struct)) _classExp;
415 struct
416 {
417 struct Identifier * id;
418 } __attribute__ ((gcc_struct)) classData;
419 struct
420 {
421 struct Expression * exp;
422 struct __ecereNameSpace__ecere__sys__OldList * arguments;
423 struct Location argLoc;
424 } __attribute__ ((gcc_struct)) call;
425 struct
426 {
427 struct Expression * exp;
428 struct __ecereNameSpace__ecere__sys__OldList * index;
429 } __attribute__ ((gcc_struct)) index;
430 struct
431 {
432 struct Expression * exp;
433 struct Identifier * member;
434 int memberType;
435 unsigned int thisPtr;
436 } __attribute__ ((gcc_struct)) member;
437 struct
438 {
439 int op;
440 struct Expression * exp1;
441 struct Expression * exp2;
442 } __attribute__ ((gcc_struct)) op;
443 struct TypeName * typeName;
444 struct Specifier * _class;
445 struct
446 {
447 struct TypeName * typeName;
448 struct Expression * exp;
449 } __attribute__ ((gcc_struct)) cast;
450 struct
451 {
452 struct Expression * cond;
453 struct __ecereNameSpace__ecere__sys__OldList * exp;
454 struct Expression * elseExp;
455 } __attribute__ ((gcc_struct)) cond;
456 struct
457 {
458 struct TypeName * typeName;
459 struct Expression * size;
460 } __attribute__ ((gcc_struct)) _new;
461 struct
462 {
463 struct TypeName * typeName;
464 struct Expression * size;
465 struct Expression * exp;
466 } __attribute__ ((gcc_struct)) _renew;
467 struct
468 {
469 char * table;
470 struct Identifier * id;
471 } __attribute__ ((gcc_struct)) db;
472 struct
473 {
474 struct Expression * ds;
475 struct Expression * name;
476 } __attribute__ ((gcc_struct)) dbopen;
477 struct
478 {
479 struct TypeName * typeName;
480 struct Initializer * initializer;
481 } __attribute__ ((gcc_struct)) initializer;
482 struct
483 {
484 struct Expression * exp;
485 struct TypeName * typeName;
486 } __attribute__ ((gcc_struct)) vaArg;
487 } __attribute__ ((gcc_struct)) __anon1;
488 unsigned int debugValue;
489 struct __ecereNameSpace__ecere__com__DataValue val;
490 uint64 address;
491 unsigned int hasAddress;
492 struct Type * expType;
493 struct Type * destType;
494 unsigned int usage;
495 int tempCount;
496 unsigned int byReference;
497 unsigned int isConstant;
498 unsigned int addedThis;
499 unsigned int needCast;
500 unsigned int thisPtr;
501 unsigned int opDestType;
502 unsigned int needTemplateCast;
503 } __attribute__ ((gcc_struct));
504
505 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
506
507 struct TemplateDatatype
508 {
509 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
510 struct Declarator * decl;
511 } __attribute__ ((gcc_struct));
512
513 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
514
515 struct TemplateArgument;
516
517 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
518
519 struct TemplateParameter
520 {
521 struct TemplateParameter * prev;
522 struct TemplateParameter * next;
523 struct Location loc;
524 int type;
525 struct Identifier * identifier;
526 union
527 {
528 struct TemplateDatatype * dataType;
529 int memberType;
530 } __attribute__ ((gcc_struct)) __anon1;
531 struct TemplateArgument * defaultArgument;
532 const char *  dataTypeString;
533 struct Type * baseType;
534 } __attribute__ ((gcc_struct));
535
536 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
537
538 struct Specifier
539 {
540 struct Specifier * prev;
541 struct Specifier * next;
542 struct Location loc;
543 int type;
544 union
545 {
546 int specifier;
547 struct
548 {
549 struct ExtDecl * extDecl;
550 char *  name;
551 struct Symbol * symbol;
552 struct __ecereNameSpace__ecere__sys__OldList *  templateArgs;
553 } __attribute__ ((gcc_struct)) __anon1;
554 struct
555 {
556 struct Identifier * id;
557 struct __ecereNameSpace__ecere__sys__OldList *  list;
558 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
559 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
560 unsigned int addNameSpace;
561 struct Context * ctx;
562 struct ExtDecl * extDeclStruct;
563 } __attribute__ ((gcc_struct)) __anon2;
564 struct Expression * expression;
565 struct Specifier * _class;
566 struct TemplateParameter * templateParameter;
567 } __attribute__ ((gcc_struct)) __anon1;
568 } __attribute__ ((gcc_struct));
569
570 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
571
572 struct Identifier
573 {
574 struct Identifier * prev;
575 struct Identifier * next;
576 struct Location loc;
577 struct Symbol * classSym;
578 struct Specifier * _class;
579 char *  string;
580 struct Identifier * badID;
581 } __attribute__ ((gcc_struct));
582
583 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Pointer;
584
585 struct Pointer;
586
587 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
588
589 struct Declarator
590 {
591 struct Declarator * prev;
592 struct Declarator * next;
593 struct Location loc;
594 int type;
595 struct Symbol * symbol;
596 struct Declarator * declarator;
597 union
598 {
599 struct Identifier * identifier;
600 struct
601 {
602 struct Expression * exp;
603 struct Expression * posExp;
604 struct Attrib * attrib;
605 } __attribute__ ((gcc_struct)) structDecl;
606 struct
607 {
608 struct Expression * exp;
609 struct Specifier * enumClass;
610 } __attribute__ ((gcc_struct)) array;
611 struct
612 {
613 struct __ecereNameSpace__ecere__sys__OldList * parameters;
614 } __attribute__ ((gcc_struct)) function;
615 struct
616 {
617 struct Pointer * pointer;
618 } __attribute__ ((gcc_struct)) pointer;
619 struct
620 {
621 struct ExtDecl * extended;
622 } __attribute__ ((gcc_struct)) extended;
623 } __attribute__ ((gcc_struct)) __anon1;
624 } __attribute__ ((gcc_struct));
625
626 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
627
628 struct FunctionDefinition
629 {
630 struct FunctionDefinition * prev;
631 struct FunctionDefinition * next;
632 struct Location loc;
633 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
634 struct Declarator * declarator;
635 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
636 struct Statement * body;
637 struct __ecereNameSpace__ecere__com__Class * _class;
638 struct __ecereNameSpace__ecere__sys__OldList attached;
639 int declMode;
640 struct Type * type;
641 struct Symbol * propSet;
642 int tempCount;
643 unsigned int propertyNoThis;
644 } __attribute__ ((gcc_struct));
645
646 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
647
648 struct DBTableDef;
649
650 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
651
652 struct External
653 {
654 struct External * prev;
655 struct External * next;
656 struct Location loc;
657 int type;
658 struct Symbol * symbol;
659 union
660 {
661 struct FunctionDefinition * function;
662 struct ClassDefinition * _class;
663 struct Declaration * declaration;
664 char *  importString;
665 struct Identifier * id;
666 struct DBTableDef * table;
667 } __attribute__ ((gcc_struct)) __anon1;
668 int importType;
669 } __attribute__ ((gcc_struct));
670
671 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
672
673 struct ModuleImport
674 {
675 struct ModuleImport * prev;
676 struct ModuleImport * next;
677 char *  name;
678 struct __ecereNameSpace__ecere__sys__OldList classes;
679 struct __ecereNameSpace__ecere__sys__OldList functions;
680 int importType;
681 int importAccess;
682 } __attribute__ ((gcc_struct));
683
684 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
685
686 struct ClassImport
687 {
688 struct ClassImport * prev;
689 struct ClassImport * next;
690 char *  name;
691 struct __ecereNameSpace__ecere__sys__OldList methods;
692 struct __ecereNameSpace__ecere__sys__OldList properties;
693 unsigned int itself;
694 int isRemote;
695 } __attribute__ ((gcc_struct));
696
697 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
698
699 struct Symbol
700 {
701 char *  string;
702 struct Symbol * parent;
703 struct Symbol * left;
704 struct Symbol * right;
705 int depth;
706 struct Type * type;
707 union
708 {
709 struct __ecereNameSpace__ecere__com__Method * method;
710 struct __ecereNameSpace__ecere__com__Property * _property;
711 struct __ecereNameSpace__ecere__com__Class * registered;
712 } __attribute__ ((gcc_struct)) __anon1;
713 int id;
714 int idCode;
715 union
716 {
717 struct
718 {
719 struct External * pointerExternal;
720 struct External * structExternal;
721 } __attribute__ ((gcc_struct)) __anon1;
722 struct
723 {
724 struct External * externalGet;
725 struct External * externalSet;
726 struct External * externalPtr;
727 struct External * externalIsSet;
728 } __attribute__ ((gcc_struct)) __anon2;
729 struct
730 {
731 struct External * methodExternal;
732 struct External * methodCodeExternal;
733 } __attribute__ ((gcc_struct)) __anon3;
734 } __attribute__ ((gcc_struct)) __anon2;
735 unsigned int imported;
736 unsigned int declaredStructSym;
737 struct __ecereNameSpace__ecere__com__Class * _class;
738 unsigned int declaredStruct;
739 unsigned int needConstructor;
740 unsigned int needDestructor;
741 char *  constructorName;
742 char *  structName;
743 char *  className;
744 char *  destructorName;
745 struct ModuleImport * module;
746 struct ClassImport * _import;
747 struct Location nameLoc;
748 unsigned int isParam;
749 unsigned int isRemote;
750 unsigned int isStruct;
751 unsigned int fireWatchersDone;
752 int declaring;
753 unsigned int classData;
754 unsigned int isStatic;
755 char *  shortName;
756 struct __ecereNameSpace__ecere__sys__OldList *  templateParams;
757 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
758 struct Context * ctx;
759 int isIterator;
760 struct Expression * propCategory;
761 } __attribute__ ((gcc_struct));
762
763 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
764
765 struct Type
766 {
767 struct Type * prev;
768 struct Type * next;
769 int refCount;
770 union
771 {
772 struct Symbol * _class;
773 struct
774 {
775 struct __ecereNameSpace__ecere__sys__OldList members;
776 char *  enumName;
777 } __attribute__ ((gcc_struct)) __anon1;
778 struct
779 {
780 struct Type * returnType;
781 struct __ecereNameSpace__ecere__sys__OldList params;
782 struct Symbol * thisClass;
783 unsigned int staticMethod;
784 struct TemplateParameter * thisClassTemplate;
785 } __attribute__ ((gcc_struct)) __anon2;
786 struct
787 {
788 struct __ecereNameSpace__ecere__com__Method * method;
789 struct __ecereNameSpace__ecere__com__Class * methodClass;
790 struct __ecereNameSpace__ecere__com__Class * usedClass;
791 } __attribute__ ((gcc_struct)) __anon3;
792 struct
793 {
794 struct Type * arrayType;
795 int arraySize;
796 struct Expression * arraySizeExp;
797 unsigned int freeExp;
798 struct Symbol * enumClass;
799 } __attribute__ ((gcc_struct)) __anon4;
800 struct Type * type;
801 struct TemplateParameter * templateParameter;
802 } __attribute__ ((gcc_struct)) __anon1;
803 int kind;
804 unsigned int size;
805 char *  name;
806 char *  typeName;
807 int classObjectType;
808 int alignment;
809 unsigned int offset;
810 int bitFieldCount;
811 int count;
812 unsigned int isSigned : 1;
813 unsigned int constant : 1;
814 unsigned int truth : 1;
815 unsigned int byReference : 1;
816 unsigned int extraParam : 1;
817 unsigned int directClassAccess : 1;
818 unsigned int computing : 1;
819 unsigned int keepCast : 1;
820 unsigned int passAsTemplate : 1;
821 unsigned int dllExport : 1;
822 unsigned int attrStdcall : 1;
823 unsigned int declaredWithStruct : 1;
824 unsigned int typedByReference : 1;
825 unsigned int casted : 1;
826 } __attribute__ ((gcc_struct));
827
828 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
829
830 struct __ecereNameSpace__ecere__com__Class
831 {
832 struct __ecereNameSpace__ecere__com__Class * prev;
833 struct __ecereNameSpace__ecere__com__Class * next;
834 const char *  name;
835 int offset;
836 int structSize;
837 int (* *  _vTbl)();
838 int vTblSize;
839 int (*  Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
840 void (*  Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
841 int offsetClass;
842 int sizeClass;
843 struct __ecereNameSpace__ecere__com__Class * base;
844 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
845 struct __ecereNameSpace__ecere__sys__BinaryTree members;
846 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
847 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
848 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
849 struct __ecereNameSpace__ecere__sys__OldList derivatives;
850 int memberID;
851 int startMemberID;
852 int type;
853 struct __ecereNameSpace__ecere__com__Instance * module;
854 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
855 const char *  dataTypeString;
856 struct Type * dataType;
857 int typeSize;
858 int defaultAlignment;
859 void (*  Initialize)();
860 int memberOffset;
861 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
862 const char *  designerClass;
863 unsigned int noExpansion;
864 const char *  defaultProperty;
865 unsigned int comRedefinition;
866 int count;
867 int isRemote;
868 unsigned int internalDecl;
869 void *  data;
870 unsigned int computeSize;
871 int structAlignment;
872 int destructionWatchOffset;
873 unsigned int fixed;
874 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
875 int inheritanceAccess;
876 const char *  fullName;
877 void *  symbol;
878 struct __ecereNameSpace__ecere__sys__OldList conversions;
879 struct __ecereNameSpace__ecere__sys__OldList templateParams;
880 struct __ecereNameSpace__ecere__com__ClassTemplateArgument *  templateArgs;
881 struct __ecereNameSpace__ecere__com__Class * templateClass;
882 struct __ecereNameSpace__ecere__sys__OldList templatized;
883 int numParams;
884 unsigned int isInstanceClass;
885 unsigned int byValueSystemClass;
886 } __attribute__ ((gcc_struct));
887
888 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name);
889
890 extern void __ecereNameSpace__ecere__com__eClass_SetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, long long value);
891
892 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
893
894 extern void __ecereNameSpace__ecere__com__eInstance_SetMethod(struct __ecereNameSpace__ecere__com__Instance * instance, const char *  name, void *  function);
895
896 extern void __ecereNameSpace__ecere__com__eInstance_IncRef(struct __ecereNameSpace__ecere__com__Instance * instance);
897
898 extern void __ecereNameSpace__ecere__com__eInstance_StopWatching(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property, struct __ecereNameSpace__ecere__com__Instance * object);
899
900 extern void __ecereNameSpace__ecere__com__eInstance_Watch(void *  instance, struct __ecereNameSpace__ecere__com__Property * _property, void *  object, void (*  callback)(void * , void * ));
901
902 extern void __ecereNameSpace__ecere__com__eInstance_FireWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
903
904 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
905
906 struct __ecereNameSpace__ecere__com__Instance
907 {
908 int (* *  _vTbl)();
909 struct __ecereNameSpace__ecere__com__Class * _class;
910 int _refCount;
911 } __attribute__ ((gcc_struct));
912
913 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
914
915 struct __ecereNameSpace__ecere__com__DataMember
916 {
917 struct __ecereNameSpace__ecere__com__DataMember * prev;
918 struct __ecereNameSpace__ecere__com__DataMember * next;
919 const char *  name;
920 unsigned int isProperty;
921 int memberAccess;
922 int id;
923 struct __ecereNameSpace__ecere__com__Class * _class;
924 const char *  dataTypeString;
925 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
926 struct Type * dataType;
927 int type;
928 int offset;
929 int memberID;
930 struct __ecereNameSpace__ecere__sys__OldList members;
931 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
932 int memberOffset;
933 int structAlignment;
934 } __attribute__ ((gcc_struct));
935
936 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
937
938 struct __ecereNameSpace__ecere__com__SerialBuffer
939 {
940 unsigned char *  _buffer;
941 unsigned int count;
942 unsigned int _size;
943 unsigned int pos;
944 } __attribute__ ((gcc_struct));
945
946 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
947
948 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
949 {
950 union
951 {
952 struct
953 {
954 const char *  dataTypeString;
955 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
956 } __attribute__ ((gcc_struct)) __anon1;
957 struct __ecereNameSpace__ecere__com__DataValue expression;
958 struct
959 {
960 const char *  memberString;
961 union
962 {
963 struct __ecereNameSpace__ecere__com__DataMember * member;
964 struct __ecereNameSpace__ecere__com__Property * prop;
965 struct __ecereNameSpace__ecere__com__Method * method;
966 } __attribute__ ((gcc_struct)) __anon1;
967 } __attribute__ ((gcc_struct)) __anon2;
968 } __attribute__ ((gcc_struct)) __anon1;
969 } __attribute__ ((gcc_struct));
970
971 void exit(int status);
972
973 void * calloc(size_t nmemb, size_t size);
974
975 void free(void * ptr);
976
977 void * malloc(size_t size);
978
979 void * realloc(void * ptr, size_t size);
980
981 long int strtol(const char * nptr, char ** endptr, int base);
982
983 long long int strtoll(const char * nptr, char ** endptr, int base);
984
985 unsigned long long int strtoull(const char * nptr, char ** endptr, int base);
986
987 enum yytokentype
988 {
989 IDENTIFIER = 258, CONSTANT = 259, STRING_LITERAL = 260, SIZEOF = 261, PTR_OP = 262, INC_OP = 263, DEC_OP = 264, LEFT_OP = 265, RIGHT_OP = 266, LE_OP = 267, GE_OP = 268, EQ_OP = 269, NE_OP = 270, AND_OP = 271, OR_OP = 272, MUL_ASSIGN = 273, DIV_ASSIGN = 274, MOD_ASSIGN = 275, ADD_ASSIGN = 276, SUB_ASSIGN = 277, LEFT_ASSIGN = 278, RIGHT_ASSIGN = 279, AND_ASSIGN = 280, XOR_ASSIGN = 281, OR_ASSIGN = 282, TYPE_NAME = 283, TYPEDEF = 284, EXTERN = 285, STATIC = 286, AUTO = 287, REGISTER = 288, CHAR = 289, SHORT = 290, INT = 291, UINT = 292, INT64 = 293, LONG = 294, SIGNED = 295, UNSIGNED = 296, FLOAT = 297, DOUBLE = 298, CONST = 299, VOLATILE = 300, VOID = 301, VALIST = 302, STRUCT = 303, UNION = 304, ENUM = 305, ELLIPSIS = 306, CASE = 307, DEFAULT = 308, IF = 309, SWITCH = 310, WHILE = 311, DO = 312, FOR = 313, GOTO = 314, CONTINUE = 315, BREAK = 316, RETURN = 317, IFX = 318, ELSE = 319, CLASS = 320, THISCLASS = 321, CLASS_NAME = 322, PROPERTY = 323, SETPROP = 324, GETPROP = 325, NEWOP = 326, RENEW = 327, DELETE = 328, EXT_DECL = 329, EXT_STORAGE = 330, IMPORT = 331, DEFINE = 332, VIRTUAL = 333, ATTRIB = 334, PUBLIC = 335, PRIVATE = 336, TYPED_OBJECT = 337, ANY_OBJECT = 338, _INCREF = 339, EXTENSION = 340, ASM = 341, TYPEOF = 342, WATCH = 343, STOPWATCHING = 344, FIREWATCHERS = 345, WATCHABLE = 346, CLASS_DESIGNER = 347, CLASS_NO_EXPANSION = 348, CLASS_FIXED = 349, ISPROPSET = 350, CLASS_DEFAULT_PROPERTY = 351, PROPERTY_CATEGORY = 352, CLASS_DATA = 353, CLASS_PROPERTY = 354, SUBCLASS = 355, NAMESPACE = 356, NEW0OP = 357, RENEW0 = 358, VAARG = 359, DBTABLE = 360, DBFIELD = 361, DBINDEX = 362, DATABASE_OPEN = 363, ALIGNOF = 364, ATTRIB_DEP = 365, __ATTRIB = 366, BOOL = 367, _BOOL = 368, _COMPLEX = 369, _IMAGINARY = 370, RESTRICT = 371, THREAD = 372
990 };
991
992 typedef union YYSTYPE
993 {
994 int specifierType;
995 int i;
996 int declMode;
997 struct Identifier * id;
998 struct Expression * exp;
999 struct Specifier * specifier;
1000 struct __ecereNameSpace__ecere__sys__OldList * list;
1001 struct Enumerator * enumerator;
1002 struct Declarator * declarator;
1003 struct Pointer * pointer;
1004 struct Initializer * initializer;
1005 struct InitDeclarator * initDeclarator;
1006 struct TypeName * typeName;
1007 struct Declaration * declaration;
1008 struct Statement * stmt;
1009 struct FunctionDefinition * function;
1010 struct External * external;
1011 struct Context * context;
1012 struct AsmField * asmField;
1013 struct Attrib * attrib;
1014 struct ExtDecl * extDecl;
1015 struct Attribute * attribute;
1016 struct Instantiation * instance;
1017 struct MembersInit * membersInit;
1018 struct MemberInit * memberInit;
1019 struct ClassFunction * classFunction;
1020 struct ClassDefinition * _class;
1021 struct ClassDef * classDef;
1022 struct PropertyDef * prop;
1023 char * string;
1024 struct Symbol * symbol;
1025 struct PropertyWatch * propertyWatch;
1026 struct TemplateParameter * templateParameter;
1027 struct TemplateArgument * templateArgument;
1028 struct TemplateDatatype * templateDatatype;
1029 struct DBTableEntry * dbtableEntry;
1030 struct DBIndexItem * dbindexItem;
1031 struct DBTableDef * dbtableDef;
1032 } __attribute__ ((gcc_struct)) YYSTYPE;
1033
1034 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
1035
1036 struct Enumerator
1037 {
1038 struct Enumerator * prev;
1039 struct Enumerator * next;
1040 struct Location loc;
1041 struct Identifier * id;
1042 struct Expression * exp;
1043 } __attribute__ ((gcc_struct));
1044
1045 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
1046
1047 struct InitDeclarator
1048 {
1049 struct InitDeclarator * prev;
1050 struct InitDeclarator * next;
1051 struct Location loc;
1052 struct Declarator * declarator;
1053 struct Initializer * initializer;
1054 } __attribute__ ((gcc_struct));
1055
1056 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
1057
1058 struct AsmField
1059 {
1060 struct AsmField * prev;
1061 struct AsmField * next;
1062 struct Location loc;
1063 char *  command;
1064 struct Expression * expression;
1065 struct Identifier * symbolic;
1066 } __attribute__ ((gcc_struct));
1067
1068 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attribute;
1069
1070 struct Attribute;
1071
1072 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
1073
1074 struct ClassFunction
1075 {
1076 struct ClassFunction * prev;
1077 struct ClassFunction * next;
1078 struct Location loc;
1079 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1080 struct Declarator * declarator;
1081 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
1082 struct Statement * body;
1083 struct __ecereNameSpace__ecere__com__Class * _class;
1084 struct __ecereNameSpace__ecere__sys__OldList attached;
1085 int declMode;
1086 struct Type * type;
1087 struct Symbol * propSet;
1088 unsigned int isVirtual;
1089 unsigned int isConstructor;
1090 unsigned int isDestructor;
1091 unsigned int dontMangle;
1092 int id;
1093 int idCode;
1094 } __attribute__ ((gcc_struct));
1095
1096 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
1097
1098 struct MembersInit
1099 {
1100 struct MembersInit * prev;
1101 struct MembersInit * next;
1102 struct Location loc;
1103 int type;
1104 union
1105 {
1106 struct __ecereNameSpace__ecere__sys__OldList *  dataMembers;
1107 struct ClassFunction * function;
1108 } __attribute__ ((gcc_struct)) __anon1;
1109 } __attribute__ ((gcc_struct));
1110
1111 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
1112
1113 struct MemberInit
1114 {
1115 struct MemberInit * prev;
1116 struct MemberInit * next;
1117 struct Location loc;
1118 struct Location realLoc;
1119 struct __ecereNameSpace__ecere__sys__OldList *  identifiers;
1120 struct Initializer * initializer;
1121 unsigned int used;
1122 unsigned int variable;
1123 unsigned int takeOutExp;
1124 } __attribute__ ((gcc_struct));
1125
1126 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1127
1128 struct PropertyDef
1129 {
1130 struct PropertyDef * prev;
1131 struct PropertyDef * next;
1132 struct Location loc;
1133 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1134 struct Declarator * declarator;
1135 struct Identifier * id;
1136 struct Statement * getStmt;
1137 struct Statement * setStmt;
1138 struct Statement * issetStmt;
1139 struct Symbol * symbol;
1140 struct Expression * category;
1141 struct
1142 {
1143 unsigned int conversion : 1;
1144 unsigned int isWatchable : 1;
1145 unsigned int isDBProp : 1;
1146 } __attribute__ ((gcc_struct)) __anon1;
1147 } __attribute__ ((gcc_struct));
1148
1149 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1150
1151 struct PropertyWatch
1152 {
1153 struct PropertyWatch * prev;
1154 struct PropertyWatch * next;
1155 struct Location loc;
1156 struct Statement * compound;
1157 struct __ecereNameSpace__ecere__sys__OldList *  properties;
1158 unsigned int deleteWatch;
1159 } __attribute__ ((gcc_struct));
1160
1161 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1162
1163 struct ClassDef
1164 {
1165 struct ClassDef * prev;
1166 struct ClassDef * next;
1167 struct Location loc;
1168 int type;
1169 union
1170 {
1171 struct Declaration * decl;
1172 struct ClassFunction * function;
1173 struct __ecereNameSpace__ecere__sys__OldList *  defProperties;
1174 struct PropertyDef * propertyDef;
1175 struct PropertyWatch * propertyWatch;
1176 char *  designer;
1177 struct Identifier * defaultProperty;
1178 struct
1179 {
1180 struct Identifier * id;
1181 struct Initializer * initializer;
1182 } __attribute__ ((gcc_struct)) __anon1;
1183 } __attribute__ ((gcc_struct)) __anon1;
1184 int memberAccess;
1185 void *  object;
1186 } __attribute__ ((gcc_struct));
1187
1188 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1189
1190 struct DBTableEntry;
1191
1192 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1193
1194 struct DBIndexItem;
1195
1196 extern YYSTYPE yylval;
1197
1198 extern struct Location yylloc;
1199
1200 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1201
1202 extern int returnCode;
1203
1204 extern struct Expression * parsedExpression;
1205
1206 extern unsigned int yydebug;
1207
1208 void SetYydebug(unsigned int b)
1209 {
1210 yydebug = b;
1211 }
1212
1213 extern unsigned int echoOn;
1214
1215 void resetScanner();
1216
1217 int propWatcherID;
1218
1219 int expression_yyparse();
1220
1221 static struct Statement * curCompound;
1222
1223 struct External * curExternal, * afterExternal;
1224
1225 static struct Type * curSwitchType;
1226
1227 static struct __ecereNameSpace__ecere__com__Class * currentClass;
1228
1229 struct __ecereNameSpace__ecere__com__Class * thisClass;
1230
1231 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
1232 {
1233 thisClass = c;
1234 }
1235
1236 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
1237 {
1238 return thisClass;
1239 }
1240
1241 static char * thisNameSpace;
1242
1243 struct __ecereNameSpace__ecere__com__Class * containerClass;
1244
1245 unsigned int thisClassParams = 1;
1246
1247 unsigned int internalValueCounter;
1248
1249 extern unsigned int outputLineNumbers;
1250
1251 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
1252
1253 extern size_t strlen(const char * );
1254
1255 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
1256
1257 extern void *  __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1258
1259 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
1260
1261 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
1262
1263 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
1264
1265 void PrintExpression(struct Expression * exp, char * string)
1266 {
1267 {
1268 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
1269 int count;
1270 unsigned int backOutputLineNumbers = outputLineNumbers;
1271
1272 outputLineNumbers = 0;
1273 if(exp)
1274 OutputExpression(exp, f);
1275 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
1276 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
1277
1278 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
1279 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
1280 count = strlen(string);
1281 count += ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__extension__ ({
1282 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
1283
1284 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
1285 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Read])(f, string + count, 1, 1023);
1286 string[count] = '\0';
1287 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
1288 outputLineNumbers = backOutputLineNumbers;
1289 }
1290 }
1291
1292 extern struct Type * ProcessTypeString(const char *  string, unsigned int staticMethod);
1293
1294 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1295
1296 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1297 {
1298 if(param && param->type == 0 && (param->__anon1.dataType || param->dataTypeString))
1299 {
1300 if(!param->baseType)
1301 {
1302 if(param->dataTypeString)
1303 param->baseType = ProcessTypeString(param->dataTypeString, 0);
1304 else
1305 param->baseType = ProcessType(param->__anon1.dataType->specifiers, param->__anon1.dataType->decl);
1306 }
1307 return param->baseType;
1308 }
1309 return (((void *)0));
1310 }
1311
1312 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1313 {
1314 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1315 return 1;
1316 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0)
1317 {
1318 return 0;
1319 }
1320 if(type1->kind == type2->kind)
1321 {
1322 switch(type1->kind)
1323 {
1324 case 24:
1325 case 1:
1326 case 2:
1327 case 3:
1328 case 4:
1329 case 22:
1330 case 23:
1331 if(type1->passAsTemplate && !type2->passAsTemplate)
1332 return 1;
1333 return type1->isSigned != type2->isSigned;
1334 case 8:
1335 return type1->__anon1._class != type2->__anon1._class;
1336 case 13:
1337 return (type1->__anon1.type && type2->__anon1.type && type1->__anon1.type->constant != type2->__anon1.type->constant) || NeedCast(type1->__anon1.type, type2->__anon1.type);
1338 default:
1339 return 1;
1340 }
1341 }
1342 return 1;
1343 }
1344
1345 extern int strcmp(const char * , const char * );
1346
1347 extern struct Context * curContext;
1348
1349 extern struct Context * topContext;
1350
1351 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
1352
1353 extern struct __ecereNameSpace__ecere__com__Property * __ecereNameSpace__ecere__com__eClass_FindProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, struct __ecereNameSpace__ecere__com__Instance * module);
1354
1355 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1356
1357 extern struct __ecereNameSpace__ecere__com__Method * __ecereNameSpace__ecere__com__eClass_FindMethod(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, struct __ecereNameSpace__ecere__com__Instance * module);
1358
1359 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_FindDataMember(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, struct __ecereNameSpace__ecere__com__Instance * module, struct __ecereNameSpace__ecere__com__DataMember **  subMemberStack, int *  subMemberStackPos);
1360
1361 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassProperty;
1362
1363 struct __ecereNameSpace__ecere__com__ClassProperty
1364 {
1365 const char *  name;
1366 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1367 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1368 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1369 int depth;
1370 void (*  Set)(struct __ecereNameSpace__ecere__com__Class *, long long);
1371 long long (*  Get)(struct __ecereNameSpace__ecere__com__Class *);
1372 const char *  dataTypeString;
1373 struct Type * dataType;
1374 unsigned int constant;
1375 } __attribute__ ((gcc_struct));
1376
1377 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name);
1378
1379 extern struct Expression * QMkExpId(const char *  id);
1380
1381 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateParameter;
1382
1383 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
1384 {
1385 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
1386 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
1387 const char *  name;
1388 int type;
1389 union
1390 {
1391 const char *  dataTypeString;
1392 int memberType;
1393 } __attribute__ ((gcc_struct)) __anon1;
1394 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
1395 void *  param;
1396 } __attribute__ ((gcc_struct));
1397
1398 extern struct Expression * GetTemplateArgExpByName(const char *  paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
1399
1400 extern struct __ecereNameSpace__ecere__sys__OldList *  MkList(void);
1401
1402 extern void FreeIdentifier(struct Identifier * id);
1403
1404 void ProcessExpressionType(struct Expression * exp);
1405
1406 extern struct Declarator * SpecDeclFromString(const char *  string, struct __ecereNameSpace__ecere__sys__OldList *  specs, struct Declarator * baseDecl);
1407
1408 extern struct __ecereNameSpace__ecere__sys__OldList *  MkListOne(void *  item);
1409
1410 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1411
1412 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1413
1414 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1415
1416 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1417
1418 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1419
1420 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char *  key);
1421
1422 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
1423 {
1424 if(exp->type == 0 && exp->__anon1.__anon1.identifier)
1425 {
1426 struct Identifier * id = exp->__anon1.__anon1.identifier;
1427 struct Context * ctx;
1428 struct Symbol * symbol = (((void *)0));
1429
1430 if(!id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
1431 {
1432 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
1433 {
1434 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
1435 if(symbol)
1436 break;
1437 }
1438 }
1439 if(!symbol && ((!id->_class || (id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))) || (id->classSym && __ecereNameSpace__ecere__com__eClass_IsDerived(_class, id->classSym->__anon1.registered))))
1440 {
1441 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
1442 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
1443 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
1444 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
1445
1446 if(!prop)
1447 {
1448 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
1449 }
1450 if(!prop && !method)
1451 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
1452 if(!prop && !method && !member)
1453 {
1454 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
1455 }
1456 if(prop || method || member || classProp)
1457 {
1458 exp->type = 8;
1459 exp->__anon1.member.member = id;
1460 exp->__anon1.member.memberType = 0;
1461 exp->__anon1.member.exp = QMkExpId("this");
1462 exp->addedThis = 1;
1463 }
1464 else if(_class && _class->templateParams.first)
1465 {
1466 struct __ecereNameSpace__ecere__com__Class * sClass;
1467
1468 for(sClass = _class; sClass; sClass = sClass->base)
1469 {
1470 if(sClass->templateParams.first)
1471 {
1472 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
1473
1474 for(param = sClass->templateParams.first; param; param = param->next)
1475 {
1476 if(param->type == 2 && !strcmp(param->name, id->string))
1477 {
1478 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
1479
1480 if(argExp)
1481 {
1482 struct Declarator * decl;
1483 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1484
1485 FreeIdentifier(exp->__anon1.member.member);
1486 ProcessExpressionType(argExp);
1487 decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
1488 exp->expType = ProcessType(specs, decl);
1489 exp->type = 5;
1490 exp->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
1491 }
1492 }
1493 }
1494 }
1495 }
1496 }
1497 }
1498 }
1499 }
1500
1501 extern int sprintf(char * , const char * , ...);
1502
1503 extern char *  strcat(char * , const char * );
1504
1505 extern char *  __ecereNameSpace__ecere__sys__CopyString(const char *  string);
1506
1507 char * PrintInt(long long result)
1508 {
1509 char temp[100];
1510
1511 if(result > (((int)0x7fffffff)))
1512 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
1513 else
1514 sprintf(temp, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), result);
1515 if(result > (((int)0x7fffffff)) || result < (((int)0x80000000)))
1516 strcat(temp, "LL");
1517 return __ecereNameSpace__ecere__sys__CopyString(temp);
1518 }
1519
1520 char * PrintUInt(uint64 result)
1521 {
1522 char temp[100];
1523
1524 if(result > (0xffffffff))
1525 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1526 else if(result > (((int)0x7fffffff)))
1527 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
1528 else
1529 sprintf(temp, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), result);
1530 return __ecereNameSpace__ecere__sys__CopyString(temp);
1531 }
1532
1533 char * PrintInt64(long long result)
1534 {
1535 char temp[100];
1536
1537 if(result > (((int)0x7fffffff)) || result < (((int)0x80000000)))
1538 sprintf(temp, ((__runtimePlatform == 1) ? "%I64dLL" : "%lldLL"), result);
1539 else
1540 sprintf(temp, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), result);
1541 return __ecereNameSpace__ecere__sys__CopyString(temp);
1542 }
1543
1544 char * PrintUInt64(uint64 result)
1545 {
1546 char temp[100];
1547
1548 if(result > (0xffffffff))
1549 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1550 else if(result > (((int)0x7fffffff)))
1551 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
1552 else
1553 sprintf(temp, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), result);
1554 return __ecereNameSpace__ecere__sys__CopyString(temp);
1555 }
1556
1557 char * PrintHexUInt(uint64 result)
1558 {
1559 char temp[100];
1560
1561 if(result > (0xffffffff))
1562 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
1563 else
1564 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
1565 if(result > (0xffffffff))
1566 strcat(temp, "LL");
1567 return __ecereNameSpace__ecere__sys__CopyString(temp);
1568 }
1569
1570 char * PrintHexUInt64(uint64 result)
1571 {
1572 char temp[100];
1573
1574 if(result > (0xffffffff))
1575 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1576 else
1577 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
1578 return __ecereNameSpace__ecere__sys__CopyString(temp);
1579 }
1580
1581 char * PrintShort(short result)
1582 {
1583 char temp[100];
1584
1585 sprintf(temp, "%d", (unsigned short)result);
1586 return __ecereNameSpace__ecere__sys__CopyString(temp);
1587 }
1588
1589 char * PrintUShort(unsigned short result)
1590 {
1591 char temp[100];
1592
1593 if(result > (unsigned short)32767)
1594 sprintf(temp, "0x%X", (int)result);
1595 else
1596 sprintf(temp, "%d", (int)result);
1597 return __ecereNameSpace__ecere__sys__CopyString(temp);
1598 }
1599
1600 extern int isprint(int c);
1601
1602 char * PrintChar(char result)
1603 {
1604 char temp[100];
1605
1606 if(result > (char)0 && isprint(result))
1607 sprintf(temp, "'%c'", result);
1608 else if(result < (char)0)
1609 sprintf(temp, "%d", (int)result);
1610 else
1611 sprintf(temp, "0x%X", (unsigned char)result);
1612 return __ecereNameSpace__ecere__sys__CopyString(temp);
1613 }
1614
1615 char * PrintUChar(unsigned char result)
1616 {
1617 char temp[100];
1618
1619 sprintf(temp, "0x%X", result);
1620 return __ecereNameSpace__ecere__sys__CopyString(temp);
1621 }
1622
1623 extern char *  strcpy(char * , const char * );
1624
1625 extern unsigned int (* __ecereProp_float_Get_isInf)(float this);
1626
1627 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_isInf;
1628
1629 extern int (* __ecereProp_float_Get_signBit)(float this);
1630
1631 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_signBit;
1632
1633 extern unsigned int (* __ecereProp_float_Get_isNan)(float this);
1634
1635 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_isNan;
1636
1637 char * PrintFloat(float result)
1638 {
1639 char temp[350];
1640
1641 if(__ecereProp_float_Get_isInf(result))
1642 {
1643 if(__ecereProp_float_Get_signBit(result))
1644 strcpy(temp, "-inf");
1645 else
1646 strcpy(temp, "inf");
1647 }
1648 else if(__ecereProp_float_Get_isNan(result))
1649 {
1650 if(__ecereProp_float_Get_signBit(result))
1651 strcpy(temp, "-nan");
1652 else
1653 strcpy(temp, "nan");
1654 }
1655 else
1656 sprintf(temp, "%.16ff", result);
1657 return __ecereNameSpace__ecere__sys__CopyString(temp);
1658 }
1659
1660 extern unsigned int (* __ecereProp_double_Get_isInf)(double this);
1661
1662 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_isInf;
1663
1664 extern int (* __ecereProp_double_Get_signBit)(double this);
1665
1666 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_signBit;
1667
1668 extern unsigned int (* __ecereProp_double_Get_isNan)(double this);
1669
1670 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_isNan;
1671
1672 char * PrintDouble(double result)
1673 {
1674 char temp[350];
1675
1676 if(__ecereProp_double_Get_isInf(result))
1677 {
1678 if(__ecereProp_double_Get_signBit(result))
1679 strcpy(temp, "-inf");
1680 else
1681 strcpy(temp, "inf");
1682 }
1683 else if(__ecereProp_double_Get_isNan(result))
1684 {
1685 if(__ecereProp_double_Get_signBit(result))
1686 strcpy(temp, "-nan");
1687 else
1688 strcpy(temp, "nan");
1689 }
1690 else
1691 sprintf(temp, "%.16f", result);
1692 return __ecereNameSpace__ecere__sys__CopyString(temp);
1693 }
1694
1695 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1696
1697 struct OpTable
1698 {
1699 unsigned int (*  Add)(struct Expression *, struct Operand *, struct Operand *);
1700 unsigned int (*  Sub)(struct Expression *, struct Operand *, struct Operand *);
1701 unsigned int (*  Mul)(struct Expression *, struct Operand *, struct Operand *);
1702 unsigned int (*  Div)(struct Expression *, struct Operand *, struct Operand *);
1703 unsigned int (*  Mod)(struct Expression *, struct Operand *, struct Operand *);
1704 unsigned int (*  Neg)(struct Expression *, struct Operand *);
1705 unsigned int (*  Inc)(struct Expression *, struct Operand *);
1706 unsigned int (*  Dec)(struct Expression *, struct Operand *);
1707 unsigned int (*  Asign)(struct Expression *, struct Operand *, struct Operand *);
1708 unsigned int (*  AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1709 unsigned int (*  SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1710 unsigned int (*  MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1711 unsigned int (*  DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1712 unsigned int (*  ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1713 unsigned int (*  BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1714 unsigned int (*  BitOr)(struct Expression *, struct Operand *, struct Operand *);
1715 unsigned int (*  BitXor)(struct Expression *, struct Operand *, struct Operand *);
1716 unsigned int (*  LShift)(struct Expression *, struct Operand *, struct Operand *);
1717 unsigned int (*  RShift)(struct Expression *, struct Operand *, struct Operand *);
1718 unsigned int (*  BitNot)(struct Expression *, struct Operand *);
1719 unsigned int (*  AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1720 unsigned int (*  OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1721 unsigned int (*  XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1722 unsigned int (*  LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1723 unsigned int (*  RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1724 unsigned int (*  Not)(struct Expression *, struct Operand *);
1725 unsigned int (*  Equ)(struct Expression *, struct Operand *, struct Operand *);
1726 unsigned int (*  Nqu)(struct Expression *, struct Operand *, struct Operand *);
1727 unsigned int (*  And)(struct Expression *, struct Operand *, struct Operand *);
1728 unsigned int (*  Or)(struct Expression *, struct Operand *, struct Operand *);
1729 unsigned int (*  Grt)(struct Expression *, struct Operand *, struct Operand *);
1730 unsigned int (*  Sma)(struct Expression *, struct Operand *, struct Operand *);
1731 unsigned int (*  GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1732 unsigned int (*  SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1733 unsigned int (*  Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1734 } __attribute__ ((gcc_struct));
1735
1736 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1737
1738 struct Operand
1739 {
1740 int kind;
1741 struct Type * type;
1742 unsigned int ptrSize;
1743 union
1744 {
1745 char c;
1746 unsigned char uc;
1747 short s;
1748 unsigned short us;
1749 int i;
1750 unsigned int ui;
1751 float f;
1752 double d;
1753 long long i64;
1754 uint64 ui64;
1755 } __attribute__ ((gcc_struct)) __anon1;
1756 struct OpTable ops;
1757 } __attribute__ ((gcc_struct));
1758
1759 unsigned int GetOpInt(struct Operand * op2, int * value2)
1760 {
1761 if(op2->kind == 3 && op2->type->isSigned)
1762 *value2 = op2->__anon1.i;
1763 else if(op2->kind == 3)
1764 *value2 = (int)op2->__anon1.ui;
1765 else if(op2->kind == 4 && op2->type->isSigned)
1766 *value2 = (int)op2->__anon1.i64;
1767 else if(op2->kind == 4)
1768 *value2 = (int)op2->__anon1.ui64;
1769 else if(op2->kind == 23 && op2->type->isSigned)
1770 *value2 = (int)op2->__anon1.i64;
1771 else if(op2->kind == 23)
1772 *value2 = (int)op2->__anon1.ui64;
1773 else if(op2->kind == 22 && op2->type->isSigned)
1774 *value2 = (int)op2->__anon1.i64;
1775 else if(op2->kind == 22)
1776 *value2 = (int)op2->__anon1.ui64;
1777 else if(op2->kind == 2 && op2->type->isSigned)
1778 *value2 = (int)op2->__anon1.s;
1779 else if(op2->kind == 2)
1780 *value2 = (int)op2->__anon1.us;
1781 else if(op2->kind == 1 && op2->type->isSigned)
1782 *value2 = (int)op2->__anon1.c;
1783 else if(op2->kind == 24 || op2->kind == 1)
1784 *value2 = (int)op2->__anon1.uc;
1785 else if(op2->kind == 6)
1786 *value2 = (int)op2->__anon1.f;
1787 else if(op2->kind == 7)
1788 *value2 = (int)op2->__anon1.d;
1789 else if(op2->kind == 13)
1790 *value2 = (int)op2->__anon1.ui64;
1791 else
1792 return 0;
1793 return 1;
1794 }
1795
1796 struct Operand GetOperand(struct Expression * exp);
1797
1798 unsigned int GetInt(struct Expression * exp, int * value2)
1799 {
1800 struct Operand op2 = GetOperand(exp);
1801
1802 return GetOpInt(&op2, value2);
1803 }
1804
1805 unsigned int GetOpUInt(struct Operand * op2, unsigned int * value2)
1806 {
1807 if(op2->kind == 3 && op2->type->isSigned)
1808 *value2 = (unsigned int)op2->__anon1.i;
1809 else if(op2->kind == 3)
1810 *value2 = op2->__anon1.ui;
1811 else if(op2->kind == 4 && op2->type->isSigned)
1812 *value2 = (unsigned int)op2->__anon1.i64;
1813 else if(op2->kind == 4)
1814 *value2 = (unsigned int)op2->__anon1.ui64;
1815 else if(op2->kind == 23 && op2->type->isSigned)
1816 *value2 = (unsigned int)op2->__anon1.i64;
1817 else if(op2->kind == 23)
1818 *value2 = (unsigned int)op2->__anon1.ui64;
1819 else if(op2->kind == 22 && op2->type->isSigned)
1820 *value2 = (unsigned int)op2->__anon1.i64;
1821 else if(op2->kind == 22)
1822 *value2 = (unsigned int)op2->__anon1.ui64;
1823 else if(op2->kind == 2 && op2->type->isSigned)
1824 *value2 = (unsigned int)op2->__anon1.s;
1825 else if(op2->kind == 2)
1826 *value2 = (unsigned int)op2->__anon1.us;
1827 else if(op2->kind == 1 && op2->type->isSigned)
1828 *value2 = (unsigned int)op2->__anon1.c;
1829 else if(op2->kind == 24 || op2->kind == 1)
1830 *value2 = (unsigned int)op2->__anon1.uc;
1831 else if(op2->kind == 6)
1832 *value2 = (unsigned int)op2->__anon1.f;
1833 else if(op2->kind == 7)
1834 *value2 = (unsigned int)op2->__anon1.d;
1835 else if(op2->kind == 13)
1836 *value2 = (unsigned int)op2->__anon1.ui64;
1837 else
1838 return 0;
1839 return 1;
1840 }
1841
1842 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1843 {
1844 struct Operand op2 = GetOperand(exp);
1845
1846 return GetOpUInt(&op2, value2);
1847 }
1848
1849 unsigned int GetOpInt64(struct Operand * op2, long long * value2)
1850 {
1851 if(op2->kind == 3 && op2->type->isSigned)
1852 *value2 = (long long)op2->__anon1.i;
1853 else if(op2->kind == 3)
1854 *value2 = (long long)op2->__anon1.ui;
1855 else if(op2->kind == 4 && op2->type->isSigned)
1856 *value2 = op2->__anon1.i64;
1857 else if(op2->kind == 4)
1858 *value2 = (long long)op2->__anon1.ui64;
1859 else if(op2->kind == 23 && op2->type->isSigned)
1860 *value2 = op2->__anon1.i64;
1861 else if(op2->kind == 23)
1862 *value2 = (long long)op2->__anon1.ui64;
1863 else if(op2->kind == 22 && op2->type->isSigned)
1864 *value2 = op2->__anon1.i64;
1865 else if(op2->kind == 22)
1866 *value2 = (long long)op2->__anon1.ui64;
1867 else if(op2->kind == 2 && op2->type->isSigned)
1868 *value2 = (long long)op2->__anon1.s;
1869 else if(op2->kind == 2)
1870 *value2 = (long long)op2->__anon1.us;
1871 else if(op2->kind == 1 && op2->type->isSigned)
1872 *value2 = (long long)op2->__anon1.c;
1873 else if(op2->kind == 24 || op2->kind == 1)
1874 *value2 = (long long)op2->__anon1.uc;
1875 else if(op2->kind == 6)
1876 *value2 = (long long)op2->__anon1.f;
1877 else if(op2->kind == 7)
1878 *value2 = (long long)op2->__anon1.d;
1879 else if(op2->kind == 13)
1880 *value2 = (long long)op2->__anon1.ui64;
1881 else
1882 return 0;
1883 return 1;
1884 }
1885
1886 unsigned int GetInt64(struct Expression * exp, long long * value2)
1887 {
1888 struct Operand op2 = GetOperand(exp);
1889
1890 return GetOpInt64(&op2, value2);
1891 }
1892
1893 unsigned int GetOpUInt64(struct Operand * op2, uint64 * value2)
1894 {
1895 if(op2->kind == 3 && op2->type->isSigned)
1896 *value2 = (uint64)op2->__anon1.i;
1897 else if(op2->kind == 3)
1898 *value2 = (uint64)op2->__anon1.ui;
1899 else if(op2->kind == 4 && op2->type->isSigned)
1900 *value2 = (uint64)op2->__anon1.i64;
1901 else if(op2->kind == 4)
1902 *value2 = op2->__anon1.ui64;
1903 else if(op2->kind == 23 && op2->type->isSigned)
1904 *value2 = (uint64)op2->__anon1.i64;
1905 else if(op2->kind == 23)
1906 *value2 = op2->__anon1.ui64;
1907 else if(op2->kind == 22 && op2->type->isSigned)
1908 *value2 = (uint64)op2->__anon1.i64;
1909 else if(op2->kind == 22)
1910 *value2 = op2->__anon1.ui64;
1911 else if(op2->kind == 2 && op2->type->isSigned)
1912 *value2 = (uint64)op2->__anon1.s;
1913 else if(op2->kind == 2)
1914 *value2 = (uint64)op2->__anon1.us;
1915 else if(op2->kind == 1 && op2->type->isSigned)
1916 *value2 = (uint64)op2->__anon1.c;
1917 else if(op2->kind == 24 || op2->kind == 1)
1918 *value2 = (uint64)op2->__anon1.uc;
1919 else if(op2->kind == 6)
1920 *value2 = (uint64)op2->__anon1.f;
1921 else if(op2->kind == 7)
1922 *value2 = (uint64)op2->__anon1.d;
1923 else if(op2->kind == 13)
1924 *value2 = op2->__anon1.ui64;
1925 else
1926 return 0;
1927 return 1;
1928 }
1929
1930 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1931 {
1932 struct Operand op2 = GetOperand(exp);
1933
1934 return GetOpUInt64(&op2, value2);
1935 }
1936
1937 unsigned int GetOpIntPtr(struct Operand * op2, intptr_t * value2)
1938 {
1939 if(op2->kind == 3 && op2->type->isSigned)
1940 *value2 = (intptr_t)op2->__anon1.i;
1941 else if(op2->kind == 3)
1942 *value2 = (intptr_t)op2->__anon1.ui;
1943 else if(op2->kind == 4 && op2->type->isSigned)
1944 *value2 = (intptr_t)op2->__anon1.i64;
1945 else if(op2->kind == 4)
1946 *value2 = (intptr_t)op2->__anon1.ui64;
1947 else if(op2->kind == 23 && op2->type->isSigned)
1948 *value2 = (intptr_t)op2->__anon1.i64;
1949 else if(op2->kind == 23)
1950 *value2 = (intptr_t)op2->__anon1.ui64;
1951 else if(op2->kind == 22 && op2->type->isSigned)
1952 *value2 = (intptr_t)op2->__anon1.i64;
1953 else if(op2->kind == 22)
1954 *value2 = (intptr_t)op2->__anon1.ui64;
1955 else if(op2->kind == 2 && op2->type->isSigned)
1956 *value2 = (intptr_t)op2->__anon1.s;
1957 else if(op2->kind == 2)
1958 *value2 = (intptr_t)op2->__anon1.us;
1959 else if(op2->kind == 1 && op2->type->isSigned)
1960 *value2 = (intptr_t)op2->__anon1.c;
1961 else if(op2->kind == 24 || op2->kind == 1)
1962 *value2 = (intptr_t)op2->__anon1.uc;
1963 else if(op2->kind == 6)
1964 *value2 = (intptr_t)op2->__anon1.f;
1965 else if(op2->kind == 7)
1966 *value2 = (intptr_t)op2->__anon1.d;
1967 else if(op2->kind == 13)
1968 *value2 = (intptr_t)op2->__anon1.ui64;
1969 else
1970 return 0;
1971 return 1;
1972 }
1973
1974 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
1975 {
1976 struct Operand op2 = GetOperand(exp);
1977
1978 return GetOpIntPtr(&op2, value2);
1979 }
1980
1981 unsigned int GetOpUIntPtr(struct Operand * op2, uintptr_t * value2)
1982 {
1983 if(op2->kind == 3 && op2->type->isSigned)
1984 *value2 = (uintptr_t)op2->__anon1.i;
1985 else if(op2->kind == 3)
1986 *value2 = (uintptr_t)op2->__anon1.ui;
1987 else if(op2->kind == 4 && op2->type->isSigned)
1988 *value2 = (uintptr_t)op2->__anon1.i64;
1989 else if(op2->kind == 4)
1990 *value2 = (uintptr_t)op2->__anon1.ui64;
1991 else if(op2->kind == 23 && op2->type->isSigned)
1992 *value2 = (uintptr_t)op2->__anon1.i64;
1993 else if(op2->kind == 23)
1994 *value2 = (uintptr_t)op2->__anon1.ui64;
1995 else if(op2->kind == 22 && op2->type->isSigned)
1996 *value2 = (uintptr_t)op2->__anon1.i64;
1997 else if(op2->kind == 22)
1998 *value2 = (uintptr_t)op2->__anon1.ui64;
1999 else if(op2->kind == 2 && op2->type->isSigned)
2000 *value2 = (uintptr_t)op2->__anon1.s;
2001 else if(op2->kind == 2)
2002 *value2 = (uintptr_t)op2->__anon1.us;
2003 else if(op2->kind == 1 && op2->type->isSigned)
2004 *value2 = (uintptr_t)op2->__anon1.c;
2005 else if(op2->kind == 24 || op2->kind == 1)
2006 *value2 = (uintptr_t)op2->__anon1.uc;
2007 else if(op2->kind == 6)
2008 *value2 = (uintptr_t)op2->__anon1.f;
2009 else if(op2->kind == 7)
2010 *value2 = (uintptr_t)op2->__anon1.d;
2011 else if(op2->kind == 13)
2012 *value2 = (uintptr_t)op2->__anon1.ui64;
2013 else
2014 return 0;
2015 return 1;
2016 }
2017
2018 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
2019 {
2020 struct Operand op2 = GetOperand(exp);
2021
2022 return GetOpUIntPtr(&op2, value2);
2023 }
2024
2025 unsigned int GetOpIntSize(struct Operand * op2, ssize_t * value2)
2026 {
2027 if(op2->kind == 3 && op2->type->isSigned)
2028 *value2 = (ssize_t)op2->__anon1.i;
2029 else if(op2->kind == 3)
2030 *value2 = (ssize_t)op2->__anon1.ui;
2031 else if(op2->kind == 4 && op2->type->isSigned)
2032 *value2 = (ssize_t)op2->__anon1.i64;
2033 else if(op2->kind == 4)
2034 *value2 = (ssize_t)op2->__anon1.ui64;
2035 else if(op2->kind == 23 && op2->type->isSigned)
2036 *value2 = (ssize_t)op2->__anon1.i64;
2037 else if(op2->kind == 23)
2038 *value2 = (ssize_t)op2->__anon1.ui64;
2039 else if(op2->kind == 22 && op2->type->isSigned)
2040 *value2 = (ssize_t)op2->__anon1.i64;
2041 else if(op2->kind == 22)
2042 *value2 = (ssize_t)op2->__anon1.ui64;
2043 else if(op2->kind == 2 && op2->type->isSigned)
2044 *value2 = (ssize_t)op2->__anon1.s;
2045 else if(op2->kind == 2)
2046 *value2 = (ssize_t)op2->__anon1.us;
2047 else if(op2->kind == 1 && op2->type->isSigned)
2048 *value2 = (ssize_t)op2->__anon1.c;
2049 else if(op2->kind == 24 || op2->kind == 1)
2050 *value2 = (ssize_t)op2->__anon1.uc;
2051 else if(op2->kind == 6)
2052 *value2 = (ssize_t)op2->__anon1.f;
2053 else if(op2->kind == 7)
2054 *value2 = (ssize_t)op2->__anon1.d;
2055 else if(op2->kind == 13)
2056 *value2 = (ssize_t)op2->__anon1.ui64;
2057 else
2058 return 0;
2059 return 1;
2060 }
2061
2062 unsigned int GetIntSize(struct Expression * exp, ssize_t * value2)
2063 {
2064 struct Operand op2 = GetOperand(exp);
2065
2066 return GetOpIntSize(&op2, value2);
2067 }
2068
2069 unsigned int GetOpUIntSize(struct Operand * op2, size_t * value2)
2070 {
2071 if(op2->kind == 3 && op2->type->isSigned)
2072 *value2 = (size_t)op2->__anon1.i;
2073 else if(op2->kind == 3)
2074 *value2 = (size_t)op2->__anon1.ui;
2075 else if(op2->kind == 4 && op2->type->isSigned)
2076 *value2 = (size_t)op2->__anon1.i64;
2077 else if(op2->kind == 4)
2078 *value2 = (size_t)op2->__anon1.ui64;
2079 else if(op2->kind == 23 && op2->type->isSigned)
2080 *value2 = (size_t)op2->__anon1.i64;
2081 else if(op2->kind == 23)
2082 *value2 = (size_t)op2->__anon1.ui64;
2083 else if(op2->kind == 22 && op2->type->isSigned)
2084 *value2 = (size_t)op2->__anon1.i64;
2085 else if(op2->kind == 22)
2086 *value2 = (size_t)op2->__anon1.ui64;
2087 else if(op2->kind == 2 && op2->type->isSigned)
2088 *value2 = (size_t)op2->__anon1.s;
2089 else if(op2->kind == 2)
2090 *value2 = (size_t)op2->__anon1.us;
2091 else if(op2->kind == 1 && op2->type->isSigned)
2092 *value2 = (size_t)op2->__anon1.c;
2093 else if(op2->kind == 24 || op2->kind == 1)
2094 *value2 = (size_t)op2->__anon1.uc;
2095 else if(op2->kind == 6)
2096 *value2 = (size_t)op2->__anon1.f;
2097 else if(op2->kind == 7)
2098 *value2 = (size_t)op2->__anon1.d;
2099 else if(op2->kind == 13)
2100 *value2 = (size_t)op2->__anon1.ui64;
2101 else
2102 return 0;
2103 return 1;
2104 }
2105
2106 unsigned int GetUIntSize(struct Expression * exp, size_t * value2)
2107 {
2108 struct Operand op2 = GetOperand(exp);
2109
2110 return GetOpUIntSize(&op2, value2);
2111 }
2112
2113 unsigned int GetOpShort(struct Operand * op2, short * value2)
2114 {
2115 if(op2->kind == 3 && op2->type->isSigned)
2116 *value2 = (short)op2->__anon1.i;
2117 else if(op2->kind == 3)
2118 *value2 = (short)op2->__anon1.ui;
2119 else if(op2->kind == 4 && op2->type->isSigned)
2120 *value2 = (short)op2->__anon1.i64;
2121 else if(op2->kind == 4)
2122 *value2 = (short)op2->__anon1.ui64;
2123 else if(op2->kind == 23 && op2->type->isSigned)
2124 *value2 = (short)op2->__anon1.i64;
2125 else if(op2->kind == 23)
2126 *value2 = (short)op2->__anon1.ui64;
2127 else if(op2->kind == 22 && op2->type->isSigned)
2128 *value2 = (short)op2->__anon1.i64;
2129 else if(op2->kind == 22)
2130 *value2 = (short)op2->__anon1.ui64;
2131 else if(op2->kind == 2 && op2->type->isSigned)
2132 *value2 = op2->__anon1.s;
2133 else if(op2->kind == 2)
2134 *value2 = (short)op2->__anon1.us;
2135 else if(op2->kind == 1 && op2->type->isSigned)
2136 *value2 = (short)op2->__anon1.c;
2137 else if(op2->kind == 24 || op2->kind == 1)
2138 *value2 = (short)op2->__anon1.uc;
2139 else if(op2->kind == 6)
2140 *value2 = (short)op2->__anon1.f;
2141 else if(op2->kind == 7)
2142 *value2 = (short)op2->__anon1.d;
2143 else if(op2->kind == 13)
2144 *value2 = (short)op2->__anon1.ui64;
2145 else
2146 return 0;
2147 return 1;
2148 }
2149
2150 unsigned int GetShort(struct Expression * exp, short * value2)
2151 {
2152 struct Operand op2 = GetOperand(exp);
2153
2154 return GetOpShort(&op2, value2);
2155 }
2156
2157 unsigned int GetOpUShort(struct Operand * op2, unsigned short * value2)
2158 {
2159 if(op2->kind == 3 && op2->type->isSigned)
2160 *value2 = (unsigned short)op2->__anon1.i;
2161 else if(op2->kind == 3)
2162 *value2 = (unsigned short)op2->__anon1.ui;
2163 else if(op2->kind == 4 && op2->type->isSigned)
2164 *value2 = (unsigned short)op2->__anon1.i64;
2165 else if(op2->kind == 4)
2166 *value2 = (unsigned short)op2->__anon1.ui64;
2167 else if(op2->kind == 23 && op2->type->isSigned)
2168 *value2 = (unsigned short)op2->__anon1.i64;
2169 else if(op2->kind == 23)
2170 *value2 = (unsigned short)op2->__anon1.ui64;
2171 else if(op2->kind == 22 && op2->type->isSigned)
2172 *value2 = (unsigned short)op2->__anon1.i64;
2173 else if(op2->kind == 22)
2174 *value2 = (unsigned short)op2->__anon1.ui64;
2175 else if(op2->kind == 2 && op2->type->isSigned)
2176 *value2 = (unsigned short)op2->__anon1.s;
2177 else if(op2->kind == 2)
2178 *value2 = op2->__anon1.us;
2179 else if(op2->kind == 1 && op2->type->isSigned)
2180 *value2 = (unsigned short)op2->__anon1.c;
2181 else if(op2->kind == 24 || op2->kind == 1)
2182 *value2 = (unsigned short)op2->__anon1.uc;
2183 else if(op2->kind == 6)
2184 *value2 = (unsigned short)op2->__anon1.f;
2185 else if(op2->kind == 7)
2186 *value2 = (unsigned short)op2->__anon1.d;
2187 else if(op2->kind == 13)
2188 *value2 = (unsigned short)op2->__anon1.ui64;
2189 else
2190 return 0;
2191 return 1;
2192 }
2193
2194 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
2195 {
2196 struct Operand op2 = GetOperand(exp);
2197
2198 return GetOpUShort(&op2, value2);
2199 }
2200
2201 unsigned int GetOpChar(struct Operand * op2, char * value2)
2202 {
2203 if(op2->kind == 3 && op2->type->isSigned)
2204 *value2 = (char)op2->__anon1.i;
2205 else if(op2->kind == 3)
2206 *value2 = (char)op2->__anon1.ui;
2207 else if(op2->kind == 4 && op2->type->isSigned)
2208 *value2 = (char)op2->__anon1.i64;
2209 else if(op2->kind == 4)
2210 *value2 = (char)op2->__anon1.ui64;
2211 else if(op2->kind == 23 && op2->type->isSigned)
2212 *value2 = (char)op2->__anon1.i64;
2213 else if(op2->kind == 23)
2214 *value2 = (char)op2->__anon1.ui64;
2215 else if(op2->kind == 22 && op2->type->isSigned)
2216 *value2 = (char)op2->__anon1.i64;
2217 else if(op2->kind == 22)
2218 *value2 = (char)op2->__anon1.ui64;
2219 else if(op2->kind == 2 && op2->type->isSigned)
2220 *value2 = (char)op2->__anon1.s;
2221 else if(op2->kind == 2)
2222 *value2 = (char)op2->__anon1.us;
2223 else if(op2->kind == 1 && op2->type->isSigned)
2224 *value2 = op2->__anon1.c;
2225 else if(op2->kind == 24 || op2->kind == 1)
2226 *value2 = (char)op2->__anon1.uc;
2227 else if(op2->kind == 6)
2228 *value2 = (char)op2->__anon1.f;
2229 else if(op2->kind == 7)
2230 *value2 = (char)op2->__anon1.d;
2231 else if(op2->kind == 13)
2232 *value2 = (char)op2->__anon1.ui64;
2233 else
2234 return 0;
2235 return 1;
2236 }
2237
2238 unsigned int GetChar(struct Expression * exp, char * value2)
2239 {
2240 struct Operand op2 = GetOperand(exp);
2241
2242 return GetOpChar(&op2, value2);
2243 }
2244
2245 unsigned int GetOpUChar(struct Operand * op2, unsigned char * value2)
2246 {
2247 if(op2->kind == 3 && op2->type->isSigned)
2248 *value2 = (unsigned char)op2->__anon1.i;
2249 else if(op2->kind == 3)
2250 *value2 = (unsigned char)op2->__anon1.ui;
2251 else if(op2->kind == 4 && op2->type->isSigned)
2252 *value2 = (unsigned char)op2->__anon1.i64;
2253 else if(op2->kind == 4)
2254 *value2 = (unsigned char)op2->__anon1.ui64;
2255 else if(op2->kind == 23 && op2->type->isSigned)
2256 *value2 = (unsigned char)op2->__anon1.i64;
2257 else if(op2->kind == 23)
2258 *value2 = (unsigned char)op2->__anon1.ui64;
2259 else if(op2->kind == 22 && op2->type->isSigned)
2260 *value2 = (unsigned char)op2->__anon1.i64;
2261 else if(op2->kind == 22)
2262 *value2 = (unsigned char)op2->__anon1.ui64;
2263 else if(op2->kind == 2 && op2->type->isSigned)
2264 *value2 = (unsigned char)op2->__anon1.s;
2265 else if(op2->kind == 2)
2266 *value2 = (unsigned char)op2->__anon1.us;
2267 else if(op2->kind == 1 && op2->type->isSigned)
2268 *value2 = (unsigned char)op2->__anon1.c;
2269 else if(op2->kind == 24 || op2->kind == 1)
2270 *value2 = op2->__anon1.uc;
2271 else if(op2->kind == 6)
2272 *value2 = (unsigned char)op2->__anon1.f;
2273 else if(op2->kind == 7)
2274 *value2 = (unsigned char)op2->__anon1.d;
2275 else if(op2->kind == 13)
2276 *value2 = (unsigned char)op2->__anon1.ui64;
2277 else
2278 return 0;
2279 return 1;
2280 }
2281
2282 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
2283 {
2284 struct Operand op2 = GetOperand(exp);
2285
2286 return GetOpUChar(&op2, value2);
2287 }
2288
2289 unsigned int GetOpFloat(struct Operand * op2, float * value2)
2290 {
2291 if(op2->kind == 3 && op2->type->isSigned)
2292 *value2 = (float)(float)op2->__anon1.i;
2293 else if(op2->kind == 3)
2294 *value2 = (float)(float)op2->__anon1.ui;
2295 else if(op2->kind == 4 && op2->type->isSigned)
2296 *value2 = (float)(float)op2->__anon1.i64;
2297 else if(op2->kind == 4)
2298 *value2 = (float)(float)op2->__anon1.ui64;
2299 else if(op2->kind == 23 && op2->type->isSigned)
2300 *value2 = (float)(float)op2->__anon1.i64;
2301 else if(op2->kind == 23)
2302 *value2 = (float)(float)op2->__anon1.ui64;
2303 else if(op2->kind == 22 && op2->type->isSigned)
2304 *value2 = (float)(float)op2->__anon1.i64;
2305 else if(op2->kind == 22)
2306 *value2 = (float)(float)op2->__anon1.ui64;
2307 else if(op2->kind == 2 && op2->type->isSigned)
2308 *value2 = (float)(float)op2->__anon1.s;
2309 else if(op2->kind == 2)
2310 *value2 = (float)(float)op2->__anon1.us;
2311 else if(op2->kind == 1 && op2->type->isSigned)
2312 *value2 = (float)(float)op2->__anon1.c;
2313 else if(op2->kind == 24 || op2->kind == 1)
2314 *value2 = (float)(float)op2->__anon1.uc;
2315 else if(op2->kind == 6)
2316 *value2 = (float)op2->__anon1.f;
2317 else if(op2->kind == 7)
2318 *value2 = (float)op2->__anon1.d;
2319 else if(op2->kind == 13)
2320 *value2 = (float)(float)op2->__anon1.ui64;
2321 else
2322 return 0;
2323 return 1;
2324 }
2325
2326 unsigned int GetFloat(struct Expression * exp, float * value2)
2327 {
2328 struct Operand op2 = GetOperand(exp);
2329
2330 return GetOpFloat(&op2, value2);
2331 }
2332
2333 unsigned int GetOpDouble(struct Operand * op2, double * value2)
2334 {
2335 if(op2->kind == 3 && op2->type->isSigned)
2336 *value2 = (double)(double)op2->__anon1.i;
2337 else if(op2->kind == 3)
2338 *value2 = (double)(double)op2->__anon1.ui;
2339 else if(op2->kind == 4 && op2->type->isSigned)
2340 *value2 = (double)(double)op2->__anon1.i64;
2341 else if(op2->kind == 4)
2342 *value2 = (double)(double)op2->__anon1.ui64;
2343 else if(op2->kind == 23 && op2->type->isSigned)
2344 *value2 = (double)(double)op2->__anon1.i64;
2345 else if(op2->kind == 23)
2346 *value2 = (double)(double)op2->__anon1.ui64;
2347 else if(op2->kind == 22 && op2->type->isSigned)
2348 *value2 = (double)(double)op2->__anon1.i64;
2349 else if(op2->kind == 22)
2350 *value2 = (double)(double)op2->__anon1.ui64;
2351 else if(op2->kind == 2 && op2->type->isSigned)
2352 *value2 = (double)(double)op2->__anon1.s;
2353 else if(op2->kind == 2)
2354 *value2 = (double)(double)op2->__anon1.us;
2355 else if(op2->kind == 1 && op2->type->isSigned)
2356 *value2 = (double)(double)op2->__anon1.c;
2357 else if(op2->kind == 24 || op2->kind == 1)
2358 *value2 = (double)(double)op2->__anon1.uc;
2359 else if(op2->kind == 6)
2360 *value2 = (double)op2->__anon1.f;
2361 else if(op2->kind == 7)
2362 *value2 = (double)op2->__anon1.d;
2363 else if(op2->kind == 13)
2364 *value2 = (double)(double)op2->__anon1.ui64;
2365 else
2366 return 0;
2367 return 1;
2368 }
2369
2370 unsigned int GetDouble(struct Expression * exp, double * value2)
2371 {
2372 struct Operand op2 = GetOperand(exp);
2373
2374 return GetOpDouble(&op2, value2);
2375 }
2376
2377 void ComputeExpression(struct Expression * exp);
2378
2379 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2380
2381 extern int targetBits;
2382
2383 int ComputeTypeSize(struct Type * type);
2384
2385 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2386
2387 struct __ecereNameSpace__ecere__com__BitMember
2388 {
2389 struct __ecereNameSpace__ecere__com__BitMember * prev;
2390 struct __ecereNameSpace__ecere__com__BitMember * next;
2391 const char *  name;
2392 unsigned int isProperty;
2393 int memberAccess;
2394 int id;
2395 struct __ecereNameSpace__ecere__com__Class * _class;
2396 const char *  dataTypeString;
2397 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2398 struct Type * dataType;
2399 int type;
2400 int size;
2401 int pos;
2402 uint64 mask;
2403 } __attribute__ ((gcc_struct));
2404
2405 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2406
2407 struct __ecereNameSpace__ecere__sys__OldLink
2408 {
2409 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2410 struct __ecereNameSpace__ecere__sys__OldLink * next;
2411 void *  data;
2412 } __attribute__ ((gcc_struct));
2413
2414 void FinishTemplatesContext(struct Context * context);
2415
2416 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2417 {
2418 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2419 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2420
2421 if(member || ((_class->type == 2 || _class->type == 0 || _class->type == 1 || _class->type == 5) && (_class->type == 2 || (!_class->structSize || _class->structSize == _class->offset)) && _class->computeSize))
2422 {
2423 int unionMemberOffset = 0;
2424 int bitFields = 0;
2425
2426 if(member)
2427 {
2428 member->memberOffset = 0;
2429 if(targetBits < sizeof(void *) * 8)
2430 member->structAlignment = 0;
2431 }
2432 else if(targetBits < sizeof(void *) * 8)
2433 _class->structAlignment = 0;
2434 if(!member && ((_class->type == 0 || _class->type == 5) || (_class->type == 1 && _class->memberOffset && _class->memberOffset > _class->base->structSize)))
2435 _class->memberOffset = (_class->base && _class->type == 1) ? _class->base->structSize : 0;
2436 if(!member && _class->destructionWatchOffset)
2437 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2438 {
2439 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2440
2441 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2442 {
2443 if(!dataMember->isProperty)
2444 {
2445 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2446 {
2447 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
2448 }
2449 }
2450 }
2451 }
2452 {
2453 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2454
2455 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2456 {
2457 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2458 {
2459 if(!isMember && _class->type == 2 && dataMember->dataType)
2460 {
2461 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2462 uint64 mask = 0;
2463 int d;
2464
2465 ComputeTypeSize(dataMember->dataType);
2466 if(bitMember->pos == -1)
2467 bitMember->pos = _class->memberOffset;
2468 if(!bitMember->size)
2469 bitMember->size = dataMember->dataType->size * 8;
2470 _class->memberOffset = bitMember->pos + bitMember->size;
2471 for(d = 0; d < bitMember->size; d++)
2472 {
2473 if(d)
2474 mask <<= 1;
2475 mask |= 1;
2476 }
2477 bitMember->mask = mask << bitMember->pos;
2478 }
2479 else if(dataMember->type == 0 && dataMember->dataType)
2480 {
2481 int size;
2482 int alignment = 0;
2483
2484 if(dataMember->dataType->kind != 8 || ((!dataMember->dataType->__anon1._class || !dataMember->dataType->__anon1._class->__anon1.registered || dataMember->dataType->__anon1._class->__anon1.registered != _class || _class->type != 1)))
2485 ComputeTypeSize(dataMember->dataType);
2486 if(dataMember->dataType->bitFieldCount)
2487 {
2488 bitFields += dataMember->dataType->bitFieldCount;
2489 size = 0;
2490 }
2491 else
2492 {
2493 if(bitFields)
2494 {
2495 int size = (bitFields + 7) / 8;
2496
2497 if(isMember)
2498 {
2499 int __simpleStruct0;
2500
2501 if(alignment)
2502 {
2503 int __simpleStruct0;
2504
2505 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2506 if(member->memberOffset % alignment)
2507 member->memberOffset += alignment - (member->memberOffset % alignment);
2508 }
2509 dataMember->offset = member->memberOffset;
2510 if(member->type == 1)
2511 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2512 else
2513 {
2514 member->memberOffset += size;
2515 }
2516 }
2517 else
2518 {
2519 if(alignment)
2520 {
2521 int __simpleStruct0;
2522
2523 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2524 if(_class->memberOffset % alignment)
2525 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2526 }
2527 dataMember->offset = _class->memberOffset;
2528 _class->memberOffset += size;
2529 }
2530 bitFields = 0;
2531 }
2532 size = dataMember->dataType->size;
2533 alignment = dataMember->dataType->alignment;
2534 }
2535 if(isMember)
2536 {
2537 int __simpleStruct0;
2538
2539 if(alignment)
2540 {
2541 int __simpleStruct0;
2542
2543 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2544 if(member->memberOffset % alignment)
2545 member->memberOffset += alignment - (member->memberOffset % alignment);
2546 }
2547 dataMember->offset = member->memberOffset;
2548 if(member->type == 1)
2549 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2550 else
2551 {
2552 member->memberOffset += size;
2553 }
2554 }
2555 else
2556 {
2557 if(alignment)
2558 {
2559 int __simpleStruct0;
2560
2561 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2562 if(_class->memberOffset % alignment)
2563 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2564 }
2565 dataMember->offset = _class->memberOffset;
2566 _class->memberOffset += size;
2567 }
2568 }
2569 else
2570 {
2571 int alignment;
2572
2573 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 1);
2574 alignment = dataMember->structAlignment;
2575 if(isMember)
2576 {
2577 int __simpleStruct0;
2578
2579 if(alignment)
2580 {
2581 int __simpleStruct0;
2582
2583 if(member->memberOffset % alignment)
2584 member->memberOffset += alignment - (member->memberOffset % alignment);
2585 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2586 }
2587 dataMember->offset = member->memberOffset;
2588 if(member->type == 1)
2589 unionMemberOffset = (__simpleStruct0 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2590 else
2591 member->memberOffset += dataMember->memberOffset;
2592 }
2593 else
2594 {
2595 if(alignment)
2596 {
2597 int __simpleStruct0;
2598
2599 if(_class->memberOffset % alignment)
2600 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2601 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2602 }
2603 dataMember->offset = _class->memberOffset;
2604 _class->memberOffset += dataMember->memberOffset;
2605 }
2606 }
2607 }
2608 }
2609 if(bitFields)
2610 {
2611 int alignment = 0;
2612 int size = (bitFields + 7) / 8;
2613
2614 if(isMember)
2615 {
2616 int __simpleStruct0;
2617
2618 if(alignment)
2619 {
2620 int __simpleStruct0;
2621
2622 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2623 if(member->memberOffset % alignment)
2624 member->memberOffset += alignment - (member->memberOffset % alignment);
2625 }
2626 if(member->type == 1)
2627 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2628 else
2629 {
2630 member->memberOffset += size;
2631 }
2632 }
2633 else
2634 {
2635 if(alignment)
2636 {
2637 int __simpleStruct0;
2638
2639 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2640 if(_class->memberOffset % alignment)
2641 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2642 }
2643 _class->memberOffset += size;
2644 }
2645 bitFields = 0;
2646 }
2647 }
2648 if(member && member->type == 1)
2649 {
2650 member->memberOffset = unionMemberOffset;
2651 }
2652 if(!isMember)
2653 {
2654 if(_class->type != 2)
2655 {
2656 int extra = 0;
2657
2658 if(_class->structAlignment)
2659 {
2660 if(_class->memberOffset % _class->structAlignment)
2661 extra += _class->structAlignment - (_class->memberOffset % _class->structAlignment);
2662 }
2663 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset + extra;
2664 if(!member)
2665 {
2666 struct __ecereNameSpace__ecere__com__Property * prop;
2667
2668 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2669 {
2670 if(prop->isProperty && prop->isWatchable)
2671 {
2672 prop->watcherOffset = _class->structSize;
2673 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2674 }
2675 }
2676 }
2677 {
2678 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2679
2680 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2681 {
2682 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2683
2684 if(deriv->computeSize)
2685 {
2686 deriv->offset = _class->structSize;
2687 deriv->memberOffset = 0;
2688 deriv->structSize = deriv->offset;
2689 ComputeClassMembers(deriv, 0);
2690 }
2691 }
2692 }
2693 }
2694 }
2695 }
2696 if(context)
2697 FinishTemplatesContext(context);
2698 }
2699
2700 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2701
2702 struct __ecereNameSpace__ecere__com__NameSpace
2703 {
2704 const char *  name;
2705 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
2706 struct __ecereNameSpace__ecere__com__NameSpace *  left;
2707 struct __ecereNameSpace__ecere__com__NameSpace *  right;
2708 int depth;
2709 struct __ecereNameSpace__ecere__com__NameSpace *  parent;
2710 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2711 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2712 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2713 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2714 } __attribute__ ((gcc_struct));
2715
2716 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2717
2718 struct __ecereNameSpace__ecere__com__Module
2719 {
2720 struct __ecereNameSpace__ecere__com__Instance * application;
2721 struct __ecereNameSpace__ecere__sys__OldList classes;
2722 struct __ecereNameSpace__ecere__sys__OldList defines;
2723 struct __ecereNameSpace__ecere__sys__OldList functions;
2724 struct __ecereNameSpace__ecere__sys__OldList modules;
2725 struct __ecereNameSpace__ecere__com__Instance * prev;
2726 struct __ecereNameSpace__ecere__com__Instance * next;
2727 const char *  name;
2728 void *  library;
2729 void *  Unload;
2730 int importType;
2731 int origImportType;
2732 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2733 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2734 } __attribute__ ((gcc_struct));
2735
2736 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2737 {
2738 struct __ecereNameSpace__ecere__com__Class * _class;
2739 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2740
2741 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
2742 ComputeModuleClasses(subModule->data);
2743 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->classes.first; _class; _class = _class->next)
2744 ComputeClassMembers(_class, 0);
2745 }
2746
2747 extern unsigned int inCompiler;
2748
2749 extern void Compiler_Error(const char *  format, ...);
2750
2751 extern const char *  __ecereNameSpace__ecere__GetTranslatedString(const char * name, const char *  string, const char *  stringAndContext);
2752
2753 int ComputeTypeSize(struct Type * type)
2754 {
2755 unsigned int size = type ? type->size : 0;
2756
2757 if(!size && type && !type->computing)
2758 {
2759 type->computing = 1;
2760 switch(type->kind)
2761 {
2762 case 24:
2763 type->alignment = size = sizeof(char);
2764 break;
2765 case 1:
2766 type->alignment = size = sizeof(char);
2767 break;
2768 case 3:
2769 type->alignment = size = sizeof(int);
2770 break;
2771 case 4:
2772 type->alignment = size = sizeof(long long);
2773 break;
2774 case 22:
2775 type->alignment = size = targetBits / 8;
2776 break;
2777 case 23:
2778 type->alignment = size = targetBits / 8;
2779 break;
2780 case 5:
2781 type->alignment = size = sizeof(long);
2782 break;
2783 case 2:
2784 type->alignment = size = sizeof(short);
2785 break;
2786 case 6:
2787 type->alignment = size = sizeof(float);
2788 break;
2789 case 7:
2790 type->alignment = size = sizeof(double);
2791 break;
2792 case 8:
2793 {
2794 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class ? type->__anon1._class->__anon1.registered : (((void *)0));
2795
2796 if(_class && _class->type == 1)
2797 {
2798 ComputeClassMembers(_class, 0);
2799 type->alignment = _class->structAlignment;
2800 size = _class->structSize;
2801 if(type->alignment && size % type->alignment)
2802 size += type->alignment - (size % type->alignment);
2803 }
2804 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2805 {
2806 if(!_class->dataType)
2807 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
2808 size = type->alignment = ComputeTypeSize(_class->dataType);
2809 }
2810 else
2811 size = type->alignment = targetBits / 8;
2812 break;
2813 }
2814 case 13:
2815 case 19:
2816 size = type->alignment = targetBits / 8;
2817 break;
2818 case 12:
2819 if(type->__anon1.__anon4.arraySizeExp)
2820 {
2821 ProcessExpressionType(type->__anon1.__anon4.arraySizeExp);
2822 ComputeExpression(type->__anon1.__anon4.arraySizeExp);
2823 if(!type->__anon1.__anon4.arraySizeExp->isConstant || (type->__anon1.__anon4.arraySizeExp->expType->kind != 3 && type->__anon1.__anon4.arraySizeExp->expType->kind != 2 && type->__anon1.__anon4.arraySizeExp->expType->kind != 1 && type->__anon1.__anon4.arraySizeExp->expType->kind != 5 && type->__anon1.__anon4.arraySizeExp->expType->kind != 4 && type->__anon1.__anon4.arraySizeExp->expType->kind != 23 && type->__anon1.__anon4.arraySizeExp->expType->kind != 22 && type->__anon1.__anon4.arraySizeExp->expType->kind != 15 && (type->__anon1.__anon4.arraySizeExp->expType->kind != 8 || !type->__anon1.__anon4.arraySizeExp->expType->__anon1._class->__anon1.registered || type->__anon1.__anon4.arraySizeExp->expType->__anon1._class->__anon1.registered->type != 4)))
2824 {
2825 struct Location oldLoc = yylloc;
2826 char expression[10240];
2827
2828 expression[0] = '\0';
2829 type->__anon1.__anon4.arraySizeExp->expType = (((void *)0));
2830 yylloc = type->__anon1.__anon4.arraySizeExp->loc;
2831 if(inCompiler)
2832 PrintExpression(type->__anon1.__anon4.arraySizeExp, expression);
2833 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Array size not constant int (%s)\n", (((void *)0))), expression);
2834 yylloc = oldLoc;
2835 }
2836 GetInt(type->__anon1.__anon4.arraySizeExp, &type->__anon1.__anon4.arraySize);
2837 }
2838 else if(type->__anon1.__anon4.enumClass)
2839 {
2840 if(type->__anon1.__anon4.enumClass && type->__anon1.__anon4.enumClass->__anon1.registered && type->__anon1.__anon4.enumClass->__anon1.registered->type == 4)
2841 {
2842 type->__anon1.__anon4.arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->__anon1.__anon4.enumClass->__anon1.registered, "enumSize");
2843 }
2844 else
2845 type->__anon1.__anon4.arraySize = 0;
2846 }
2847 else
2848 {
2849 type->__anon1.__anon4.arraySize = 0;
2850 }
2851 size = ComputeTypeSize(type->__anon1.type) * type->__anon1.__anon4.arraySize;
2852 if(type->__anon1.type)
2853 type->alignment = type->__anon1.type->alignment;
2854 break;
2855 case 9:
2856 {
2857 struct Type * member;
2858
2859 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
2860 {
2861 int __simpleStruct0, __simpleStruct1;
2862 unsigned int addSize = ComputeTypeSize(member);
2863
2864 member->offset = size;
2865 if(member->alignment && size % member->alignment)
2866 member->offset += member->alignment - (size % member->alignment);
2867 size = member->offset;
2868 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2869 size += addSize;
2870 }
2871 if(type->alignment && size % type->alignment)
2872 size += type->alignment - (size % type->alignment);
2873 break;
2874 }
2875 case 10:
2876 {
2877 struct Type * member;
2878
2879 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
2880 {
2881 int __simpleStruct0, __simpleStruct1;
2882 unsigned int addSize = ComputeTypeSize(member);
2883
2884 member->offset = size;
2885 if(member->alignment && size % member->alignment)
2886 member->offset += member->alignment - (size % member->alignment);
2887 size = member->offset;
2888 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2889 size = ((size > addSize) ? size : addSize);
2890 }
2891 if(type->alignment && size % type->alignment)
2892 size += type->alignment - (size % type->alignment);
2893 break;
2894 }
2895 case 20:
2896 {
2897 struct TemplateParameter * param = type->__anon1.templateParameter;
2898 struct Type * baseType = ProcessTemplateParameterType(param);
2899
2900 if(baseType)
2901 {
2902 size = ComputeTypeSize(baseType);
2903 type->alignment = baseType->alignment;
2904 }
2905 else
2906 type->alignment = size = sizeof(uint64);
2907 break;
2908 }
2909 case 15:
2910 {
2911 type->alignment = size = sizeof(enum
2912 {
2913 test
2914 });
2915 break;
2916 }
2917 case 21:
2918 {
2919 type->alignment = size = targetBits / 8;
2920 break;
2921 }
2922 }
2923 type->size = size;
2924 type->computing = 0;
2925 }
2926 return size;
2927 }
2928
2929 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2930
2931 extern struct Identifier * MkIdentifier(const char *  string);
2932
2933 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void *  item);
2934
2935 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2936
2937 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2938
2939 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2940
2941 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2942
2943 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2944
2945 extern void FreeType(struct Type * type);
2946
2947 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2948
2949 extern struct Specifier * MkSpecifier(int specifier);
2950
2951 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2952
2953 extern struct Expression * MkExpConstant(const char *  string);
2954
2955 int AddMembers(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember, unsigned int * retSize, struct __ecereNameSpace__ecere__com__Class * topClass, unsigned int * addedPadding)
2956 {
2957 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2958 unsigned int totalSize = 0;
2959 unsigned int maxSize = 0;
2960 int alignment;
2961 unsigned int size;
2962 struct __ecereNameSpace__ecere__com__DataMember * member;
2963 int anonID = 1;
2964 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2965
2966 if(addedPadding)
2967 *addedPadding = 0;
2968 if(!isMember && _class->base)
2969 {
2970 maxSize = _class->structSize;
2971 {
2972 if(_class->type == 1 || _class->type == 5)
2973 AddMembers(declarations, _class->base, 0, &totalSize, topClass, (((void *)0)));
2974 else
2975 {
2976 unsigned int baseSize = _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2977
2978 if(maxSize > baseSize)
2979 maxSize -= baseSize;
2980 else
2981 maxSize = 0;
2982 }
2983 }
2984 }
2985 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2986 {
2987 if(!member->isProperty)
2988 {
2989 switch(member->type)
2990 {
2991 case 0:
2992 {
2993 if(member->dataTypeString)
2994 {
2995 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2996 struct Declarator * decl;
2997
2998 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2999 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
3000 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
3001 if(!member->dataType)
3002 member->dataType = ProcessType(specs, decl);
3003 ReplaceThisClassSpecifiers(specs, topClass);
3004 {
3005 struct Type * type = ProcessType(specs, decl);
3006
3007 DeclareType(member->dataType, 0, 0);
3008 FreeType(type);
3009 }
3010 ComputeTypeSize(member->dataType);
3011 size = member->dataType->size;
3012 alignment = member->dataType->alignment;
3013 if(alignment)
3014 {
3015 if(totalSize % alignment)
3016 totalSize += alignment - (totalSize % alignment);
3017 }
3018 totalSize += size;
3019 }
3020 break;
3021 }
3022 case 1:
3023 case 2:
3024 {
3025 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
3026 char id[100];
3027
3028 sprintf(id, "__anon%d", anonID++);
3029 size = 0;
3030 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 1, &size, topClass, (((void *)0)));
3031 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
3032 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, MkListOne(MkDeclaratorIdentifier(MkIdentifier(id))), (((void *)0)))));
3033 alignment = member->structAlignment;
3034 if(alignment)
3035 {
3036 if(totalSize % alignment)
3037 totalSize += alignment - (totalSize % alignment);
3038 }
3039 totalSize += size;
3040 break;
3041 }
3042 }
3043 }
3044 }
3045 if(retSize)
3046 {
3047 unsigned int __simpleStruct0;
3048
3049 if(topMember && topMember->type == 1)
3050 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
3051 else
3052 *retSize += totalSize;
3053 }
3054 else if(totalSize < maxSize && _class->type != 1000)
3055 {
3056 int autoPadding = 0;
3057
3058 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
3059 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
3060 if(totalSize + autoPadding < maxSize)
3061 {
3062 char sizeString[50];
3063
3064 sprintf(sizeString, "%d", maxSize - totalSize);
3065 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
3066 if(addedPadding)
3067 *addedPadding = 1;
3068 }
3069 }
3070 if(context)
3071 FinishTemplatesContext(context);
3072 return topMember ? topMember->memberID : _class->memberID;
3073 }
3074
3075 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
3076 {
3077 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
3078 struct __ecereNameSpace__ecere__com__DataMember * member;
3079 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
3080
3081 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
3082 DeclareMembers(_class->base, 0);
3083 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
3084 {
3085 if(!member->isProperty)
3086 {
3087 switch(member->type)
3088 {
3089 case 0:
3090 {
3091 if(!member->dataType && member->dataTypeString)
3092 member->dataType = ProcessTypeString(member->dataTypeString, 0);
3093 if(member->dataType)
3094 DeclareType(member->dataType, 0, 0);
3095 break;
3096 }
3097 case 1:
3098 case 2:
3099 {
3100 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 1);
3101 break;
3102 }
3103 }
3104 }
3105 }
3106 if(context)
3107 FinishTemplatesContext(context);
3108 return topMember ? topMember->memberID : _class->memberID;
3109 }
3110
3111 extern struct Identifier * GetDeclId(struct Declarator * decl);
3112
3113 static void IdentifyAnonStructs(struct __ecereNameSpace__ecere__sys__OldList * definitions)
3114 {
3115 struct ClassDef * def;
3116 int anonID = 1;
3117
3118 for(def = (*definitions).first; def; def = def->next)
3119 {
3120 if(def->type == 2)
3121 {
3122 struct Declaration * decl = def->__anon1.decl;
3123
3124 if(decl && decl->__anon1.__anon1.specifiers)
3125 {
3126 struct Specifier * spec;
3127 unsigned int isStruct = 0;
3128
3129 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
3130 {
3131 if(spec->type == 3 || spec->type == 4)
3132 {
3133 if(spec->__anon1.__anon2.definitions)
3134 IdentifyAnonStructs(spec->__anon1.__anon2.definitions);
3135 isStruct = 1;
3136 }
3137 }
3138 if(isStruct)
3139 {
3140 struct Declarator * d = (((void *)0));
3141
3142 if(decl->__anon1.__anon1.declarators)
3143 {
3144 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
3145 {
3146 struct Identifier * idDecl = GetDeclId(d);
3147
3148 if(idDecl)
3149 break;
3150 }
3151 }
3152 if(!d)
3153 {
3154 char id[100];
3155
3156 sprintf(id, "__anon%d", anonID++);
3157 if(!decl->__anon1.__anon1.declarators)
3158 decl->__anon1.__anon1.declarators = MkList();
3159 ListAdd(decl->__anon1.__anon1.declarators, MkDeclaratorIdentifier(MkIdentifier(id)));
3160 }
3161 }
3162 }
3163 }
3164 }
3165 }
3166
3167 extern struct Symbol * FindClass(const char *  name);
3168
3169 extern char *  strchr(const char * , int);
3170
3171 extern void FullClassNameCat(char *  output, const char *  className, unsigned int includeTemplateParams);
3172
3173 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (*  FreeFunction)(void * ));
3174
3175 extern void FreeClassDef(struct ClassDef * def);
3176
3177 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
3178
3179 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
3180
3181 extern void DeclareClass(struct Symbol * classSym, const char *  className);
3182
3183 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item, void *  prevItem);
3184
3185 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void *  prevItem, void *  item);
3186
3187 void DeclareStruct(const char * name, unsigned int skipNoHead)
3188 {
3189 struct External * external = (((void *)0));
3190 struct Symbol * classSym = FindClass(name);
3191
3192 if(!inCompiler || !classSym)
3193 return ;
3194 if(classSym->__anon1.registered && (classSym->__anon1.registered->type == 2 || classSym->__anon1.registered->type == 3 || classSym->__anon1.registered->type == 4))
3195 return ;
3196 if(classSym->__anon1.registered && classSym->imported && !classSym->declaredStructSym)
3197 {
3198 struct Declaration * decl;
3199 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3200 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
3201 char structName[1024];
3202 struct Specifier * spec = (((void *)0));
3203
3204 external = (classSym->__anon1.registered && classSym->__anon1.registered->type == 1) ? classSym->__anon2.__anon1.pointerExternal : classSym->__anon2.__anon1.structExternal;
3205 classSym->declaring++;
3206 if(strchr(classSym->string, '<'))
3207 {
3208 if(classSym->__anon1.registered->templateClass)
3209 {
3210 DeclareStruct(classSym->__anon1.registered->templateClass->fullName, skipNoHead);
3211 classSym->declaring--;
3212 }
3213 return ;
3214 }
3215 DeclareMembers(classSym->__anon1.registered, 0);
3216 structName[0] = (char)0;
3217 FullClassNameCat(structName, name, 0);
3218 if(external && external->__anon1.declaration && external->__anon1.declaration->__anon1.__anon1.specifiers)
3219 {
3220 for(spec = (*external->__anon1.declaration->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
3221 {
3222 if(spec->type == 3 || spec->type == 4)
3223 break;
3224 }
3225 }
3226 if(!skipNoHead && (!spec || !spec->__anon1.__anon2.definitions))
3227 {
3228 unsigned int addedPadding = 0;
3229
3230 classSym->declaredStructSym = 1;
3231 declarations = MkList();
3232 AddMembers(declarations, classSym->__anon1.registered, 0, (((void *)0)), classSym->__anon1.registered, &addedPadding);
3233 if(!(*declarations).count || ((*declarations).count == 1 && addedPadding))
3234 {
3235 FreeList(declarations, FreeClassDef);
3236 declarations = (((void *)0));
3237 }
3238 }
3239 if(skipNoHead || declarations)
3240 {
3241 if(spec)
3242 {
3243 if(declarations)
3244 spec->__anon1.__anon2.definitions = declarations;
3245 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3246 {
3247 if(classSym->__anon2.__anon1.structExternal)
3248 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->__anon2.__anon1.structExternal, curExternal->prev);
3249 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->__anon2.__anon1.pointerExternal, curExternal->prev);
3250 classSym->id = curExternal->symbol->idCode;
3251 classSym->idCode = curExternal->symbol->idCode;
3252 }
3253 }
3254 else
3255 {
3256 if(!external)
3257 external = MkExternalDeclaration((((void *)0)));
3258 specifiers = MkList();
3259 declarators = MkList();
3260 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
3261 external->__anon1.declaration = decl = MkDeclaration(specifiers, declarators);
3262 if(decl->symbol && !decl->symbol->__anon2.__anon1.pointerExternal)
3263 decl->symbol->__anon2.__anon1.pointerExternal = external;
3264 if(classSym->__anon1.registered && classSym->__anon1.registered->type == 1)
3265 {
3266 char className[1024];
3267
3268 strcpy(className, "__ecereClass_");
3269 FullClassNameCat(className, classSym->string, 1);
3270 DeclareClass(classSym, className);
3271 external->symbol = classSym;
3272 classSym->__anon2.__anon1.pointerExternal = external;
3273 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3274 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3275 }
3276 else
3277 {
3278 char className[1024];
3279
3280 strcpy(className, "__ecereClass_");
3281 FullClassNameCat(className, classSym->string, 1);
3282 classSym->__anon2.__anon1.structExternal = external;
3283 DeclareClass(classSym, className);
3284 external->symbol = classSym;
3285 }
3286 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
3287 }
3288 }
3289 classSym->declaring--;
3290 }
3291 else
3292 {
3293 if(classSym->__anon2.__anon1.structExternal && classSym->__anon2.__anon1.structExternal->__anon1.declaration && classSym->__anon2.__anon1.structExternal->__anon1.declaration->__anon1.__anon1.specifiers)
3294 {
3295 struct Specifier * spec;
3296
3297 for(spec = (*classSym->__anon2.__anon1.structExternal->__anon1.declaration->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
3298 {
3299 IdentifyAnonStructs(spec->__anon1.__anon2.definitions);
3300 }
3301 }
3302 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3303 {
3304 classSym->declaring++;
3305 {
3306 if(classSym->__anon1.registered)
3307 DeclareMembers(classSym->__anon1.registered, 0);
3308 }
3309 if(classSym->__anon1.registered && (classSym->__anon1.registered->type == 1 || classSym->__anon1.registered->type == 5))
3310 {
3311 if(classSym->__anon2.__anon1.structExternal)
3312 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->__anon2.__anon1.structExternal, curExternal->prev);
3313 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->__anon2.__anon1.pointerExternal, curExternal->prev);
3314 classSym->id = curExternal->symbol->idCode;
3315 classSym->idCode = curExternal->symbol->idCode;
3316 }
3317 classSym->declaring--;
3318 }
3319 }
3320 }
3321
3322 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
3323
3324 extern struct ModuleImport * mainModule;
3325
3326 extern struct Specifier * MkSpecifierName(const char *  name);
3327
3328 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
3329
3330 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
3331
3332 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
3333
3334 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
3335
3336 extern void FreeDeclarator(struct Declarator * decl);
3337
3338 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
3339
3340 struct PropertyImport
3341 {
3342 struct PropertyImport * prev;
3343 struct PropertyImport * next;
3344 char *  name;
3345 unsigned int isVirtual;
3346 unsigned int hasSet;
3347 unsigned int hasGet;
3348 } __attribute__ ((gcc_struct));
3349
3350 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
3351
3352 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
3353 {
3354 struct Symbol * symbol = prop->symbol;
3355
3356 strcpy(setName, "__ecereProp_");
3357 FullClassNameCat(setName, prop->_class->fullName, 0);
3358 strcat(setName, "_Set_");
3359 FullClassNameCat(setName, prop->name, 1);
3360 strcpy(getName, "__ecereProp_");
3361 FullClassNameCat(getName, prop->_class->fullName, 0);
3362 strcat(getName, "_Get_");
3363 FullClassNameCat(getName, prop->name, 1);
3364 if(prop->_class->type == 1)
3365 DeclareStruct(prop->_class->fullName, 0);
3366 if(!symbol || curExternal->symbol->idCode < symbol->id)
3367 {
3368 unsigned int imported = 0;
3369 unsigned int dllImport = 0;
3370
3371 if(!symbol || symbol->_import)
3372 {
3373 if(!symbol)
3374 {
3375 struct Symbol * classSym;
3376
3377 if(!prop->_class->symbol)
3378 prop->_class->symbol = FindClass(prop->_class->fullName);
3379 classSym = prop->_class->symbol;
3380 if(classSym && !classSym->_import)
3381 {
3382 struct ModuleImport * module;
3383
3384 if(prop->_class->module)
3385 module = FindModule(prop->_class->module);
3386 else
3387 module = mainModule;
3388 classSym->_import = __extension__ ({
3389 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
3390
3391 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
3392 });
3393 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3394 }
3395 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3396 symbol->_import = (struct ClassImport *)__extension__ ({
3397 struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
3398
3399 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0, __ecereInstance1->hasSet = prop->Set ? 1 : 0, __ecereInstance1->hasGet = prop->Get ? 1 : 0, __ecereInstance1;
3400 });
3401 if(classSym)
3402 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3403 }
3404 imported = 1;
3405 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)
3406 dllImport = 1;
3407 }
3408 if(!symbol->type)
3409 {
3410 struct Context * context = SetupTemplatesContext(prop->_class);
3411
3412 symbol->type = ProcessTypeString(prop->dataTypeString, 0);
3413 FinishTemplatesContext(context);
3414 }
3415 if(prop->Get)
3416 {
3417 if(!symbol->__anon2.__anon2.externalGet || symbol->__anon2.__anon2.externalGet->type == 0)
3418 {
3419 struct Declaration * decl;
3420 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3421 struct Declarator * d;
3422 struct __ecereNameSpace__ecere__sys__OldList * params;
3423 struct Specifier * spec;
3424 struct External * external;
3425 struct Declarator * typeDecl;
3426 unsigned int simple = 0;
3427
3428 specifiers = MkList();
3429 declarators = MkList();
3430 params = MkList();
3431 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3432 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3433 if(dllImport)
3434 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3435 {
3436 struct Context * context = SetupTemplatesContext(prop->_class);
3437
3438 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3439 FinishTemplatesContext(context);
3440 }
3441 for(spec = (*specifiers).first; spec; spec = spec->next)
3442 {
3443 if(spec->type == 1)
3444 {
3445 if((!typeDecl || typeDecl->type == 1))
3446 {
3447 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
3448
3449 symbol->_class = classSym->__anon1.registered;
3450 if(classSym->__anon1.registered && classSym->__anon1.registered->type == 1)
3451 {
3452 DeclareStruct(spec->__anon1.__anon1.name, 0);
3453 simple = 1;
3454 }
3455 }
3456 }
3457 }
3458 if(!simple)
3459 d = PlugDeclarator(typeDecl, d);
3460 else
3461 {
3462 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3463 specifiers = MkList();
3464 }
3465 d = MkDeclaratorFunction(d, params);
3466 if(dllImport)
3467 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3468 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3469 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3470 if(simple)
3471 ListAdd(specifiers, MkSpecifier(VOID));
3472 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3473 decl = MkDeclaration(specifiers, declarators);
3474 external = MkExternalDeclaration(decl);
3475 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3476 external->symbol = symbol;
3477 symbol->__anon2.__anon2.externalGet = external;
3478 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3479 if(typeDecl)
3480 FreeDeclarator(typeDecl);
3481 }
3482 else
3483 {
3484 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon2.externalGet, curExternal->prev);
3485 }
3486 }
3487 if(prop->Set)
3488 {
3489 if(!symbol->__anon2.__anon2.externalSet || symbol->__anon2.__anon2.externalSet->type == 0)
3490 {
3491 struct Declaration * decl;
3492 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3493 struct Declarator * d;
3494 struct __ecereNameSpace__ecere__sys__OldList * params;
3495 struct Specifier * spec;
3496 struct External * external;
3497 struct Declarator * typeDecl;
3498
3499 declarators = MkList();
3500 params = MkList();
3501 if(!prop->conversion || prop->_class->type == 1)
3502 {
3503 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3504 }
3505 specifiers = MkList();
3506 {
3507 struct Context * context = SetupTemplatesContext(prop->_class);
3508
3509 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3510 FinishTemplatesContext(context);
3511 }
3512 if(!strcmp(prop->_class->base->fullName, "eda::Row") || !strcmp(prop->_class->base->fullName, "eda::Id"))
3513 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(CONST));
3514 ListAdd(params, MkTypeName(specifiers, d));
3515 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3516 if(dllImport)
3517 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3518 d = MkDeclaratorFunction(d, params);
3519 for(spec = (*specifiers).first; spec; spec = spec->next)
3520 {
3521 if(spec->type == 1)
3522 {
3523 if((!typeDecl || typeDecl->type == 1))
3524 {
3525 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
3526
3527 symbol->_class = classSym->__anon1.registered;
3528 if(classSym->__anon1.registered && classSym->__anon1.registered->type == 1)
3529 DeclareStruct(spec->__anon1.__anon1.name, 0);
3530 }
3531 }
3532 }
3533 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3534 specifiers = MkList();
3535 if(dllImport)
3536 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3537 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3538 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3539 if(!prop->conversion || prop->_class->type == 1)
3540 ListAdd(specifiers, MkSpecifier(VOID));
3541 else
3542 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3543 decl = MkDeclaration(specifiers, declarators);
3544 external = MkExternalDeclaration(decl);
3545 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3546 external->symbol = symbol;
3547 symbol->__anon2.__anon2.externalSet = external;
3548 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3549 }
3550 else
3551 {
3552 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon2.externalSet, curExternal->prev);
3553 }
3554 }
3555 if(!symbol->__anon2.__anon2.externalPtr)
3556 {
3557 struct Declaration * decl;
3558 struct External * external;
3559 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3560 char propName[1024];
3561
3562 if(imported)
3563 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3564 else
3565 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3566 ListAdd(specifiers, MkSpecifierName("Property"));
3567 strcpy(propName, "__ecereProp_");
3568 FullClassNameCat(propName, prop->_class->fullName, 0);
3569 strcat(propName, "_");
3570 FullClassNameCat(propName, prop->name, 1);
3571 {
3572 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3573
3574 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3575 if(!imported)
3576 {
3577 strcpy(propName, "__ecerePropM_");
3578 FullClassNameCat(propName, prop->_class->fullName, 0);
3579 strcat(propName, "_");
3580 FullClassNameCat(propName, prop->name, 1);
3581 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3582 }
3583 decl = MkDeclaration(specifiers, list);
3584 }
3585 external = MkExternalDeclaration(decl);
3586 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3587 external->symbol = symbol;
3588 symbol->__anon2.__anon2.externalPtr = external;
3589 }
3590 else
3591 {
3592 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon2.externalPtr, curExternal->prev);
3593 }
3594 symbol->id = curExternal->symbol->idCode;
3595 }
3596 }
3597
3598 struct Type * Dereference(struct Type * source)
3599 {
3600 struct Type * type = (((void *)0));
3601
3602 if(source)
3603 {
3604 if(source->kind == 13 || source->kind == 12)
3605 {
3606 type = source->__anon1.type;
3607 source->__anon1.type->refCount++;
3608 }
3609 else if(source->kind == 8 && !strcmp(source->__anon1._class->string, "String"))
3610 {
3611 type = __extension__ ({
3612 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3613
3614 __ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
3615 });
3616 }
3617 else if(source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 5)
3618 {
3619 type = source;
3620 source->refCount++;
3621 }
3622 else
3623 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot dereference type\n", (((void *)0))));
3624 }
3625 return type;
3626 }
3627
3628 static struct Type * Reference(struct Type * source)
3629 {
3630 struct Type * type = (((void *)0));
3631
3632 if(source)
3633 {
3634 type = __extension__ ({
3635 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3636
3637 __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
3638 });
3639 source->refCount++;
3640 }
3641 return type;
3642 }
3643
3644 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);
3645
3646 extern void *  memcpy(void * , const void * , size_t size);
3647
3648 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3649
3650 extern void FreeExpression(struct Expression * exp);
3651
3652 extern void __ecereNameSpace__ecere__sys__ChangeCh(char *  string, char ch1, char ch2);
3653
3654 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);
3655
3656 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3657
3658 extern struct Type * MkClassType(const char *  name);
3659
3660 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);
3661
3662 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)
3663 {
3664 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3665 unsigned int found = 0;
3666 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3667 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3668 unsigned int freeType = 0;
3669
3670 yylloc = member->loc;
3671 if(!ident)
3672 {
3673 if(curMember)
3674 {
3675 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3676 if(*curMember)
3677 {
3678 found = 1;
3679 dataMember = *curMember;
3680 }
3681 }
3682 }
3683 else
3684 {
3685 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3686 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3687 int _subMemberStackPos = 0;
3688
3689 if(!thisMember)
3690 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3691 if(thisMember)
3692 {
3693 dataMember = thisMember;
3694 if(curMember && thisMember->memberAccess == 1)
3695 {
3696 *curMember = thisMember;
3697 *curClass = thisMember->_class;
3698 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
3699 *subMemberStackPos = _subMemberStackPos;
3700 }
3701 found = 1;
3702 }
3703 else
3704 {
3705 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3706 if(method && method->type == 1)
3707 found = 1;
3708 else
3709 method = (((void *)0));
3710 }
3711 }
3712 if(found)
3713 {
3714 struct Type * type = (((void *)0));
3715
3716 if(dataMember)
3717 {
3718 if(!dataMember->dataType && dataMember->dataTypeString)
3719 {
3720 struct Context * context = SetupTemplatesContext(_class);
3721
3722 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
3723 FinishTemplatesContext(context);
3724 }
3725 type = dataMember->dataType;
3726 }
3727 else if(method)
3728 {
3729 if(!method->dataType)
3730 ProcessMethodType(method);
3731 type = method->dataType;
3732 }
3733 if(ident && ident->next)
3734 {
3735 for(ident = ident->next; ident && type; ident = ident->next)
3736 {
3737 if(type->kind == 8)
3738 {
3739 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->__anon1._class->__anon1.registered, ident->string, privateModule);
3740 if(!dataMember)
3741 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->__anon1._class->__anon1.registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3742 if(dataMember)
3743 type = dataMember->dataType;
3744 }
3745 else if(type->kind == 9 || type->kind == 10)
3746 {
3747 struct Type * memberType;
3748
3749 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
3750 {
3751 if(!strcmp(memberType->name, ident->string))
3752 {
3753 type = memberType;
3754 break;
3755 }
3756 }
3757 }
3758 }
3759 }
3760 if(type && type->kind == 20 && type->__anon1.templateParameter->type == 0 && _class->templateArgs)
3761 {
3762 int id = 0;
3763 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3764 struct __ecereNameSpace__ecere__com__Class * sClass;
3765
3766 for(sClass = _class; sClass; sClass = sClass->base)
3767 {
3768 id = 0;
3769 if(sClass->templateClass)
3770 sClass = sClass->templateClass;
3771 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3772 {
3773 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
3774 {
3775 for(sClass = sClass->base; sClass; sClass = sClass->base)
3776 {
3777 if(sClass->templateClass)
3778 sClass = sClass->templateClass;
3779 id += sClass->templateParams.count;
3780 }
3781 break;
3782 }
3783 id++;
3784 }
3785 if(curParam)
3786 break;
3787 }
3788 if(curParam)
3789 {
3790 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3791
3792 if(arg.__anon1.__anon1.dataTypeString)
3793 {
3794 unsigned int constant = type->constant;
3795
3796 type = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
3797 if(type->kind == 8 && constant)
3798 type->constant = 1;
3799 else if(type->kind == 13)
3800 {
3801 struct Type * t = type->__anon1.type;
3802
3803 while(t->kind == 13)
3804 t = t->__anon1.type;
3805 if(constant)
3806 t->constant = constant;
3807 }
3808 freeType = 1;
3809 if(type && _class->templateClass)
3810 type->passAsTemplate = 1;
3811 if(type)
3812 {
3813 }
3814 }
3815 }
3816 }
3817 if(type && type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered && strchr(type->__anon1._class->__anon1.registered->fullName, '<'))
3818 {
3819 struct __ecereNameSpace__ecere__com__Class * expClass = type->__anon1._class->__anon1.registered;
3820 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3821 int paramCount = 0;
3822 int lastParam = -1;
3823 char templateString[1024];
3824 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3825
3826 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3827 for(cClass = expClass; cClass; cClass = cClass->base)
3828 {
3829 int p = 0;
3830
3831 if(cClass->templateClass)
3832 cClass = cClass->templateClass;
3833 for(param = cClass->templateParams.first; param; param = param->next)
3834 {
3835 int id = p;
3836 struct __ecereNameSpace__ecere__com__Class * sClass;
3837 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3838
3839 for(sClass = cClass->base; sClass; sClass = sClass->base)
3840 {
3841 if(sClass->templateClass)
3842 sClass = sClass->templateClass;
3843 id += sClass->templateParams.count;
3844 }
3845 arg = expClass->templateArgs[id];
3846 for(sClass = _class; sClass; sClass = sClass->base)
3847 {
3848 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3849 int p = 0;
3850 struct __ecereNameSpace__ecere__com__Class * nextClass;
3851
3852 if(sClass->templateClass)
3853 sClass = sClass->templateClass;
3854 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3855 {
3856 if(nextClass->templateClass)
3857 nextClass = nextClass->templateClass;
3858 p += nextClass->templateParams.count;
3859 }
3860 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3861 {
3862 if(cParam->type == 0 && arg.__anon1.__anon1.dataTypeString && !strcmp(cParam->name, arg.__anon1.__anon1.dataTypeString))
3863 {
3864 if(_class->templateArgs && arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
3865 {
3866 arg.__anon1.__anon1.dataTypeString = _class->templateArgs[p].__anon1.__anon1.dataTypeString;
3867 arg.__anon1.__anon1.dataTypeClass = _class->templateArgs[p].__anon1.__anon1.dataTypeClass;
3868 break;
3869 }
3870 }
3871 }
3872 }
3873 {
3874 char argument[256];
3875
3876 argument[0] = '\0';
3877 switch(param->type)
3878 {
3879 case 2:
3880 {
3881 char expString[1024];
3882 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3883 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
3884 struct Expression * exp;
3885 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
3886
3887 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3888 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
3889 ProcessExpressionType(exp);
3890 ComputeExpression(exp);
3891 expString[0] = '\0';
3892 PrintExpression(exp, expString);
3893 strcat(argument, expString);
3894 FreeExpression(exp);
3895 break;
3896 }
3897 case 1:
3898 {
3899 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
3900 break;
3901 }
3902 case 0:
3903 {
3904 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
3905 strcat(argument, arg.__anon1.__anon1.dataTypeString);
3906 break;
3907 }
3908 }
3909 if(argument[0])
3910 {
3911 if(paramCount)
3912 strcat(templateString, ", ");
3913 if(lastParam != p - 1)
3914 {
3915 strcat(templateString, param->name);
3916 strcat(templateString, " = ");
3917 }
3918 strcat(templateString, argument);
3919 paramCount++;
3920 lastParam = p;
3921 }
3922 p++;
3923 }
3924 }
3925 }
3926 {
3927 int len = strlen(templateString);
3928
3929 if(templateString[len - 1] == '<')
3930 len--;
3931 else
3932 {
3933 if(templateString[len - 1] == '>')
3934 templateString[len++] = ' ';
3935 templateString[len++] = '>';
3936 }
3937 templateString[len++] = '\0';
3938 }
3939 {
3940 struct Context * context = SetupTemplatesContext(_class);
3941
3942 if(freeType)
3943 FreeType(type);
3944 type = ProcessTypeString(templateString, 0);
3945 freeType = 1;
3946 FinishTemplatesContext(context);
3947 }
3948 }
3949 if(method && member->initializer && member->initializer->type == 0 && member->initializer->__anon1.exp)
3950 {
3951 ProcessExpressionType(member->initializer->__anon1.exp);
3952 if(!member->initializer->__anon1.exp->expType)
3953 {
3954 if(inCompiler)
3955 {
3956 char expString[10240];
3957
3958 expString[0] = '\0';
3959 PrintExpression(member->initializer->__anon1.exp, expString);
3960 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3961 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3962 }
3963 }
3964 else if(!MatchTypes(member->initializer->__anon1.exp->expType, type, (((void *)0)), (((void *)0)), _class, 1, 1, 0, 0, 1))
3965 {
3966 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible instance method %s\n", (((void *)0))), ident->string);
3967 }
3968 }
3969 else if(member->initializer)
3970 {
3971 ProcessInitializer(member->initializer, type);
3972 }
3973 if(freeType)
3974 FreeType(type);
3975 }
3976 else
3977 {
3978 if(_class && _class->type == 3)
3979 {
3980 if(member->initializer)
3981 {
3982 struct Type * type = MkClassType(_class->fullName);
3983
3984 ProcessInitializer(member->initializer, type);
3985 FreeType(type);
3986 }
3987 }
3988 else
3989 {
3990 if(member->initializer)
3991 {
3992 ProcessInitializer(member->initializer, (((void *)0)));
3993 }
3994 if(ident)
3995 {
3996 if(method)
3997 {
3998 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3999 }
4000 else if(_class)
4001 {
4002 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
4003 if(inCompiler)
4004 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
4005 }
4006 }
4007 else if(_class)
4008 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
4009 }
4010 }
4011 }
4012
4013 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);
4014
4015 extern void FreeSpecifier(struct Specifier * spec);
4016
4017 static void ProcessFunction(struct FunctionDefinition * function);
4018
4019 extern struct __ecereNameSpace__ecere__sys__OldList *  CopyList(struct __ecereNameSpace__ecere__sys__OldList *  source, void *  (*  CopyFunction)(void * ));
4020
4021 extern struct Specifier * CopySpecifier(struct Specifier * spec);
4022
4023 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
4024
4025 extern void FreeClassFunction(struct ClassFunction * func);
4026
4027 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
4028
4029 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
4030
4031 void ProcessInstantiationType(struct Instantiation * inst)
4032 {
4033 yylloc = inst->loc;
4034 if(inst->_class)
4035 {
4036 struct MembersInit * members;
4037 struct Symbol * classSym;
4038 struct __ecereNameSpace__ecere__com__Class * _class;
4039
4040 classSym = inst->_class->__anon1.__anon1.symbol;
4041 _class = classSym ? classSym->__anon1.registered : (((void *)0));
4042 if(!_class || _class->type != 5)
4043 DeclareStruct(inst->_class->__anon1.__anon1.name, 0);
4044 afterExternal = afterExternal ? afterExternal : curExternal;
4045 if(inst->exp)
4046 ProcessExpressionType(inst->exp);
4047 inst->isConstant = 1;
4048 if(inst->members)
4049 {
4050 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
4051 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
4052 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
4053 int subMemberStackPos = 0;
4054
4055 for(members = (*inst->members).first; members; members = members->next)
4056 {
4057 switch(members->type)
4058 {
4059 case 1:
4060 {
4061 char name[1024];
4062 static unsigned int instMethodID = 0;
4063 struct External * external = curExternal;
4064 struct Context * context = curContext;
4065 struct Declarator * declarator = members->__anon1.function->declarator;
4066 struct Identifier * nameID = GetDeclId(declarator);
4067 char * unmangled = nameID ? nameID->string : (((void *)0));
4068 struct Expression * exp;
4069 struct External * createdExternal = (((void *)0));
4070
4071 if(inCompiler)
4072 {
4073 char number[16];
4074
4075 strcpy(name, "__ecereInstMeth_");
4076 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0);
4077 strcat(name, "_");
4078 strcat(name, nameID->string);
4079 strcat(name, "_");
4080 sprintf(number, "_%08d", instMethodID++);
4081 strcat(name, number);
4082 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
4083 }
4084 if(declarator)
4085 {
4086 struct Symbol * symbol = declarator->symbol;
4087 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
4088
4089 if(method && method->type == 1)
4090 {
4091 symbol->__anon1.method = method;
4092 ProcessMethodType(method);
4093 if(!symbol->type->__anon1.__anon2.thisClass)
4094 {
4095 if(method->dataType->__anon1.__anon2.thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->__anon1.__anon2.thisClass->__anon1.registered))
4096 {
4097 if(!currentClass->symbol)
4098 currentClass->symbol = FindClass(currentClass->fullName);
4099 symbol->type->__anon1.__anon2.thisClass = currentClass->symbol;
4100 }
4101 else
4102 {
4103 if(!_class->symbol)
4104 _class->symbol = FindClass(_class->fullName);
4105 symbol->type->__anon1.__anon2.thisClass = _class->symbol;
4106 }
4107 }
4108 DeclareType(symbol->type, 1, 1);
4109 }
4110 else if(classSym)
4111 {
4112 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
4113 }
4114 }
4115 createdExternal = ProcessClassFunction(classSym ? classSym->__anon1.registered : (((void *)0)), members->__anon1.function, ast, afterExternal, 1);
4116 if(nameID)
4117 {
4118 FreeSpecifier(nameID->_class);
4119 nameID->_class = (((void *)0));
4120 }
4121 if(inCompiler)
4122 {
4123 struct External * oldExternal = curExternal;
4124
4125 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
4126 {
4127 struct External * externalDecl;
4128
4129 externalDecl = MkExternalDeclaration((((void *)0)));
4130 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
4131 if(createdExternal->__anon1.function)
4132 {
4133 ProcessFunction(createdExternal->__anon1.function);
4134 {
4135 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->__anon1.function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
4136
4137 externalDecl->__anon1.declaration = decl;
4138 if(decl->symbol && !decl->symbol->__anon2.__anon1.pointerExternal)
4139 decl->symbol->__anon2.__anon1.pointerExternal = externalDecl;
4140 declarator->symbol->__anon2.__anon1.pointerExternal = externalDecl;
4141 }
4142 }
4143 }
4144 }
4145 else if(declarator)
4146 {
4147 curExternal = declarator->symbol->__anon2.__anon1.pointerExternal;
4148 ProcessFunction((struct FunctionDefinition *)members->__anon1.function);
4149 }
4150 curExternal = external;
4151 curContext = context;
4152 if(inCompiler)
4153 {
4154 FreeClassFunction(members->__anon1.function);
4155 exp = QMkExpId(name);
4156 members->type = 0;
4157 members->__anon1.dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
4158 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
4159 }
4160 break;
4161 }
4162 case 0:
4163 {
4164 if(members->__anon1.dataMembers && classSym)
4165 {
4166 struct MemberInit * member;
4167 struct Location oldyyloc = yylloc;
4168
4169 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
4170 {
4171 ProcessMemberInitData(member, classSym->__anon1.registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
4172 if(member->initializer && !member->initializer->isConstant)
4173 inst->isConstant = 0;
4174 }
4175 yylloc = oldyyloc;
4176 }
4177 break;
4178 }
4179 }
4180 }
4181 }
4182 }
4183 }
4184
4185 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
4186 {
4187 if(inCompiler)
4188 {
4189 if(type->kind == 11)
4190 {
4191 struct Type * param;
4192
4193 if(declareParams)
4194 {
4195 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
4196 DeclareType(param, declarePointers, 1);
4197 }
4198 DeclareType(type->__anon1.__anon2.returnType, declarePointers, 1);
4199 }
4200 else if(type->kind == 13 && declarePointers)
4201 DeclareType(type->__anon1.type, declarePointers, 0);
4202 else if(type->kind == 8)
4203 {
4204 if(type->__anon1._class->__anon1.registered && (type->__anon1._class->__anon1.registered->type == 1 || type->__anon1._class->__anon1.registered->type == 5) && !type->__anon1._class->declaring)
4205 DeclareStruct(type->__anon1._class->__anon1.registered->fullName, type->__anon1._class->__anon1.registered->type == 5);
4206 }
4207 else if(type->kind == 9 || type->kind == 10)
4208 {
4209 struct Type * member;
4210
4211 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
4212 DeclareType(member, 0, 0);
4213 }
4214 else if(type->kind == 12)
4215 DeclareType(type->__anon1.__anon4.arrayType, declarePointers, 0);
4216 }
4217 }
4218
4219 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
4220
4221 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
4222 {
4223 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
4224 int id = 0;
4225 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4226 struct __ecereNameSpace__ecere__com__Class * sClass;
4227
4228 for(sClass = _class; sClass; sClass = sClass->base)
4229 {
4230 id = 0;
4231 if(sClass->templateClass)
4232 sClass = sClass->templateClass;
4233 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4234 {
4235 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
4236 {
4237 for(sClass = sClass->base; sClass; sClass = sClass->base)
4238 {
4239 if(sClass->templateClass)
4240 sClass = sClass->templateClass;
4241 id += sClass->templateParams.count;
4242 }
4243 break;
4244 }
4245 id++;
4246 }
4247 if(curParam)
4248 break;
4249 }
4250 if(curParam)
4251 {
4252 arg = &_class->templateArgs[id];
4253 if(arg && param->type == 0)
4254 (*arg).__anon1.__anon1.dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).__anon1.__anon1.dataTypeString);
4255 }
4256 return arg;
4257 }
4258
4259 extern struct Context * PushContext(void);
4260
4261 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
4262
4263 struct TemplatedType
4264 {
4265 uintptr_t key;
4266 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4267 struct __ecereNameSpace__ecere__sys__BTNode * left;
4268 struct __ecereNameSpace__ecere__sys__BTNode * right;
4269 int depth;
4270 struct TemplateParameter * param;
4271 } __attribute__ ((gcc_struct));
4272
4273 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
4274
4275 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
4276 {
4277 struct Context * context = PushContext();
4278
4279 context->templateTypesOnly = 1;
4280 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
4281 {
4282 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
4283
4284 for(; param; param = param->next)
4285 {
4286 if(param->type == 0 && param->identifier)
4287 {
4288 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
4289
4290 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4291 }
4292 }
4293 }
4294 else if(_class)
4295 {
4296 struct __ecereNameSpace__ecere__com__Class * sClass;
4297
4298 for(sClass = _class; sClass; sClass = sClass->base)
4299 {
4300 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
4301
4302 for(p = sClass->templateParams.first; p; p = p->next)
4303 {
4304 if(p->type == 0)
4305 {
4306 struct TemplateParameter * param = p->param;
4307 struct TemplatedType * type;
4308
4309 if(!param)
4310 {
4311 p->param = param = __extension__ ({
4312 struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
4313
4314 __ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->__anon1.dataTypeString, __ecereInstance1;
4315 });
4316 }
4317 type = __extension__ ({
4318 struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
4319
4320 __ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
4321 });
4322 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4323 }
4324 }
4325 }
4326 }
4327 return context;
4328 }
4329
4330 extern void PopContext(struct Context * ctx);
4331
4332 extern void FreeContext(struct Context * context);
4333
4334 void FinishTemplatesContext(struct Context * context)
4335 {
4336 PopContext(context);
4337 FreeContext(context);
4338 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor((void *)context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
4339 }
4340
4341 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
4342 {
4343 if(!method->dataType)
4344 {
4345 struct Context * context = SetupTemplatesContext(method->_class);
4346
4347 method->dataType = ProcessTypeString(method->dataTypeString, 0);
4348 FinishTemplatesContext(context);
4349 if(method->type != 1 && method->dataType)
4350 {
4351 if(!method->dataType->__anon1.__anon2.thisClass && !method->dataType->__anon1.__anon2.staticMethod)
4352 {
4353 if(!method->_class->symbol)
4354 method->_class->symbol = FindClass(method->_class->fullName);
4355 method->dataType->__anon1.__anon2.thisClass = method->_class->symbol;
4356 }
4357 }
4358 }
4359 }
4360
4361 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
4362 {
4363 if(!prop->dataType)
4364 {
4365 struct Context * context = SetupTemplatesContext(prop->_class);
4366
4367 prop->dataType = ProcessTypeString(prop->dataTypeString, 0);
4368 FinishTemplatesContext(context);
4369 }
4370 }
4371
4372 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4373
4374 extern void FreeTypeName(struct TypeName * typeName);
4375
4376 static void ProcessDeclarator(struct Declarator * decl);
4377
4378 extern struct __ecereNameSpace__ecere__sys__OldList *  excludedSymbols;
4379
4380 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4381
4382 struct MethodImport
4383 {
4384 struct MethodImport * prev;
4385 struct MethodImport * next;
4386 char *  name;
4387 unsigned int isVirtual;
4388 } __attribute__ ((gcc_struct));
4389
4390 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
4391
4392 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, const char * name)
4393 {
4394 struct Symbol * symbol = method->symbol;
4395
4396 if(!symbol || (!symbol->__anon2.__anon1.pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4397 {
4398 unsigned int dllImport = 0;
4399
4400 if(!method->dataType)
4401 method->dataType = ProcessTypeString(method->dataTypeString, 0);
4402 if(!symbol || symbol->_import || method->type == 1)
4403 {
4404 if(!symbol || method->type == 1)
4405 {
4406 struct Symbol * classSym;
4407
4408 if(!method->_class->symbol)
4409 method->_class->symbol = FindClass(method->_class->fullName);
4410 classSym = method->_class->symbol;
4411 if(!classSym->_import)
4412 {
4413 struct ModuleImport * module;
4414
4415 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->name)
4416 module = FindModule(method->_class->module);
4417 else
4418 module = mainModule;
4419 classSym->_import = __extension__ ({
4420 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
4421
4422 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
4423 });
4424 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4425 }
4426 if(!symbol)
4427 {
4428 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4429 }
4430 if(!symbol->_import)
4431 {
4432 symbol->_import = (struct ClassImport *)__extension__ ({
4433 struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
4434
4435 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
4436 });
4437 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4438 }
4439 if(!symbol)
4440 {
4441 symbol->type = method->dataType;
4442 if(symbol->type)
4443 symbol->type->refCount++;
4444 }
4445 }
4446 if(!method->dataType->dllExport)
4447 {
4448 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)
4449 dllImport = 1;
4450 }
4451 }
4452 if(method->type != 1 && method->dataType)
4453 DeclareType(method->dataType, 1, 1);
4454 if(!symbol->__anon2.__anon1.pointerExternal || symbol->__anon2.__anon1.pointerExternal->type == 0)
4455 {
4456 struct Declaration * decl;
4457 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4458 struct Declarator * d;
4459 struct Declarator * funcDecl;
4460 struct External * external;
4461
4462 specifiers = MkList();
4463 declarators = MkList();
4464 if(dllImport)
4465 ListAdd(specifiers, MkSpecifier(EXTERN));
4466 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4467 ListAdd(specifiers, MkSpecifier(STATIC));
4468 if(method->type == 1)
4469 {
4470 ListAdd(specifiers, MkSpecifier(INT));
4471 d = MkDeclaratorIdentifier(MkIdentifier(name));
4472 }
4473 else
4474 {
4475 d = MkDeclaratorIdentifier(MkIdentifier(name));
4476 if(dllImport)
4477 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4478 {
4479 struct Context * context = SetupTemplatesContext(method->_class);
4480
4481 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4482 FinishTemplatesContext(context);
4483 }
4484 funcDecl = GetFuncDecl(d);
4485 if(dllImport)
4486 {
4487 struct Specifier * spec, * next;
4488
4489 for(spec = (*specifiers).first; spec; spec = next)
4490 {
4491 next = spec->next;
4492 if(spec->type == 5)
4493 {
4494 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4495 FreeSpecifier(spec);
4496 }
4497 }
4498 }
4499 if(method->dataType && !method->dataType->__anon1.__anon2.staticMethod)
4500 {
4501 if(funcDecl && funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count)
4502 {
4503 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->__anon1.__anon2.thisClass ? method->dataType->__anon1.__anon2.thisClass->__anon1.registered : method->_class;
4504 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")));
4505 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->__anon1.function.parameters).first);
4506 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4507
4508 if(firstSpec && firstSpec->type == 0 && firstSpec->__anon1.specifier == VOID && !firstParam->declarator)
4509 {
4510 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
4511
4512 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
4513 FreeTypeName(param);
4514 }
4515 if(!funcDecl->__anon1.function.parameters)
4516 funcDecl->__anon1.function.parameters = MkList();
4517 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
4518 }
4519 }
4520 }
4521 ProcessDeclarator(d);
4522 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4523 decl = MkDeclaration(specifiers, declarators);
4524 ReplaceThisClassSpecifiers(specifiers, method->_class);
4525 if(symbol->__anon2.__anon1.pointerExternal)
4526 {
4527 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4528
4529 {
4530 *functionSymbol = *symbol;
4531 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4532 if(functionSymbol->type)
4533 functionSymbol->type->refCount++;
4534 }
4535 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4536 symbol->__anon2.__anon1.pointerExternal->symbol = functionSymbol;
4537 }
4538 external = MkExternalDeclaration(decl);
4539 if(curExternal)
4540 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4541 external->symbol = symbol;
4542 symbol->__anon2.__anon1.pointerExternal = external;
4543 }
4544 else if(ast)
4545 {
4546 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon1.pointerExternal, curExternal->prev);
4547 }
4548 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4549 }
4550 }
4551
4552 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4553 {
4554 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4555 {
4556 unsigned int first = 1;
4557 int p = 0;
4558 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4559 int lastParam = -1;
4560 char className[1024];
4561
4562 strcpy(className, _class->fullName);
4563 for(param = _class->templateParams.first; param; param = param->next)
4564 {
4565 {
4566 if(first)
4567 strcat(className, "<");
4568 if(!first)
4569 strcat(className, ", ");
4570 if(lastParam + 1 != p)
4571 {
4572 strcat(className, param->name);
4573 strcat(className, " = ");
4574 }
4575 strcat(className, param->name);
4576 first = 0;
4577 lastParam = p;
4578 }
4579 p++;
4580 }
4581 if(!first)
4582 {
4583 int len = strlen(className);
4584
4585 if(className[len - 1] == '>')
4586 className[len++] = ' ';
4587 className[len++] = '>';
4588 className[len++] = '\0';
4589 }
4590 return __ecereNameSpace__ecere__sys__CopyString(className);
4591 }
4592 else
4593 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4594 }
4595
4596 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4597 {
4598 struct Type * type;
4599
4600 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4601 {
4602 unsigned int first = 1;
4603 int p = 0;
4604 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4605 int lastParam = -1;
4606 char className[1024];
4607
4608 strcpy(className, _class->fullName);
4609 for(param = _class->templateParams.first; param; param = param->next)
4610 {
4611 {
4612 if(first)
4613 strcat(className, "<");
4614 if(!first)
4615 strcat(className, ", ");
4616 if(lastParam + 1 != p)
4617 {
4618 strcat(className, param->name);
4619 strcat(className, " = ");
4620 }
4621 strcat(className, param->name);
4622 first = 0;
4623 lastParam = p;
4624 }
4625 p++;
4626 }
4627 if(!first)
4628 {
4629 int len = strlen(className);
4630
4631 if(className[len - 1] == '>')
4632 className[len++] = ' ';
4633 className[len++] = '>';
4634 className[len++] = '\0';
4635 }
4636 type = MkClassType(className);
4637 }
4638 else
4639 {
4640 type = MkClassType(_class->fullName);
4641 }
4642 return type;
4643 }
4644
4645 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4646 {
4647 if(specs != (((void *)0)) && _class)
4648 {
4649 struct Specifier * spec;
4650
4651 for(spec = specs->first; spec; spec = spec->next)
4652 {
4653 if(spec->type == 0 && spec->__anon1.specifier == THISCLASS)
4654 {
4655 spec->type = 1;
4656 spec->__anon1.__anon1.name = ReplaceThisClass(_class);
4657 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
4658 }
4659 }
4660 }
4661 }
4662
4663 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4664
4665 struct __ecereNameSpace__ecere__com__GlobalFunction
4666 {
4667 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4668 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4669 const char *  name;
4670 int (*  function)();
4671 struct __ecereNameSpace__ecere__com__Instance * module;
4672 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
4673 const char *  dataTypeString;
4674 struct Type * dataType;
4675 void *  symbol;
4676 } __attribute__ ((gcc_struct));
4677
4678 extern struct Context * globalContext;
4679
4680 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4681
4682 struct FunctionImport
4683 {
4684 struct FunctionImport * prev;
4685 struct FunctionImport * next;
4686 char *  name;
4687 } __attribute__ ((gcc_struct));
4688
4689 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4690 {
4691 struct Symbol * symbol = function->symbol;
4692
4693 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4694 {
4695 unsigned int imported = 0;
4696 unsigned int dllImport = 0;
4697
4698 if(!function->dataType)
4699 {
4700 function->dataType = ProcessTypeString(function->dataTypeString, 0);
4701 if(!function->dataType->__anon1.__anon2.thisClass)
4702 function->dataType->__anon1.__anon2.staticMethod = 1;
4703 }
4704 if(inCompiler)
4705 {
4706 if(!symbol)
4707 {
4708 struct ModuleImport * module = FindModule(function->module);
4709
4710 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4711 if(module->name)
4712 {
4713 if(!function->dataType->dllExport)
4714 {
4715 symbol->_import = (struct ClassImport *)__extension__ ({
4716 struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
4717
4718 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
4719 });
4720 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4721 }
4722 }
4723 {
4724 symbol->type = ProcessTypeString(function->dataTypeString, 0);
4725 if(!symbol->type->__anon1.__anon2.thisClass)
4726 symbol->type->__anon1.__anon2.staticMethod = 1;
4727 }
4728 }
4729 imported = symbol->_import ? 1 : 0;
4730 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1)
4731 dllImport = 1;
4732 }
4733 DeclareType(function->dataType, 1, 1);
4734 if(inCompiler)
4735 {
4736 if(!symbol->__anon2.__anon1.pointerExternal || symbol->__anon2.__anon1.pointerExternal->type == 0)
4737 {
4738 struct Declaration * decl;
4739 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4740 struct Declarator * d;
4741 struct Declarator * funcDecl;
4742 struct External * external;
4743
4744 specifiers = MkList();
4745 declarators = MkList();
4746 ListAdd(specifiers, MkSpecifier(EXTERN));
4747 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4748 if(dllImport)
4749 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4750 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4751 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType == 1)
4752 {
4753 struct Specifier * spec;
4754
4755 for(spec = (*specifiers).first; spec; spec = spec->next)
4756 if(spec->type == 5 && spec->__anon1.__anon1.extDecl && spec->__anon1.__anon1.extDecl->type == 0 && !strcmp(spec->__anon1.__anon1.extDecl->__anon1.s, "dllexport"))
4757 {
4758 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4759 FreeSpecifier(spec);
4760 break;
4761 }
4762 }
4763 funcDecl = GetFuncDecl(d);
4764 if(funcDecl && !funcDecl->__anon1.function.parameters)
4765 {
4766 funcDecl->__anon1.function.parameters = MkList();
4767 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4768 }
4769 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4770 {
4771 struct Context * oldCtx = curContext;
4772
4773 curContext = globalContext;
4774 decl = MkDeclaration(specifiers, declarators);
4775 curContext = oldCtx;
4776 }
4777 if(symbol->__anon2.__anon1.pointerExternal)
4778 {
4779 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4780
4781 {
4782 *functionSymbol = *symbol;
4783 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4784 if(functionSymbol->type)
4785 functionSymbol->type->refCount++;
4786 }
4787 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4788 symbol->__anon2.__anon1.pointerExternal->symbol = functionSymbol;
4789 }
4790 external = MkExternalDeclaration(decl);
4791 if(curExternal)
4792 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4793 external->symbol = symbol;
4794 symbol->__anon2.__anon1.pointerExternal = external;
4795 }
4796 else
4797 {
4798 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon1.pointerExternal, curExternal->prev);
4799 }
4800 if(curExternal)
4801 symbol->id = curExternal->symbol->idCode;
4802 }
4803 }
4804 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1) ? 1 : 0;
4805 }
4806
4807 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4808
4809 struct GlobalData
4810 {
4811 uintptr_t key;
4812 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4813 struct __ecereNameSpace__ecere__sys__BTNode * left;
4814 struct __ecereNameSpace__ecere__sys__BTNode * right;
4815 int depth;
4816 struct __ecereNameSpace__ecere__com__Instance * module;
4817 char *  dataTypeString;
4818 struct Type * dataType;
4819 void *  symbol;
4820 char *  fullName;
4821 } __attribute__ ((gcc_struct));
4822
4823 void DeclareGlobalData(struct GlobalData * data)
4824 {
4825 struct Symbol * symbol = data->symbol;
4826
4827 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4828 {
4829 if(inCompiler)
4830 {
4831 if(!symbol)
4832 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4833 }
4834 if(!data->dataType)
4835 data->dataType = ProcessTypeString(data->dataTypeString, 0);
4836 DeclareType(data->dataType, 1, 1);
4837 if(inCompiler)
4838 {
4839 if(!symbol->__anon2.__anon1.pointerExternal)
4840 {
4841 struct Declaration * decl;
4842 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4843 struct Declarator * d;
4844 struct External * external;
4845
4846 specifiers = MkList();
4847 declarators = MkList();
4848 ListAdd(specifiers, MkSpecifier(EXTERN));
4849 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4850 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4851 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4852 decl = MkDeclaration(specifiers, declarators);
4853 external = MkExternalDeclaration(decl);
4854 if(curExternal)
4855 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4856 external->symbol = symbol;
4857 symbol->__anon2.__anon1.pointerExternal = external;
4858 }
4859 else
4860 {
4861 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon1.pointerExternal, curExternal->prev);
4862 }
4863 if(curExternal)
4864 symbol->id = curExternal->symbol->idCode;
4865 }
4866 }
4867 }
4868
4869 struct Conversion
4870 {
4871 struct Conversion * prev, * next;
4872 struct __ecereNameSpace__ecere__com__Property * convert;
4873 unsigned int isGet;
4874 struct Type * resultType;
4875 } __attribute__ ((gcc_struct));
4876
4877 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4878
4879 extern void Compiler_Warning(const char *  format, ...);
4880
4881 static unsigned int CheckConstCompatibility(struct Type * source, struct Type * dest, unsigned int warn)
4882 {
4883 unsigned int status = 1;
4884
4885 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))
4886 {
4887 struct __ecereNameSpace__ecere__com__Class * sourceClass = source->kind == 8 ? source->__anon1._class->__anon1.registered : (((void *)0));
4888 struct __ecereNameSpace__ecere__com__Class * destClass = dest->kind == 8 ? dest->__anon1._class->__anon1.registered : (((void *)0));
4889
4890 if((!sourceClass || (sourceClass && sourceClass->type == 0 && !sourceClass->structSize)) && (!destClass || (destClass && destClass->type == 0 && !destClass->structSize)))
4891 {
4892 struct Type * sourceType = source, * destType = dest;
4893
4894 while((sourceType->kind == 13 || sourceType->kind == 12) && sourceType->__anon1.type)
4895 sourceType = sourceType->__anon1.type;
4896 while((destType->kind == 13 || destType->kind == 12) && destType->__anon1.type)
4897 destType = destType->__anon1.type;
4898 if(!destType->constant && sourceType->constant)
4899 {
4900 status = 0;
4901 if(warn)
4902 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "discarding const qualifier\n", (((void *)0))));
4903 }
4904 }
4905 }
4906 return status;
4907 }
4908
4909 extern void CopyTypeInto(struct Type * type, struct Type * src);
4910
4911 void PrintType(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
4912
4913 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)
4914 {
4915 if(source && dest)
4916 {
4917 if(warnConst)
4918 CheckConstCompatibility(source, dest, 1);
4919 if(source->kind == 20 && dest->kind != 20)
4920 {
4921 struct Type * type = ProcessTemplateParameterType(source->__anon1.templateParameter);
4922
4923 if(type)
4924 source = type;
4925 }
4926 if(dest->kind == 20 && source->kind != 20)
4927 {
4928 struct Type * type = ProcessTemplateParameterType(dest->__anon1.templateParameter);
4929
4930 if(type)
4931 dest = type;
4932 }
4933 if(dest->classObjectType == 2 && dest->kind != 11)
4934 {
4935 if(source->classObjectType != 3)
4936 return 1;
4937 else
4938 {
4939 if((dest->__anon1._class && strcmp(dest->__anon1._class->string, "class")) || (source->__anon1._class && strcmp(source->__anon1._class->string, "class")))
4940 {
4941 return 1;
4942 }
4943 }
4944 }
4945 else
4946 {
4947 if(source->kind != 11 && source->classObjectType == 3)
4948 return 1;
4949 if(dest->kind != 11 && dest->classObjectType == 3 && source->classObjectType != 2)
4950 return 1;
4951 }
4952 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4953 {
4954 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))
4955 return 1;
4956 }
4957 if(dest->kind == 14 && source->kind != 0)
4958 return 1;
4959 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))
4960 return 1;
4961 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))
4962 return 1;
4963 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->__anon1._class)
4964 {
4965 if(source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 3)
4966 {
4967 if(conversions != (((void *)0)))
4968 {
4969 if(source->__anon1._class->__anon1.registered == dest->__anon1._class->__anon1.registered)
4970 return 1;
4971 }
4972 else
4973 {
4974 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4975
4976 for(sourceBase = source->__anon1._class->__anon1.registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4977 ;
4978 for(destBase = dest->__anon1._class->__anon1.registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4979 ;
4980 if(sourceBase == destBase)
4981 return 1;
4982 }
4983 }
4984 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))
4985 return 1;
4986 else
4987 {
4988 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))
4989 {
4990 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->__anon1._class->__anon1.registered, source->__anon1._class->__anon1.registered))
4991 {
4992 return 1;
4993 }
4994 }
4995 }
4996 }
4997 if(source->kind == 19 && dest->kind == 8 && dest->__anon1._class && !strcmp(dest->__anon1._class->string, "ecere::com::Class"))
4998 return 1;
4999 if(doConversion)
5000 {
5001 if(source->kind == 8)
5002 {
5003 struct __ecereNameSpace__ecere__com__Class * _class;
5004
5005 for(_class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
5006 {
5007 struct __ecereNameSpace__ecere__com__Property * convert;
5008
5009 for(convert = _class->conversions.first; convert; convert = convert->next)
5010 {
5011 if(convert->memberAccess == 1 || _class->module == privateModule)
5012 {
5013 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
5014
5015 if(!convert->dataType)
5016 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
5017 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))
5018 {
5019 if(!conversions && !convert->Get)
5020 return 1;
5021 else if(conversions != (((void *)0)))
5022 {
5023 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))
5024 return 1;
5025 else
5026 {
5027 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 1, conv);
5028
5029 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
5030 return 1;
5031 }
5032 }
5033 }
5034 }
5035 }
5036 }
5037 }
5038 if(dest->kind == 8)
5039 {
5040 struct __ecereNameSpace__ecere__com__Class * _class;
5041
5042 for(_class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
5043 {
5044 struct __ecereNameSpace__ecere__com__Property * convert;
5045
5046 for(convert = _class->conversions.first; convert; convert = convert->next)
5047 {
5048 if(convert->memberAccess == 1 || _class->module == privateModule)
5049 {
5050 struct Type * constType = (((void *)0));
5051 unsigned int success = 0;
5052
5053 if(!convert->dataType)
5054 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
5055 if(warnConst && convert->dataType->kind == 13 && convert->dataType->__anon1.type && dest->constant)
5056 {
5057 struct Type * ptrType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5058
5059 constType = __extension__ ({
5060 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5061
5062 __ecereInstance1->kind = 13, __ecereInstance1->refCount = 1, __ecereInstance1->__anon1.type = ptrType, __ecereInstance1;
5063 });
5064 CopyTypeInto(ptrType, convert->dataType->__anon1.type);
5065 ptrType->constant = 1;
5066 }
5067 if((constType || convert->dataType != dest) && MatchTypes(source, constType ? constType : convert->dataType, conversions, (((void *)0)), (((void *)0)), 1, 0, 0, 1, warnConst))
5068 {
5069 if(!conversions && !convert->Set)
5070 success = 1;
5071 else if(conversions != (((void *)0)))
5072 {
5073 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))
5074 success = 1;
5075 else
5076 {
5077 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
5078
5079 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
5080 success = 1;
5081 }
5082 }
5083 }
5084 if(constType)
5085 FreeType(constType);
5086 if(success)
5087 return 1;
5088 }
5089 }
5090 }
5091 if(enumBaseType && dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
5092 {
5093 if(!dest->__anon1._class->__anon1.registered->dataType)
5094 dest->__anon1._class->__anon1.registered->dataType = ProcessTypeString(dest->__anon1._class->__anon1.registered->dataTypeString, 0);
5095 if(dest->__anon1._class->__anon1.registered->dataType->kind == 8 || source->truth || dest->truth)
5096 {
5097 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))
5098 {
5099 return 1;
5100 }
5101 }
5102 }
5103 }
5104 if(source->kind == 8)
5105 {
5106 struct __ecereNameSpace__ecere__com__Class * _class;
5107
5108 for(_class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
5109 {
5110 struct __ecereNameSpace__ecere__com__Property * convert;
5111
5112 for(convert = _class->conversions.first; convert; convert = convert->next)
5113 {
5114 if(convert->memberAccess == 1 || _class->module == privateModule)
5115 {
5116 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
5117
5118 if(!convert->dataType)
5119 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
5120 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))
5121 {
5122 if(!conversions && !convert->Get)
5123 return 1;
5124 else if(conversions != (((void *)0)))
5125 {
5126 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))
5127 return 1;
5128 else
5129 {
5130 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 1, conv);
5131
5132 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
5133 return 1;
5134 }
5135 }
5136 }
5137 }
5138 }
5139 }
5140 if(enumBaseType && source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 4)
5141 {
5142 if(!source->__anon1._class->__anon1.registered->dataType)
5143 source->__anon1._class->__anon1.registered->dataType = ProcessTypeString(source->__anon1._class->__anon1.registered->dataTypeString, 0);
5144 if(!isConversionExploration || source->__anon1._class->__anon1.registered->dataType->kind == 8 || !strcmp(source->__anon1._class->__anon1.registered->name, "String"))
5145 {
5146 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))
5147 return 1;
5148 else if(MatchTypes(dest, source->__anon1._class->__anon1.registered->dataType, (((void *)0)), (((void *)0)), (((void *)0)), 0, 0, 0, 0, warnConst))
5149 return 1;
5150 }
5151 }
5152 }
5153 }
5154 if(source->kind == 8 || source->kind == 19)
5155 ;
5156 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
5157 return 1;
5158 else if(dest->kind == 7 && source->kind == 6)
5159 return 1;
5160 else if(dest->kind == 2 && (source->kind == 1 || source->kind == 24))
5161 return 1;
5162 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 23))
5163 return 1;
5164 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 22 || source->kind == 23))
5165 return 1;
5166 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 23 || source->kind == 4))
5167 return 1;
5168 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 4 || source->kind == 22))
5169 return 1;
5170 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))
5171 return 1;
5172 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))
5173 return 1;
5174 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)))
5175 {
5176 struct Type * paramSource, * paramDest;
5177
5178 if(dest->kind == 16)
5179 owningClassDest = dest->__anon1.__anon3.methodClass ? dest->__anon1.__anon3.methodClass : dest->__anon1.__anon3.method->_class;
5180 if(source->kind == 16)
5181 owningClassSource = source->__anon1.__anon3.methodClass ? source->__anon1.__anon3.methodClass : source->__anon1.__anon3.method->_class;
5182 if(dest->kind == 13 && dest->__anon1.type->kind == 11)
5183 dest = dest->__anon1.type;
5184 if(source->kind == 13 && source->__anon1.type->kind == 11)
5185 source = source->__anon1.type;
5186 if(dest->kind == 16)
5187 dest = dest->__anon1.__anon3.method->dataType;
5188 if(source->kind == 16)
5189 source = source->__anon1.__anon3.method->dataType;
5190 paramSource = source->__anon1.__anon2.params.first;
5191 if(paramSource && paramSource->kind == 0)
5192 paramSource = (((void *)0));
5193 paramDest = dest->__anon1.__anon2.params.first;
5194 if(paramDest && paramDest->kind == 0)
5195 paramDest = (((void *)0));
5196 if((dest->__anon1.__anon2.staticMethod || (!dest->__anon1.__anon2.thisClass && !owningClassDest)) && !(source->__anon1.__anon2.staticMethod || (!source->__anon1.__anon2.thisClass && !owningClassSource)))
5197 {
5198 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))))
5199 {
5200 if(paramDest && paramDest->kind == 8)
5201 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), paramDest->__anon1._class->string);
5202 else
5203 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class should not take an object\n", (((void *)0))));
5204 return 0;
5205 }
5206 paramDest = paramDest->next;
5207 }
5208 else if(!dest->__anon1.__anon2.staticMethod && (dest->__anon1.__anon2.thisClass || owningClassDest))
5209 {
5210 if((source->__anon1.__anon2.staticMethod || (!source->__anon1.__anon2.thisClass && !owningClassSource)))
5211 {
5212 if(dest->__anon1.__anon2.thisClass)
5213 {
5214 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->__anon1._class->__anon1.registered, dest->__anon1.__anon2.thisClass->__anon1.registered))
5215 {
5216 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->__anon1.__anon2.thisClass->string);
5217 return 0;
5218 }
5219 }
5220 else
5221 {
5222 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->__anon1._class->__anon1.registered, owningClassDest)))
5223 {
5224 if(owningClassDest)
5225 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
5226 else
5227 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "overriding class expected to be derived from method class\n", (((void *)0))));
5228 return 0;
5229 }
5230 }
5231 paramSource = paramSource->next;
5232 }
5233 else
5234 {
5235 if(dest->__anon1.__anon2.thisClass)
5236 {
5237 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1.__anon2.thisClass ? source->__anon1.__anon2.thisClass->__anon1.registered : owningClassSource, dest->__anon1.__anon2.thisClass->__anon1.registered))
5238 {
5239 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->__anon1.__anon2.thisClass->string);
5240 return 0;
5241 }
5242 }
5243 else
5244 {
5245 if(source->__anon1.__anon2.thisClass && source->__anon1.__anon2.thisClass->__anon1.registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1.__anon2.thisClass->__anon1.registered, owningClassDest))
5246 {
5247 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), source->__anon1.__anon2.thisClass->__anon1.registered->fullName);
5248 return 0;
5249 }
5250 }
5251 }
5252 }
5253 if(!MatchTypes(source->__anon1.__anon2.returnType, dest->__anon1.__anon2.returnType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
5254 {
5255 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible return type for function\n", (((void *)0))));
5256 return 0;
5257 }
5258 else
5259 CheckConstCompatibility(dest->__anon1.__anon2.returnType, source->__anon1.__anon2.returnType, 1);
5260 for(; paramDest; paramDest = paramDest->next)
5261 {
5262 if(!paramSource)
5263 {
5264 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "not enough parameters\n", (((void *)0))));
5265 return 0;
5266 }
5267 {
5268 struct Type * paramDestType = paramDest;
5269 struct Type * paramSourceType = paramSource;
5270 struct Type * type = paramDestType;
5271
5272 if(paramDest->kind == 20 && paramDest->__anon1.templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
5273 {
5274 int id = 0;
5275 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
5276 struct __ecereNameSpace__ecere__com__Class * sClass;
5277
5278 for(sClass = owningClassSource; sClass; sClass = sClass->base)
5279 {
5280 id = 0;
5281 if(sClass->templateClass)
5282 sClass = sClass->templateClass;
5283 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
5284 {
5285 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
5286 {
5287 for(sClass = sClass->base; sClass; sClass = sClass->base)
5288 {
5289 if(sClass->templateClass)
5290 sClass = sClass->templateClass;
5291 id += sClass->templateParams.count;
5292 }
5293 break;
5294 }
5295 id++;
5296 }
5297 if(curParam)
5298 break;
5299 }
5300 if(curParam)
5301 {
5302 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
5303
5304 paramDestType = type = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
5305 }
5306 }
5307 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)))
5308 {
5309 char type[1024];
5310
5311 type[0] = (char)0;
5312 PrintType(paramDest, type, 0, 1);
5313 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
5314 if(paramDestType != paramDest)
5315 FreeType(paramDestType);
5316 return 0;
5317 }
5318 if(paramDestType != paramDest)
5319 FreeType(paramDestType);
5320 }
5321 paramSource = paramSource->next;
5322 }
5323 if(paramSource)
5324 {
5325 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many parameters\n", (((void *)0))));
5326 return 0;
5327 }
5328 return 1;
5329 }
5330 else if((dest->kind == 11 || (dest->kind == 13 && dest->__anon1.type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->__anon1.type->kind == 0))
5331 {
5332 return 1;
5333 }
5334 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
5335 {
5336 if(MatchTypes(source->__anon1.type, dest->__anon1.type, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
5337 return 1;
5338 }
5339 }
5340 return 0;
5341 }
5342
5343 static void FreeConvert(struct Conversion * convert)
5344 {
5345 if(convert->resultType)
5346 FreeType(convert->resultType);
5347 }
5348
5349 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
5350
5351 struct __ecereNameSpace__ecere__com__BTNamedLink
5352 {
5353 const char *  name;
5354 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
5355 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
5356 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
5357 int depth;
5358 void *  data;
5359 } __attribute__ ((gcc_struct));
5360
5361 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
5362
5363 struct __ecereNameSpace__ecere__com__EnumClassData
5364 {
5365 struct __ecereNameSpace__ecere__sys__OldList values;
5366 long long largest;
5367 } __attribute__ ((gcc_struct));
5368
5369 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink64;
5370
5371 struct __ecereNameSpace__ecere__sys__NamedLink64
5372 {
5373 struct __ecereNameSpace__ecere__sys__NamedLink64 * prev;
5374 struct __ecereNameSpace__ecere__sys__NamedLink64 * next;
5375 char *  name;
5376 long long data;
5377 } __attribute__ ((gcc_struct));
5378
5379 extern void FreeExpContents(struct Expression * exp);
5380
5381 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
5382
5383 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
5384
5385 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
5386
5387 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
5388
5389 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (*  freeFn)(void * ));
5390
5391 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5392 {
5393 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
5394
5395 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)))
5396 {
5397 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
5398
5399 if(_class->type == 4)
5400 {
5401 struct __ecereNameSpace__ecere__sys__OldList converts =
5402 {
5403 0, 0, 0, 0, 0
5404 };
5405 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5406
5407 type->kind = 8;
5408 if(!_class->symbol)
5409 _class->symbol = FindClass(_class->fullName);
5410 type->__anon1._class = _class->symbol;
5411 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 1, 0, 0, 0, 0))
5412 {
5413 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
5414 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5415
5416 if(enumClass)
5417 {
5418 struct __ecereNameSpace__ecere__com__Class * baseClass;
5419
5420 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
5421 {
5422 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
5423
5424 for(value = e->values.first; value; value = value->next)
5425 {
5426 if(!strcmp(value->name, string))
5427 break;
5428 }
5429 if(value)
5430 {
5431 FreeExpContents(sourceExp);
5432 FreeType(sourceExp->expType);
5433 sourceExp->isConstant = 1;
5434 sourceExp->expType = MkClassType(baseClass->fullName);
5435 {
5436 char constant[256];
5437
5438 sourceExp->type = 2;
5439 if(!strcmp(baseClass->dataTypeString, "int") || !strcmp(baseClass->dataTypeString, "int64") || !strcmp(baseClass->dataTypeString, "short") || !strcmp(baseClass->dataTypeString, "char"))
5440 sprintf(constant, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), value->data);
5441 else
5442 sprintf(constant, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), value->data);
5443 sourceExp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5444 }
5445 while(converts.first)
5446 {
5447 struct Conversion * convert = converts.first;
5448
5449 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
5450 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5451 }
5452 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5453 return 1;
5454 }
5455 }
5456 }
5457 }
5458 if(converts.first)
5459 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
5460 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5461 }
5462 }
5463 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)))
5464 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5465 return 1;
5466 return 0;
5467 }
5468
5469 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5470
5471 struct __ecereNameSpace__ecere__com__SubModule
5472 {
5473 struct __ecereNameSpace__ecere__com__SubModule * prev;
5474 struct __ecereNameSpace__ecere__com__SubModule * next;
5475 struct __ecereNameSpace__ecere__com__Instance * module;
5476 int importMode;
5477 } __attribute__ ((gcc_struct));
5478
5479 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5480 {
5481 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5482
5483 if(searchFor == searchIn)
5484 return 1;
5485 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
5486 {
5487 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->application)
5488 {
5489 if(ModuleVisibility(subModule->module, searchFor))
5490 return 1;
5491 }
5492 }
5493 return 0;
5494 }
5495
5496 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5497
5498 struct __ecereNameSpace__ecere__com__Application
5499 {
5500 int argc;
5501 const char * *  argv;
5502 int exitCode;
5503 unsigned int isGUIApp;
5504 struct __ecereNameSpace__ecere__sys__OldList allModules;
5505 char *  parsedCommand;
5506 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5507 } __attribute__ ((gcc_struct));
5508
5509 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5510 {
5511 struct __ecereNameSpace__ecere__com__Instance * module;
5512
5513 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))
5514 return 1;
5515 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))
5516 return 1;
5517 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))
5518 return 1;
5519 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)
5520 {
5521 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5522 return 1;
5523 }
5524 return 0;
5525 }
5526
5527 extern struct Expression * CopyExpression(struct Expression * exp);
5528
5529 extern unsigned long strtoul(const char *  nptr, char * *  endptr, int base);
5530
5531 void ReadString(char *  output, char *  string);
5532
5533 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5534
5535 extern struct TypeName * QMkClass(const char *  spec, struct Declarator * decl);
5536
5537 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5538
5539 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla, unsigned int warnConst)
5540 {
5541 struct Type * source;
5542 struct Type * realDest = dest;
5543 struct Type * backupSourceExpType = (((void *)0));
5544 struct Expression * computedExp = sourceExp;
5545
5546 dest->refCount++;
5547 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)
5548 {
5549 computedExp = CopyExpression(sourceExp);
5550 ComputeExpression(computedExp);
5551 }
5552 source = sourceExp->expType;
5553 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->__anon1.__anon1.constant, (((void *)0)), 0))
5554 {
5555 if(computedExp != sourceExp)
5556 {
5557 FreeExpression(computedExp);
5558 computedExp = sourceExp;
5559 }
5560 FreeType(dest);
5561 return 1;
5562 }
5563 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5564 {
5565 if(source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 3)
5566 {
5567 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5568
5569 for(sourceBase = source->__anon1._class->__anon1.registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5570 ;
5571 for(destBase = dest->__anon1._class->__anon1.registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5572 ;
5573 if(sourceBase == destBase)
5574 {
5575 if(computedExp != sourceExp)
5576 {
5577 FreeExpression(computedExp);
5578 computedExp = sourceExp;
5579 }
5580 FreeType(dest);
5581 return 1;
5582 }
5583 }
5584 }
5585 if(source)
5586 {
5587 struct __ecereNameSpace__ecere__sys__OldList * specs;
5588 unsigned int flag = 0;
5589 long long value = (((int)0x7fffffff));
5590
5591 source->refCount++;
5592 if(computedExp->type == 2)
5593 {
5594 if(source->isSigned)
5595 value = strtoll(computedExp->__anon1.__anon1.constant, (((void *)0)), 0);
5596 else
5597 value = strtoull(computedExp->__anon1.__anon1.constant, (((void *)0)), 0);
5598 }
5599 else if(computedExp->type == 4 && sourceExp->__anon1.op.op == '-' && !computedExp->__anon1.op.exp1 && computedExp->__anon1.op.exp2 && computedExp->__anon1.op.exp2->type == 2)
5600 {
5601 if(source->isSigned)
5602 value = -strtoll(computedExp->__anon1.op.exp2->__anon1.__anon1.constant, (((void *)0)), 0);
5603 else
5604 value = -strtoull(computedExp->__anon1.op.exp2->__anon1.__anon1.constant, (((void *)0)), 0);
5605 }
5606 if(computedExp != sourceExp)
5607 {
5608 FreeExpression(computedExp);
5609 computedExp = sourceExp;
5610 }
5611 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"))
5612 {
5613 FreeType(source);
5614 source = __extension__ ({
5615 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5616
5617 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0, __ecereInstance1->refCount = 1, __ecereInstance1;
5618 });
5619 }
5620 if(dest->kind == 8)
5621 {
5622 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0));
5623
5624 if(_class && _class->type == 3)
5625 {
5626 if(source->kind != 8)
5627 {
5628 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5629 struct Type * tempDest, * tempSource;
5630
5631 for(; _class->base->type != 1000; _class = _class->base)
5632 ;
5633 tempSource = dest;
5634 tempDest = tempType;
5635 tempType->kind = 8;
5636 if(!_class->symbol)
5637 _class->symbol = FindClass(_class->fullName);
5638 tempType->__anon1._class = _class->symbol;
5639 tempType->truth = dest->truth;
5640 if(tempType->__anon1._class)
5641 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
5642 backupSourceExpType = sourceExp->expType;
5643 sourceExp->expType = dest;
5644 dest->refCount++;
5645 flag = 1;
5646 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5647 }
5648 }
5649 if(_class && _class->type == 2 && source->kind != 8)
5650 {
5651 if(!dest->__anon1._class->__anon1.registered->dataType)
5652 dest->__anon1._class->__anon1.registered->dataType = ProcessTypeString(dest->__anon1._class->__anon1.registered->dataTypeString, 0);
5653 if(MatchTypes(source, dest->__anon1._class->__anon1.registered->dataType, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
5654 {
5655 FreeType(source);
5656 FreeType(sourceExp->expType);
5657 source = sourceExp->expType = MkClassType(dest->__anon1._class->string);
5658 source->refCount++;
5659 }
5660 }
5661 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->__anon1.type && source->__anon1.type->kind == 1 && sourceExp->type == 3)
5662 {
5663 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5664 struct Declarator * decl;
5665 char string[1024];
5666
5667 ReadString(string, sourceExp->__anon1.__anon2.string);
5668 decl = SpecDeclFromString(string, specs, (((void *)0)));
5669 FreeExpContents(sourceExp);
5670 FreeType(sourceExp->expType);
5671 sourceExp->type = 24;
5672 sourceExp->__anon1._classExp.specifiers = specs;
5673 sourceExp->__anon1._classExp.decl = decl;
5674 sourceExp->expType = dest;
5675 dest->refCount++;
5676 FreeType(source);
5677 FreeType(dest);
5678 if(backupSourceExpType)
5679 FreeType(backupSourceExpType);
5680 return 1;
5681 }
5682 }
5683 else if(source->kind == 8)
5684 {
5685 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0));
5686
5687 if(_class && (_class->type == 3 || _class->type == 2))
5688 {
5689 if(dest->kind != 8)
5690 {
5691 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5692 struct Type * tempDest, * tempSource;
5693
5694 if(!source->__anon1._class->__anon1.registered->dataType)
5695 source->__anon1._class->__anon1.registered->dataType = ProcessTypeString(source->__anon1._class->__anon1.registered->dataTypeString, 0);
5696 for(; _class->base->type != 1000; _class = _class->base)
5697 ;
5698 tempDest = source;
5699 tempSource = tempType;
5700 tempType->kind = 8;
5701 tempType->__anon1._class = FindClass(_class->fullName);
5702 tempType->truth = source->truth;
5703 tempType->classObjectType = source->classObjectType;
5704 if(tempType->__anon1._class)
5705 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
5706 if(conversions->last)
5707 {
5708 ((struct Conversion *)conversions->last)->resultType = dest;
5709 dest->refCount++;
5710 }
5711 FreeType(sourceExp->expType);
5712 sourceExp->expType = MkClassType(_class->fullName);
5713 sourceExp->expType->truth = source->truth;
5714 sourceExp->expType->classObjectType = source->classObjectType;
5715 if(!sourceExp->destType)
5716 {
5717 FreeType(sourceExp->destType);
5718 sourceExp->destType = sourceExp->expType;
5719 if(sourceExp->expType)
5720 sourceExp->expType->refCount++;
5721 }
5722 if(!_class->dataType)
5723 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
5724 FreeType(dest);
5725 dest = MkClassType(source->__anon1._class->string);
5726 dest->truth = source->truth;
5727 dest->classObjectType = source->classObjectType;
5728 FreeType(source);
5729 source = _class->dataType;
5730 source->refCount++;
5731 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5732 }
5733 }
5734 }
5735 if(!flag)
5736 {
5737 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
5738 {
5739 FreeType(source);
5740 FreeType(dest);
5741 return 1;
5742 }
5743 }
5744 if(dest->kind == 8)
5745 {
5746 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0));
5747 unsigned int fittingValue = 0;
5748
5749 if(_class && _class->type == 4)
5750 {
5751 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5752 struct __ecereNameSpace__ecere__com__EnumClassData * c = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5753
5754 if(c && value >= 0 && value <= c->largest)
5755 fittingValue = 1;
5756 }
5757 if(_class && !dest->truth && (_class->type == 3 || fittingValue || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5758 {
5759 if(_class->type == 0 || _class->type == 5)
5760 {
5761 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5762
5763 *newExp = *sourceExp;
5764 if(sourceExp->destType)
5765 sourceExp->destType->refCount++;
5766 if(sourceExp->expType)
5767 sourceExp->expType->refCount++;
5768 sourceExp->type = 11;
5769 sourceExp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5770 sourceExp->__anon1.cast.exp = newExp;
5771 FreeType(sourceExp->expType);
5772 sourceExp->expType = (((void *)0));
5773 ProcessExpressionType(sourceExp);
5774 if(!inCompiler)
5775 {
5776 FreeType(sourceExp->expType);
5777 sourceExp->expType = dest;
5778 }
5779 FreeType(source);
5780 if(inCompiler)
5781 FreeType(dest);
5782 if(backupSourceExpType)
5783 FreeType(backupSourceExpType);
5784 return 1;
5785 }
5786 if(!_class->dataType)
5787 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
5788 FreeType(dest);
5789 dest = _class->dataType;
5790 dest->refCount++;
5791 }
5792 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))
5793 {
5794 specs = MkListOne(MkSpecifier(DOUBLE));
5795 }
5796 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))
5797 {
5798 specs = MkListOne(MkSpecifier(FLOAT));
5799 }
5800 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))
5801 {
5802 specs = MkList();
5803 if(!dest->isSigned)
5804 ListAdd(specs, MkSpecifier(UNSIGNED));
5805 ListAdd(specs, MkSpecifier(INT64));
5806 }
5807 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
5808 {
5809 specs = MkList();
5810 if(!dest->isSigned)
5811 ListAdd(specs, MkSpecifier(UNSIGNED));
5812 ListAdd(specs, MkSpecifier(INT));
5813 }
5814 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5815 {
5816 specs = MkList();
5817 if(!dest->isSigned)
5818 ListAdd(specs, MkSpecifier(UNSIGNED));
5819 ListAdd(specs, MkSpecifier(SHORT));
5820 }
5821 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 24 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5822 {
5823 specs = MkList();
5824 if(!dest->isSigned)
5825 ListAdd(specs, MkSpecifier(UNSIGNED));
5826 ListAdd(specs, MkSpecifier(CHAR));
5827 }
5828 else
5829 {
5830 FreeType(source);
5831 FreeType(dest);
5832 if(backupSourceExpType)
5833 {
5834 if(sourceExp->expType)
5835 FreeType(sourceExp->expType);
5836 sourceExp->expType = backupSourceExpType;
5837 }
5838 return 0;
5839 }
5840 }
5841 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))
5842 {
5843 specs = MkListOne(MkSpecifier(DOUBLE));
5844 }
5845 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))
5846 {
5847 specs = MkListOne(MkSpecifier(FLOAT));
5848 }
5849 else if(dest->kind == 24 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (value == 1 || value == 0))
5850 {
5851 specs = MkList();
5852 ListAdd(specs, MkSpecifier(BOOL));
5853 }
5854 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)))
5855 {
5856 specs = MkList();
5857 if(!dest->isSigned)
5858 ListAdd(specs, MkSpecifier(UNSIGNED));
5859 ListAdd(specs, MkSpecifier(CHAR));
5860 }
5861 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)))))
5862 {
5863 specs = MkList();
5864 if(!dest->isSigned)
5865 ListAdd(specs, MkSpecifier(UNSIGNED));
5866 ListAdd(specs, MkSpecifier(SHORT));
5867 }
5868 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3))
5869 {
5870 specs = MkList();
5871 if(!dest->isSigned)
5872 ListAdd(specs, MkSpecifier(UNSIGNED));
5873 ListAdd(specs, MkSpecifier(INT));
5874 }
5875 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5876 {
5877 specs = MkList();
5878 if(!dest->isSigned)
5879 ListAdd(specs, MkSpecifier(UNSIGNED));
5880 ListAdd(specs, MkSpecifier(INT64));
5881 }
5882 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
5883 {
5884 specs = MkListOne(MkEnum(MkIdentifier(dest->__anon1.__anon1.enumName), (((void *)0))));
5885 }
5886 else
5887 {
5888 FreeType(source);
5889 FreeType(dest);
5890 if(backupSourceExpType)
5891 {
5892 if(sourceExp->expType)
5893 FreeType(sourceExp->expType);
5894 sourceExp->expType = backupSourceExpType;
5895 }
5896 return 0;
5897 }
5898 if(!flag && !sourceExp->opDestType)
5899 {
5900 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5901
5902 *newExp = *sourceExp;
5903 newExp->prev = (((void *)0));
5904 newExp->next = (((void *)0));
5905 if(sourceExp->destType)
5906 sourceExp->destType->refCount++;
5907 if(sourceExp->expType)
5908 sourceExp->expType->refCount++;
5909 sourceExp->type = 11;
5910 if(realDest->kind == 8)
5911 {
5912 sourceExp->__anon1.cast.typeName = QMkClass(realDest->__anon1._class->string, (((void *)0)));
5913 FreeList(specs, FreeSpecifier);
5914 }
5915 else
5916 sourceExp->__anon1.cast.typeName = MkTypeName(specs, (((void *)0)));
5917 if(newExp->type == 4)
5918 {
5919 sourceExp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
5920 }
5921 else
5922 sourceExp->__anon1.cast.exp = newExp;
5923 FreeType(sourceExp->expType);
5924 sourceExp->expType = (((void *)0));
5925 ProcessExpressionType(sourceExp);
5926 }
5927 else
5928 FreeList(specs, FreeSpecifier);
5929 FreeType(dest);
5930 FreeType(source);
5931 if(backupSourceExpType)
5932 FreeType(backupSourceExpType);
5933 return 1;
5934 }
5935 else
5936 {
5937 if(computedExp != sourceExp)
5938 {
5939 FreeExpression(computedExp);
5940 computedExp = sourceExp;
5941 }
5942 while((sourceExp->type == 5 || sourceExp->type == 32) && sourceExp->__anon1.list)
5943 sourceExp = (*sourceExp->__anon1.list).last;
5944 if(sourceExp->type == 0)
5945 {
5946 struct Identifier * id = sourceExp->__anon1.__anon1.identifier;
5947
5948 if(dest->kind == 8)
5949 {
5950 if(dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
5951 {
5952 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class->__anon1.registered;
5953 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5954
5955 if(enumClass)
5956 {
5957 for(; _class && _class->type == 4; _class = _class->base)
5958 {
5959 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
5960 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5961
5962 for(value = e->values.first; value; value = value->next)
5963 {
5964 if(!strcmp(value->name, id->string))
5965 break;
5966 }
5967 if(value)
5968 {
5969 FreeExpContents(sourceExp);
5970 FreeType(sourceExp->expType);
5971 sourceExp->isConstant = 1;
5972 sourceExp->expType = MkClassType(_class->fullName);
5973 {
5974 sourceExp->type = 2;
5975 if(_class->dataTypeString && (!strcmp(_class->dataTypeString, "int") || !strcmp(_class->dataTypeString, "int64") || !strcmp(_class->dataTypeString, "short") || !strcmp(_class->dataTypeString, "char")))
5976 sourceExp->__anon1.__anon1.constant = PrintInt64(value->data);
5977 else
5978 sourceExp->__anon1.__anon1.constant = PrintUInt64(value->data);
5979 }
5980 FreeType(dest);
5981 return 1;
5982 }
5983 }
5984 }
5985 }
5986 }
5987 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5988 {
5989 FreeType(dest);
5990 return 1;
5991 }
5992 }
5993 FreeType(dest);
5994 }
5995 return 0;
5996 }
5997
5998 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5999 {
6000 int value2 = op2->__anon1.i;
6001
6002 exp->type = 2;
6003 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i + value2));
6004 if(!exp->expType)
6005 {
6006 exp->expType = op1->type;
6007 if(op1->type)
6008 op1->type->refCount++;
6009 }
6010 return 1;
6011 }
6012
6013 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6014 {
6015 unsigned int value2 = op2->__anon1.ui;
6016
6017 exp->type = 2;
6018 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui + value2));
6019 if(!exp->expType)
6020 {
6021 exp->expType = op1->type;
6022 if(op1->type)
6023 op1->type->refCount++;
6024 }
6025 return 1;
6026 }
6027
6028 static unsigned int Int64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6029 {
6030 long long value2 = op2->__anon1.i64;
6031
6032 exp->type = 2;
6033 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 + value2));
6034 if(!exp->expType)
6035 {
6036 exp->expType = op1->type;
6037 if(op1->type)
6038 op1->type->refCount++;
6039 }
6040 return 1;
6041 }
6042
6043 static unsigned int UInt64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6044 {
6045 uint64 value2 = op2->__anon1.ui64;
6046
6047 exp->type = 2;
6048 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 + value2));
6049 if(!exp->expType)
6050 {
6051 exp->expType = op1->type;
6052 if(op1->type)
6053 op1->type->refCount++;
6054 }
6055 return 1;
6056 }
6057
6058 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6059 {
6060 short value2 = op2->__anon1.s;
6061
6062 exp->type = 2;
6063 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s + 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 UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6074 {
6075 unsigned short value2 = op2->__anon1.us;
6076
6077 exp->type = 2;
6078 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us + 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 CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6089 {
6090 char value2 = op2->__anon1.c;
6091
6092 exp->type = 2;
6093 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c + 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 UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6104 {
6105 unsigned char value2 = op2->__anon1.uc;
6106
6107 exp->type = 2;
6108 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc + 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 FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6119 {
6120 float value2 = op2->__anon1.f;
6121
6122 exp->type = 2;
6123 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f + 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 DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6134 {
6135 double value2 = op2->__anon1.d;
6136
6137 exp->type = 2;
6138 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d + 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 IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6149 {
6150 int value2 = op2->__anon1.i;
6151
6152 exp->type = 2;
6153 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i - 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 UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6164 {
6165 unsigned int value2 = op2->__anon1.ui;
6166
6167 exp->type = 2;
6168 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui - 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 Int64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6179 {
6180 long long value2 = op2->__anon1.i64;
6181
6182 exp->type = 2;
6183 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 - 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 UInt64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6194 {
6195 uint64 value2 = op2->__anon1.ui64;
6196
6197 exp->type = 2;
6198 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 - 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 ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6209 {
6210 short value2 = op2->__anon1.s;
6211
6212 exp->type = 2;
6213 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s - 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 UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6224 {
6225 unsigned short value2 = op2->__anon1.us;
6226
6227 exp->type = 2;
6228 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us - 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 CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6239 {
6240 char value2 = op2->__anon1.c;
6241
6242 exp->type = 2;
6243 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c - 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 UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6254 {
6255 unsigned char value2 = op2->__anon1.uc;
6256
6257 exp->type = 2;
6258 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc - 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 FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6269 {
6270 float value2 = op2->__anon1.f;
6271
6272 exp->type = 2;
6273 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f - 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 DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6284 {
6285 double value2 = op2->__anon1.d;
6286
6287 exp->type = 2;
6288 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d - 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 IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6299 {
6300 int value2 = op2->__anon1.i;
6301
6302 exp->type = 2;
6303 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i * 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 UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6314 {
6315 unsigned int value2 = op2->__anon1.ui;
6316
6317 exp->type = 2;
6318 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui * 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 Int64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6329 {
6330 long long value2 = op2->__anon1.i64;
6331
6332 exp->type = 2;
6333 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 * 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 UInt64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6344 {
6345 uint64 value2 = op2->__anon1.ui64;
6346
6347 exp->type = 2;
6348 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 * 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 ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6359 {
6360 short value2 = op2->__anon1.s;
6361
6362 exp->type = 2;
6363 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s * 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 UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6374 {
6375 unsigned short value2 = op2->__anon1.us;
6376
6377 exp->type = 2;
6378 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us * 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 CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6389 {
6390 char value2 = op2->__anon1.c;
6391
6392 exp->type = 2;
6393 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c * 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 UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6404 {
6405 unsigned char value2 = op2->__anon1.uc;
6406
6407 exp->type = 2;
6408 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc * 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 FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6419 {
6420 float value2 = op2->__anon1.f;
6421
6422 exp->type = 2;
6423 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f * 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 DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6434 {
6435 double value2 = op2->__anon1.d;
6436
6437 exp->type = 2;
6438 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d * 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 IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6449 {
6450 int value2 = op2->__anon1.i;
6451
6452 exp->type = 2;
6453 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i / value2) : 0);
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 UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6464 {
6465 unsigned int value2 = op2->__anon1.ui;
6466
6467 exp->type = 2;
6468 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui / value2) : 0);
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 Int64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6479 {
6480 long long value2 = op2->__anon1.i64;
6481
6482 exp->type = 2;
6483 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 / value2) : 0);
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 UInt64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6494 {
6495 uint64 value2 = op2->__anon1.ui64;
6496
6497 exp->type = 2;
6498 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 / value2) : 0);
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 ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6509 {
6510 short value2 = op2->__anon1.s;
6511
6512 exp->type = 2;
6513 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s / value2) : (short)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 UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6524 {
6525 unsigned short value2 = op2->__anon1.us;
6526
6527 exp->type = 2;
6528 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us / value2) : (unsigned short)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 CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6539 {
6540 char value2 = op2->__anon1.c;
6541
6542 exp->type = 2;
6543 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c / value2) : (char)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 UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6554 {
6555 unsigned char value2 = op2->__anon1.uc;
6556
6557 exp->type = 2;
6558 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc / value2) : (unsigned char)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 FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6569 {
6570 float value2 = op2->__anon1.f;
6571
6572 exp->type = 2;
6573 exp->__anon1.__anon2.string = PrintFloat(op1->__anon1.f / value2);
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 DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6584 {
6585 double value2 = op2->__anon1.d;
6586
6587 exp->type = 2;
6588 exp->__anon1.__anon2.string = PrintDouble(op1->__anon1.d / value2);
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 IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6599 {
6600 int value2 = op2->__anon1.i;
6601
6602 exp->type = 2;
6603 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i % value2) : 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 UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6614 {
6615 unsigned int value2 = op2->__anon1.ui;
6616
6617 exp->type = 2;
6618 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui % value2) : 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 Int64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6629 {
6630 long long value2 = op2->__anon1.i64;
6631
6632 exp->type = 2;
6633 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 % value2) : 0);
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 UInt64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6644 {
6645 uint64 value2 = op2->__anon1.ui64;
6646
6647 exp->type = 2;
6648 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 % value2) : 0);
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 ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6659 {
6660 short value2 = op2->__anon1.s;
6661
6662 exp->type = 2;
6663 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s % value2) : (short)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 UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6674 {
6675 unsigned short value2 = op2->__anon1.us;
6676
6677 exp->type = 2;
6678 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us % value2) : (unsigned short)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 CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6689 {
6690 char value2 = op2->__anon1.c;
6691
6692 exp->type = 2;
6693 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c % value2) : (char)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 UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6704 {
6705 unsigned char value2 = op2->__anon1.uc;
6706
6707 exp->type = 2;
6708 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc % value2) : (unsigned char)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 IntNeg(struct Expression * exp, struct Operand * op1)
6719 {
6720 exp->type = 2;
6721 exp->__anon1.__anon2.string = PrintInt((-op1->__anon1.i));
6722 if(!exp->expType)
6723 {
6724 exp->expType = op1->type;
6725 if(op1->type)
6726 op1->type->refCount++;
6727 }
6728 return 1;
6729 }
6730
6731 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6732 {
6733 exp->type = 2;
6734 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(-op1->__anon1.ui));
6735 if(!exp->expType)
6736 {
6737 exp->expType = op1->type;
6738 if(op1->type)
6739 op1->type->refCount++;
6740 }
6741 return 1;
6742 }
6743
6744 static unsigned int Int64Neg(struct Expression * exp, struct Operand * op1)
6745 {
6746 exp->type = 2;
6747 exp->__anon1.__anon2.string = PrintInt64((-op1->__anon1.i64));
6748 if(!exp->expType)
6749 {
6750 exp->expType = op1->type;
6751 if(op1->type)
6752 op1->type->refCount++;
6753 }
6754 return 1;
6755 }
6756
6757 static unsigned int UInt64Neg(struct Expression * exp, struct Operand * op1)
6758 {
6759 exp->type = 2;
6760 exp->__anon1.__anon2.string = PrintUInt64((uint64)(-op1->__anon1.ui64));
6761 if(!exp->expType)
6762 {
6763 exp->expType = op1->type;
6764 if(op1->type)
6765 op1->type->refCount++;
6766 }
6767 return 1;
6768 }
6769
6770 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6771 {
6772 exp->type = 2;
6773 exp->__anon1.__anon2.string = PrintShort((-op1->__anon1.s));
6774 if(!exp->expType)
6775 {
6776 exp->expType = op1->type;
6777 if(op1->type)
6778 op1->type->refCount++;
6779 }
6780 return 1;
6781 }
6782
6783 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6784 {
6785 exp->type = 2;
6786 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(-op1->__anon1.us));
6787 if(!exp->expType)
6788 {
6789 exp->expType = op1->type;
6790 if(op1->type)
6791 op1->type->refCount++;
6792 }
6793 return 1;
6794 }
6795
6796 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6797 {
6798 exp->type = 2;
6799 exp->__anon1.__anon2.string = PrintChar((-op1->__anon1.c));
6800 if(!exp->expType)
6801 {
6802 exp->expType = op1->type;
6803 if(op1->type)
6804 op1->type->refCount++;
6805 }
6806 return 1;
6807 }
6808
6809 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6810 {
6811 exp->type = 2;
6812 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(-op1->__anon1.uc));
6813 if(!exp->expType)
6814 {
6815 exp->expType = op1->type;
6816 if(op1->type)
6817 op1->type->refCount++;
6818 }
6819 return 1;
6820 }
6821
6822 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6823 {
6824 exp->type = 2;
6825 exp->__anon1.__anon2.string = PrintFloat((float)(-op1->__anon1.f));
6826 if(!exp->expType)
6827 {
6828 exp->expType = op1->type;
6829 if(op1->type)
6830 op1->type->refCount++;
6831 }
6832 return 1;
6833 }
6834
6835 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6836 {
6837 exp->type = 2;
6838 exp->__anon1.__anon2.string = PrintDouble((double)(-op1->__anon1.d));
6839 if(!exp->expType)
6840 {
6841 exp->expType = op1->type;
6842 if(op1->type)
6843 op1->type->refCount++;
6844 }
6845 return 1;
6846 }
6847
6848 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6849 {
6850 exp->type = 2;
6851 exp->__anon1.__anon2.string = PrintInt((++op1->__anon1.i));
6852 if(!exp->expType)
6853 {
6854 exp->expType = op1->type;
6855 if(op1->type)
6856 op1->type->refCount++;
6857 }
6858 return 1;
6859 }
6860
6861 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6862 {
6863 exp->type = 2;
6864 exp->__anon1.__anon2.string = PrintUInt((++op1->__anon1.ui));
6865 if(!exp->expType)
6866 {
6867 exp->expType = op1->type;
6868 if(op1->type)
6869 op1->type->refCount++;
6870 }
6871 return 1;
6872 }
6873
6874 static unsigned int Int64Inc(struct Expression * exp, struct Operand * op1)
6875 {
6876 exp->type = 2;
6877 exp->__anon1.__anon2.string = PrintInt64((++op1->__anon1.i64));
6878 if(!exp->expType)
6879 {
6880 exp->expType = op1->type;
6881 if(op1->type)
6882 op1->type->refCount++;
6883 }
6884 return 1;
6885 }
6886
6887 static unsigned int UInt64Inc(struct Expression * exp, struct Operand * op1)
6888 {
6889 exp->type = 2;
6890 exp->__anon1.__anon2.string = PrintUInt64((++op1->__anon1.ui64));
6891 if(!exp->expType)
6892 {
6893 exp->expType = op1->type;
6894 if(op1->type)
6895 op1->type->refCount++;
6896 }
6897 return 1;
6898 }
6899
6900 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6901 {
6902 exp->type = 2;
6903 exp->__anon1.__anon2.string = PrintShort((++op1->__anon1.s));
6904 if(!exp->expType)
6905 {
6906 exp->expType = op1->type;
6907 if(op1->type)
6908 op1->type->refCount++;
6909 }
6910 return 1;
6911 }
6912
6913 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6914 {
6915 exp->type = 2;
6916 exp->__anon1.__anon2.string = PrintUShort((++op1->__anon1.us));
6917 if(!exp->expType)
6918 {
6919 exp->expType = op1->type;
6920 if(op1->type)
6921 op1->type->refCount++;
6922 }
6923 return 1;
6924 }
6925
6926 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6927 {
6928 exp->type = 2;
6929 exp->__anon1.__anon2.string = PrintChar((++op1->__anon1.c));
6930 if(!exp->expType)
6931 {
6932 exp->expType = op1->type;
6933 if(op1->type)
6934 op1->type->refCount++;
6935 }
6936 return 1;
6937 }
6938
6939 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6940 {
6941 exp->type = 2;
6942 exp->__anon1.__anon2.string = PrintUChar((++op1->__anon1.uc));
6943 if(!exp->expType)
6944 {
6945 exp->expType = op1->type;
6946 if(op1->type)
6947 op1->type->refCount++;
6948 }
6949 return 1;
6950 }
6951
6952 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6953 {
6954 exp->type = 2;
6955 exp->__anon1.__anon2.string = PrintFloat((float)(++op1->__anon1.f));
6956 if(!exp->expType)
6957 {
6958 exp->expType = op1->type;
6959 if(op1->type)
6960 op1->type->refCount++;
6961 }
6962 return 1;
6963 }
6964
6965 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6966 {
6967 exp->type = 2;
6968 exp->__anon1.__anon2.string = PrintDouble((double)(++op1->__anon1.d));
6969 if(!exp->expType)
6970 {
6971 exp->expType = op1->type;
6972 if(op1->type)
6973 op1->type->refCount++;
6974 }
6975 return 1;
6976 }
6977
6978 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6979 {
6980 exp->type = 2;
6981 exp->__anon1.__anon2.string = PrintInt((--op1->__anon1.i));
6982 if(!exp->expType)
6983 {
6984 exp->expType = op1->type;
6985 if(op1->type)
6986 op1->type->refCount++;
6987 }
6988 return 1;
6989 }
6990
6991 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6992 {
6993 exp->type = 2;
6994 exp->__anon1.__anon2.string = PrintUInt((--op1->__anon1.ui));
6995 if(!exp->expType)
6996 {
6997 exp->expType = op1->type;
6998 if(op1->type)
6999 op1->type->refCount++;
7000 }
7001 return 1;
7002 }
7003
7004 static unsigned int Int64Dec(struct Expression * exp, struct Operand * op1)
7005 {
7006 exp->type = 2;
7007 exp->__anon1.__anon2.string = PrintInt64((--op1->__anon1.i64));
7008 if(!exp->expType)
7009 {
7010 exp->expType = op1->type;
7011 if(op1->type)
7012 op1->type->refCount++;
7013 }
7014 return 1;
7015 }
7016
7017 static unsigned int UInt64Dec(struct Expression * exp, struct Operand * op1)
7018 {
7019 exp->type = 2;
7020 exp->__anon1.__anon2.string = PrintUInt64((--op1->__anon1.ui64));
7021 if(!exp->expType)
7022 {
7023 exp->expType = op1->type;
7024 if(op1->type)
7025 op1->type->refCount++;
7026 }
7027 return 1;
7028 }
7029
7030 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
7031 {
7032 exp->type = 2;
7033 exp->__anon1.__anon2.string = PrintShort((--op1->__anon1.s));
7034 if(!exp->expType)
7035 {
7036 exp->expType = op1->type;
7037 if(op1->type)
7038 op1->type->refCount++;
7039 }
7040 return 1;
7041 }
7042
7043 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
7044 {
7045 exp->type = 2;
7046 exp->__anon1.__anon2.string = PrintUShort((--op1->__anon1.us));
7047 if(!exp->expType)
7048 {
7049 exp->expType = op1->type;
7050 if(op1->type)
7051 op1->type->refCount++;
7052 }
7053 return 1;
7054 }
7055
7056 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
7057 {
7058 exp->type = 2;
7059 exp->__anon1.__anon2.string = PrintChar((--op1->__anon1.c));
7060 if(!exp->expType)
7061 {
7062 exp->expType = op1->type;
7063 if(op1->type)
7064 op1->type->refCount++;
7065 }
7066 return 1;
7067 }
7068
7069 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
7070 {
7071 exp->type = 2;
7072 exp->__anon1.__anon2.string = PrintUChar((--op1->__anon1.uc));
7073 if(!exp->expType)
7074 {
7075 exp->expType = op1->type;
7076 if(op1->type)
7077 op1->type->refCount++;
7078 }
7079 return 1;
7080 }
7081
7082 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
7083 {
7084 exp->type = 2;
7085 exp->__anon1.__anon2.string = PrintFloat((float)(--op1->__anon1.f));
7086 if(!exp->expType)
7087 {
7088 exp->expType = op1->type;
7089 if(op1->type)
7090 op1->type->refCount++;
7091 }
7092 return 1;
7093 }
7094
7095 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
7096 {
7097 exp->type = 2;
7098 exp->__anon1.__anon2.string = PrintDouble((double)(--op1->__anon1.d));
7099 if(!exp->expType)
7100 {
7101 exp->expType = op1->type;
7102 if(op1->type)
7103 op1->type->refCount++;
7104 }
7105 return 1;
7106 }
7107
7108 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7109 {
7110 int value2 = op2->__anon1.i;
7111
7112 exp->type = 2;
7113 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i = value2));
7114 if(!exp->expType)
7115 {
7116 exp->expType = op1->type;
7117 if(op1->type)
7118 op1->type->refCount++;
7119 }
7120 return 1;
7121 }
7122
7123 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7124 {
7125 unsigned int value2 = op2->__anon1.ui;
7126
7127 exp->type = 2;
7128 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui = value2));
7129 if(!exp->expType)
7130 {
7131 exp->expType = op1->type;
7132 if(op1->type)
7133 op1->type->refCount++;
7134 }
7135 return 1;
7136 }
7137
7138 static unsigned int Int64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7139 {
7140 long long value2 = op2->__anon1.i64;
7141
7142 exp->type = 2;
7143 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 = value2));
7144 if(!exp->expType)
7145 {
7146 exp->expType = op1->type;
7147 if(op1->type)
7148 op1->type->refCount++;
7149 }
7150 return 1;
7151 }
7152
7153 static unsigned int UInt64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7154 {
7155 uint64 value2 = op2->__anon1.ui64;
7156
7157 exp->type = 2;
7158 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 = value2));
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 ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7169 {
7170 short value2 = op2->__anon1.s;
7171
7172 exp->type = 2;
7173 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s = 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 UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7184 {
7185 unsigned short value2 = op2->__anon1.us;
7186
7187 exp->type = 2;
7188 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us = 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 CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7199 {
7200 char value2 = op2->__anon1.c;
7201
7202 exp->type = 2;
7203 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c = 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 UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7214 {
7215 unsigned char value2 = op2->__anon1.uc;
7216
7217 exp->type = 2;
7218 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc = 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 FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7229 {
7230 float value2 = op2->__anon1.f;
7231
7232 exp->type = 2;
7233 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f = 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 DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7244 {
7245 double value2 = op2->__anon1.d;
7246
7247 exp->type = 2;
7248 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d = 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 IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7259 {
7260 int value2 = op2->__anon1.i;
7261
7262 exp->type = 2;
7263 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i += 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 UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7274 {
7275 unsigned int value2 = op2->__anon1.ui;
7276
7277 exp->type = 2;
7278 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui += 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 Int64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7289 {
7290 long long value2 = op2->__anon1.i64;
7291
7292 exp->type = 2;
7293 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 += 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 UInt64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7304 {
7305 uint64 value2 = op2->__anon1.ui64;
7306
7307 exp->type = 2;
7308 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 += 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 ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7319 {
7320 short value2 = op2->__anon1.s;
7321
7322 exp->type = 2;
7323 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s += 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 UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7334 {
7335 unsigned short value2 = op2->__anon1.us;
7336
7337 exp->type = 2;
7338 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us += 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 CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7349 {
7350 char value2 = op2->__anon1.c;
7351
7352 exp->type = 2;
7353 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c += 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 UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7364 {
7365 unsigned char value2 = op2->__anon1.uc;
7366
7367 exp->type = 2;
7368 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc += 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 FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7379 {
7380 float value2 = op2->__anon1.f;
7381
7382 exp->type = 2;
7383 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f += 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 DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7394 {
7395 double value2 = op2->__anon1.d;
7396
7397 exp->type = 2;
7398 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d += 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 IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7409 {
7410 int value2 = op2->__anon1.i;
7411
7412 exp->type = 2;
7413 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i -= 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 UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7424 {
7425 unsigned int value2 = op2->__anon1.ui;
7426
7427 exp->type = 2;
7428 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui -= 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 Int64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7439 {
7440 long long value2 = op2->__anon1.i64;
7441
7442 exp->type = 2;
7443 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 -= 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 UInt64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7454 {
7455 uint64 value2 = op2->__anon1.ui64;
7456
7457 exp->type = 2;
7458 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 -= 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 ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7469 {
7470 short value2 = op2->__anon1.s;
7471
7472 exp->type = 2;
7473 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s -= 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 UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7484 {
7485 unsigned short value2 = op2->__anon1.us;
7486
7487 exp->type = 2;
7488 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us -= 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 CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7499 {
7500 char value2 = op2->__anon1.c;
7501
7502 exp->type = 2;
7503 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c -= 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 UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7514 {
7515 unsigned char value2 = op2->__anon1.uc;
7516
7517 exp->type = 2;
7518 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc -= 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 FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7529 {
7530 float value2 = op2->__anon1.f;
7531
7532 exp->type = 2;
7533 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f -= 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 DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7544 {
7545 double value2 = op2->__anon1.d;
7546
7547 exp->type = 2;
7548 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d -= 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 IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7559 {
7560 int value2 = op2->__anon1.i;
7561
7562 exp->type = 2;
7563 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i *= 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 UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7574 {
7575 unsigned int value2 = op2->__anon1.ui;
7576
7577 exp->type = 2;
7578 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui *= 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 Int64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7589 {
7590 long long value2 = op2->__anon1.i64;
7591
7592 exp->type = 2;
7593 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 *= 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 UInt64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7604 {
7605 uint64 value2 = op2->__anon1.ui64;
7606
7607 exp->type = 2;
7608 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 *= 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 ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7619 {
7620 short value2 = op2->__anon1.s;
7621
7622 exp->type = 2;
7623 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s *= 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 UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7634 {
7635 unsigned short value2 = op2->__anon1.us;
7636
7637 exp->type = 2;
7638 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us *= 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 CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7649 {
7650 char value2 = op2->__anon1.c;
7651
7652 exp->type = 2;
7653 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c *= 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 UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7664 {
7665 unsigned char value2 = op2->__anon1.uc;
7666
7667 exp->type = 2;
7668 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc *= 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 FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7679 {
7680 float value2 = op2->__anon1.f;
7681
7682 exp->type = 2;
7683 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f *= 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 DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7694 {
7695 double value2 = op2->__anon1.d;
7696
7697 exp->type = 2;
7698 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d *= 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 IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7709 {
7710 int value2 = op2->__anon1.i;
7711
7712 exp->type = 2;
7713 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i /= value2) : 0);
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 UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7724 {
7725 unsigned int value2 = op2->__anon1.ui;
7726
7727 exp->type = 2;
7728 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui /= value2) : 0);
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 Int64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7739 {
7740 long long value2 = op2->__anon1.i64;
7741
7742 exp->type = 2;
7743 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 /= value2) : 0);
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 UInt64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7754 {
7755 uint64 value2 = op2->__anon1.ui64;
7756
7757 exp->type = 2;
7758 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 /= value2) : 0);
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 ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7769 {
7770 short value2 = op2->__anon1.s;
7771
7772 exp->type = 2;
7773 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s /= value2) : (short)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 UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7784 {
7785 unsigned short value2 = op2->__anon1.us;
7786
7787 exp->type = 2;
7788 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us /= value2) : (unsigned short)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 CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7799 {
7800 char value2 = op2->__anon1.c;
7801
7802 exp->type = 2;
7803 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c /= value2) : (char)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 UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7814 {
7815 unsigned char value2 = op2->__anon1.uc;
7816
7817 exp->type = 2;
7818 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc /= value2) : (unsigned char)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 FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7829 {
7830 float value2 = op2->__anon1.f;
7831
7832 exp->type = 2;
7833 exp->__anon1.__anon2.string = PrintFloat(op1->__anon1.f /= value2);
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 DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7844 {
7845 double value2 = op2->__anon1.d;
7846
7847 exp->type = 2;
7848 exp->__anon1.__anon2.string = PrintDouble(op1->__anon1.d /= value2);
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 IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7859 {
7860 int value2 = op2->__anon1.i;
7861
7862 exp->type = 2;
7863 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i %= value2) : 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 UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7874 {
7875 unsigned int value2 = op2->__anon1.ui;
7876
7877 exp->type = 2;
7878 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui %= value2) : 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 Int64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7889 {
7890 long long value2 = op2->__anon1.i64;
7891
7892 exp->type = 2;
7893 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 %= value2) : 0);
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 UInt64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7904 {
7905 uint64 value2 = op2->__anon1.ui64;
7906
7907 exp->type = 2;
7908 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 %= value2) : 0);
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 ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7919 {
7920 short value2 = op2->__anon1.s;
7921
7922 exp->type = 2;
7923 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s %= value2) : (short)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 UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7934 {
7935 unsigned short value2 = op2->__anon1.us;
7936
7937 exp->type = 2;
7938 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us %= value2) : (unsigned short)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 CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7949 {
7950 char value2 = op2->__anon1.c;
7951
7952 exp->type = 2;
7953 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c %= value2) : (char)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 UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7964 {
7965 unsigned char value2 = op2->__anon1.uc;
7966
7967 exp->type = 2;
7968 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc %= value2) : (unsigned char)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 IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7979 {
7980 int value2 = op2->__anon1.i;
7981
7982 exp->type = 2;
7983 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i & value2));
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 UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7994 {
7995 unsigned int value2 = op2->__anon1.ui;
7996
7997 exp->type = 2;
7998 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui & value2));
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 Int64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8009 {
8010 long long value2 = op2->__anon1.i64;
8011
8012 exp->type = 2;
8013 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 & value2));
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 UInt64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8024 {
8025 uint64 value2 = op2->__anon1.ui64;
8026
8027 exp->type = 2;
8028 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 & value2));
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 ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8039 {
8040 short value2 = op2->__anon1.s;
8041
8042 exp->type = 2;
8043 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s & 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 UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8054 {
8055 unsigned short value2 = op2->__anon1.us;
8056
8057 exp->type = 2;
8058 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us & 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 CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8069 {
8070 char value2 = op2->__anon1.c;
8071
8072 exp->type = 2;
8073 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c & 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 UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8084 {
8085 unsigned char value2 = op2->__anon1.uc;
8086
8087 exp->type = 2;
8088 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc & 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 IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8099 {
8100 int value2 = op2->__anon1.i;
8101
8102 exp->type = 2;
8103 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i | 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 UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8114 {
8115 unsigned int value2 = op2->__anon1.ui;
8116
8117 exp->type = 2;
8118 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui | 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 Int64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8129 {
8130 long long value2 = op2->__anon1.i64;
8131
8132 exp->type = 2;
8133 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 | 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 UInt64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8144 {
8145 uint64 value2 = op2->__anon1.ui64;
8146
8147 exp->type = 2;
8148 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 | 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 ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8159 {
8160 short value2 = op2->__anon1.s;
8161
8162 exp->type = 2;
8163 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s | 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 UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8174 {
8175 unsigned short value2 = op2->__anon1.us;
8176
8177 exp->type = 2;
8178 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us | 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 CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8189 {
8190 char value2 = op2->__anon1.c;
8191
8192 exp->type = 2;
8193 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c | 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 UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8204 {
8205 unsigned char value2 = op2->__anon1.uc;
8206
8207 exp->type = 2;
8208 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc | 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 IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8219 {
8220 int value2 = op2->__anon1.i;
8221
8222 exp->type = 2;
8223 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i ^ 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 UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8234 {
8235 unsigned int value2 = op2->__anon1.ui;
8236
8237 exp->type = 2;
8238 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui ^ 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 Int64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8249 {
8250 long long value2 = op2->__anon1.i64;
8251
8252 exp->type = 2;
8253 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 ^ 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 UInt64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8264 {
8265 uint64 value2 = op2->__anon1.ui64;
8266
8267 exp->type = 2;
8268 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 ^ 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 ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8279 {
8280 short value2 = op2->__anon1.s;
8281
8282 exp->type = 2;
8283 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s ^ 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 UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8294 {
8295 unsigned short value2 = op2->__anon1.us;
8296
8297 exp->type = 2;
8298 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us ^ 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 CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8309 {
8310 char value2 = op2->__anon1.c;
8311
8312 exp->type = 2;
8313 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c ^ 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 UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8324 {
8325 unsigned char value2 = op2->__anon1.uc;
8326
8327 exp->type = 2;
8328 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc ^ 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 IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8339 {
8340 int value2 = op2->__anon1.i;
8341
8342 exp->type = 2;
8343 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i << 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 UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8354 {
8355 unsigned int value2 = op2->__anon1.ui;
8356
8357 exp->type = 2;
8358 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui << 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 Int64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8369 {
8370 long long value2 = op2->__anon1.i64;
8371
8372 exp->type = 2;
8373 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 << 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 UInt64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8384 {
8385 uint64 value2 = op2->__anon1.ui64;
8386
8387 exp->type = 2;
8388 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 << 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 ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8399 {
8400 short value2 = op2->__anon1.s;
8401
8402 exp->type = 2;
8403 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s << 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 UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8414 {
8415 unsigned short value2 = op2->__anon1.us;
8416
8417 exp->type = 2;
8418 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us << 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 CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8429 {
8430 char value2 = op2->__anon1.c;
8431
8432 exp->type = 2;
8433 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c << 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 UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8444 {
8445 unsigned char value2 = op2->__anon1.uc;
8446
8447 exp->type = 2;
8448 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc << 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 IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8459 {
8460 int value2 = op2->__anon1.i;
8461
8462 exp->type = 2;
8463 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i >> 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 UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8474 {
8475 unsigned int value2 = op2->__anon1.ui;
8476
8477 exp->type = 2;
8478 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui >> 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 Int64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8489 {
8490 long long value2 = op2->__anon1.i64;
8491
8492 exp->type = 2;
8493 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 >> 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 UInt64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8504 {
8505 uint64 value2 = op2->__anon1.ui64;
8506
8507 exp->type = 2;
8508 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 >> 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 ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8519 {
8520 short value2 = op2->__anon1.s;
8521
8522 exp->type = 2;
8523 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s >> 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 UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8534 {
8535 unsigned short value2 = op2->__anon1.us;
8536
8537 exp->type = 2;
8538 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us >> 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 CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8549 {
8550 char value2 = op2->__anon1.c;
8551
8552 exp->type = 2;
8553 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c >> 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 UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8564 {
8565 unsigned char value2 = op2->__anon1.uc;
8566
8567 exp->type = 2;
8568 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc >> 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 IntBitNot(struct Expression * exp, struct Operand * op1)
8579 {
8580 exp->type = 2;
8581 exp->__anon1.__anon2.string = PrintInt((~op1->__anon1.i));
8582 if(!exp->expType)
8583 {
8584 exp->expType = op1->type;
8585 if(op1->type)
8586 op1->type->refCount++;
8587 }
8588 return 1;
8589 }
8590
8591 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
8592 {
8593 exp->type = 2;
8594 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(~op1->__anon1.ui));
8595 if(!exp->expType)
8596 {
8597 exp->expType = op1->type;
8598 if(op1->type)
8599 op1->type->refCount++;
8600 }
8601 return 1;
8602 }
8603
8604 static unsigned int Int64BitNot(struct Expression * exp, struct Operand * op1)
8605 {
8606 exp->type = 2;
8607 exp->__anon1.__anon2.string = PrintInt64((long long)(~op1->__anon1.i64));
8608 if(!exp->expType)
8609 {
8610 exp->expType = op1->type;
8611 if(op1->type)
8612 op1->type->refCount++;
8613 }
8614 return 1;
8615 }
8616
8617 static unsigned int UInt64BitNot(struct Expression * exp, struct Operand * op1)
8618 {
8619 exp->type = 2;
8620 exp->__anon1.__anon2.string = PrintUInt64((uint64)(~op1->__anon1.ui64));
8621 if(!exp->expType)
8622 {
8623 exp->expType = op1->type;
8624 if(op1->type)
8625 op1->type->refCount++;
8626 }
8627 return 1;
8628 }
8629
8630 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
8631 {
8632 exp->type = 2;
8633 exp->__anon1.__anon2.string = PrintShort((short)(~op1->__anon1.s));
8634 if(!exp->expType)
8635 {
8636 exp->expType = op1->type;
8637 if(op1->type)
8638 op1->type->refCount++;
8639 }
8640 return 1;
8641 }
8642
8643 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
8644 {
8645 exp->type = 2;
8646 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(~op1->__anon1.us));
8647 if(!exp->expType)
8648 {
8649 exp->expType = op1->type;
8650 if(op1->type)
8651 op1->type->refCount++;
8652 }
8653 return 1;
8654 }
8655
8656 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
8657 {
8658 exp->type = 2;
8659 exp->__anon1.__anon2.string = PrintChar((char)(~op1->__anon1.c));
8660 if(!exp->expType)
8661 {
8662 exp->expType = op1->type;
8663 if(op1->type)
8664 op1->type->refCount++;
8665 }
8666 return 1;
8667 }
8668
8669 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
8670 {
8671 exp->type = 2;
8672 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(~op1->__anon1.uc));
8673 if(!exp->expType)
8674 {
8675 exp->expType = op1->type;
8676 if(op1->type)
8677 op1->type->refCount++;
8678 }
8679 return 1;
8680 }
8681
8682 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8683 {
8684 int value2 = op2->__anon1.i;
8685
8686 exp->type = 2;
8687 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i &= value2));
8688 if(!exp->expType)
8689 {
8690 exp->expType = op1->type;
8691 if(op1->type)
8692 op1->type->refCount++;
8693 }
8694 return 1;
8695 }
8696
8697 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8698 {
8699 unsigned int value2 = op2->__anon1.ui;
8700
8701 exp->type = 2;
8702 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui &= value2));
8703 if(!exp->expType)
8704 {
8705 exp->expType = op1->type;
8706 if(op1->type)
8707 op1->type->refCount++;
8708 }
8709 return 1;
8710 }
8711
8712 static unsigned int Int64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8713 {
8714 long long value2 = op2->__anon1.i64;
8715
8716 exp->type = 2;
8717 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 &= value2));
8718 if(!exp->expType)
8719 {
8720 exp->expType = op1->type;
8721 if(op1->type)
8722 op1->type->refCount++;
8723 }
8724 return 1;
8725 }
8726
8727 static unsigned int UInt64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8728 {
8729 uint64 value2 = op2->__anon1.ui64;
8730
8731 exp->type = 2;
8732 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 &= value2));
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 ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8743 {
8744 short value2 = op2->__anon1.s;
8745
8746 exp->type = 2;
8747 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s &= 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 UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8758 {
8759 unsigned short value2 = op2->__anon1.us;
8760
8761 exp->type = 2;
8762 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us &= 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 CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8773 {
8774 char value2 = op2->__anon1.c;
8775
8776 exp->type = 2;
8777 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c &= 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 UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8788 {
8789 unsigned char value2 = op2->__anon1.uc;
8790
8791 exp->type = 2;
8792 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc &= 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 IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8803 {
8804 int value2 = op2->__anon1.i;
8805
8806 exp->type = 2;
8807 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i |= 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 UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8818 {
8819 unsigned int value2 = op2->__anon1.ui;
8820
8821 exp->type = 2;
8822 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui |= 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 Int64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8833 {
8834 long long value2 = op2->__anon1.i64;
8835
8836 exp->type = 2;
8837 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 |= 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 UInt64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8848 {
8849 uint64 value2 = op2->__anon1.ui64;
8850
8851 exp->type = 2;
8852 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 |= 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 ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8863 {
8864 short value2 = op2->__anon1.s;
8865
8866 exp->type = 2;
8867 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s |= 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 UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8878 {
8879 unsigned short value2 = op2->__anon1.us;
8880
8881 exp->type = 2;
8882 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us |= 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 CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8893 {
8894 char value2 = op2->__anon1.c;
8895
8896 exp->type = 2;
8897 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c |= 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 UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8908 {
8909 unsigned char value2 = op2->__anon1.uc;
8910
8911 exp->type = 2;
8912 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc |= 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 IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8923 {
8924 int value2 = op2->__anon1.i;
8925
8926 exp->type = 2;
8927 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i ^= 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 UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8938 {
8939 unsigned int value2 = op2->__anon1.ui;
8940
8941 exp->type = 2;
8942 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui ^= 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 Int64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8953 {
8954 long long value2 = op2->__anon1.i64;
8955
8956 exp->type = 2;
8957 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 ^= 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 UInt64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8968 {
8969 uint64 value2 = op2->__anon1.ui64;
8970
8971 exp->type = 2;
8972 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 ^= 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 ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8983 {
8984 short value2 = op2->__anon1.s;
8985
8986 exp->type = 2;
8987 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s ^= 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 UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8998 {
8999 unsigned short value2 = op2->__anon1.us;
9000
9001 exp->type = 2;
9002 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us ^= 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 CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9013 {
9014 char value2 = op2->__anon1.c;
9015
9016 exp->type = 2;
9017 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c ^= 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 UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9028 {
9029 unsigned char value2 = op2->__anon1.uc;
9030
9031 exp->type = 2;
9032 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc ^= 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 IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9043 {
9044 int value2 = op2->__anon1.i;
9045
9046 exp->type = 2;
9047 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i <<= 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 UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9058 {
9059 unsigned int value2 = op2->__anon1.ui;
9060
9061 exp->type = 2;
9062 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui <<= 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 Int64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9073 {
9074 long long value2 = op2->__anon1.i64;
9075
9076 exp->type = 2;
9077 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 <<= 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 UInt64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9088 {
9089 uint64 value2 = op2->__anon1.ui64;
9090
9091 exp->type = 2;
9092 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 <<= 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 ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9103 {
9104 short value2 = op2->__anon1.s;
9105
9106 exp->type = 2;
9107 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s <<= 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 UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9118 {
9119 unsigned short value2 = op2->__anon1.us;
9120
9121 exp->type = 2;
9122 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us <<= 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 CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9133 {
9134 char value2 = op2->__anon1.c;
9135
9136 exp->type = 2;
9137 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c <<= 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 UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9148 {
9149 unsigned char value2 = op2->__anon1.uc;
9150
9151 exp->type = 2;
9152 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc <<= 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 IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9163 {
9164 int value2 = op2->__anon1.i;
9165
9166 exp->type = 2;
9167 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i >>= 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 UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9178 {
9179 unsigned int value2 = op2->__anon1.ui;
9180
9181 exp->type = 2;
9182 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui >>= 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 Int64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9193 {
9194 long long value2 = op2->__anon1.i64;
9195
9196 exp->type = 2;
9197 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 >>= 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 UInt64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9208 {
9209 uint64 value2 = op2->__anon1.ui64;
9210
9211 exp->type = 2;
9212 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 >>= 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 ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9223 {
9224 short value2 = op2->__anon1.s;
9225
9226 exp->type = 2;
9227 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s >>= 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 UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9238 {
9239 unsigned short value2 = op2->__anon1.us;
9240
9241 exp->type = 2;
9242 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us >>= 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 CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9253 {
9254 char value2 = op2->__anon1.c;
9255
9256 exp->type = 2;
9257 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c >>= 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 UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9268 {
9269 unsigned char value2 = op2->__anon1.uc;
9270
9271 exp->type = 2;
9272 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc >>= 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 IntNot(struct Expression * exp, struct Operand * op1)
9283 {
9284 exp->type = 2;
9285 exp->__anon1.__anon2.string = PrintInt((int)(!op1->__anon1.i));
9286 if(!exp->expType)
9287 {
9288 exp->expType = op1->type;
9289 if(op1->type)
9290 op1->type->refCount++;
9291 }
9292 return 1;
9293 }
9294
9295 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
9296 {
9297 exp->type = 2;
9298 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(!op1->__anon1.ui));
9299 if(!exp->expType)
9300 {
9301 exp->expType = op1->type;
9302 if(op1->type)
9303 op1->type->refCount++;
9304 }
9305 return 1;
9306 }
9307
9308 static unsigned int Int64Not(struct Expression * exp, struct Operand * op1)
9309 {
9310 exp->type = 2;
9311 exp->__anon1.__anon2.string = PrintInt64((long long)(!op1->__anon1.i64));
9312 if(!exp->expType)
9313 {
9314 exp->expType = op1->type;
9315 if(op1->type)
9316 op1->type->refCount++;
9317 }
9318 return 1;
9319 }
9320
9321 static unsigned int UInt64Not(struct Expression * exp, struct Operand * op1)
9322 {
9323 exp->type = 2;
9324 exp->__anon1.__anon2.string = PrintUInt64((uint64)(!op1->__anon1.ui64));
9325 if(!exp->expType)
9326 {
9327 exp->expType = op1->type;
9328 if(op1->type)
9329 op1->type->refCount++;
9330 }
9331 return 1;
9332 }
9333
9334 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
9335 {
9336 exp->type = 2;
9337 exp->__anon1.__anon2.string = PrintShort((short)(!op1->__anon1.s));
9338 if(!exp->expType)
9339 {
9340 exp->expType = op1->type;
9341 if(op1->type)
9342 op1->type->refCount++;
9343 }
9344 return 1;
9345 }
9346
9347 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
9348 {
9349 exp->type = 2;
9350 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(!op1->__anon1.us));
9351 if(!exp->expType)
9352 {
9353 exp->expType = op1->type;
9354 if(op1->type)
9355 op1->type->refCount++;
9356 }
9357 return 1;
9358 }
9359
9360 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
9361 {
9362 exp->type = 2;
9363 exp->__anon1.__anon2.string = PrintChar((char)(!op1->__anon1.c));
9364 if(!exp->expType)
9365 {
9366 exp->expType = op1->type;
9367 if(op1->type)
9368 op1->type->refCount++;
9369 }
9370 return 1;
9371 }
9372
9373 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
9374 {
9375 exp->type = 2;
9376 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(!op1->__anon1.uc));
9377 if(!exp->expType)
9378 {
9379 exp->expType = op1->type;
9380 if(op1->type)
9381 op1->type->refCount++;
9382 }
9383 return 1;
9384 }
9385
9386 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9387 {
9388 int value2 = op2->__anon1.i;
9389
9390 exp->type = 2;
9391 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i == value2));
9392 if(!exp->expType)
9393 {
9394 exp->expType = op1->type;
9395 if(op1->type)
9396 op1->type->refCount++;
9397 }
9398 return 1;
9399 }
9400
9401 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9402 {
9403 unsigned int value2 = op2->__anon1.ui;
9404
9405 exp->type = 2;
9406 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui == value2));
9407 if(!exp->expType)
9408 {
9409 exp->expType = op1->type;
9410 if(op1->type)
9411 op1->type->refCount++;
9412 }
9413 return 1;
9414 }
9415
9416 static unsigned int Int64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9417 {
9418 long long value2 = op2->__anon1.i64;
9419
9420 exp->type = 2;
9421 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 == value2));
9422 if(!exp->expType)
9423 {
9424 exp->expType = op1->type;
9425 if(op1->type)
9426 op1->type->refCount++;
9427 }
9428 return 1;
9429 }
9430
9431 static unsigned int UInt64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9432 {
9433 uint64 value2 = op2->__anon1.ui64;
9434
9435 exp->type = 2;
9436 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 == value2));
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 ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9447 {
9448 short value2 = op2->__anon1.s;
9449
9450 exp->type = 2;
9451 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s == 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 UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9462 {
9463 unsigned short value2 = op2->__anon1.us;
9464
9465 exp->type = 2;
9466 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us == 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 CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9477 {
9478 char value2 = op2->__anon1.c;
9479
9480 exp->type = 2;
9481 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c == 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 UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9492 {
9493 unsigned char value2 = op2->__anon1.uc;
9494
9495 exp->type = 2;
9496 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc == 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 FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9507 {
9508 float value2 = op2->__anon1.f;
9509
9510 exp->type = 2;
9511 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f == 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 DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9522 {
9523 double value2 = op2->__anon1.d;
9524
9525 exp->type = 2;
9526 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d == 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 IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9537 {
9538 int value2 = op2->__anon1.i;
9539
9540 exp->type = 2;
9541 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i != 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 UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9552 {
9553 unsigned int value2 = op2->__anon1.ui;
9554
9555 exp->type = 2;
9556 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui != 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 Int64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9567 {
9568 long long value2 = op2->__anon1.i64;
9569
9570 exp->type = 2;
9571 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 != 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 UInt64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9582 {
9583 uint64 value2 = op2->__anon1.ui64;
9584
9585 exp->type = 2;
9586 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 != 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 ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9597 {
9598 short value2 = op2->__anon1.s;
9599
9600 exp->type = 2;
9601 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s != 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 UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9612 {
9613 unsigned short value2 = op2->__anon1.us;
9614
9615 exp->type = 2;
9616 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us != 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 CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9627 {
9628 char value2 = op2->__anon1.c;
9629
9630 exp->type = 2;
9631 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c != 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 UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9642 {
9643 unsigned char value2 = op2->__anon1.uc;
9644
9645 exp->type = 2;
9646 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc != 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 FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9657 {
9658 float value2 = op2->__anon1.f;
9659
9660 exp->type = 2;
9661 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f != 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 DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9672 {
9673 double value2 = op2->__anon1.d;
9674
9675 exp->type = 2;
9676 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d != 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 IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9687 {
9688 int value2 = op2->__anon1.i;
9689
9690 exp->type = 2;
9691 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i && 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 UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9702 {
9703 unsigned int value2 = op2->__anon1.ui;
9704
9705 exp->type = 2;
9706 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui && 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 Int64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9717 {
9718 long long value2 = op2->__anon1.i64;
9719
9720 exp->type = 2;
9721 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 && 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 UInt64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9732 {
9733 uint64 value2 = op2->__anon1.ui64;
9734
9735 exp->type = 2;
9736 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 && 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 ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9747 {
9748 short value2 = op2->__anon1.s;
9749
9750 exp->type = 2;
9751 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s && 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 UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9762 {
9763 unsigned short value2 = op2->__anon1.us;
9764
9765 exp->type = 2;
9766 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us && 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 CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9777 {
9778 char value2 = op2->__anon1.c;
9779
9780 exp->type = 2;
9781 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c && 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 UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9792 {
9793 unsigned char value2 = op2->__anon1.uc;
9794
9795 exp->type = 2;
9796 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc && 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 FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9807 {
9808 float value2 = op2->__anon1.f;
9809
9810 exp->type = 2;
9811 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f && 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 DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9822 {
9823 double value2 = op2->__anon1.d;
9824
9825 exp->type = 2;
9826 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d && 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 IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9837 {
9838 int value2 = op2->__anon1.i;
9839
9840 exp->type = 2;
9841 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i || 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 UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9852 {
9853 unsigned int value2 = op2->__anon1.ui;
9854
9855 exp->type = 2;
9856 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui || 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 Int64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9867 {
9868 long long value2 = op2->__anon1.i64;
9869
9870 exp->type = 2;
9871 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 || 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 UInt64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9882 {
9883 uint64 value2 = op2->__anon1.ui64;
9884
9885 exp->type = 2;
9886 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 || 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 ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9897 {
9898 short value2 = op2->__anon1.s;
9899
9900 exp->type = 2;
9901 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s || 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 UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9912 {
9913 unsigned short value2 = op2->__anon1.us;
9914
9915 exp->type = 2;
9916 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us || 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 CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9927 {
9928 char value2 = op2->__anon1.c;
9929
9930 exp->type = 2;
9931 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c || 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 UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9942 {
9943 unsigned char value2 = op2->__anon1.uc;
9944
9945 exp->type = 2;
9946 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc || 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 FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9957 {
9958 float value2 = op2->__anon1.f;
9959
9960 exp->type = 2;
9961 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f || 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 DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9972 {
9973 double value2 = op2->__anon1.d;
9974
9975 exp->type = 2;
9976 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d || 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 IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9987 {
9988 int value2 = op2->__anon1.i;
9989
9990 exp->type = 2;
9991 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i > 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 UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10002 {
10003 unsigned int value2 = op2->__anon1.ui;
10004
10005 exp->type = 2;
10006 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui > 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 Int64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10017 {
10018 long long value2 = op2->__anon1.i64;
10019
10020 exp->type = 2;
10021 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 > 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 UInt64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10032 {
10033 uint64 value2 = op2->__anon1.ui64;
10034
10035 exp->type = 2;
10036 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 > 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 ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10047 {
10048 short value2 = op2->__anon1.s;
10049
10050 exp->type = 2;
10051 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s > 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 UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10062 {
10063 unsigned short value2 = op2->__anon1.us;
10064
10065 exp->type = 2;
10066 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us > 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 CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10077 {
10078 char value2 = op2->__anon1.c;
10079
10080 exp->type = 2;
10081 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c > 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 UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10092 {
10093 unsigned char value2 = op2->__anon1.uc;
10094
10095 exp->type = 2;
10096 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc > 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 FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10107 {
10108 float value2 = op2->__anon1.f;
10109
10110 exp->type = 2;
10111 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f > 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 DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10122 {
10123 double value2 = op2->__anon1.d;
10124
10125 exp->type = 2;
10126 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d > 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 IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10137 {
10138 int value2 = op2->__anon1.i;
10139
10140 exp->type = 2;
10141 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i < 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 UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10152 {
10153 unsigned int value2 = op2->__anon1.ui;
10154
10155 exp->type = 2;
10156 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui < 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 Int64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10167 {
10168 long long value2 = op2->__anon1.i64;
10169
10170 exp->type = 2;
10171 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 < 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 UInt64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10182 {
10183 uint64 value2 = op2->__anon1.ui64;
10184
10185 exp->type = 2;
10186 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 < 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 ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10197 {
10198 short value2 = op2->__anon1.s;
10199
10200 exp->type = 2;
10201 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s < 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 UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10212 {
10213 unsigned short value2 = op2->__anon1.us;
10214
10215 exp->type = 2;
10216 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us < 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 CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10227 {
10228 char value2 = op2->__anon1.c;
10229
10230 exp->type = 2;
10231 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c < 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 UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10242 {
10243 unsigned char value2 = op2->__anon1.uc;
10244
10245 exp->type = 2;
10246 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc < 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 FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10257 {
10258 float value2 = op2->__anon1.f;
10259
10260 exp->type = 2;
10261 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f < 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 DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10272 {
10273 double value2 = op2->__anon1.d;
10274
10275 exp->type = 2;
10276 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d < 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 IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10287 {
10288 int value2 = op2->__anon1.i;
10289
10290 exp->type = 2;
10291 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i >= 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 UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10302 {
10303 unsigned int value2 = op2->__anon1.ui;
10304
10305 exp->type = 2;
10306 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui >= 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 Int64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10317 {
10318 long long value2 = op2->__anon1.i64;
10319
10320 exp->type = 2;
10321 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 >= 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 UInt64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10332 {
10333 uint64 value2 = op2->__anon1.ui64;
10334
10335 exp->type = 2;
10336 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 >= 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 ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10347 {
10348 short value2 = op2->__anon1.s;
10349
10350 exp->type = 2;
10351 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s >= 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 UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10362 {
10363 unsigned short value2 = op2->__anon1.us;
10364
10365 exp->type = 2;
10366 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us >= 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 CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10377 {
10378 char value2 = op2->__anon1.c;
10379
10380 exp->type = 2;
10381 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c >= 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 UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10392 {
10393 unsigned char value2 = op2->__anon1.uc;
10394
10395 exp->type = 2;
10396 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc >= 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 FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10407 {
10408 float value2 = op2->__anon1.f;
10409
10410 exp->type = 2;
10411 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f >= 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 DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10422 {
10423 double value2 = op2->__anon1.d;
10424
10425 exp->type = 2;
10426 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d >= 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 IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10437 {
10438 int value2 = op2->__anon1.i;
10439
10440 exp->type = 2;
10441 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i <= 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 UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10452 {
10453 unsigned int value2 = op2->__anon1.ui;
10454
10455 exp->type = 2;
10456 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui <= 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 Int64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10467 {
10468 long long value2 = op2->__anon1.i64;
10469
10470 exp->type = 2;
10471 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 <= 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 UInt64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10482 {
10483 uint64 value2 = op2->__anon1.ui64;
10484
10485 exp->type = 2;
10486 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 <= 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 ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10497 {
10498 short value2 = op2->__anon1.s;
10499
10500 exp->type = 2;
10501 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s <= 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 UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10512 {
10513 unsigned short value2 = op2->__anon1.us;
10514
10515 exp->type = 2;
10516 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us <= 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 CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10527 {
10528 char value2 = op2->__anon1.c;
10529
10530 exp->type = 2;
10531 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c <= 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 UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10542 {
10543 unsigned char value2 = op2->__anon1.uc;
10544
10545 exp->type = 2;
10546 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc <= 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 FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10557 {
10558 float value2 = op2->__anon1.f;
10559
10560 exp->type = 2;
10561 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f <= 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 DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10572 {
10573 double value2 = op2->__anon1.d;
10574
10575 exp->type = 2;
10576 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d <= 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 IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10587 {
10588 exp->type = 2;
10589 exp->__anon1.__anon2.string = PrintInt(op1->__anon1.i ? op2->__anon1.i : op3->__anon1.i);
10590 if(!exp->expType)
10591 {
10592 exp->expType = op1->type;
10593 if(op1->type)
10594 op1->type->refCount++;
10595 }
10596 return 1;
10597 }
10598
10599 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10600 {
10601 exp->type = 2;
10602 exp->__anon1.__anon2.string = PrintUInt(op1->__anon1.ui ? op2->__anon1.ui : op3->__anon1.ui);
10603 if(!exp->expType)
10604 {
10605 exp->expType = op1->type;
10606 if(op1->type)
10607 op1->type->refCount++;
10608 }
10609 return 1;
10610 }
10611
10612 static unsigned int Int64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10613 {
10614 exp->type = 2;
10615 exp->__anon1.__anon2.string = PrintInt64(op1->__anon1.i64 ? op2->__anon1.i64 : op3->__anon1.i64);
10616 if(!exp->expType)
10617 {
10618 exp->expType = op1->type;
10619 if(op1->type)
10620 op1->type->refCount++;
10621 }
10622 return 1;
10623 }
10624
10625 static unsigned int UInt64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10626 {
10627 exp->type = 2;
10628 exp->__anon1.__anon2.string = PrintUInt64(op1->__anon1.ui64 ? op2->__anon1.ui64 : op3->__anon1.ui64);
10629 if(!exp->expType)
10630 {
10631 exp->expType = op1->type;
10632 if(op1->type)
10633 op1->type->refCount++;
10634 }
10635 return 1;
10636 }
10637
10638 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10639 {
10640 exp->type = 2;
10641 exp->__anon1.__anon2.string = PrintShort(op1->__anon1.s ? op2->__anon1.s : op3->__anon1.s);
10642 if(!exp->expType)
10643 {
10644 exp->expType = op1->type;
10645 if(op1->type)
10646 op1->type->refCount++;
10647 }
10648 return 1;
10649 }
10650
10651 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10652 {
10653 exp->type = 2;
10654 exp->__anon1.__anon2.string = PrintUShort(op1->__anon1.us ? op2->__anon1.us : op3->__anon1.us);
10655 if(!exp->expType)
10656 {
10657 exp->expType = op1->type;
10658 if(op1->type)
10659 op1->type->refCount++;
10660 }
10661 return 1;
10662 }
10663
10664 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10665 {
10666 exp->type = 2;
10667 exp->__anon1.__anon2.string = PrintChar(op1->__anon1.c ? op2->__anon1.c : op3->__anon1.c);
10668 if(!exp->expType)
10669 {
10670 exp->expType = op1->type;
10671 if(op1->type)
10672 op1->type->refCount++;
10673 }
10674 return 1;
10675 }
10676
10677 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10678 {
10679 exp->type = 2;
10680 exp->__anon1.__anon2.string = PrintUChar(op1->__anon1.uc ? op2->__anon1.uc : op3->__anon1.uc);
10681 if(!exp->expType)
10682 {
10683 exp->expType = op1->type;
10684 if(op1->type)
10685 op1->type->refCount++;
10686 }
10687 return 1;
10688 }
10689
10690 struct OpTable intOps =
10691 {
10692 IntAdd, IntSub, IntMul, IntDiv, IntMod, IntNeg, IntInc, IntDec, IntAsign, IntAddAsign, IntSubAsign, IntMulAsign, IntDivAsign, IntModAsign, IntBitAnd, IntBitOr, IntBitXor, IntLShift, IntRShift, IntBitNot, IntAndAsign, IntOrAsign, IntXorAsign, IntLShiftAsign, IntRShiftAsign, IntNot, IntEqu, IntNqu, IntAnd, IntOr, IntGrt, IntSma, IntGrtEqu, IntSmaEqu, IntCond
10693 };
10694
10695 struct OpTable uintOps =
10696 {
10697 UIntAdd, UIntSub, UIntMul, UIntDiv, UIntMod, UIntNeg, UIntInc, UIntDec, UIntAsign, UIntAddAsign, UIntSubAsign, UIntMulAsign, UIntDivAsign, UIntModAsign, UIntBitAnd, UIntBitOr, UIntBitXor, UIntLShift, UIntRShift, UIntBitNot, UIntAndAsign, UIntOrAsign, UIntXorAsign, UIntLShiftAsign, UIntRShiftAsign, UIntNot, UIntEqu, UIntNqu, UIntAnd, UIntOr, UIntGrt, UIntSma, UIntGrtEqu, UIntSmaEqu, UIntCond
10698 };
10699
10700 struct OpTable int64Ops =
10701 {
10702 Int64Add, Int64Sub, Int64Mul, Int64Div, Int64Mod, Int64Neg, Int64Inc, Int64Dec, Int64Asign, Int64AddAsign, Int64SubAsign, Int64MulAsign, Int64DivAsign, Int64ModAsign, Int64BitAnd, Int64BitOr, Int64BitXor, Int64LShift, Int64RShift, Int64BitNot, Int64AndAsign, Int64OrAsign, Int64XorAsign, Int64LShiftAsign, Int64RShiftAsign, Int64Not, Int64Equ, Int64Nqu, Int64And, Int64Or, Int64Grt, Int64Sma, Int64GrtEqu, Int64SmaEqu, Int64Cond
10703 };
10704
10705 struct OpTable uint64Ops =
10706 {
10707 UInt64Add, UInt64Sub, UInt64Mul, UInt64Div, UInt64Mod, UInt64Neg, UInt64Inc, UInt64Dec, UInt64Asign, UInt64AddAsign, UInt64SubAsign, UInt64MulAsign, UInt64DivAsign, UInt64ModAsign, UInt64BitAnd, UInt64BitOr, UInt64BitXor, UInt64LShift, UInt64RShift, UInt64BitNot, UInt64AndAsign, UInt64OrAsign, UInt64XorAsign, UInt64LShiftAsign, UInt64RShiftAsign, UInt64Not, UInt64Equ, UInt64Nqu, UInt64And, UInt64Or, UInt64Grt, UInt64Sma, UInt64GrtEqu, UInt64SmaEqu, UInt64Cond
10708 };
10709
10710 struct OpTable shortOps =
10711 {
10712 ShortAdd, ShortSub, ShortMul, ShortDiv, ShortMod, ShortNeg, ShortInc, ShortDec, ShortAsign, ShortAddAsign, ShortSubAsign, ShortMulAsign, ShortDivAsign, ShortModAsign, ShortBitAnd, ShortBitOr, ShortBitXor, ShortLShift, ShortRShift, ShortBitNot, ShortAndAsign, ShortOrAsign, ShortXorAsign, ShortLShiftAsign, ShortRShiftAsign, ShortNot, ShortEqu, ShortNqu, ShortAnd, ShortOr, ShortGrt, ShortSma, ShortGrtEqu, ShortSmaEqu, ShortCond
10713 };
10714
10715 struct OpTable ushortOps =
10716 {
10717 UShortAdd, UShortSub, UShortMul, UShortDiv, UShortMod, UShortNeg, UShortInc, UShortDec, UShortAsign, UShortAddAsign, UShortSubAsign, UShortMulAsign, UShortDivAsign, UShortModAsign, UShortBitAnd, UShortBitOr, UShortBitXor, UShortLShift, UShortRShift, UShortBitNot, UShortAndAsign, UShortOrAsign, UShortXorAsign, UShortLShiftAsign, UShortRShiftAsign, UShortNot, UShortEqu, UShortNqu, UShortAnd, UShortOr, UShortGrt, UShortSma, UShortGrtEqu, UShortSmaEqu, UShortCond
10718 };
10719
10720 struct OpTable floatOps =
10721 {
10722 FloatAdd, FloatSub, FloatMul, FloatDiv, (((void *)0)), FloatNeg, FloatInc, FloatDec, FloatAsign, FloatAddAsign, FloatSubAsign, FloatMulAsign, FloatDivAsign, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), FloatEqu, FloatNqu, FloatAnd, FloatOr, FloatGrt, FloatSma, FloatGrtEqu, FloatSmaEqu
10723 };
10724
10725 struct OpTable doubleOps =
10726 {
10727 DoubleAdd, DoubleSub, DoubleMul, DoubleDiv, (((void *)0)), DoubleNeg, DoubleInc, DoubleDec, DoubleAsign, DoubleAddAsign, DoubleSubAsign, DoubleMulAsign, DoubleDivAsign, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), DoubleEqu, DoubleNqu, DoubleAnd, DoubleOr, DoubleGrt, DoubleSma, DoubleGrtEqu, DoubleSmaEqu
10728 };
10729
10730 struct OpTable charOps =
10731 {
10732 CharAdd, CharSub, CharMul, CharDiv, CharMod, CharNeg, CharInc, CharDec, CharAsign, CharAddAsign, CharSubAsign, CharMulAsign, CharDivAsign, CharModAsign, CharBitAnd, CharBitOr, CharBitXor, CharLShift, CharRShift, CharBitNot, CharAndAsign, CharOrAsign, CharXorAsign, CharLShiftAsign, CharRShiftAsign, CharNot, CharEqu, CharNqu, CharAnd, CharOr, CharGrt, CharSma, CharGrtEqu, CharSmaEqu, CharCond
10733 };
10734
10735 struct OpTable ucharOps =
10736 {
10737 UCharAdd, UCharSub, UCharMul, UCharDiv, UCharMod, UCharNeg, UCharInc, UCharDec, UCharAsign, UCharAddAsign, UCharSubAsign, UCharMulAsign, UCharDivAsign, UCharModAsign, UCharBitAnd, UCharBitOr, UCharBitXor, UCharLShift, UCharRShift, UCharBitNot, UCharAndAsign, UCharOrAsign, UCharXorAsign, UCharLShiftAsign, UCharRShiftAsign, UCharNot, UCharEqu, UCharNqu, UCharAnd, UCharOr, UCharGrt, UCharSma, UCharGrtEqu, UCharSmaEqu, UCharCond
10738 };
10739
10740 void ReadString(char * output, char * string)
10741 {
10742 int len = strlen(string);
10743 int c, d = 0;
10744 unsigned int quoted = 0, escaped = 0;
10745
10746 for(c = 0; c < len; c++)
10747 {
10748 char ch = string[c];
10749
10750 if(escaped)
10751 {
10752 switch(ch)
10753 {
10754 case 'n':
10755 output[d] = '\n';
10756 break;
10757 case 't':
10758 output[d] = '\t';
10759 break;
10760 case 'a':
10761 output[d] = '\a';
10762 break;
10763 case 'b':
10764 output[d] = '\b';
10765 break;
10766 case 'f':
10767 output[d] = '\f';
10768 break;
10769 case 'r':
10770 output[d] = '\r';
10771 break;
10772 case 'v':
10773 output[d] = '\v';
10774 break;
10775 case '\\':
10776 output[d] = '\\';
10777 break;
10778 case '\"':
10779 output[d] = '\"';
10780 break;
10781 case '\'':
10782 output[d] = '\'';
10783 break;
10784 default:
10785 output[d] = ch;
10786 }
10787 d++;
10788 escaped = 0;
10789 }
10790 else
10791 {
10792 if(ch == '\"')
10793 quoted ^= 1;
10794 else if(quoted)
10795 {
10796 if(ch == '\\')
10797 escaped = 1;
10798 else
10799 output[d++] = ch;
10800 }
10801 }
10802 }
10803 output[d] = '\0';
10804 }
10805
10806 int UnescapeString(char * d, char * s, int len)
10807 {
10808 int j = 0, k = 0;
10809 char ch;
10810
10811 while(j < len && (ch = s[j]))
10812 {
10813 switch(ch)
10814 {
10815 case '\\':
10816 switch((ch = s[++j]))
10817 {
10818 case 'n':
10819 d[k] = '\n';
10820 break;
10821 case 't':
10822 d[k] = '\t';
10823 break;
10824 case 'a':
10825 d[k] = '\a';
10826 break;
10827 case 'b':
10828 d[k] = '\b';
10829 break;
10830 case 'f':
10831 d[k] = '\f';
10832 break;
10833 case 'r':
10834 d[k] = '\r';
10835 break;
10836 case 'v':
10837 d[k] = '\v';
10838 break;
10839 case '\\':
10840 d[k] = '\\';
10841 break;
10842 case '\"':
10843 d[k] = '\"';
10844 break;
10845 case '\'':
10846 d[k] = '\'';
10847 break;
10848 default:
10849 d[k] = '\\';
10850 d[k] = ch;
10851 }
10852 break;
10853 default:
10854 d[k] = ch;
10855 }
10856 j++, k++;
10857 }
10858 d[k] = '\0';
10859 return k;
10860 }
10861
10862 char * OffsetEscapedString(char * s, int len, int offset)
10863 {
10864 char ch;
10865 int j = 0, k = 0;
10866
10867 while(j < len && k < offset && (ch = s[j]))
10868 {
10869 if(ch == '\\')
10870 ++j;
10871 j++, k++;
10872 }
10873 return (k == offset) ? s + j : (((void *)0));
10874 }
10875
10876 extern long long __ecereNameSpace__ecere__com___strtoi64(const char *  string, const char * *  endString, int base);
10877
10878 extern uint64 __ecereNameSpace__ecere__com___strtoui64(const char *  string, const char * *  endString, int base);
10879
10880 extern double strtod(const char * , char * * );
10881
10882 extern float (* __ecereMethod_float_inf)(void);
10883
10884 extern float (* __ecereMethod_float_nan)(void);
10885
10886 extern double (* __ecereMethod_double_inf)(void);
10887
10888 extern double (* __ecereMethod_double_nan)(void);
10889
10890 struct Operand GetOperand(struct Expression * exp)
10891 {
10892 struct Operand op =
10893 {
10894 0, 0, 0,
10895 .__anon1 = {
10896 .c = 0
10897 },
10898 {
10899 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10900 }
10901 };
10902 struct Type * type = exp->expType;
10903
10904 if(type)
10905 {
10906 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))
10907 {
10908 if(!type->__anon1._class->__anon1.registered->dataType)
10909 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
10910 type = type->__anon1._class->__anon1.registered->dataType;
10911 }
10912 if(exp->type == 3 && op.kind == 13)
10913 {
10914 op.__anon1.ui64 = (uint64)exp->__anon1.__anon2.string;
10915 op.kind = 13;
10916 op.ops = uint64Ops;
10917 }
10918 else if(exp->isConstant && exp->type == 2)
10919 {
10920 op.kind = type->kind;
10921 op.type = type;
10922 switch(op.kind)
10923 {
10924 case 24:
10925 case 1:
10926 {
10927 if(exp->__anon1.__anon1.constant[0] == '\'')
10928 {
10929 op.__anon1.c = exp->__anon1.__anon1.constant[1];
10930 op.ops = charOps;
10931 }
10932 else if(type->isSigned)
10933 {
10934 op.__anon1.c = (char)strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10935 op.ops = charOps;
10936 }
10937 else
10938 {
10939 op.__anon1.uc = (unsigned char)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10940 op.ops = ucharOps;
10941 }
10942 break;
10943 }
10944 case 2:
10945 if(type->isSigned)
10946 {
10947 op.__anon1.s = (short)strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10948 op.ops = shortOps;
10949 }
10950 else
10951 {
10952 op.__anon1.us = (unsigned short)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10953 op.ops = ushortOps;
10954 }
10955 break;
10956 case 3:
10957 case 5:
10958 if(type->isSigned)
10959 {
10960 op.__anon1.i = strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10961 op.ops = intOps;
10962 }
10963 else
10964 {
10965 op.__anon1.ui = strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10966 op.ops = uintOps;
10967 }
10968 op.kind = 3;
10969 break;
10970 case 4:
10971 if(type->isSigned)
10972 {
10973 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10974 op.ops = int64Ops;
10975 }
10976 else
10977 {
10978 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10979 op.ops = uint64Ops;
10980 }
10981 op.kind = 4;
10982 break;
10983 case 22:
10984 if(type->isSigned)
10985 {
10986 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10987 op.ops = int64Ops;
10988 }
10989 else
10990 {
10991 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10992 op.ops = uint64Ops;
10993 }
10994 op.kind = 4;
10995 break;
10996 case 23:
10997 if(type->isSigned)
10998 {
10999 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11000 op.ops = int64Ops;
11001 }
11002 else
11003 {
11004 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11005 op.ops = uint64Ops;
11006 }
11007 op.kind = 4;
11008 break;
11009 case 6:
11010 if(!strcmp(exp->__anon1.__anon1.constant, "inf"))
11011 op.__anon1.f = __ecereMethod_float_inf();
11012 else if(!strcmp(exp->__anon1.__anon1.constant, "-inf"))
11013 op.__anon1.f = -__ecereMethod_float_inf();
11014 else if(!strcmp(exp->__anon1.__anon1.constant, "nan"))
11015 op.__anon1.f = __ecereMethod_float_nan();
11016 else if(!strcmp(exp->__anon1.__anon1.constant, "-nan"))
11017 op.__anon1.f = -__ecereMethod_float_nan();
11018 else
11019 op.__anon1.f = (float)strtod(exp->__anon1.__anon1.constant, (((void *)0)));
11020 op.ops = floatOps;
11021 break;
11022 case 7:
11023 if(!strcmp(exp->__anon1.__anon1.constant, "inf"))
11024 op.__anon1.d = __ecereMethod_double_inf();
11025 else if(!strcmp(exp->__anon1.__anon1.constant, "-inf"))
11026 op.__anon1.d = -__ecereMethod_double_inf();
11027 else if(!strcmp(exp->__anon1.__anon1.constant, "nan"))
11028 op.__anon1.d = __ecereMethod_double_nan();
11029 else if(!strcmp(exp->__anon1.__anon1.constant, "-nan"))
11030 op.__anon1.d = -__ecereMethod_double_nan();
11031 else
11032 op.__anon1.d = (double)strtod(exp->__anon1.__anon1.constant, (((void *)0)));
11033 op.ops = doubleOps;
11034 break;
11035 case 12:
11036 case 13:
11037 case 8:
11038 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11039 op.kind = 13;
11040 op.ops = uint64Ops;
11041 break;
11042 }
11043 }
11044 }
11045 return op;
11046 }
11047
11048 static long long GetEnumValue(struct __ecereNameSpace__ecere__com__Class * _class, void * ptr)
11049 {
11050 long long v = 0;
11051
11052 switch(_class->typeSize)
11053 {
11054 case 8:
11055 if(!strcmp(_class->dataTypeString, "uint64"))
11056 v = (long long)*(uint64 *)ptr;
11057 else
11058 v = *(long long *)ptr;
11059 break;
11060 case 4:
11061 if(!strcmp(_class->dataTypeString, "uint"))
11062 v = (long long)*(unsigned int *)ptr;
11063 else
11064 v = (long long)*(int *)ptr;
11065 break;
11066 case 2:
11067 if(!strcmp(_class->dataTypeString, "uint16"))
11068 v = (long long)*(unsigned short *)ptr;
11069 else
11070 v = (long long)*(short *)ptr;
11071 break;
11072 case 1:
11073 if(!strcmp(_class->dataTypeString, "byte"))
11074 v = (long long)*(unsigned char *)ptr;
11075 else
11076 v = (long long)*(char *)ptr;
11077 break;
11078 }
11079 return v;
11080 }
11081
11082 int __ecereVMethodID_class_OnGetString;
11083
11084 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
11085
11086 static __attribute__((unused)) void UnusedFunction()
11087 {
11088 int a;
11089
11090 ((const char *  (*)(struct __ecereNameSpace__ecere__com__Class *, const void *, char *  tempString, void *  fieldData, unsigned int *  needClass))__ecereClass_int->_vTbl[__ecereVMethodID_class_OnGetString])(__ecereClass_int, &a, 0, 0, 0);
11091 }
11092
11093 extern int __ecereVMethodID_class_OnGetString;
11094
11095 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
11096 {
11097 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
11098
11099 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
11100 {
11101 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
11102 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
11103 else
11104 {
11105 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11106 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
11107 struct Type * type;
11108 void * ptr = inst->data + dataMember->offset + offset;
11109 char * result = (((void *)0));
11110
11111 exp->loc = member->loc = inst->loc;
11112 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
11113 if(!dataMember->dataType)
11114 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
11115 type = dataMember->dataType;
11116 if(type->kind == 8)
11117 {
11118 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11119
11120 if(_class->type == 4)
11121 {
11122 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11123
11124 if(enumClass)
11125 {
11126 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
11127 struct __ecereNameSpace__ecere__sys__NamedLink64 * item;
11128
11129 for(item = e->values.first; item; item = item->next)
11130 {
11131 if(item->data == GetEnumValue(_class, ptr))
11132 {
11133 result = item->name;
11134 break;
11135 }
11136 }
11137 if(result)
11138 {
11139 exp->__anon1.__anon1.identifier = MkIdentifier(result);
11140 exp->type = 0;
11141 exp->destType = MkClassType(_class->fullName);
11142 ProcessExpressionType(exp);
11143 }
11144 }
11145 }
11146 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
11147 {
11148 if(!_class->dataType)
11149 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11150 type = _class->dataType;
11151 }
11152 }
11153 if(!result)
11154 {
11155 switch(type->kind)
11156 {
11157 case 6:
11158 {
11159 FreeExpContents(exp);
11160 exp->__anon1.__anon1.constant = PrintFloat(*(float *)ptr);
11161 exp->type = 2;
11162 break;
11163 }
11164 case 7:
11165 {
11166 FreeExpContents(exp);
11167 exp->__anon1.__anon1.constant = PrintDouble(*(double *)ptr);
11168 exp->type = 2;
11169 break;
11170 }
11171 case 3:
11172 {
11173 FreeExpContents(exp);
11174 exp->__anon1.__anon1.constant = PrintInt(*(int *)ptr);
11175 exp->type = 2;
11176 break;
11177 }
11178 case 4:
11179 {
11180 FreeExpContents(exp);
11181 exp->__anon1.__anon1.constant = PrintInt64(*(long long *)ptr);
11182 exp->type = 2;
11183 break;
11184 }
11185 case 22:
11186 {
11187 FreeExpContents(exp);
11188 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
11189 exp->type = 2;
11190 break;
11191 }
11192 case 23:
11193 {
11194 FreeExpContents(exp);
11195 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
11196 exp->type = 2;
11197 break;
11198 }
11199 default:
11200 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
11201 }
11202 }
11203 ListAdd(memberList, member);
11204 }
11205 if(parentDataMember->type == 1)
11206 break;
11207 }
11208 }
11209
11210 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
11211
11212 void PopulateInstance(struct Instantiation * inst)
11213 {
11214 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
11215 struct __ecereNameSpace__ecere__com__Class * _class = classSym->__anon1.registered;
11216 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
11217 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
11218
11219 if(!inst->members)
11220 inst->members = MkListOne(MkMembersInitList(memberList));
11221 else
11222 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
11223 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
11224 {
11225 if(!dataMember->isProperty)
11226 {
11227 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
11228 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
11229 else
11230 {
11231 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11232 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
11233 struct Type * type;
11234 void * ptr = inst->data + dataMember->offset;
11235 char * result = (((void *)0));
11236
11237 exp->loc = member->loc = inst->loc;
11238 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
11239 if(!dataMember->dataType)
11240 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
11241 type = dataMember->dataType;
11242 if(type->kind == 8)
11243 {
11244 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11245
11246 if(_class->type == 4)
11247 {
11248 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11249
11250 if(enumClass)
11251 {
11252 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
11253 struct __ecereNameSpace__ecere__sys__NamedLink64 * item;
11254
11255 for(item = e->values.first; item; item = item->next)
11256 {
11257 if(item->data == GetEnumValue(_class, ptr))
11258 {
11259 result = item->name;
11260 break;
11261 }
11262 }
11263 }
11264 if(result)
11265 {
11266 exp->__anon1.__anon1.identifier = MkIdentifier(result);
11267 exp->type = 0;
11268 exp->destType = MkClassType(_class->fullName);
11269 ProcessExpressionType(exp);
11270 }
11271 }
11272 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
11273 {
11274 if(!_class->dataType)
11275 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11276 type = _class->dataType;
11277 }
11278 }
11279 if(!result)
11280 {
11281 switch(type->kind)
11282 {
11283 case 6:
11284 {
11285 exp->__anon1.__anon1.constant = PrintFloat(*(float *)ptr);
11286 exp->type = 2;
11287 break;
11288 }
11289 case 7:
11290 {
11291 exp->__anon1.__anon1.constant = PrintDouble(*(double *)ptr);
11292 exp->type = 2;
11293 break;
11294 }
11295 case 3:
11296 {
11297 exp->__anon1.__anon1.constant = PrintInt(*(int *)ptr);
11298 exp->type = 2;
11299 break;
11300 }
11301 case 4:
11302 {
11303 exp->__anon1.__anon1.constant = PrintInt64(*(long long *)ptr);
11304 exp->type = 2;
11305 break;
11306 }
11307 case 22:
11308 {
11309 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
11310 exp->type = 2;
11311 break;
11312 }
11313 default:
11314 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
11315 }
11316 }
11317 ListAdd(memberList, member);
11318 }
11319 }
11320 }
11321 }
11322
11323 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);
11324
11325 extern void FreeInstance(struct Instantiation * inst);
11326
11327 void ComputeInstantiation(struct Expression * exp)
11328 {
11329 struct Instantiation * inst = exp->__anon1.instance;
11330 struct MembersInit * members;
11331 struct Symbol * classSym = inst->_class ? inst->_class->__anon1.__anon1.symbol : (((void *)0));
11332 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->__anon1.registered : (((void *)0));
11333 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
11334 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
11335 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
11336 int subMemberStackPos = 0;
11337 uint64 bits = 0;
11338
11339 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11340 {
11341 if(inst->data)
11342 return ;
11343 if(_class->type == 0 || _class->type == 5)
11344 {
11345 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
11346 if(_class->type == 0)
11347 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)inst->data))->_refCount++;
11348 }
11349 else
11350 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11351 }
11352 if(inst->members)
11353 {
11354 for(members = (*inst->members).first; members; members = members->next)
11355 {
11356 switch(members->type)
11357 {
11358 case 0:
11359 {
11360 if(members->__anon1.dataMembers)
11361 {
11362 struct MemberInit * member;
11363
11364 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
11365 {
11366 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
11367 unsigned int found = 0;
11368 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11369 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
11370 unsigned int dataMemberOffset;
11371
11372 if(!ident)
11373 {
11374 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
11375 if(curMember)
11376 {
11377 if(curMember->isProperty)
11378 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
11379 else
11380 {
11381 dataMember = curMember;
11382 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11383 if(_class->type == 0)
11384 dataMemberOffset += _class->base->structSize;
11385 }
11386 found = 1;
11387 }
11388 }
11389 else
11390 {
11391 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
11392 if(prop)
11393 {
11394 found = 1;
11395 if(prop->memberAccess == 1)
11396 {
11397 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
11398 curClass = prop->_class;
11399 }
11400 }
11401 else
11402 {
11403 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
11404 int _subMemberStackPos = 0;
11405
11406 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
11407 if(dataMember)
11408 {
11409 found = 1;
11410 if(dataMember->memberAccess == 1)
11411 {
11412 curMember = dataMember;
11413 curClass = dataMember->_class;
11414 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
11415 subMemberStackPos = _subMemberStackPos;
11416 }
11417 }
11418 }
11419 }
11420 if(found && member->initializer && member->initializer->type == 0)
11421 {
11422 struct Expression * value = member->initializer->__anon1.exp;
11423 struct Type * type = (((void *)0));
11424 unsigned int deepMember = 0;
11425
11426 if(prop)
11427 {
11428 type = prop->dataType;
11429 }
11430 else if(dataMember)
11431 {
11432 if(!dataMember->dataType)
11433 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
11434 type = dataMember->dataType;
11435 }
11436 if(ident && ident->next)
11437 {
11438 deepMember = 1;
11439 for(ident = ident->next; ident && type; ident = ident->next)
11440 {
11441 if(type->kind == 8)
11442 {
11443 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->__anon1._class->__anon1.registered, ident->string, privateModule);
11444 if(prop)
11445 type = prop->dataType;
11446 else
11447 {
11448 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->__anon1._class->__anon1.registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11449 if(dataMember)
11450 type = dataMember->dataType;
11451 }
11452 }
11453 else if(type->kind == 9 || type->kind == 10)
11454 {
11455 struct Type * memberType;
11456
11457 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
11458 {
11459 if(!strcmp(memberType->name, ident->string))
11460 {
11461 type = memberType;
11462 break;
11463 }
11464 }
11465 }
11466 }
11467 }
11468 if(value)
11469 {
11470 FreeType(value->destType);
11471 value->destType = type;
11472 if(type)
11473 type->refCount++;
11474 ComputeExpression(value);
11475 }
11476 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11477 {
11478 if(type->kind == 8)
11479 {
11480 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11481
11482 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
11483 {
11484 if(!_class->dataType)
11485 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11486 type = _class->dataType;
11487 }
11488 }
11489 if(dataMember)
11490 {
11491 void * ptr = inst->data + dataMemberOffset;
11492
11493 if(value->type == 2)
11494 {
11495 switch(type->kind)
11496 {
11497 case 3:
11498 {
11499 GetInt(value, (int *)ptr);
11500 break;
11501 }
11502 case 4:
11503 {
11504 GetInt64(value, (long long *)ptr);
11505 break;
11506 }
11507 case 22:
11508 {
11509 GetIntPtr(value, (intptr_t *)ptr);
11510 break;
11511 }
11512 case 23:
11513 {
11514 GetIntSize(value, (ssize_t *)ptr);
11515 break;
11516 }
11517 case 6:
11518 {
11519 GetFloat(value, (float *)ptr);
11520 break;
11521 }
11522 case 7:
11523 {
11524 GetDouble(value, (double *)ptr);
11525 break;
11526 }
11527 }
11528 }
11529 else if(value->type == 1)
11530 {
11531 if(type->kind == 8)
11532 {
11533 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11534
11535 if(_class->type == 1)
11536 {
11537 ComputeTypeSize(type);
11538 if(value->__anon1.instance->data)
11539 memcpy(ptr, value->__anon1.instance->data, type->size);
11540 }
11541 }
11542 }
11543 }
11544 else if(prop)
11545 {
11546 if(value->type == 1 && value->__anon1.instance->data)
11547 {
11548 if(type->kind == 8)
11549 {
11550 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11551
11552 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)))
11553 {
11554 void (* Set)(void *, void *) = (void *)prop->Set;
11555
11556 Set(inst->data, value->__anon1.instance->data);
11557 PopulateInstance(inst);
11558 }
11559 }
11560 }
11561 else if(value->type == 2)
11562 {
11563 switch(type->kind)
11564 {
11565 case 7:
11566 {
11567 void (* Set)(void *, double) = (void *)prop->Set;
11568
11569 Set(inst->data, strtod(value->__anon1.__anon1.constant, (((void *)0))));
11570 break;
11571 }
11572 case 6:
11573 {
11574 void (* Set)(void *, float) = (void *)prop->Set;
11575
11576 Set(inst->data, (float)(strtod(value->__anon1.__anon1.constant, (((void *)0)))));
11577 break;
11578 }
11579 case 3:
11580 {
11581 void (* Set)(void *, int) = (void *)prop->Set;
11582
11583 Set(inst->data, strtol(value->__anon1.__anon1.constant, (((void *)0)), 0));
11584 break;
11585 }
11586 case 4:
11587 {
11588 void (* Set)(void *, long long) = (void *)prop->Set;
11589
11590 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11591 break;
11592 }
11593 case 22:
11594 {
11595 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11596
11597 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11598 break;
11599 }
11600 case 23:
11601 {
11602 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11603
11604 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11605 break;
11606 }
11607 }
11608 }
11609 else if(value->type == 3)
11610 {
11611 char temp[1024];
11612
11613 ReadString(temp, value->__anon1.__anon2.string);
11614 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
11615 }
11616 }
11617 }
11618 else if(!deepMember && type && _class->type == 3)
11619 {
11620 if(prop)
11621 {
11622 if(value->type == 2)
11623 {
11624 if(type->kind == 8)
11625 {
11626 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11627
11628 if(_class->type == 3)
11629 {
11630 if(!_class->dataType)
11631 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11632 type = _class->dataType;
11633 }
11634 }
11635 switch(type->kind)
11636 {
11637 case 6:
11638 {
11639 float fValue;
11640 float (* Set)(float) = (void *)prop->Set;
11641
11642 GetFloat(member->initializer->__anon1.exp, &fValue);
11643 exp->__anon1.__anon1.constant = PrintFloat(Set(fValue));
11644 exp->type = 2;
11645 break;
11646 }
11647 case 7:
11648 {
11649 double dValue;
11650 double (* Set)(double) = (void *)prop->Set;
11651
11652 GetDouble(member->initializer->__anon1.exp, &dValue);
11653 exp->__anon1.__anon1.constant = PrintDouble(Set(dValue));
11654 exp->type = 2;
11655 break;
11656 }
11657 }
11658 }
11659 }
11660 }
11661 else if(!deepMember && type && _class->type == 2)
11662 {
11663 if(prop)
11664 {
11665 if(value->type == 1 && value->__anon1.instance->data)
11666 {
11667 unsigned int (* Set)(void *) = (void *)prop->Set;
11668
11669 bits = Set(value->__anon1.instance->data);
11670 }
11671 else if(value->type == 2)
11672 {
11673 }
11674 }
11675 else if(dataMember)
11676 {
11677 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
11678 struct Type * type;
11679 uint64 part = 0;
11680
11681 bits = (bits & ~bitMember->mask);
11682 if(!bitMember->dataType)
11683 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0);
11684 type = bitMember->dataType;
11685 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
11686 {
11687 if(!type->__anon1._class->__anon1.registered->dataType)
11688 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
11689 type = type->__anon1._class->__anon1.registered->dataType;
11690 }
11691 switch(type->kind)
11692 {
11693 case 24:
11694 case 1:
11695 {
11696 unsigned char v;
11697
11698 type->isSigned ? GetChar(value, (char *)&v) : GetUChar(value, &v);
11699 part = (uint64)v;
11700 break;
11701 }
11702 case 2:
11703 {
11704 unsigned short v;
11705
11706 type->isSigned ? GetShort(value, (short *)&v) : GetUShort(value, &v);
11707 part = (uint64)v;
11708 break;
11709 }
11710 case 3:
11711 case 5:
11712 {
11713 unsigned int v;
11714
11715 type->isSigned ? GetInt(value, (int *)&v) : GetUInt(value, &v);
11716 part = (uint64)v;
11717 break;
11718 }
11719 case 4:
11720 {
11721 uint64 v;
11722
11723 type->isSigned ? GetInt64(value, (long long *)&v) : GetUInt64(value, &v);
11724 part = v;
11725 break;
11726 }
11727 case 22:
11728 {
11729 uintptr_t v;
11730
11731 type->isSigned ? GetIntPtr(value, (intptr_t *)&v) : GetUIntPtr(value, &v);
11732 part = (uint64)v;
11733 break;
11734 }
11735 case 23:
11736 {
11737 size_t v;
11738
11739 type->isSigned ? GetIntSize(value, (ssize_t *)&v) : GetUIntSize(value, &v);
11740 part = (uint64)v;
11741 break;
11742 }
11743 }
11744 bits |= part << bitMember->pos;
11745 }
11746 }
11747 }
11748 else
11749 {
11750 if(_class && _class->type == 3)
11751 {
11752 ComputeExpression(member->initializer->__anon1.exp);
11753 exp->__anon1.__anon1.constant = member->initializer->__anon1.exp->__anon1.__anon1.constant;
11754 exp->type = 2;
11755 member->initializer->__anon1.exp->__anon1.__anon1.constant = (((void *)0));
11756 }
11757 }
11758 }
11759 }
11760 break;
11761 }
11762 }
11763 }
11764 }
11765 if(_class && _class->type == 2)
11766 {
11767 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
11768 exp->type = 2;
11769 }
11770 if(exp->type != 1)
11771 {
11772 FreeInstance(inst);
11773 }
11774 }
11775
11776 static unsigned int Promote(struct Operand * op, int kind, unsigned int isSigned)
11777 {
11778 unsigned int result = 0;
11779
11780 switch(kind)
11781 {
11782 case 2:
11783 if(op->kind == 1 || op->kind == 15 || op->kind == 24)
11784 result = isSigned ? GetOpShort(op, &op->__anon1.s) : GetOpUShort(op, &op->__anon1.us);
11785 break;
11786 case 3:
11787 case 5:
11788 if(op->kind == 1 || op->kind == 2 || op->kind == 15 || op->kind == 24)
11789 result = isSigned ? GetOpInt(op, &op->__anon1.i) : GetOpUInt(op, &op->__anon1.ui);
11790 break;
11791 case 4:
11792 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)
11793 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
11794 break;
11795 case 6:
11796 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)
11797 result = GetOpFloat(op, &op->__anon1.f);
11798 break;
11799 case 7:
11800 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)
11801 result = GetOpDouble(op, &op->__anon1.d);
11802 break;
11803 case 13:
11804 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)
11805 result = GetOpUInt64(op, &op->__anon1.ui64);
11806 break;
11807 case 15:
11808 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)
11809 result = isSigned ? GetOpInt(op, &op->__anon1.i) : GetOpUInt(op, &op->__anon1.ui);
11810 break;
11811 case 22:
11812 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11813 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
11814 break;
11815 case 23:
11816 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11817 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
11818 break;
11819 }
11820 return result;
11821 }
11822
11823 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
11824 {
11825 if(exp->__anon1.op.op == SIZEOF)
11826 {
11827 FreeExpContents(exp);
11828 exp->type = 2;
11829 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(op1->type));
11830 }
11831 else
11832 {
11833 if(!exp->__anon1.op.exp1)
11834 {
11835 switch(exp->__anon1.op.op)
11836 {
11837 case '+':
11838 {
11839 struct Expression * exp2 = exp->__anon1.op.exp2;
11840
11841 exp->__anon1.op.exp2 = (((void *)0));
11842 FreeExpContents(exp);
11843 FreeType(exp->expType);
11844 FreeType(exp->destType);
11845 *exp = *exp2;
11846 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
11847 break;
11848 }
11849 case '-':
11850 if(op1->ops.Neg)
11851 {
11852 FreeExpContents(exp);
11853 op1->ops.Neg(exp, op1);
11854 }
11855 break;
11856 case '~':
11857 if(op1->ops.BitNot)
11858 {
11859 FreeExpContents(exp);
11860 op1->ops.BitNot(exp, op1);
11861 }
11862 break;
11863 case '!':
11864 if(op1->ops.Not)
11865 {
11866 FreeExpContents(exp);
11867 op1->ops.Not(exp, op1);
11868 }
11869 break;
11870 }
11871 }
11872 else
11873 {
11874 if(op1 && op2 && op1->type && op2->type && op1->kind != op2->kind)
11875 {
11876 if(Promote(op2, op1->kind, op1->type->isSigned))
11877 op2->kind = op1->kind, op2->ops = op1->ops;
11878 else if(Promote(op1, op2->kind, op2->type->isSigned))
11879 op1->kind = op2->kind, op1->ops = op2->ops;
11880 }
11881 switch(exp->__anon1.op.op)
11882 {
11883 case '+':
11884 if(op1->ops.Add)
11885 {
11886 FreeExpContents(exp);
11887 op1->ops.Add(exp, op1, op2);
11888 }
11889 break;
11890 case '-':
11891 if(op1->ops.Sub)
11892 {
11893 FreeExpContents(exp);
11894 op1->ops.Sub(exp, op1, op2);
11895 }
11896 break;
11897 case '*':
11898 if(op1->ops.Mul)
11899 {
11900 FreeExpContents(exp);
11901 op1->ops.Mul(exp, op1, op2);
11902 }
11903 break;
11904 case '/':
11905 if(op1->ops.Div)
11906 {
11907 FreeExpContents(exp);
11908 op1->ops.Div(exp, op1, op2);
11909 }
11910 break;
11911 case '%':
11912 if(op1->ops.Mod)
11913 {
11914 FreeExpContents(exp);
11915 op1->ops.Mod(exp, op1, op2);
11916 }
11917 break;
11918 case '&':
11919 if(exp->__anon1.op.exp2)
11920 {
11921 if(op1->ops.BitAnd)
11922 {
11923 FreeExpContents(exp);
11924 op1->ops.BitAnd(exp, op1, op2);
11925 }
11926 }
11927 break;
11928 case '|':
11929 if(op1->ops.BitOr)
11930 {
11931 FreeExpContents(exp);
11932 op1->ops.BitOr(exp, op1, op2);
11933 }
11934 break;
11935 case '^':
11936 if(op1->ops.BitXor)
11937 {
11938 FreeExpContents(exp);
11939 op1->ops.BitXor(exp, op1, op2);
11940 }
11941 break;
11942 case LEFT_OP:
11943 if(op1->ops.LShift)
11944 {
11945 FreeExpContents(exp);
11946 op1->ops.LShift(exp, op1, op2);
11947 }
11948 break;
11949 case RIGHT_OP:
11950 if(op1->ops.RShift)
11951 {
11952 FreeExpContents(exp);
11953 op1->ops.RShift(exp, op1, op2);
11954 }
11955 break;
11956 case EQ_OP:
11957 if(op1->ops.Equ)
11958 {
11959 FreeExpContents(exp);
11960 op1->ops.Equ(exp, op1, op2);
11961 }
11962 break;
11963 case NE_OP:
11964 if(op1->ops.Nqu)
11965 {
11966 FreeExpContents(exp);
11967 op1->ops.Nqu(exp, op1, op2);
11968 }
11969 break;
11970 case AND_OP:
11971 if(op1->ops.And)
11972 {
11973 FreeExpContents(exp);
11974 op1->ops.And(exp, op1, op2);
11975 }
11976 break;
11977 case OR_OP:
11978 if(op1->ops.Or)
11979 {
11980 FreeExpContents(exp);
11981 op1->ops.Or(exp, op1, op2);
11982 }
11983 break;
11984 case '>':
11985 if(op1->ops.Grt)
11986 {
11987 FreeExpContents(exp);
11988 op1->ops.Grt(exp, op1, op2);
11989 }
11990 break;
11991 case '<':
11992 if(op1->ops.Sma)
11993 {
11994 FreeExpContents(exp);
11995 op1->ops.Sma(exp, op1, op2);
11996 }
11997 break;
11998 case GE_OP:
11999 if(op1->ops.GrtEqu)
12000 {
12001 FreeExpContents(exp);
12002 op1->ops.GrtEqu(exp, op1, op2);
12003 }
12004 break;
12005 case LE_OP:
12006 if(op1->ops.SmaEqu)
12007 {
12008 FreeExpContents(exp);
12009 op1->ops.SmaEqu(exp, op1, op2);
12010 }
12011 break;
12012 }
12013 }
12014 }
12015 }
12016
12017 void PrintTypeNoConst(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
12018
12019 extern struct Expression * MkExpIdentifier(struct Identifier * id);
12020
12021 void ComputeExpression(struct Expression * exp)
12022 {
12023 switch(exp->type)
12024 {
12025 case 1:
12026 {
12027 ComputeInstantiation(exp);
12028 break;
12029 }
12030 case 4:
12031 {
12032 struct Expression * exp1, * exp2 = (((void *)0));
12033 struct Operand op1 =
12034 {
12035 0, 0, 0,
12036 .__anon1 = {
12037 .c = 0
12038 },
12039 {
12040 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12041 }
12042 };
12043 struct Operand op2 =
12044 {
12045 0, 0, 0,
12046 .__anon1 = {
12047 .c = 0
12048 },
12049 {
12050 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12051 }
12052 };
12053
12054 if(exp->__anon1.op.exp2)
12055 {
12056 struct Expression * e = exp->__anon1.op.exp2;
12057
12058 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
12059 {
12060 if(e->type == 5 || e->type == 32 || e->type == 23)
12061 {
12062 if(e->type == 23)
12063 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
12064 else
12065 e = (*e->__anon1.list).last;
12066 }
12067 }
12068 if(exp->__anon1.op.op == 261 && e && e->expType)
12069 {
12070 if(e->type == 3 && e->__anon1.__anon2.string)
12071 {
12072 char * string = e->__anon1.__anon2.string;
12073 int len = strlen(string);
12074 char * tmp = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (len - 2 + 1));
12075
12076 len = UnescapeString(tmp, string + 1, len - 2);
12077 (__ecereNameSpace__ecere__com__eSystem_Delete(tmp), tmp = 0);
12078 FreeExpContents(exp);
12079 exp->type = 2;
12080 exp->__anon1.__anon1.constant = PrintUInt(len + 1);
12081 }
12082 else
12083 {
12084 struct Type * type = e->expType;
12085
12086 type->refCount++;
12087 FreeExpContents(exp);
12088 exp->type = 2;
12089 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(type));
12090 FreeType(type);
12091 }
12092 break;
12093 }
12094 else
12095 ComputeExpression(exp->__anon1.op.exp2);
12096 }
12097 if(exp->__anon1.op.exp1)
12098 {
12099 ComputeExpression(exp->__anon1.op.exp1);
12100 exp1 = exp->__anon1.op.exp1;
12101 exp2 = exp->__anon1.op.exp2;
12102 op1 = GetOperand(exp1);
12103 if(op1.type)
12104 op1.type->refCount++;
12105 if(exp2)
12106 {
12107 op2 = GetOperand(exp2);
12108 if(op2.type)
12109 op2.type->refCount++;
12110 }
12111 }
12112 else
12113 {
12114 exp1 = exp->__anon1.op.exp2;
12115 op1 = GetOperand(exp1);
12116 if(op1.type)
12117 op1.type->refCount++;
12118 }
12119 CallOperator(exp, exp1, exp2, &op1, &op2);
12120 if(op1.type)
12121 FreeType(op1.type);
12122 if(op2.type)
12123 FreeType(op2.type);
12124 break;
12125 }
12126 case 5:
12127 case 32:
12128 {
12129 struct Expression * e, * n;
12130
12131 for(e = (*exp->__anon1.list).first; e; e = n)
12132 {
12133 n = e->next;
12134 if(!n)
12135 {
12136 struct __ecereNameSpace__ecere__sys__OldList * list = exp->__anon1.list;
12137 struct Expression * prev = exp->prev;
12138 struct Expression * next = exp->next;
12139
12140 ComputeExpression(e);
12141 FreeType(exp->expType);
12142 FreeType(exp->destType);
12143 *exp = *e;
12144 exp->prev = prev;
12145 exp->next = next;
12146 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
12147 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
12148 }
12149 else
12150 {
12151 FreeExpression(e);
12152 }
12153 }
12154 break;
12155 }
12156 case 8:
12157 {
12158 struct Expression * memberExp = exp->__anon1.member.exp;
12159 struct Identifier * memberID = exp->__anon1.member.member;
12160 struct Type * type;
12161
12162 ComputeExpression(exp->__anon1.member.exp);
12163 type = exp->__anon1.member.exp->expType;
12164 if(type)
12165 {
12166 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)));
12167 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
12168 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
12169 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
12170
12171 if(type->kind == 19 && exp->__anon1.member.exp->type == 24)
12172 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
12173 if(!_class)
12174 {
12175 char string[256];
12176 struct Symbol * classSym;
12177
12178 string[0] = '\0';
12179 PrintTypeNoConst(type, string, 0, 1);
12180 classSym = FindClass(string);
12181 _class = classSym ? classSym->__anon1.registered : (((void *)0));
12182 }
12183 if(exp->__anon1.member.member)
12184 {
12185 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->__anon1.member.member->string, privateModule);
12186 if(!prop)
12187 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->__anon1.member.member->string, privateModule, (((void *)0)), (((void *)0)));
12188 }
12189 if(!prop && !member && _class && exp->__anon1.member.member)
12190 {
12191 struct Symbol * classSym = FindClass(exp->__anon1.member.member->string);
12192
12193 convertTo = _class;
12194 _class = classSym ? classSym->__anon1.registered : (((void *)0));
12195 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
12196 }
12197 if(prop)
12198 {
12199 if(prop->compiled)
12200 {
12201 struct Type * type = prop->dataType;
12202
12203 if(_class->type == 3)
12204 {
12205 if(type->kind == 8)
12206 {
12207 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12208
12209 if(_class->type == 3)
12210 {
12211 if(!_class->dataType)
12212 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
12213 type = _class->dataType;
12214 }
12215 }
12216 switch(type->kind)
12217 {
12218 case 6:
12219 {
12220 float value;
12221 float (* Get)(float) = (void *)prop->Get;
12222
12223 GetFloat(exp->__anon1.member.exp, &value);
12224 exp->__anon1.__anon1.constant = PrintFloat(Get ? Get(value) : value);
12225 exp->type = 2;
12226 break;
12227 }
12228 case 7:
12229 {
12230 double value;
12231 double (* Get)(double);
12232
12233 GetDouble(exp->__anon1.member.exp, &value);
12234 if(convertTo)
12235 Get = (void *)prop->Set;
12236 else
12237 Get = (void *)prop->Get;
12238 exp->__anon1.__anon1.constant = PrintDouble(Get ? Get(value) : value);
12239 exp->type = 2;
12240 break;
12241 }
12242 }
12243 }
12244 else
12245 {
12246 if(convertTo)
12247 {
12248 struct Expression * value = exp->__anon1.member.exp;
12249 struct Type * type;
12250
12251 if(!prop->dataType)
12252 ProcessPropertyType(prop);
12253 type = prop->dataType;
12254 if(!type)
12255 {
12256 }
12257 else if(_class->type == 1)
12258 {
12259 switch(type->kind)
12260 {
12261 case 8:
12262 {
12263 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->__anon1._class->__anon1.registered;
12264
12265 if(propertyClass->type == 1 && value->type == 1)
12266 {
12267 void (* Set)(void *, void *) = (void *)prop->Set;
12268
12269 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12270 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12271 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12272 exp->__anon1.instance->loc = exp->loc;
12273 exp->type = 1;
12274 Set(exp->__anon1.instance->data, value->__anon1.instance->data);
12275 PopulateInstance(exp->__anon1.instance);
12276 }
12277 break;
12278 }
12279 case 3:
12280 {
12281 int intValue;
12282 void (* Set)(void *, int) = (void *)prop->Set;
12283
12284 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12285 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12286 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12287 exp->__anon1.instance->loc = exp->loc;
12288 exp->type = 1;
12289 GetInt(value, &intValue);
12290 Set(exp->__anon1.instance->data, intValue);
12291 PopulateInstance(exp->__anon1.instance);
12292 break;
12293 }
12294 case 4:
12295 {
12296 long long intValue;
12297 void (* Set)(void *, long long) = (void *)prop->Set;
12298
12299 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12300 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12301 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12302 exp->__anon1.instance->loc = exp->loc;
12303 exp->type = 1;
12304 GetInt64(value, &intValue);
12305 Set(exp->__anon1.instance->data, intValue);
12306 PopulateInstance(exp->__anon1.instance);
12307 break;
12308 }
12309 case 22:
12310 {
12311 intptr_t intValue;
12312 void (* Set)(void *, intptr_t) = (void *)prop->Set;
12313
12314 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12315 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12316 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12317 exp->__anon1.instance->loc = exp->loc;
12318 exp->type = 1;
12319 GetIntPtr(value, &intValue);
12320 Set(exp->__anon1.instance->data, intValue);
12321 PopulateInstance(exp->__anon1.instance);
12322 break;
12323 }
12324 case 23:
12325 {
12326 ssize_t intValue;
12327 void (* Set)(void *, ssize_t) = (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 GetIntSize(value, &intValue);
12335 Set(exp->__anon1.instance->data, intValue);
12336 PopulateInstance(exp->__anon1.instance);
12337 break;
12338 }
12339 case 6:
12340 {
12341 float floatValue;
12342 void (* Set)(void *, float) = (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 GetFloat(value, &floatValue);
12350 Set(exp->__anon1.instance->data, floatValue);
12351 PopulateInstance(exp->__anon1.instance);
12352 break;
12353 }
12354 case 7:
12355 {
12356 double doubleValue;
12357 void (* Set)(void *, double) = (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 GetDouble(value, &doubleValue);
12365 Set(exp->__anon1.instance->data, doubleValue);
12366 PopulateInstance(exp->__anon1.instance);
12367 break;
12368 }
12369 }
12370 }
12371 else if(_class->type == 2)
12372 {
12373 switch(type->kind)
12374 {
12375 case 8:
12376 {
12377 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->__anon1._class->__anon1.registered;
12378
12379 if(propertyClass->type == 1 && value->__anon1.instance->data)
12380 {
12381 unsigned int (* Set)(void *) = (void *)prop->Set;
12382 unsigned int bits = Set(value->__anon1.instance->data);
12383
12384 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
12385 exp->type = 2;
12386 break;
12387 }
12388 else if(_class->type == 2)
12389 {
12390 unsigned int value;
12391 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
12392 unsigned int bits;
12393
12394 GetUInt(exp->__anon1.member.exp, &value);
12395 bits = Set(value);
12396 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
12397 exp->type = 2;
12398 }
12399 }
12400 }
12401 }
12402 }
12403 else
12404 {
12405 if(_class->type == 2)
12406 {
12407 unsigned int value;
12408
12409 GetUInt(exp->__anon1.member.exp, &value);
12410 switch(type->kind)
12411 {
12412 case 8:
12413 {
12414 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12415
12416 if(_class->type == 1)
12417 {
12418 void (* Get)(unsigned int, void *) = (void *)prop->Get;
12419
12420 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12421 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12422 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12423 exp->__anon1.instance->loc = exp->loc;
12424 exp->type = 1;
12425 Get(value, exp->__anon1.instance->data);
12426 PopulateInstance(exp->__anon1.instance);
12427 }
12428 else if(_class->type == 2)
12429 {
12430 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
12431 uint64 bits = Get(value);
12432
12433 exp->__anon1.__anon1.constant = PrintHexUInt64(bits);
12434 exp->type = 2;
12435 }
12436 break;
12437 }
12438 }
12439 }
12440 else if(_class->type == 1)
12441 {
12442 unsigned char * value = (exp->__anon1.member.exp->type == 1) ? exp->__anon1.member.exp->__anon1.instance->data : (((void *)0));
12443
12444 switch(type->kind)
12445 {
12446 case 8:
12447 {
12448 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12449
12450 if(_class->type == 1 && value)
12451 {
12452 void (* Get)(void *, void *) = (void *)prop->Get;
12453
12454 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12455 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12456 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12457 exp->__anon1.instance->loc = exp->loc;
12458 exp->type = 1;
12459 Get(value, exp->__anon1.instance->data);
12460 PopulateInstance(exp->__anon1.instance);
12461 }
12462 break;
12463 }
12464 }
12465 }
12466 }
12467 }
12468 }
12469 else
12470 {
12471 exp->isConstant = 0;
12472 }
12473 }
12474 else if(member)
12475 {
12476 }
12477 }
12478 if(exp->type != 8)
12479 {
12480 FreeExpression(memberExp);
12481 FreeIdentifier(memberID);
12482 }
12483 break;
12484 }
12485 case 10:
12486 {
12487 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
12488
12489 FreeExpContents(exp);
12490 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(type));
12491 exp->type = 2;
12492 FreeType(type);
12493 break;
12494 }
12495 case 15:
12496 {
12497 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
12498
12499 if(classSym && classSym->__anon1.registered)
12500 {
12501 if(classSym->__anon1.registered->fixed)
12502 {
12503 FreeSpecifier(exp->__anon1._class);
12504 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
12505 exp->type = 2;
12506 }
12507 else
12508 {
12509 char className[1024];
12510
12511 strcpy(className, "__ecereClass_");
12512 FullClassNameCat(className, classSym->string, 1);
12513 DeclareClass(classSym, className);
12514 FreeExpContents(exp);
12515 exp->type = 9;
12516 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
12517 exp->__anon1.member.member = MkIdentifier("structSize");
12518 }
12519 }
12520 break;
12521 }
12522 case 11:
12523 {
12524 struct Type * type;
12525 struct Expression * e = exp;
12526
12527 if(exp->type == 11)
12528 {
12529 if(exp->__anon1.cast.exp)
12530 ComputeExpression(exp->__anon1.cast.exp);
12531 e = exp->__anon1.cast.exp;
12532 }
12533 if(e && exp->expType)
12534 {
12535 type = exp->expType;
12536 if(type->kind == 8)
12537 {
12538 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12539
12540 if(_class && (_class->type == 3 || _class->type == 2))
12541 {
12542 if(!_class->dataType)
12543 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
12544 type = _class->dataType;
12545 }
12546 }
12547 switch(type->kind)
12548 {
12549 case 24:
12550 case 1:
12551 if(type->isSigned)
12552 {
12553 char value = (char)0;
12554
12555 if(GetChar(e, &value))
12556 {
12557 FreeExpContents(exp);
12558 exp->__anon1.__anon1.constant = PrintChar(value);
12559 exp->type = 2;
12560 }
12561 }
12562 else
12563 {
12564 unsigned char value = (unsigned char)0;
12565
12566 if(GetUChar(e, &value))
12567 {
12568 FreeExpContents(exp);
12569 exp->__anon1.__anon1.constant = PrintUChar(value);
12570 exp->type = 2;
12571 }
12572 }
12573 break;
12574 case 2:
12575 if(type->isSigned)
12576 {
12577 short value = (short)0;
12578
12579 if(GetShort(e, &value))
12580 {
12581 FreeExpContents(exp);
12582 exp->__anon1.__anon1.constant = PrintShort(value);
12583 exp->type = 2;
12584 }
12585 }
12586 else
12587 {
12588 unsigned short value = (unsigned short)0;
12589
12590 if(GetUShort(e, &value))
12591 {
12592 FreeExpContents(exp);
12593 exp->__anon1.__anon1.constant = PrintUShort(value);
12594 exp->type = 2;
12595 }
12596 }
12597 break;
12598 case 3:
12599 if(type->isSigned)
12600 {
12601 int value = 0;
12602
12603 if(GetInt(e, &value))
12604 {
12605 FreeExpContents(exp);
12606 exp->__anon1.__anon1.constant = PrintInt(value);
12607 exp->type = 2;
12608 }
12609 }
12610 else
12611 {
12612 unsigned int value = 0;
12613
12614 if(GetUInt(e, &value))
12615 {
12616 FreeExpContents(exp);
12617 exp->__anon1.__anon1.constant = PrintUInt(value);
12618 exp->type = 2;
12619 }
12620 }
12621 break;
12622 case 4:
12623 if(type->isSigned)
12624 {
12625 long long value = 0;
12626
12627 if(GetInt64(e, &value))
12628 {
12629 FreeExpContents(exp);
12630 exp->__anon1.__anon1.constant = PrintInt64(value);
12631 exp->type = 2;
12632 }
12633 }
12634 else
12635 {
12636 uint64 value = 0;
12637
12638 if(GetUInt64(e, &value))
12639 {
12640 FreeExpContents(exp);
12641 exp->__anon1.__anon1.constant = PrintUInt64(value);
12642 exp->type = 2;
12643 }
12644 }
12645 break;
12646 case 22:
12647 if(type->isSigned)
12648 {
12649 intptr_t value = 0;
12650
12651 if(GetIntPtr(e, &value))
12652 {
12653 FreeExpContents(exp);
12654 exp->__anon1.__anon1.constant = PrintInt64((long long)value);
12655 exp->type = 2;
12656 }
12657 }
12658 else
12659 {
12660 uintptr_t value = 0;
12661
12662 if(GetUIntPtr(e, &value))
12663 {
12664 FreeExpContents(exp);
12665 exp->__anon1.__anon1.constant = PrintUInt64((uint64)value);
12666 exp->type = 2;
12667 }
12668 }
12669 break;
12670 case 23:
12671 if(type->isSigned)
12672 {
12673 ssize_t value = 0;
12674
12675 if(GetIntSize(e, &value))
12676 {
12677 FreeExpContents(exp);
12678 exp->__anon1.__anon1.constant = PrintInt64((long long)value);
12679 exp->type = 2;
12680 }
12681 }
12682 else
12683 {
12684 size_t value = 0;
12685
12686 if(GetUIntSize(e, &value))
12687 {
12688 FreeExpContents(exp);
12689 exp->__anon1.__anon1.constant = PrintUInt64((uint64)value);
12690 exp->type = 2;
12691 }
12692 }
12693 break;
12694 case 6:
12695 {
12696 float value = 0;
12697
12698 if(GetFloat(e, &value))
12699 {
12700 FreeExpContents(exp);
12701 exp->__anon1.__anon1.constant = PrintFloat(value);
12702 exp->type = 2;
12703 }
12704 break;
12705 }
12706 case 7:
12707 {
12708 double value = 0;
12709
12710 if(GetDouble(e, &value))
12711 {
12712 FreeExpContents(exp);
12713 exp->__anon1.__anon1.constant = PrintDouble(value);
12714 exp->type = 2;
12715 }
12716 break;
12717 }
12718 }
12719 }
12720 break;
12721 }
12722 case 12:
12723 {
12724 struct Operand op1 =
12725 {
12726 0, 0, 0,
12727 .__anon1 = {
12728 .c = 0
12729 },
12730 {
12731 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12732 }
12733 };
12734 struct Operand op2 =
12735 {
12736 0, 0, 0,
12737 .__anon1 = {
12738 .c = 0
12739 },
12740 {
12741 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12742 }
12743 };
12744 struct Operand op3 =
12745 {
12746 0, 0, 0,
12747 .__anon1 = {
12748 .c = 0
12749 },
12750 {
12751 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12752 }
12753 };
12754
12755 if(exp->__anon1.cond.exp)
12756 ComputeExpression((*exp->__anon1.cond.exp).last);
12757 if(exp->__anon1.cond.elseExp)
12758 ComputeExpression(exp->__anon1.cond.elseExp);
12759 if(exp->__anon1.cond.cond)
12760 ComputeExpression(exp->__anon1.cond.cond);
12761 op1 = GetOperand(exp->__anon1.cond.cond);
12762 if(op1.type)
12763 op1.type->refCount++;
12764 op2 = GetOperand((*exp->__anon1.cond.exp).last);
12765 if(op2.type)
12766 op2.type->refCount++;
12767 op3 = GetOperand(exp->__anon1.cond.elseExp);
12768 if(op3.type)
12769 op3.type->refCount++;
12770 if(op1.ops.Cond)
12771 {
12772 FreeExpContents(exp);
12773 op1.ops.Cond(exp, &op1, &op2, &op3);
12774 }
12775 if(op1.type)
12776 FreeType(op1.type);
12777 if(op2.type)
12778 FreeType(op2.type);
12779 if(op3.type)
12780 FreeType(op3.type);
12781 break;
12782 }
12783 }
12784 }
12785
12786 void ApplyAnyObjectLogic(struct Expression * e);
12787
12788 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla, unsigned int warnConst)
12789 {
12790 unsigned int result = 1;
12791
12792 if(destType)
12793 {
12794 struct __ecereNameSpace__ecere__sys__OldList converts =
12795 {
12796 0, 0, 0, 0, 0
12797 };
12798 struct Conversion * convert;
12799
12800 if(destType->kind == 0)
12801 return 0;
12802 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla, warnConst))
12803 result = 0;
12804 if(converts.count)
12805 {
12806 for(convert = converts.first; convert; convert = convert->next)
12807 {
12808 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
12809
12810 if(!empty)
12811 {
12812 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12813 int objectType = exp->expType ? exp->expType->classObjectType : 0;
12814
12815 *newExp = *exp;
12816 newExp->prev = (((void *)0));
12817 newExp->next = (((void *)0));
12818 newExp->destType = (((void *)0));
12819 if(convert->isGet)
12820 {
12821 exp->type = 8;
12822 exp->addedThis = 1;
12823 exp->__anon1.member.exp = newExp;
12824 FreeType(exp->__anon1.member.exp->expType);
12825 exp->__anon1.member.exp->expType = MkClassType(convert->convert->_class->fullName);
12826 exp->__anon1.member.exp->expType->classObjectType = objectType;
12827 exp->__anon1.member.member = MkIdentifier(convert->convert->dataTypeString);
12828 exp->__anon1.member.memberType = 1;
12829 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12830 exp->needCast = 1;
12831 if(exp->expType)
12832 exp->expType->refCount++;
12833 ApplyAnyObjectLogic(exp->__anon1.member.exp);
12834 }
12835 else
12836 {
12837 {
12838 exp->type = 8;
12839 exp->addedThis = 1;
12840 exp->__anon1.member.exp = newExp;
12841 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)
12842 {
12843 newExp->byReference = 1;
12844 }
12845 FreeType(exp->__anon1.member.exp->expType);
12846 exp->__anon1.member.exp->expType = (((void *)0));
12847 if(convert->convert->dataType)
12848 {
12849 exp->__anon1.member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12850 CopyTypeInto(exp->__anon1.member.exp->expType, convert->convert->dataType);
12851 exp->__anon1.member.exp->expType->refCount = 1;
12852 exp->__anon1.member.exp->expType->classObjectType = objectType;
12853 ApplyAnyObjectLogic(exp->__anon1.member.exp);
12854 }
12855 exp->__anon1.member.member = MkIdentifier(convert->convert->_class->fullName);
12856 exp->__anon1.member.memberType = 4;
12857 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12858 exp->needCast = 1;
12859 if(convert->resultType)
12860 convert->resultType->refCount++;
12861 }
12862 }
12863 }
12864 else
12865 {
12866 FreeType(exp->expType);
12867 if(convert->isGet)
12868 {
12869 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12870 if(exp->destType->casted)
12871 exp->needCast = 1;
12872 if(exp->expType)
12873 exp->expType->refCount++;
12874 }
12875 else
12876 {
12877 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12878 if(exp->destType->casted)
12879 exp->needCast = 1;
12880 if(convert->resultType)
12881 convert->resultType->refCount++;
12882 }
12883 }
12884 }
12885 if(exp->isConstant && inCompiler)
12886 ComputeExpression(exp);
12887 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
12888 }
12889 if(!result && exp->expType && converts.count)
12890 {
12891 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
12892 }
12893 if(!result && exp->expType && exp->destType)
12894 {
12895 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))
12896 result = 1;
12897 }
12898 }
12899 return result;
12900 }
12901
12902 extern struct Expression * GetNonBracketsExp(struct Expression * exp);
12903
12904 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
12905
12906 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
12907
12908 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
12909
12910 void CheckTemplateTypes(struct Expression * exp)
12911 {
12912 struct Expression * nbExp = GetNonBracketsExp(exp);
12913
12914 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate && (nbExp == exp || nbExp->type != 11))
12915 {
12916 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12917 struct Context * context;
12918
12919 *newExp = *exp;
12920 if(exp->destType)
12921 exp->destType->refCount++;
12922 if(exp->expType)
12923 exp->expType->refCount++;
12924 newExp->prev = (((void *)0));
12925 newExp->next = (((void *)0));
12926 switch(exp->expType->kind)
12927 {
12928 case 7:
12929 if(exp->destType->classObjectType)
12930 {
12931 if(exp->destType)
12932 exp->destType->refCount--;
12933 if(exp->expType)
12934 exp->expType->refCount--;
12935 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12936 }
12937 else
12938 {
12939 struct __ecereNameSpace__ecere__sys__OldList * specs;
12940 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12941 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12942
12943 context = PushContext();
12944 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12945 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12946 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12947 exp->type = 23;
12948 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12949 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
12950 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
12951 exp->__anon1.compound->__anon1.compound.context = context;
12952 PopContext(context);
12953 }
12954 break;
12955 default:
12956 exp->type = 11;
12957 exp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
12958 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
12959 exp->needCast = 1;
12960 break;
12961 }
12962 }
12963 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
12964 {
12965 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12966 struct Context * context;
12967
12968 *newExp = *exp;
12969 if(exp->destType)
12970 exp->destType->refCount++;
12971 if(exp->expType)
12972 exp->expType->refCount++;
12973 newExp->prev = (((void *)0));
12974 newExp->next = (((void *)0));
12975 switch(exp->expType->kind)
12976 {
12977 case 7:
12978 if(exp->destType->classObjectType)
12979 {
12980 if(exp->destType)
12981 exp->destType->refCount--;
12982 if(exp->expType)
12983 exp->expType->refCount--;
12984 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12985 }
12986 else
12987 {
12988 struct __ecereNameSpace__ecere__sys__OldList * specs;
12989 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12990 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12991
12992 context = PushContext();
12993 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12994 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12995 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12996 exp->type = 23;
12997 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12998 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
12999 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
13000 exp->__anon1.compound->__anon1.compound.context = context;
13001 PopContext(context);
13002 }
13003 break;
13004 case 8:
13005 {
13006 if(exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->type == 1)
13007 {
13008 exp->type = 5;
13009 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)));
13010 ProcessExpressionType((*exp->__anon1.list).first);
13011 break;
13012 }
13013 else
13014 {
13015 exp->type = 5;
13016 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->__anon1._class->string)), (((void *)0))), newExp));
13017 exp->needTemplateCast = 2;
13018 newExp->needCast = 1;
13019 newExp->needTemplateCast = 2;
13020 ProcessExpressionType((*exp->__anon1.list).first);
13021 break;
13022 }
13023 }
13024 default:
13025 {
13026 if(exp->expType->kind == 20)
13027 {
13028 struct Type * type = ProcessTemplateParameterType(exp->expType->__anon1.templateParameter);
13029
13030 if(type)
13031 {
13032 FreeType(exp->destType);
13033 FreeType(exp->expType);
13034 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13035 break;
13036 }
13037 }
13038 if(newExp->type == 8 && newExp->__anon1.member.memberType == 3)
13039 {
13040 exp->type = 4;
13041 exp->__anon1.op.op = '*';
13042 exp->__anon1.op.exp1 = (((void *)0));
13043 exp->__anon1.op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
13044 }
13045 else
13046 {
13047 char typeString[1024];
13048 struct Declarator * decl;
13049 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13050
13051 typeString[0] = '\0';
13052 PrintType(exp->expType, typeString, 0, 0);
13053 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13054 exp->type = 11;
13055 exp->__anon1.cast.typeName = MkTypeName(specs, decl);
13056 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
13057 exp->__anon1.cast.exp->needCast = 1;
13058 }
13059 break;
13060 }
13061 }
13062 }
13063 }
13064
13065 extern int strncmp(const char * , const char * , size_t n);
13066
13067 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char *  key);
13068
13069 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * nameSpace, const char * name)
13070 {
13071 int nsLen = strlen(nameSpace);
13072 struct Symbol * symbol;
13073
13074 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)))
13075 {
13076 char * s = symbol->string;
13077
13078 if(!strncmp(s, nameSpace, nsLen))
13079 {
13080 int c;
13081 char * namePart;
13082
13083 for(c = strlen(s) - 1; c >= 0; c--)
13084 if(s[c] == ':')
13085 break;
13086 namePart = s + c + 1;
13087 if(!strcmp(namePart, name))
13088 {
13089 return symbol;
13090 }
13091 }
13092 else
13093 break;
13094 }
13095 return (((void *)0));
13096 }
13097
13098 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * name)
13099 {
13100 int c;
13101 char nameSpace[1024];
13102 const char * namePart;
13103 unsigned int gotColon = 0;
13104
13105 nameSpace[0] = '\0';
13106 for(c = strlen(name) - 1; c >= 0; c--)
13107 if(name[c] == ':')
13108 {
13109 gotColon = 1;
13110 break;
13111 }
13112 namePart = name + c + 1;
13113 while(c >= 0 && name[c] == ':')
13114 c--;
13115 if(c >= 0)
13116 {
13117 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
13118
13119 if(symbol)
13120 return symbol;
13121 memcpy(nameSpace, name, c + 1);
13122 nameSpace[c + 1] = (char)0;
13123 return ScanWithNameSpace(tree, nameSpace, namePart);
13124 }
13125 else if(gotColon)
13126 {
13127 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
13128
13129 return symbol;
13130 }
13131 else
13132 {
13133 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
13134
13135 if(symbol)
13136 return symbol;
13137 return ScanWithNameSpace(tree, "", namePart);
13138 }
13139 return (((void *)0));
13140 }
13141
13142 static void ProcessDeclaration(struct Declaration * decl);
13143
13144 struct Symbol * FindSymbol(const char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
13145 {
13146 struct Context * ctx;
13147 struct Symbol * symbol = (((void *)0));
13148
13149 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
13150 {
13151 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
13152 {
13153 symbol = (((void *)0));
13154 if(thisNameSpace)
13155 {
13156 char curName[1024];
13157
13158 strcpy(curName, thisNameSpace);
13159 strcat(curName, "::");
13160 strcat(curName, name);
13161 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
13162 }
13163 if(!symbol)
13164 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
13165 }
13166 else
13167 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
13168 if(symbol || ctx == endContext)
13169 break;
13170 }
13171 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->__anon2.__anon1.pointerExternal)
13172 {
13173 if(symbol->__anon2.__anon1.pointerExternal->type == 0)
13174 {
13175 struct FunctionDefinition * function = symbol->__anon2.__anon1.pointerExternal->__anon1.function;
13176 struct Context * tmpContext = curContext;
13177
13178 curContext = (((void *)0));
13179 symbol->__anon2.__anon1.pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
13180 curContext = tmpContext;
13181 symbol->__anon2.__anon1.pointerExternal->symbol = symbol;
13182 DeclareType(symbol->type, 1, 1);
13183 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->__anon2.__anon1.pointerExternal);
13184 symbol->id = curExternal->symbol->idCode;
13185 }
13186 else if(symbol->__anon2.__anon1.pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->__anon2.__anon1.pointerExternal->symbol->id)
13187 {
13188 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon1.pointerExternal, curExternal->prev);
13189 symbol->id = curExternal->symbol->idCode;
13190 }
13191 }
13192 return symbol;
13193 }
13194
13195 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
13196 {
13197 if(!type->isSigned && type->kind != 22 && type->kind != 23)
13198 ListAdd(specs, MkSpecifier(UNSIGNED));
13199 switch(type->kind)
13200 {
13201 case 8:
13202 {
13203 if(type->__anon1._class->__anon1.registered)
13204 {
13205 if(!type->__anon1._class->__anon1.registered->dataType)
13206 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
13207 GetTypeSpecs(type->__anon1._class->__anon1.registered->dataType, specs);
13208 }
13209 break;
13210 }
13211 case 7:
13212 ListAdd(specs, MkSpecifier(DOUBLE));
13213 break;
13214 case 6:
13215 ListAdd(specs, MkSpecifier(FLOAT));
13216 break;
13217 case 1:
13218 ListAdd(specs, MkSpecifier(CHAR));
13219 break;
13220 case 24:
13221 ListAdd(specs, MkSpecifier(_BOOL));
13222 break;
13223 case 2:
13224 ListAdd(specs, MkSpecifier(SHORT));
13225 break;
13226 case 4:
13227 ListAdd(specs, MkSpecifier(INT64));
13228 break;
13229 case 22:
13230 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
13231 break;
13232 case 23:
13233 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
13234 break;
13235 case 3:
13236 default:
13237 ListAdd(specs, MkSpecifier(INT));
13238 break;
13239 }
13240 }
13241
13242 static void PrintArraySize(struct Type * arrayType, char * string)
13243 {
13244 char size[256];
13245
13246 size[0] = '\0';
13247 strcat(size, "[");
13248 if(arrayType->__anon1.__anon4.enumClass)
13249 strcat(size, arrayType->__anon1.__anon4.enumClass->string);
13250 else if(arrayType->__anon1.__anon4.arraySizeExp)
13251 PrintExpression(arrayType->__anon1.__anon4.arraySizeExp, size);
13252 strcat(size, "]");
13253 strcat(string, size);
13254 }
13255
13256 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
13257 {
13258 if(type)
13259 {
13260 if(printConst && type->constant)
13261 strcat(string, "const ");
13262 switch(type->kind)
13263 {
13264 case 8:
13265 {
13266 struct Symbol * c = type->__anon1._class;
13267
13268 if(type->classObjectType == 2)
13269 strcat(string, "typed_object");
13270 else if(type->classObjectType == 3)
13271 strcat(string, "any_object");
13272 else
13273 {
13274 if(c && c->string)
13275 strcat(string, (fullName || !c->__anon1.registered) ? c->string : c->__anon1.registered->name);
13276 }
13277 if(type->byReference)
13278 strcat(string, " &");
13279 break;
13280 }
13281 case 0:
13282 strcat(string, "void");
13283 break;
13284 case 3:
13285 strcat(string, type->isSigned ? "int" : "uint");
13286 break;
13287 case 4:
13288 strcat(string, type->isSigned ? "int64" : "uint64");
13289 break;
13290 case 22:
13291 strcat(string, type->isSigned ? "intptr" : "uintptr");
13292 break;
13293 case 23:
13294 strcat(string, type->isSigned ? "intsize" : "uintsize");
13295 break;
13296 case 1:
13297 strcat(string, type->isSigned ? "char" : "byte");
13298 break;
13299 case 24:
13300 strcat(string, "_Bool");
13301 break;
13302 case 2:
13303 strcat(string, type->isSigned ? "short" : "uint16");
13304 break;
13305 case 6:
13306 strcat(string, "float");
13307 break;
13308 case 7:
13309 strcat(string, "double");
13310 break;
13311 case 9:
13312 if(type->__anon1.__anon1.enumName)
13313 {
13314 strcat(string, "struct ");
13315 strcat(string, type->__anon1.__anon1.enumName);
13316 }
13317 else if(type->typeName)
13318 strcat(string, type->typeName);
13319 else
13320 {
13321 struct Type * member;
13322
13323 strcat(string, "struct { ");
13324 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
13325 {
13326 PrintType(member, string, 1, fullName);
13327 strcat(string, "; ");
13328 }
13329 strcat(string, "}");
13330 }
13331 break;
13332 case 10:
13333 if(type->__anon1.__anon1.enumName)
13334 {
13335 strcat(string, "union ");
13336 strcat(string, type->__anon1.__anon1.enumName);
13337 }
13338 else if(type->typeName)
13339 strcat(string, type->typeName);
13340 else
13341 {
13342 strcat(string, "union ");
13343 strcat(string, "(unnamed)");
13344 }
13345 break;
13346 case 15:
13347 if(type->__anon1.__anon1.enumName)
13348 {
13349 strcat(string, "enum ");
13350 strcat(string, type->__anon1.__anon1.enumName);
13351 }
13352 else if(type->typeName)
13353 strcat(string, type->typeName);
13354 else
13355 strcat(string, "int");
13356 break;
13357 case 14:
13358 strcat(string, "...");
13359 break;
13360 case 19:
13361 strcat(string, "subclass(");
13362 strcat(string, type->__anon1._class ? type->__anon1._class->string : "int");
13363 strcat(string, ")");
13364 break;
13365 case 20:
13366 strcat(string, type->__anon1.templateParameter->identifier->string);
13367 break;
13368 case 21:
13369 strcat(string, "thisclass");
13370 break;
13371 case 17:
13372 strcat(string, "__builtin_va_list");
13373 break;
13374 }
13375 }
13376 }
13377
13378 extern char *  __ecereNameSpace__ecere__sys__RSearchString(const char *  buffer, const char *  subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
13379
13380 static void PrintName(struct Type * type, char * string, unsigned int fullName)
13381 {
13382 if(type->name && type->name[0])
13383 {
13384 if(fullName)
13385 strcat(string, type->name);
13386 else
13387 {
13388 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 1, 0);
13389
13390 if(name)
13391 name += 2;
13392 else
13393 name = type->name;
13394 strcat(string, name);
13395 }
13396 }
13397 }
13398
13399 static void PrintAttribs(struct Type * type, char * string)
13400 {
13401 if(type)
13402 {
13403 if(type->dllExport)
13404 strcat(string, "dllexport ");
13405 if(type->attrStdcall)
13406 strcat(string, "stdcall ");
13407 }
13408 }
13409
13410 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
13411 {
13412 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13413 {
13414 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
13415 PrintAttribs(type, string);
13416 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
13417 strcat(string, " const");
13418 PrePrintType(type->kind == 16 ? type->__anon1.__anon3.method->dataType : type->__anon1.type, string, fullName, type, printConst);
13419 if(type->kind == 13 && (type->__anon1.type->kind == 12 || type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16))
13420 strcat(string, " (");
13421 if(type->kind == 13)
13422 {
13423 if(type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16)
13424 PrintAttribs(type->__anon1.type, string);
13425 }
13426 if(type->kind == 13)
13427 {
13428 if(type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16 || type->__anon1.type->kind == 12)
13429 strcat(string, "*");
13430 else
13431 strcat(string, " *");
13432 }
13433 if(printConst && type->constant && type->kind == 13)
13434 strcat(string, " const");
13435 }
13436 else
13437 PrintTypeSpecs(type, string, fullName, printConst);
13438 }
13439
13440 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
13441 {
13442 if(type->kind == 13 && (type->__anon1.type->kind == 12 || type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16))
13443 strcat(string, ")");
13444 if(type->kind == 12)
13445 PrintArraySize(type, string);
13446 else if(type->kind == 11)
13447 {
13448 struct Type * param;
13449
13450 strcat(string, "(");
13451 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
13452 {
13453 PrintType(param, string, 1, fullName);
13454 if(param->next)
13455 strcat(string, ", ");
13456 }
13457 strcat(string, ")");
13458 }
13459 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13460 PostPrintType(type->kind == 16 ? type->__anon1.__anon3.method->dataType : type->__anon1.type, string, fullName);
13461 }
13462
13463 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
13464 {
13465 PrePrintType(type, string, fullName, (((void *)0)), printConst);
13466 if(type->__anon1.__anon2.thisClass || (printName && type->name && type->name[0]))
13467 strcat(string, " ");
13468 if((type->__anon1.__anon2.thisClass || type->__anon1.__anon2.staticMethod))
13469 {
13470 struct Symbol * _class = type->__anon1.__anon2.thisClass;
13471
13472 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
13473 {
13474 if(type->classObjectType == 1)
13475 strcat(string, "class");
13476 else
13477 strcat(string, type->byReference ? "typed_object&" : "typed_object");
13478 }
13479 else if(_class && _class->string)
13480 {
13481 char * s = _class->string;
13482
13483 if(fullName)
13484 strcat(string, s);
13485 else
13486 {
13487 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 1, 0);
13488
13489 if(name)
13490 name += 2;
13491 else
13492 name = s;
13493 strcat(string, name);
13494 }
13495 }
13496 strcat(string, "::");
13497 }
13498 if(printName && type->name)
13499 PrintName(type, string, fullName);
13500 PostPrintType(type, string, fullName);
13501 if(type->bitFieldCount)
13502 {
13503 char count[100];
13504
13505 sprintf(count, ":%d", type->bitFieldCount);
13506 strcat(string, count);
13507 }
13508 }
13509
13510 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13511 {
13512 _PrintType(type, string, printName, fullName, 1);
13513 }
13514
13515 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13516 {
13517 _PrintType(type, string, printName, fullName, 0);
13518 }
13519
13520 static struct Type * FindMember(struct Type * type, char * string)
13521 {
13522 struct Type * memberType;
13523
13524 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
13525 {
13526 if(!memberType->name)
13527 {
13528 struct Type * subType = FindMember(memberType, string);
13529
13530 if(subType)
13531 return subType;
13532 }
13533 else if(!strcmp(memberType->name, string))
13534 return memberType;
13535 }
13536 return (((void *)0));
13537 }
13538
13539 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
13540 {
13541 struct Type * memberType;
13542
13543 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
13544 {
13545 if(!memberType->name)
13546 {
13547 struct Type * subType = FindMember(memberType, string);
13548
13549 if(subType)
13550 {
13551 *offset += memberType->offset;
13552 return subType;
13553 }
13554 }
13555 else if(!strcmp(memberType->name, string))
13556 {
13557 *offset += memberType->offset;
13558 return memberType;
13559 }
13560 }
13561 return (((void *)0));
13562 }
13563
13564 extern unsigned int parseError;
13565
13566 unsigned int GetParseError()
13567 {
13568 return parseError;
13569 }
13570
13571 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
13572
13573 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
13574
13575 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
13576
13577 struct Expression * ParseExpressionString(char * expression)
13578 {
13579 parseError = 0;
13580 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13581 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count))__extension__ ({
13582 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13583
13584 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13585 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
13586 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13587 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13588
13589 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13590 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13591 echoOn = 0;
13592 parsedExpression = (((void *)0));
13593 resetScanner();
13594 expression_yyparse();
13595 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13596 return parsedExpression;
13597 }
13598
13599 extern char *  QMkString(const char *  source);
13600
13601 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
13602 {
13603 struct Identifier * id = exp->__anon1.__anon1.identifier;
13604 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13605 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13606 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13607 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13608
13609 if(_class && _class->type == 4)
13610 {
13611 struct __ecereNameSpace__ecere__sys__NamedLink64 * value = (((void *)0));
13612 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
13613
13614 if(enumClass)
13615 {
13616 struct __ecereNameSpace__ecere__com__Class * baseClass;
13617
13618 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
13619 {
13620 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
13621
13622 for(value = e->values.first; value; value = value->next)
13623 {
13624 if(!strcmp(value->name, id->string))
13625 break;
13626 }
13627 if(value)
13628 {
13629 char constant[256];
13630
13631 FreeExpContents(exp);
13632 exp->type = 2;
13633 exp->isConstant = 1;
13634 if(!strcmp(baseClass->dataTypeString, "int") || !strcmp(baseClass->dataTypeString, "int64") || !strcmp(baseClass->dataTypeString, "char") || !strcmp(baseClass->dataTypeString, "short"))
13635 sprintf(constant, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), value->data);
13636 else
13637 sprintf(constant, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), value->data);
13638 exp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13639 exp->expType = MkClassType(baseClass->fullName);
13640 break;
13641 }
13642 }
13643 }
13644 if(value)
13645 return 1;
13646 }
13647 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
13648 {
13649 ProcessMethodType(method);
13650 exp->expType = __extension__ ({
13651 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13652
13653 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1->__anon1.__anon3.methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
13654 });
13655 return 1;
13656 }
13657 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
13658 {
13659 if(!prop->dataType)
13660 ProcessPropertyType(prop);
13661 exp->expType = prop->dataType;
13662 if(prop->dataType)
13663 prop->dataType->refCount++;
13664 return 1;
13665 }
13666 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
13667 {
13668 if(!member->dataType)
13669 member->dataType = ProcessTypeString(member->dataTypeString, 0);
13670 exp->expType = member->dataType;
13671 if(member->dataType)
13672 member->dataType->refCount++;
13673 return 1;
13674 }
13675 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
13676 {
13677 if(!classProp->dataType)
13678 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0);
13679 if(classProp->constant)
13680 {
13681 FreeExpContents(exp);
13682 exp->isConstant = 1;
13683 if(classProp->dataType->kind == 13 && classProp->dataType->__anon1.type->kind == 1)
13684 {
13685 exp->type = 3;
13686 exp->__anon1.__anon1.constant = QMkString((char *)classProp->Get(_class));
13687 }
13688 else
13689 {
13690 char constant[256];
13691
13692 exp->type = 2;
13693 sprintf(constant, "%d", (int)classProp->Get(_class));
13694 exp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13695 }
13696 }
13697 else
13698 {
13699 }
13700 exp->expType = classProp->dataType;
13701 if(classProp->dataType)
13702 classProp->dataType->refCount++;
13703 return 1;
13704 }
13705 return 0;
13706 }
13707
13708 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
13709 {
13710 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
13711 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
13712 struct __ecereNameSpace__ecere__com__NameSpace * child;
13713
13714 if(!data)
13715 {
13716 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)))
13717 {
13718 data = ScanGlobalData(child, name);
13719 if(data)
13720 break;
13721 }
13722 }
13723 return data;
13724 }
13725
13726 extern struct __ecereNameSpace__ecere__com__NameSpace *  globalData;
13727
13728 extern char *  strncpy(char * , const char * , size_t n);
13729
13730 static struct GlobalData * FindGlobalData(char * name)
13731 {
13732 int start = 0, c;
13733 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13734
13735 nameSpace = globalData;
13736 for(c = 0; name[c]; c++)
13737 {
13738 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
13739 {
13740 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
13741 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
13742
13743 strncpy(spaceName, name + start, c - start);
13744 spaceName[c - start] = '\0';
13745 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
13746 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
13747 if(!newSpace)
13748 return (((void *)0));
13749 nameSpace = newSpace;
13750 if(name[c] == ':')
13751 c++;
13752 start = c + 1;
13753 }
13754 }
13755 if(c - start)
13756 {
13757 return ScanGlobalData(nameSpace, name + start);
13758 }
13759 return (((void *)0));
13760 }
13761
13762 static int definedExpStackPos;
13763
13764 static void * definedExpStack[512];
13765
13766 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
13767 {
13768 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
13769
13770 FreeExpContents(checkedExp);
13771 FreeType(checkedExp->expType);
13772 FreeType(checkedExp->destType);
13773 *checkedExp = *newExp;
13774 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13775 checkedExp->prev = prev;
13776 checkedExp->next = next;
13777 }
13778
13779 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
13780
13781 extern int printf(const char * , ...);
13782
13783 void __ecereMethod_Expression_Clear();
13784
13785 void ApplyAnyObjectLogic(struct Expression * e)
13786 {
13787 struct Type * destType = e->destType;
13788
13789 if(destType && (destType->classObjectType == 3))
13790 {
13791 if(e && e->expType)
13792 {
13793 struct Type * type = e->expType;
13794 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
13795
13796 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
13797 {
13798 _class = type->__anon1._class->__anon1.registered;
13799 }
13800 else if(type->kind == 19)
13801 {
13802 _class = FindClass("ecere::com::Class")->__anon1.registered;
13803 }
13804 else
13805 {
13806 char string[1024] = "";
13807 struct Symbol * classSym;
13808
13809 PrintTypeNoConst(type, string, 0, 1);
13810 classSym = FindClass(string);
13811 if(classSym)
13812 _class = classSym->__anon1.registered;
13813 }
13814 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)))
13815 {
13816 if(!_class || strcmp(_class->fullName, "char *"))
13817 {
13818 struct Expression * checkedExp = e, * newExp;
13819
13820 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->__anon1.list) || checkedExp->type == 11)
13821 {
13822 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13823 {
13824 if(checkedExp->type == 23)
13825 {
13826 checkedExp = (*((struct Statement *)(*checkedExp->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
13827 }
13828 else
13829 checkedExp = (*checkedExp->__anon1.list).last;
13830 }
13831 else if(checkedExp->type == 11)
13832 checkedExp = checkedExp->__anon1.cast.exp;
13833 }
13834 if(checkedExp && checkedExp->type == 4 && checkedExp->__anon1.op.op == '*' && !checkedExp->__anon1.op.exp1)
13835 {
13836 newExp = checkedExp->__anon1.op.exp2;
13837 checkedExp->__anon1.op.exp2 = (((void *)0));
13838 FreeExpContents(checkedExp);
13839 if(e->expType && e->expType->passAsTemplate)
13840 {
13841 char size[100];
13842
13843 ComputeTypeSize(e->expType);
13844 sprintf(size, "%d", e->expType->size);
13845 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))))));
13846 }
13847 ReplaceExpContents(checkedExp, newExp);
13848 e->byReference = 1;
13849 }
13850 else if(!e->byReference || (_class && _class->type == 5))
13851 {
13852 struct Expression * checkedExp;
13853
13854 {
13855 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;
13856
13857 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
13858 {
13859 struct Context * context = PushContext();
13860 struct Declarator * decl;
13861 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13862 char typeString[1024];
13863 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13864
13865 typeString[0] = '\0';
13866 *newExp = *e;
13867 newExp->prev = (((void *)0));
13868 newExp->next = (((void *)0));
13869 newExp->expType = (((void *)0));
13870 PrintTypeNoConst(e->expType, typeString, 0, 1);
13871 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13872 newExp->destType = ProcessType(specs, decl);
13873 curContext = context;
13874 if(curCompound)
13875 {
13876 char name[100];
13877 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
13878
13879 e->type = 23;
13880 sprintf(name, "__internalValue%03X", internalValueCounter++);
13881 if(!curCompound->__anon1.compound.declarations)
13882 curCompound->__anon1.compound.declarations = MkList();
13883 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
13884 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
13885 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
13886 e->__anon1.compound = MkCompoundStmt((((void *)0)), stmts);
13887 }
13888 else
13889 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
13890 {
13891 struct Type * type = e->destType;
13892
13893 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13894 CopyTypeInto(e->destType, type);
13895 e->destType->refCount = 1;
13896 e->destType->classObjectType = 0;
13897 FreeType(type);
13898 }
13899 e->__anon1.compound->__anon1.compound.context = context;
13900 PopContext(context);
13901 curContext = context->parent;
13902 }
13903 }
13904 checkedExp = e;
13905 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->__anon1.list) || checkedExp->type == 11)
13906 {
13907 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13908 {
13909 if(checkedExp->type == 23)
13910 {
13911 checkedExp = (*((struct Statement *)(*checkedExp->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
13912 }
13913 else
13914 checkedExp = (*checkedExp->__anon1.list).last;
13915 }
13916 else if(checkedExp->type == 11)
13917 checkedExp = checkedExp->__anon1.cast.exp;
13918 }
13919 {
13920 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13921
13922 *operand = *checkedExp;
13923 __ecereMethod_Expression_Clear(checkedExp);
13924 checkedExp->destType = ProcessTypeString("void *", 0);
13925 checkedExp->expType = checkedExp->destType;
13926 checkedExp->destType->refCount++;
13927 checkedExp->type = 4;
13928 checkedExp->__anon1.op.op = '&';
13929 checkedExp->__anon1.op.exp1 = (((void *)0));
13930 checkedExp->__anon1.op.exp2 = operand;
13931 }
13932 }
13933 }
13934 }
13935 }
13936 }
13937 {
13938 }
13939 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))))
13940 {
13941 if(e->expType->classObjectType && destType && destType->classObjectType)
13942 {
13943 return ;
13944 }
13945 else
13946 {
13947 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13948
13949 *thisExp = *e;
13950 thisExp->prev = (((void *)0));
13951 thisExp->next = (((void *)0));
13952 __ecereMethod_Expression_Clear(e);
13953 e->type = 5;
13954 e->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
13955 if(thisExp->expType->kind == 8 && thisExp->expType->__anon1._class && thisExp->expType->__anon1._class->__anon1.registered && thisExp->expType->__anon1._class->__anon1.registered->type == 5)
13956 ((struct Expression *)(*e->__anon1.list).first)->byReference = 1;
13957 {
13958 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13959 CopyTypeInto(e->expType, thisExp->expType);
13960 e->expType->byReference = 0;
13961 e->expType->refCount = 1;
13962 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))
13963 {
13964 e->expType->classObjectType = 0;
13965 }
13966 }
13967 }
13968 }
13969 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
13970 {
13971 if(destType->kind == 14)
13972 {
13973 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unspecified type\n", (((void *)0))));
13974 }
13975 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))
13976 {
13977 unsigned int byReference = e->expType->byReference;
13978 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13979 struct Declarator * decl;
13980 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13981 char typeString[1024];
13982 struct Type * type;
13983 int backupClassObjectType;
13984 unsigned int backupByReference;
13985
13986 if(e->expType->kind == 8 && e->expType->__anon1._class && e->expType->__anon1._class->__anon1.registered && strcmp(e->expType->__anon1._class->__anon1.registered->name, "class"))
13987 type = e->expType;
13988 else
13989 type = destType;
13990 backupClassObjectType = type->classObjectType;
13991 backupByReference = type->byReference;
13992 type->classObjectType = 0;
13993 type->byReference = 0;
13994 typeString[0] = '\0';
13995 PrintType(type, typeString, 0, 1);
13996 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13997 type->classObjectType = backupClassObjectType;
13998 type->byReference = backupByReference;
13999 *thisExp = *e;
14000 thisExp->prev = (((void *)0));
14001 thisExp->next = (((void *)0));
14002 __ecereMethod_Expression_Clear(e);
14003 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)))
14004 {
14005 e->type = 4;
14006 e->__anon1.op.op = '*';
14007 e->__anon1.op.exp1 = (((void *)0));
14008 e->__anon1.op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
14009 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14010 CopyTypeInto(e->expType, type);
14011 e->expType->byReference = 0;
14012 e->expType->refCount = 1;
14013 }
14014 else
14015 {
14016 e->type = 11;
14017 e->__anon1.cast.typeName = MkTypeName(specs, decl);
14018 e->__anon1.cast.exp = thisExp;
14019 e->byReference = 1;
14020 e->expType = type;
14021 type->refCount++;
14022 }
14023 e->destType = destType;
14024 destType->refCount++;
14025 }
14026 }
14027 }
14028
14029 void ApplyLocation(struct Expression * exp, struct Location * loc)
14030 {
14031 exp->loc = *loc;
14032 switch(exp->type)
14033 {
14034 case 4:
14035 if(exp->__anon1.op.exp1)
14036 ApplyLocation(exp->__anon1.op.exp1, loc);
14037 if(exp->__anon1.op.exp2)
14038 ApplyLocation(exp->__anon1.op.exp2, loc);
14039 break;
14040 case 5:
14041 if(exp->__anon1.list)
14042 {
14043 struct Expression * e;
14044
14045 for(e = (*exp->__anon1.list).first; e; e = e->next)
14046 ApplyLocation(e, loc);
14047 }
14048 break;
14049 case 6:
14050 if(exp->__anon1.index.index)
14051 {
14052 struct Expression * e;
14053
14054 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
14055 ApplyLocation(e, loc);
14056 }
14057 if(exp->__anon1.index.exp)
14058 ApplyLocation(exp->__anon1.index.exp, loc);
14059 break;
14060 case 7:
14061 if(exp->__anon1.call.arguments)
14062 {
14063 struct Expression * arg;
14064
14065 for(arg = (*exp->__anon1.call.arguments).first; arg; arg = arg->next)
14066 ApplyLocation(arg, loc);
14067 }
14068 if(exp->__anon1.call.exp)
14069 ApplyLocation(exp->__anon1.call.exp, loc);
14070 break;
14071 case 8:
14072 case 9:
14073 if(exp->__anon1.member.exp)
14074 ApplyLocation(exp->__anon1.member.exp, loc);
14075 break;
14076 case 11:
14077 if(exp->__anon1.cast.exp)
14078 ApplyLocation(exp->__anon1.cast.exp, loc);
14079 break;
14080 case 12:
14081 if(exp->__anon1.cond.exp)
14082 {
14083 struct Expression * e;
14084
14085 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
14086 ApplyLocation(e, loc);
14087 }
14088 if(exp->__anon1.cond.cond)
14089 ApplyLocation(exp->__anon1.cond.cond, loc);
14090 if(exp->__anon1.cond.elseExp)
14091 ApplyLocation(exp->__anon1.cond.elseExp, loc);
14092 break;
14093 case 34:
14094 if(exp->__anon1.vaArg.exp)
14095 ApplyLocation(exp->__anon1.vaArg.exp, loc);
14096 break;
14097 default:
14098 break;
14099 }
14100 }
14101
14102 extern char *  strstr(const char * , const char * );
14103
14104 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
14105
14106 struct __ecereNameSpace__ecere__com__DefinedExpression
14107 {
14108 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
14109 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
14110 const char *  name;
14111 const char *  value;
14112 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
14113 } __attribute__ ((gcc_struct));
14114
14115 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
14116
14117 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
14118
14119 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(const char *  string, int *  numBytes);
14120
14121 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
14122
14123 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
14124
14125 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList *  specifiers, struct Declarator * decl);
14126
14127 static void ProcessStatement(struct Statement * stmt);
14128
14129 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
14130
14131 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
14132
14133 extern char *  __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, const void * object, ...);
14134
14135 extern const char *  sourceFile;
14136
14137 unsigned int __ecereProp_Type_Get_specConst(struct Type * this);
14138
14139 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_Type_specConst;
14140
14141 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
14142
14143 void ProcessExpressionType(struct Expression * exp)
14144 {
14145 unsigned int unresolved = 0;
14146 struct Location oldyylloc = yylloc;
14147 unsigned int notByReference = 0;
14148
14149 if(!exp || exp->expType)
14150 return ;
14151 yylloc = exp->loc;
14152 switch(exp->type)
14153 {
14154 case 0:
14155 {
14156 struct Identifier * id = exp->__anon1.__anon1.identifier;
14157
14158 if(!id || !topContext)
14159 return ;
14160 if(id->_class && id->_class->__anon1.__anon1.name)
14161 {
14162 id->classSym = id->_class->__anon1.__anon1.symbol;
14163 }
14164 if(!strcmp(id->string, "__runtimePlatform"))
14165 {
14166 exp->expType = ProcessTypeString("ecere::com::Platform", 1);
14167 break;
14168 }
14169 else if(strstr(id->string, "__ecereClass") == id->string)
14170 {
14171 exp->expType = ProcessTypeString("ecere::com::Class", 1);
14172 break;
14173 }
14174 else if(id->_class && (id->classSym || (id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))))
14175 {
14176 ReplaceClassMembers(exp, thisClass);
14177 if(exp->type != 0)
14178 {
14179 ProcessExpressionType(exp);
14180 break;
14181 }
14182 if(id->classSym && ResolveIdWithClass(exp, id->classSym->__anon1.registered, 0))
14183 break;
14184 }
14185 else
14186 {
14187 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
14188
14189 if(!symbol)
14190 {
14191 if(exp->destType && CheckExpressionType(exp, exp->destType, 0, 0))
14192 break;
14193 else
14194 {
14195 if(thisClass)
14196 {
14197 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
14198 if(exp->type != 0)
14199 {
14200 ProcessExpressionType(exp);
14201 break;
14202 }
14203 }
14204 else if(currentClass && !id->_class)
14205 {
14206 if(ResolveIdWithClass(exp, currentClass, 1))
14207 break;
14208 }
14209 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
14210 }
14211 }
14212 if(symbol)
14213 {
14214 struct Type * type = symbol->type;
14215 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->__anon1._class) ? type->__anon1._class->__anon1.registered : (((void *)0));
14216
14217 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
14218 {
14219 struct Context * context = SetupTemplatesContext(_class);
14220
14221 type = ReplaceThisClassType(_class);
14222 FinishTemplatesContext(context);
14223 if(type)
14224 type->refCount = 0;
14225 }
14226 FreeSpecifier(id->_class);
14227 id->_class = (((void *)0));
14228 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14229 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
14230 id->classSym = (((void *)0));
14231 exp->expType = type;
14232 if(type)
14233 type->refCount++;
14234 if(type && (type->kind == 15))
14235 exp->isConstant = 1;
14236 if(symbol->isParam || !strcmp(id->string, "this"))
14237 {
14238 if(_class && _class->type == 1 && !type->declaredWithStruct)
14239 exp->byReference = 1;
14240 }
14241 if(symbol->isIterator)
14242 {
14243 if(symbol->isIterator == 3)
14244 {
14245 exp->type = 5;
14246 exp->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->__anon1.__anon1.identifier)));
14247 ((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2->expType = exp->expType;
14248 exp->expType = (((void *)0));
14249 ProcessExpressionType(exp);
14250 }
14251 else if(symbol->isIterator != 4)
14252 {
14253 exp->type = 8;
14254 exp->__anon1.member.exp = MkExpIdentifier(exp->__anon1.__anon1.identifier);
14255 exp->__anon1.member.exp->expType = exp->expType;
14256 exp->__anon1.member.member = MkIdentifier("data");
14257 exp->expType = (((void *)0));
14258 ProcessExpressionType(exp);
14259 }
14260 }
14261 break;
14262 }
14263 else
14264 {
14265 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
14266
14267 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
14268 {
14269 char name[1024];
14270
14271 strcpy(name, thisNameSpace);
14272 strcat(name, "::");
14273 strcat(name, id->string);
14274 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
14275 }
14276 if(!definedExp)
14277 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
14278 if(definedExp)
14279 {
14280 int c;
14281
14282 for(c = 0; c < definedExpStackPos; c++)
14283 if(definedExpStack[c] == definedExp)
14284 break;
14285 if(c == definedExpStackPos && c < sizeof (definedExpStack) / sizeof(void *))
14286 {
14287 struct Location backupYylloc = yylloc;
14288 struct __ecereNameSpace__ecere__com__Instance * backInput = fileInput;
14289
14290 definedExpStack[definedExpStackPos++] = definedExp;
14291 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
14292 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count))__extension__ ({
14293 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
14294
14295 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
14296 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
14297 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
14298 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
14299
14300 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
14301 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
14302 echoOn = 0;
14303 parsedExpression = (((void *)0));
14304 resetScanner();
14305 expression_yyparse();
14306 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
14307 if(backInput)
14308 fileInput = backInput;
14309 yylloc = backupYylloc;
14310 if(parsedExpression)
14311 {
14312 FreeIdentifier(id);
14313 exp->type = 5;
14314 exp->__anon1.list = MkListOne(parsedExpression);
14315 ApplyLocation(parsedExpression, &yylloc);
14316 ProcessExpressionType(exp);
14317 definedExpStackPos--;
14318 return ;
14319 }
14320 definedExpStackPos--;
14321 }
14322 else
14323 {
14324 if(inCompiler)
14325 {
14326 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Recursion in defined expression %s\n", (((void *)0))), id->string);
14327 }
14328 }
14329 }
14330 else
14331 {
14332 struct GlobalData * data = (((void *)0));
14333
14334 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
14335 {
14336 char name[1024];
14337
14338 strcpy(name, thisNameSpace);
14339 strcat(name, "::");
14340 strcat(name, id->string);
14341 data = FindGlobalData(name);
14342 }
14343 if(!data)
14344 data = FindGlobalData(id->string);
14345 if(data)
14346 {
14347 DeclareGlobalData(data);
14348 exp->expType = data->dataType;
14349 if(data->dataType)
14350 data->dataType->refCount++;
14351 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14352 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
14353 FreeSpecifier(id->_class);
14354 id->_class = (((void *)0));
14355 break;
14356 }
14357 else
14358 {
14359 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
14360
14361 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
14362 {
14363 char name[1024];
14364
14365 strcpy(name, thisNameSpace);
14366 strcat(name, "::");
14367 strcat(name, id->string);
14368 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
14369 }
14370 if(!function)
14371 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
14372 if(function)
14373 {
14374 char name[1024];
14375
14376 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14377 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
14378 name[0] = (char)0;
14379 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
14380 strcpy(name, "__ecereFunction_");
14381 FullClassNameCat(name, id->string, 0);
14382 if(DeclareFunction(function, name))
14383 {
14384 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14385 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
14386 }
14387 exp->expType = function->dataType;
14388 if(function->dataType)
14389 function->dataType->refCount++;
14390 FreeSpecifier(id->_class);
14391 id->_class = (((void *)0));
14392 break;
14393 }
14394 }
14395 }
14396 }
14397 }
14398 unresolved = 1;
14399 break;
14400 }
14401 case 1:
14402 {
14403 if(!exp->__anon1.instance->_class)
14404 {
14405 if(exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class)
14406 {
14407 exp->__anon1.instance->_class = MkSpecifierName(exp->destType->__anon1._class->string);
14408 }
14409 }
14410 ProcessInstantiationType(exp->__anon1.instance);
14411 exp->isConstant = exp->__anon1.instance->isConstant;
14412 if(exp->__anon1.instance->_class)
14413 {
14414 exp->expType = MkClassType(exp->__anon1.instance->_class->__anon1.__anon1.name);
14415 }
14416 break;
14417 }
14418 case 2:
14419 {
14420 if(!exp->expType)
14421 {
14422 char * constant = exp->__anon1.__anon1.constant;
14423 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 1, type);
14424
14425 exp->expType = type;
14426 if(constant[0] == '\'')
14427 {
14428 if((int)((unsigned char *)constant)[1] > 127)
14429 {
14430 int nb;
14431 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
14432
14433 if(nb < 2)
14434 ch = constant[1];
14435 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
14436 exp->__anon1.__anon1.constant = PrintUInt(ch);
14437 type->kind = 8;
14438 type->__anon1._class = FindClass("unichar");
14439 type->isSigned = 0;
14440 }
14441 else
14442 {
14443 type->kind = 1;
14444 type->isSigned = 1;
14445 }
14446 }
14447 else
14448 {
14449 char * dot = strchr(constant, '.');
14450 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
14451 char * exponent;
14452
14453 if(isHex)
14454 {
14455 exponent = strchr(constant, 'p');
14456 if(!exponent)
14457 exponent = strchr(constant, 'P');
14458 }
14459 else
14460 {
14461 exponent = strchr(constant, 'e');
14462 if(!exponent)
14463 exponent = strchr(constant, 'E');
14464 }
14465 if(dot || exponent)
14466 {
14467 if(strchr(constant, 'f') || strchr(constant, 'F'))
14468 type->kind = 6;
14469 else
14470 type->kind = 7;
14471 type->isSigned = 1;
14472 }
14473 else
14474 {
14475 unsigned int isSigned = constant[0] == '-';
14476 char * endP = (((void *)0));
14477 long long i64 = strtoll(constant, &endP, 0);
14478 uint64 ui64 = strtoull(constant, &endP, 0);
14479 unsigned int is64Bit = endP && (!strcmp(endP, "LL") || !strcmp(endP, "ll"));
14480
14481 if(isSigned)
14482 {
14483 if(i64 < (((int)0x80000000)))
14484 is64Bit = 1;
14485 }
14486 else
14487 {
14488 if(ui64 > (((int)0x7fffffff)))
14489 {
14490 if(ui64 > (0xffffffff))
14491 {
14492 is64Bit = 1;
14493 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
14494 isSigned = 1;
14495 }
14496 }
14497 else if(constant[0] != '0' || !constant[1])
14498 isSigned = 1;
14499 }
14500 type->kind = is64Bit ? 4 : 3;
14501 type->isSigned = isSigned;
14502 }
14503 }
14504 exp->isConstant = 1;
14505 if(exp->destType && exp->destType->kind == 7)
14506 type->kind = 7;
14507 else if(exp->destType && exp->destType->kind == 6)
14508 type->kind = 6;
14509 else if(exp->destType && exp->destType->kind == 4)
14510 type->kind = 4;
14511 }
14512 break;
14513 }
14514 case 3:
14515 {
14516 exp->isConstant = 1;
14517 exp->expType = __extension__ ({
14518 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14519
14520 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
14521 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14522
14523 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 1, __ecereInstance1->constant = 1, __ecereInstance1->isSigned = 1, __ecereInstance1;
14524 }), __ecereInstance2;
14525 });
14526 break;
14527 }
14528 case 13:
14529 case 26:
14530 ProcessExpressionType(exp->__anon1._new.size);
14531 exp->expType = __extension__ ({
14532 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14533
14534 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = ProcessType(exp->__anon1._new.typeName->qualifiers, exp->__anon1._new.typeName->declarator), __ecereInstance1;
14535 });
14536 DeclareType(exp->expType->__anon1.type, 0, 0);
14537 break;
14538 case 14:
14539 case 27:
14540 ProcessExpressionType(exp->__anon1._renew.size);
14541 ProcessExpressionType(exp->__anon1._renew.exp);
14542 exp->expType = __extension__ ({
14543 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14544
14545 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = ProcessType(exp->__anon1._renew.typeName->qualifiers, exp->__anon1._renew.typeName->declarator), __ecereInstance1;
14546 });
14547 DeclareType(exp->expType->__anon1.type, 0, 0);
14548 break;
14549 case 4:
14550 {
14551 unsigned int assign = 0, boolResult = 0, boolOps = 0;
14552 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
14553 unsigned int useDestType = 0, useSideType = 0;
14554 struct Location oldyylloc = yylloc;
14555 unsigned int useSideUnit = 0;
14556 struct __ecereNameSpace__ecere__com__Class * destClass = (exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class) ? exp->destType->__anon1._class->__anon1.registered : (((void *)0));
14557 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
14558
14559 switch(exp->__anon1.op.op)
14560 {
14561 case '=':
14562 case MUL_ASSIGN:
14563 case DIV_ASSIGN:
14564 case MOD_ASSIGN:
14565 case ADD_ASSIGN:
14566 case SUB_ASSIGN:
14567 case LEFT_ASSIGN:
14568 case RIGHT_ASSIGN:
14569 case AND_ASSIGN:
14570 case XOR_ASSIGN:
14571 case OR_ASSIGN:
14572 assign = 1;
14573 break;
14574 case '!':
14575 break;
14576 case AND_OP:
14577 case OR_OP:
14578 boolOps = 1;
14579 boolResult = 1;
14580 break;
14581 case EQ_OP:
14582 case '<':
14583 case '>':
14584 case LE_OP:
14585 case GE_OP:
14586 case NE_OP:
14587 boolResult = 1;
14588 useSideType = 1;
14589 break;
14590 case '+':
14591 case '-':
14592 useSideUnit = 1;
14593 useSideType = 1;
14594 useDestType = 1;
14595 break;
14596 case LEFT_OP:
14597 case RIGHT_OP:
14598 useSideType = 1;
14599 useDestType = 1;
14600 break;
14601 case '|':
14602 case '^':
14603 useSideType = 1;
14604 useDestType = 1;
14605 break;
14606 case '/':
14607 case '%':
14608 useSideType = 1;
14609 useDestType = 1;
14610 break;
14611 case '&':
14612 case '*':
14613 if(exp->__anon1.op.exp1)
14614 {
14615 useSideType = 1;
14616 useDestType = 1;
14617 }
14618 break;
14619 }
14620 if(exp->__anon1.op.op == '&')
14621 {
14622 if(!exp->__anon1.op.exp1 && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->type == 0 && exp->__anon1.op.exp2->__anon1.__anon1.identifier)
14623 {
14624 struct Identifier * id = exp->__anon1.op.exp2->__anon1.__anon1.identifier;
14625 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
14626
14627 if(symbol && symbol->isIterator == 2)
14628 {
14629 exp->type = 8;
14630 exp->__anon1.member.exp = exp->__anon1.op.exp2;
14631 exp->__anon1.member.member = MkIdentifier("key");
14632 exp->expType = (((void *)0));
14633 exp->__anon1.op.exp2->expType = symbol->type;
14634 symbol->type->refCount++;
14635 ProcessExpressionType(exp);
14636 FreeType(dummy);
14637 break;
14638 }
14639 }
14640 }
14641 if(exp->__anon1.op.exp1)
14642 {
14643 if(exp->__anon1.op.exp2 && useSideUnit && useDestType && destClass && destClass->type == 3 && destClass->base->type != 3)
14644 useDestType = 0;
14645 if(destClass && useDestType && ((destClass->type == 3 && useSideUnit) || destClass->type == 4 || destClass->type == 2))
14646 {
14647 if(exp->__anon1.op.exp1->destType)
14648 FreeType(exp->__anon1.op.exp1->destType);
14649 exp->__anon1.op.exp1->destType = exp->destType;
14650 exp->__anon1.op.exp1->opDestType = 1;
14651 if(exp->destType)
14652 exp->destType->refCount++;
14653 }
14654 else if(!assign)
14655 {
14656 if(exp->__anon1.op.exp1->destType)
14657 FreeType(exp->__anon1.op.exp1->destType);
14658 exp->__anon1.op.exp1->destType = dummy;
14659 dummy->refCount++;
14660 }
14661 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
14662 exp->__anon1.op.exp1->destType->count++;
14663 ProcessExpressionType(exp->__anon1.op.exp1);
14664 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
14665 exp->__anon1.op.exp1->destType->count--;
14666 exp->__anon1.op.exp1->opDestType = 0;
14667 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)
14668 {
14669 exp->__anon1.op.exp2 = MkExpConstant("1");
14670 exp->__anon1.op.op = exp->__anon1.op.op == INC_OP ? ADD_ASSIGN : SUB_ASSIGN;
14671 assign = 1;
14672 }
14673 if(exp->__anon1.op.exp1->destType == dummy)
14674 {
14675 FreeType(dummy);
14676 exp->__anon1.op.exp1->destType = (((void *)0));
14677 }
14678 type1 = exp->__anon1.op.exp1->expType;
14679 }
14680 if(exp->__anon1.op.exp2)
14681 {
14682 char expString[10240];
14683
14684 expString[0] = '\0';
14685 if(exp->__anon1.op.exp2->type == 1 && !exp->__anon1.op.exp2->__anon1.instance->_class)
14686 {
14687 if(exp->__anon1.op.exp1)
14688 {
14689 exp->__anon1.op.exp2->destType = exp->__anon1.op.exp1->expType;
14690 if(exp->__anon1.op.exp1->expType)
14691 exp->__anon1.op.exp1->expType->refCount++;
14692 }
14693 else
14694 {
14695 exp->__anon1.op.exp2->destType = exp->destType;
14696 if(!exp->__anon1.op.exp1 || exp->__anon1.op.op != '&')
14697 exp->__anon1.op.exp2->opDestType = 1;
14698 if(exp->destType)
14699 exp->destType->refCount++;
14700 }
14701 if(type1)
14702 type1->refCount++;
14703 exp->expType = type1;
14704 }
14705 else if(assign)
14706 {
14707 if(inCompiler)
14708 PrintExpression(exp->__anon1.op.exp2, expString);
14709 if(type1 && type1->kind == 13)
14710 {
14711 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)
14712 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "operator %s illegal on pointer\n", (((void *)0))), exp->__anon1.op.op);
14713 else if(exp->__anon1.op.op == '=')
14714 {
14715 if(exp->__anon1.op.exp2->destType)
14716 FreeType(exp->__anon1.op.exp2->destType);
14717 exp->__anon1.op.exp2->destType = type1;
14718 if(type1)
14719 type1->refCount++;
14720 }
14721 }
14722 else
14723 {
14724 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)
14725 ;
14726 else
14727 {
14728 if(exp->__anon1.op.exp2->destType)
14729 FreeType(exp->__anon1.op.exp2->destType);
14730 exp->__anon1.op.exp2->destType = type1;
14731 if(type1)
14732 type1->refCount++;
14733 }
14734 }
14735 if(type1)
14736 type1->refCount++;
14737 exp->expType = type1;
14738 }
14739 else if(destClass && ((destClass->type == 3 && useDestType && useSideUnit) || (destClass->type == 4 && useDestType)))
14740 {
14741 if(exp->__anon1.op.exp2->destType)
14742 FreeType(exp->__anon1.op.exp2->destType);
14743 exp->__anon1.op.exp2->destType = exp->destType;
14744 if(exp->__anon1.op.op != '&')
14745 exp->__anon1.op.exp2->opDestType = 1;
14746 if(exp->destType)
14747 exp->destType->refCount++;
14748 }
14749 else
14750 {
14751 if(exp->__anon1.op.exp2->destType)
14752 FreeType(exp->__anon1.op.exp2->destType);
14753 exp->__anon1.op.exp2->destType = dummy;
14754 dummy->refCount++;
14755 }
14756 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))
14757 {
14758 FreeType(exp->__anon1.op.exp2->destType);
14759 exp->__anon1.op.exp2->destType = type1;
14760 type1->refCount++;
14761 }
14762 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
14763 exp->__anon1.op.exp2->destType->count++;
14764 if(exp->__anon1.op.op == SIZEOF)
14765 {
14766 struct Expression * e = exp->__anon1.op.exp2;
14767
14768 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
14769 {
14770 if(e->type == 5 || e->type == 32 || e->type == 23)
14771 {
14772 if(e->type == 23)
14773 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
14774 else
14775 e = (*e->__anon1.list).last;
14776 }
14777 }
14778 if(e->type == 11 && e->__anon1.cast.exp)
14779 e->__anon1.cast.exp->needCast = 1;
14780 }
14781 ProcessExpressionType(exp->__anon1.op.exp2);
14782 exp->__anon1.op.exp2->opDestType = 0;
14783 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
14784 exp->__anon1.op.exp2->destType->count--;
14785 if(assign && type1 && type1->kind == 13 && exp->__anon1.op.exp2->expType)
14786 {
14787 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)
14788 {
14789 if(exp->__anon1.op.op != '=' && type1->__anon1.type->kind == 0)
14790 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14791 }
14792 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)))
14793 {
14794 if(exp->__anon1.op.op == ADD_ASSIGN)
14795 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14796 }
14797 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))
14798 {
14799 if(exp->__anon1.op.op == ADD_ASSIGN)
14800 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14801 }
14802 else if(inCompiler)
14803 {
14804 char type1String[1024];
14805 char type2String[1024];
14806
14807 type1String[0] = '\0';
14808 type2String[0] = '\0';
14809 PrintType(exp->__anon1.op.exp2->expType, type1String, 0, 1);
14810 PrintType(type1, type2String, 0, 1);
14811 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14812 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
14813 }
14814 }
14815 if(exp->__anon1.op.exp2->destType == dummy)
14816 {
14817 FreeType(dummy);
14818 exp->__anon1.op.exp2->destType = (((void *)0));
14819 }
14820 if(exp->__anon1.op.op == '-' && !exp->__anon1.op.exp1 && exp->__anon1.op.exp2->expType && !exp->__anon1.op.exp2->expType->isSigned)
14821 {
14822 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14823 type2->refCount = 1;
14824 CopyTypeInto(type2, exp->__anon1.op.exp2->expType);
14825 type2->isSigned = 1;
14826 }
14827 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))
14828 {
14829 type2 = __extension__ ({
14830 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14831
14832 __ecereInstance1->kind = 3, __ecereInstance1;
14833 });
14834 type2->refCount = 1;
14835 type2->isSigned = 1;
14836 }
14837 else
14838 {
14839 type2 = exp->__anon1.op.exp2->expType;
14840 if(type2)
14841 type2->refCount++;
14842 }
14843 }
14844 dummy->kind = 0;
14845 if(exp->__anon1.op.op == SIZEOF)
14846 {
14847 exp->expType = __extension__ ({
14848 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14849
14850 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
14851 });
14852 exp->isConstant = 1;
14853 }
14854 else if(exp->__anon1.op.op == '*' && !exp->__anon1.op.exp1)
14855 {
14856 exp->expType = Dereference(type2);
14857 if(type2 && type2->kind == 8)
14858 notByReference = 1;
14859 }
14860 else if(exp->__anon1.op.op == '&' && !exp->__anon1.op.exp1)
14861 exp->expType = Reference(type2);
14862 else if(!assign)
14863 {
14864 if(boolOps)
14865 {
14866 if(exp->__anon1.op.exp1)
14867 {
14868 if(exp->__anon1.op.exp1->destType)
14869 FreeType(exp->__anon1.op.exp1->destType);
14870 exp->__anon1.op.exp1->destType = MkClassType("bool");
14871 exp->__anon1.op.exp1->destType->truth = 1;
14872 if(!exp->__anon1.op.exp1->expType)
14873 ProcessExpressionType(exp->__anon1.op.exp1);
14874 else
14875 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
14876 FreeType(exp->__anon1.op.exp1->expType);
14877 exp->__anon1.op.exp1->expType = MkClassType("bool");
14878 exp->__anon1.op.exp1->expType->truth = 1;
14879 }
14880 if(exp->__anon1.op.exp2)
14881 {
14882 if(exp->__anon1.op.exp2->destType)
14883 FreeType(exp->__anon1.op.exp2->destType);
14884 exp->__anon1.op.exp2->destType = MkClassType("bool");
14885 exp->__anon1.op.exp2->destType->truth = 1;
14886 if(!exp->__anon1.op.exp2->expType)
14887 ProcessExpressionType(exp->__anon1.op.exp2);
14888 else
14889 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
14890 FreeType(exp->__anon1.op.exp2->expType);
14891 exp->__anon1.op.exp2->expType = MkClassType("bool");
14892 exp->__anon1.op.exp2->expType->truth = 1;
14893 }
14894 }
14895 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")))))
14896 {
14897 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"))))
14898 {
14899 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)))
14900 {
14901 struct Type * intType;
14902
14903 if(!type1->__anon1._class->__anon1.registered->dataType)
14904 type1->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type1->__anon1._class->__anon1.registered->dataTypeString, 0);
14905 if(!type2->__anon1._class->__anon1.registered->dataType)
14906 type2->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type2->__anon1._class->__anon1.registered->dataTypeString, 0);
14907 intType = ProcessTypeString((type1->__anon1._class->__anon1.registered->dataType->kind == 4 || type2->__anon1._class->__anon1.registered->dataType->kind == 4) ? "int64" : "int", 0);
14908 if(exp->__anon1.op.exp1->destType)
14909 FreeType(exp->__anon1.op.exp1->destType);
14910 if(exp->__anon1.op.exp2->destType)
14911 FreeType(exp->__anon1.op.exp2->destType);
14912 exp->__anon1.op.exp1->destType = intType;
14913 exp->__anon1.op.exp2->destType = intType;
14914 intType->refCount++;
14915 }
14916 else
14917 {
14918 if(exp->__anon1.op.exp2->destType)
14919 FreeType(exp->__anon1.op.exp2->destType);
14920 exp->__anon1.op.exp2->destType = type1;
14921 type1->refCount++;
14922 if(exp->__anon1.op.exp1->destType)
14923 FreeType(exp->__anon1.op.exp1->destType);
14924 exp->__anon1.op.exp1->destType = type2;
14925 type2->refCount++;
14926 }
14927 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)
14928 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);
14929 if(type1->kind == 13 && type1->__anon1.type->kind == 20 && type2->kind != 13)
14930 {
14931 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 1);
14932
14933 if(argExp)
14934 {
14935 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14936
14937 exp->__anon1.op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->__anon1.op.exp1)));
14938 ProcessExpressionType(exp->__anon1.op.exp1);
14939 if(type2->kind != 13)
14940 {
14941 ProcessExpressionType(classExp);
14942 exp->__anon1.op.exp2 = MkExpBrackets(MkListOne(MkExpOp(exp->__anon1.op.exp2, '*', MkExpMember(classExp, MkIdentifier("typeSize")))));
14943 if(!exp->__anon1.op.exp2->expType)
14944 {
14945 if(type2)
14946 FreeType(type2);
14947 type2 = exp->__anon1.op.exp2->expType = ProcessTypeString("int", 0);
14948 type2->refCount++;
14949 }
14950 ProcessExpressionType(exp->__anon1.op.exp2);
14951 }
14952 }
14953 }
14954 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)))
14955 {
14956 if(type1->kind != 8 && type1->__anon1.type->kind == 0)
14957 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14958 exp->expType = type1;
14959 if(type1)
14960 type1->refCount++;
14961 }
14962 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)))
14963 {
14964 if(type2->kind != 8 && type2->__anon1.type->kind == 0)
14965 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14966 exp->expType = type2;
14967 if(type2)
14968 type2->refCount++;
14969 }
14970 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))
14971 {
14972 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "different levels of indirection\n", (((void *)0))));
14973 }
14974 else
14975 {
14976 unsigned int success = 0;
14977
14978 if(type1->kind == 13 && type2->kind == 13)
14979 {
14980 if(exp->__anon1.op.op == '+')
14981 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14982 else if(exp->__anon1.op.op == '-')
14983 {
14984 if(MatchTypes(type1->__anon1.type, type2->__anon1.type, (((void *)0)), (((void *)0)), (((void *)0)), 0, 0, 0, 0, 0))
14985 {
14986 exp->expType = __extension__ ({
14987 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14988
14989 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
14990 });
14991 success = 1;
14992 if(type1->__anon1.type->kind == 20)
14993 {
14994 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 1);
14995
14996 if(argExp)
14997 {
14998 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14999
15000 ProcessExpressionType(classExp);
15001 exp->type = 5;
15002 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"))));
15003 ProcessExpressionType(((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2);
15004 FreeType(dummy);
15005 return ;
15006 }
15007 }
15008 }
15009 }
15010 }
15011 if(!success && exp->__anon1.op.exp1->type == 2)
15012 {
15013 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
15014 {
15015 if(exp->expType)
15016 FreeType(exp->expType);
15017 exp->expType = exp->__anon1.op.exp1->destType;
15018 if(exp->__anon1.op.exp1->destType)
15019 exp->__anon1.op.exp1->destType->refCount++;
15020 success = 1;
15021 }
15022 else if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
15023 {
15024 if(exp->expType)
15025 FreeType(exp->expType);
15026 exp->expType = exp->__anon1.op.exp2->destType;
15027 if(exp->__anon1.op.exp2->destType)
15028 exp->__anon1.op.exp2->destType->refCount++;
15029 success = 1;
15030 }
15031 }
15032 else if(!success)
15033 {
15034 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
15035 {
15036 if(exp->expType)
15037 FreeType(exp->expType);
15038 exp->expType = exp->__anon1.op.exp2->destType;
15039 if(exp->__anon1.op.exp2->destType)
15040 exp->__anon1.op.exp2->destType->refCount++;
15041 success = 1;
15042 }
15043 else if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
15044 {
15045 if(exp->expType)
15046 FreeType(exp->expType);
15047 exp->expType = exp->__anon1.op.exp1->destType;
15048 if(exp->__anon1.op.exp1->destType)
15049 exp->__anon1.op.exp1->destType->refCount++;
15050 success = 1;
15051 }
15052 }
15053 if(!success)
15054 {
15055 char expString1[10240];
15056 char expString2[10240];
15057 char type1[1024];
15058 char type2[1024];
15059
15060 expString1[0] = '\0';
15061 expString2[0] = '\0';
15062 type1[0] = '\0';
15063 type2[0] = '\0';
15064 if(inCompiler)
15065 {
15066 PrintExpression(exp->__anon1.op.exp1, expString1);
15067 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
15068 PrintExpression(exp->__anon1.op.exp2, expString2);
15069 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
15070 PrintType(exp->__anon1.op.exp1->expType, type1, 0, 1);
15071 PrintType(exp->__anon1.op.exp2->expType, type2, 0, 1);
15072 }
15073 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
15074 }
15075 }
15076 }
15077 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)
15078 {
15079 if(exp->__anon1.op.exp1->destType)
15080 FreeType(exp->__anon1.op.exp1->destType);
15081 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
15082 if(type2->__anon1._class->__anon1.registered->dataType)
15083 type2->__anon1._class->__anon1.registered->dataType->refCount++;
15084 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
15085 exp->expType = type2;
15086 if(type2)
15087 type2->refCount++;
15088 }
15089 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)
15090 {
15091 if(exp->__anon1.op.exp2->destType)
15092 FreeType(exp->__anon1.op.exp2->destType);
15093 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
15094 if(type1->__anon1._class->__anon1.registered->dataType)
15095 type1->__anon1._class->__anon1.registered->dataType->refCount++;
15096 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
15097 exp->expType = type1;
15098 if(type1)
15099 type1->refCount++;
15100 }
15101 else if(type1)
15102 {
15103 unsigned int valid = 0;
15104
15105 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3 && type2 && type2->kind != 8)
15106 {
15107 if(exp->__anon1.op.exp2->destType)
15108 FreeType(exp->__anon1.op.exp2->destType);
15109 if(!type1->__anon1._class->__anon1.registered->dataType)
15110 type1->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type1->__anon1._class->__anon1.registered->dataTypeString, 0);
15111 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
15112 exp->__anon1.op.exp2->destType->refCount++;
15113 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
15114 if(type2)
15115 FreeType(type2);
15116 type2 = exp->__anon1.op.exp2->destType;
15117 if(type2)
15118 type2->refCount++;
15119 exp->expType = type2;
15120 type2->refCount++;
15121 }
15122 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3 && type1 && type1->kind != 8)
15123 {
15124 if(exp->__anon1.op.exp1->destType)
15125 FreeType(exp->__anon1.op.exp1->destType);
15126 if(!type2->__anon1._class->__anon1.registered->dataType)
15127 type2->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type2->__anon1._class->__anon1.registered->dataTypeString, 0);
15128 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
15129 exp->__anon1.op.exp1->destType->refCount++;
15130 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
15131 type1 = exp->__anon1.op.exp1->destType;
15132 exp->expType = type1;
15133 type1->refCount++;
15134 }
15135 if(!boolResult || exp->__anon1.op.op == '>' || exp->__anon1.op.op == '<' || exp->__anon1.op.op == GE_OP || exp->__anon1.op.op == LE_OP)
15136 {
15137 unsigned int op1IsEnum = type1 && type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4;
15138 unsigned int op2IsEnum = type2 && type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4;
15139
15140 if(exp->__anon1.op.op == '*' || exp->__anon1.op.op == '/' || exp->__anon1.op.op == '-' || exp->__anon1.op.op == '|' || exp->__anon1.op.op == '^')
15141 {
15142 if(op1IsEnum && exp->__anon1.op.exp2->expType)
15143 {
15144 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0, 0))
15145 {
15146 if(exp->expType)
15147 FreeType(exp->expType);
15148 exp->expType = exp->__anon1.op.exp2->expType;
15149 if(exp->__anon1.op.exp2->expType)
15150 exp->__anon1.op.exp2->expType->refCount++;
15151 valid = 1;
15152 }
15153 }
15154 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
15155 {
15156 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0, 0))
15157 {
15158 if(exp->expType)
15159 FreeType(exp->expType);
15160 exp->expType = exp->__anon1.op.exp1->expType;
15161 if(exp->__anon1.op.exp1->expType)
15162 exp->__anon1.op.exp1->expType->refCount++;
15163 valid = 1;
15164 }
15165 }
15166 }
15167 else
15168 {
15169 if(op1IsEnum && exp->__anon1.op.exp2->expType)
15170 {
15171 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0, 0))
15172 {
15173 if(exp->expType)
15174 FreeType(exp->expType);
15175 exp->expType = exp->__anon1.op.exp1->expType;
15176 if(exp->__anon1.op.exp1->expType)
15177 exp->__anon1.op.exp1->expType->refCount++;
15178 valid = 1;
15179 }
15180 }
15181 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
15182 {
15183 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0, 0))
15184 {
15185 if(exp->expType)
15186 FreeType(exp->expType);
15187 exp->expType = exp->__anon1.op.exp2->expType;
15188 if(exp->__anon1.op.exp2->expType)
15189 exp->__anon1.op.exp2->expType->refCount++;
15190 valid = 1;
15191 }
15192 }
15193 }
15194 }
15195 if(!valid)
15196 {
15197 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))
15198 {
15199 if(exp->__anon1.op.exp1->destType)
15200 FreeType(exp->__anon1.op.exp1->destType);
15201 exp->__anon1.op.exp1->destType = type2;
15202 type2->refCount++;
15203 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
15204 {
15205 if(exp->expType)
15206 FreeType(exp->expType);
15207 exp->expType = exp->__anon1.op.exp1->destType;
15208 if(exp->__anon1.op.exp1->destType)
15209 exp->__anon1.op.exp1->destType->refCount++;
15210 }
15211 }
15212 else
15213 {
15214 if(exp->__anon1.op.exp2->destType)
15215 FreeType(exp->__anon1.op.exp2->destType);
15216 exp->__anon1.op.exp2->destType = type1;
15217 type1->refCount++;
15218 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
15219 {
15220 if(exp->expType)
15221 FreeType(exp->expType);
15222 exp->expType = exp->__anon1.op.exp2->destType;
15223 if(exp->__anon1.op.exp2->destType)
15224 exp->__anon1.op.exp2->destType->refCount++;
15225 }
15226 else if(type1 && type2)
15227 {
15228 char expString1[10240];
15229 char expString2[10240];
15230 char type1String[1024];
15231 char type2String[1024];
15232
15233 expString1[0] = '\0';
15234 expString2[0] = '\0';
15235 type1String[0] = '\0';
15236 type2String[0] = '\0';
15237 if(inCompiler)
15238 {
15239 PrintExpression(exp->__anon1.op.exp1, expString1);
15240 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
15241 PrintExpression(exp->__anon1.op.exp2, expString2);
15242 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
15243 PrintType(exp->__anon1.op.exp1->expType, type1String, 0, 1);
15244 PrintType(exp->__anon1.op.exp2->expType, type2String, 0, 1);
15245 }
15246 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
15247 if(type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4)
15248 {
15249 exp->expType = exp->__anon1.op.exp1->expType;
15250 if(exp->__anon1.op.exp1->expType)
15251 exp->__anon1.op.exp1->expType->refCount++;
15252 }
15253 else if(type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)
15254 {
15255 exp->expType = exp->__anon1.op.exp2->expType;
15256 if(exp->__anon1.op.exp2->expType)
15257 exp->__anon1.op.exp2->expType->refCount++;
15258 }
15259 }
15260 }
15261 }
15262 }
15263 else if(type2)
15264 {
15265 if(type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)
15266 {
15267 struct Type * oldType = exp->__anon1.op.exp1->expType;
15268
15269 exp->__anon1.op.exp1->expType = (((void *)0));
15270 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
15271 FreeType(oldType);
15272 else
15273 exp->__anon1.op.exp1->expType = oldType;
15274 }
15275 if(exp->__anon1.op.exp1->destType)
15276 FreeType(exp->__anon1.op.exp1->destType);
15277 exp->__anon1.op.exp1->destType = type2;
15278 type2->refCount++;
15279 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
15280 {
15281 if(exp->expType)
15282 FreeType(exp->expType);
15283 exp->expType = exp->__anon1.op.exp1->destType;
15284 if(exp->__anon1.op.exp1->destType)
15285 exp->__anon1.op.exp1->destType->refCount++;
15286 }
15287 }
15288 }
15289 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
15290 {
15291 if(type1 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3)
15292 {
15293 if(exp->__anon1.op.exp1->destType)
15294 FreeType(exp->__anon1.op.exp1->destType);
15295 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
15296 if(type2->__anon1._class->__anon1.registered->dataType)
15297 type2->__anon1._class->__anon1.registered->dataType->refCount++;
15298 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
15299 }
15300 if(exp->__anon1.op.op == '!')
15301 {
15302 exp->expType = MkClassType("bool");
15303 exp->expType->truth = 1;
15304 }
15305 else
15306 {
15307 exp->expType = type2;
15308 if(type2)
15309 type2->refCount++;
15310 }
15311 }
15312 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
15313 {
15314 if(type2 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3)
15315 {
15316 if(exp->__anon1.op.exp2->destType)
15317 FreeType(exp->__anon1.op.exp2->destType);
15318 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
15319 if(type1->__anon1._class->__anon1.registered->dataType)
15320 type1->__anon1._class->__anon1.registered->dataType->refCount++;
15321 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
15322 }
15323 exp->expType = type1;
15324 if(type1)
15325 type1->refCount++;
15326 }
15327 }
15328 yylloc = exp->loc;
15329 if(exp->__anon1.op.exp1 && !exp->__anon1.op.exp1->expType)
15330 {
15331 char expString[10000];
15332
15333 expString[0] = '\0';
15334 if(inCompiler)
15335 {
15336 PrintExpression(exp->__anon1.op.exp1, expString);
15337 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15338 }
15339 if(expString[0])
15340 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
15341 }
15342 if(exp->__anon1.op.exp2 && !exp->__anon1.op.exp2->expType)
15343 {
15344 char expString[10240];
15345
15346 expString[0] = '\0';
15347 if(inCompiler)
15348 {
15349 PrintExpression(exp->__anon1.op.exp2, expString);
15350 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15351 }
15352 if(expString[0])
15353 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
15354 }
15355 if(boolResult)
15356 {
15357 FreeType(exp->expType);
15358 exp->expType = MkClassType("bool");
15359 exp->expType->truth = 1;
15360 }
15361 if(exp->__anon1.op.op != SIZEOF)
15362 exp->isConstant = (!exp->__anon1.op.exp1 || exp->__anon1.op.exp1->isConstant) && (!exp->__anon1.op.exp2 || exp->__anon1.op.exp2->isConstant);
15363 if(exp->__anon1.op.op == SIZEOF && exp->__anon1.op.exp2->expType)
15364 {
15365 DeclareType(exp->__anon1.op.exp2->expType, 0, 0);
15366 }
15367 if(exp->__anon1.op.op == DELETE && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->expType && __ecereProp_Type_Get_specConst(exp->__anon1.op.exp2->expType))
15368 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "deleting const qualified object\n", (((void *)0))));
15369 yylloc = oldyylloc;
15370 FreeType(dummy);
15371 if(type2)
15372 FreeType(type2);
15373 break;
15374 }
15375 case 5:
15376 case 32:
15377 {
15378 struct Expression * e;
15379
15380 exp->isConstant = 1;
15381 for(e = (*exp->__anon1.list).first; e; e = e->next)
15382 {
15383 unsigned int inced = 0;
15384
15385 if(!e->next)
15386 {
15387 FreeType(e->destType);
15388 e->opDestType = exp->opDestType;
15389 e->destType = exp->destType;
15390 if(e->destType)
15391 {
15392 exp->destType->refCount++;
15393 e->destType->count++;
15394 inced = 1;
15395 }
15396 }
15397 ProcessExpressionType(e);
15398 if(inced)
15399 exp->destType->count--;
15400 if(!exp->expType && !e->next)
15401 {
15402 exp->expType = e->expType;
15403 if(e->expType)
15404 e->expType->refCount++;
15405 }
15406 if(!e->isConstant)
15407 exp->isConstant = 0;
15408 }
15409 e = (*exp->__anon1.list).first;
15410 if(!e->next && e->type == 8)
15411 {
15412 struct Expression * next = exp->next, * prev = exp->prev;
15413
15414 FreeType(exp->expType);
15415 FreeType(exp->destType);
15416 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
15417 *exp = *e;
15418 exp->prev = prev;
15419 exp->next = next;
15420 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
15421 ProcessExpressionType(exp);
15422 }
15423 break;
15424 }
15425 case 6:
15426 {
15427 struct Expression * e;
15428
15429 exp->isConstant = 1;
15430 ProcessExpressionType(exp->__anon1.index.exp);
15431 if(!exp->__anon1.index.exp->isConstant)
15432 exp->isConstant = 0;
15433 if(exp->__anon1.index.exp->expType)
15434 {
15435 struct Type * source = exp->__anon1.index.exp->expType;
15436
15437 if(source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered)
15438 {
15439 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class->__anon1.registered;
15440 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
15441
15442 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
15443 {
15444 exp->expType = ProcessTypeString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, 0);
15445 if(exp->__anon1.index.index && (*exp->__anon1.index.index).last)
15446 {
15447 struct Type * type = ProcessTypeString(_class->templateArgs[1].__anon1.__anon1.dataTypeString, 0);
15448
15449 if(type->kind == 8)
15450 type->constant = 1;
15451 else if(type->kind == 13)
15452 {
15453 struct Type * t = type;
15454
15455 while(t->kind == 13)
15456 t = t->__anon1.type;
15457 t->constant = 1;
15458 }
15459 ((struct Expression *)(*exp->__anon1.index.index).last)->destType = type;
15460 }
15461 }
15462 }
15463 }
15464 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
15465 {
15466 if(!e->next && exp->__anon1.index.exp->expType && exp->__anon1.index.exp->expType->kind == 12 && exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass)
15467 {
15468 if(e->destType)
15469 FreeType(e->destType);
15470 e->destType = MkClassType(exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass->string);
15471 }
15472 ProcessExpressionType(e);
15473 if(!e->next)
15474 {
15475 }
15476 if(!e->isConstant)
15477 exp->isConstant = 0;
15478 }
15479 if(!exp->expType)
15480 exp->expType = Dereference(exp->__anon1.index.exp->expType);
15481 if(exp->expType)
15482 DeclareType(exp->expType, 0, 0);
15483 break;
15484 }
15485 case 7:
15486 {
15487 struct Expression * e;
15488 struct Type * functionType;
15489 struct Type * methodType = (((void *)0));
15490 char name[1024];
15491
15492 name[0] = '\0';
15493 if(inCompiler)
15494 {
15495 PrintExpression(exp->__anon1.call.exp, name);
15496 if(exp->__anon1.call.exp->expType && !exp->__anon1.call.exp->expType->__anon1.__anon2.returnType)
15497 {
15498 PrintExpression(exp->__anon1.call.exp, name);
15499 }
15500 }
15501 if(exp->__anon1.call.exp->type == 0)
15502 {
15503 struct Expression * idExp = exp->__anon1.call.exp;
15504 struct Identifier * id = idExp->__anon1.__anon1.identifier;
15505
15506 if(!strcmp(id->string, "__builtin_frame_address"))
15507 {
15508 exp->expType = ProcessTypeString("void *", 1);
15509 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
15510 ProcessExpressionType((*exp->__anon1.call.arguments).first);
15511 break;
15512 }
15513 else if(!strcmp(id->string, "__ENDIAN_PAD"))
15514 {
15515 exp->expType = ProcessTypeString("int", 1);
15516 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
15517 ProcessExpressionType((*exp->__anon1.call.arguments).first);
15518 break;
15519 }
15520 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
15521 {
15522 struct Expression * a = (((void *)0));
15523 struct Expression * b = (((void *)0));
15524 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
15525
15526 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->__anon1.call.arguments).count == 2)
15527 {
15528 a = (*exp->__anon1.call.arguments).first;
15529 b = (*exp->__anon1.call.arguments).last;
15530 tempExp1 = a;
15531 tempExp2 = b;
15532 }
15533 else if((*exp->__anon1.call.arguments).count == 1)
15534 {
15535 a = (*exp->__anon1.call.arguments).first;
15536 tempExp1 = a;
15537 }
15538 if(a)
15539 {
15540 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->__anon1.call.arguments));
15541 idExp->__anon1.__anon1.identifier = (((void *)0));
15542 FreeExpContents(exp);
15543 ProcessExpressionType(a);
15544 if(b)
15545 ProcessExpressionType(b);
15546 exp->type = 5;
15547 exp->__anon1.list = MkList();
15548 if(a->expType && (!b || b->expType))
15549 {
15550 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
15551 {
15552 if(inCompiler)
15553 {
15554 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15555 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
15556 struct Declaration * decl;
15557 char temp1[1024], temp2[1024];
15558
15559 GetTypeSpecs(a->expType, specs);
15560 if(a && !a->isConstant && a->type != 0)
15561 {
15562 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
15563 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
15564 tempExp1 = QMkExpId(temp1);
15565 tempExp1->expType = a->expType;
15566 if(a->expType)
15567 a->expType->refCount++;
15568 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp1), '=', a));
15569 }
15570 if(b && !b->isConstant && b->type != 0)
15571 {
15572 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
15573 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
15574 tempExp2 = QMkExpId(temp2);
15575 tempExp2->expType = b->expType;
15576 if(b->expType)
15577 b->expType->refCount++;
15578 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp2), '=', b));
15579 }
15580 decl = MkDeclaration(specs, decls);
15581 if(!curCompound->__anon1.compound.declarations)
15582 curCompound->__anon1.compound.declarations = MkList();
15583 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), decl);
15584 }
15585 }
15586 }
15587 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
15588 {
15589 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
15590
15591 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
15592 exp->expType = a->expType;
15593 if(a->expType)
15594 a->expType->refCount++;
15595 }
15596 else if(!strcmp(id->string, "Abs"))
15597 {
15598 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
15599 exp->expType = a->expType;
15600 if(a->expType)
15601 a->expType->refCount++;
15602 }
15603 else if(!strcmp(id->string, "Sgn"))
15604 {
15605 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"))))));
15606 exp->expType = ProcessTypeString("int", 0);
15607 }
15608 FreeExpression(tempExp1);
15609 if(tempExp2)
15610 FreeExpression(tempExp2);
15611 FreeIdentifier(id);
15612 break;
15613 }
15614 }
15615 }
15616 {
15617 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
15618
15619 if(!exp->__anon1.call.exp->destType)
15620 {
15621 exp->__anon1.call.exp->destType = dummy;
15622 dummy->refCount++;
15623 }
15624 ProcessExpressionType(exp->__anon1.call.exp);
15625 if(exp->__anon1.call.exp->destType == dummy)
15626 {
15627 FreeType(dummy);
15628 exp->__anon1.call.exp->destType = (((void *)0));
15629 }
15630 FreeType(dummy);
15631 }
15632 functionType = exp->__anon1.call.exp->expType;
15633 if(functionType && functionType->kind == 16)
15634 {
15635 methodType = functionType;
15636 functionType = methodType->__anon1.__anon3.method->dataType;
15637 if(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass)
15638 {
15639 char typeString[1024];
15640
15641 typeString[0] = '\0';
15642 {
15643 struct Symbol * back = functionType->__anon1.__anon2.thisClass;
15644
15645 functionType->__anon1.__anon2.thisClass = (((void *)0));
15646 PrintType(functionType, typeString, 1, 1);
15647 functionType->__anon1.__anon2.thisClass = back;
15648 }
15649 if(strstr(typeString, "thisclass"))
15650 {
15651 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15652 struct Declarator * decl;
15653
15654 {
15655 struct Context * context = SetupTemplatesContext(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
15656
15657 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
15658 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))
15659 thisClassParams = 0;
15660 ReplaceThisClassSpecifiers(specs, exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
15661 {
15662 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
15663
15664 thisClass = exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass;
15665 ProcessDeclarator(decl);
15666 thisClass = backupThisClass;
15667 }
15668 thisClassParams = 1;
15669 functionType = ProcessType(specs, decl);
15670 functionType->refCount = 0;
15671 FinishTemplatesContext(context);
15672 }
15673 FreeList(specs, FreeSpecifier);
15674 FreeDeclarator(decl);
15675 }
15676 }
15677 }
15678 if(functionType && functionType->kind == 13 && functionType->__anon1.type && functionType->__anon1.type->kind == 11)
15679 {
15680 struct Type * type = functionType->__anon1.type;
15681
15682 if(!functionType->refCount)
15683 {
15684 functionType->__anon1.type = (((void *)0));
15685 FreeType(functionType);
15686 }
15687 functionType = type;
15688 }
15689 if(functionType && functionType->kind != 11)
15690 {
15691 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "called object %s is not a function\n", (((void *)0))), name);
15692 }
15693 else if(functionType)
15694 {
15695 unsigned int emptyParams = 0, noParams = 0;
15696 struct Expression * e = exp->__anon1.call.arguments ? (*exp->__anon1.call.arguments).first : (((void *)0));
15697 struct Type * type = functionType->__anon1.__anon2.params.first;
15698 struct Expression * memberExp = (exp->__anon1.call.exp->type == 8) ? exp->__anon1.call.exp : (((void *)0));
15699 int extra = 0;
15700 struct Location oldyylloc = yylloc;
15701
15702 if(!type)
15703 emptyParams = 1;
15704 if(functionType->extraParam && e && functionType->__anon1.__anon2.thisClass)
15705 {
15706 e->destType = MkClassType(functionType->__anon1.__anon2.thisClass->string);
15707 e = e->next;
15708 }
15709 if(!functionType->__anon1.__anon2.staticMethod && !functionType->extraParam)
15710 {
15711 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)
15712 {
15713 type = MkClassType(memberExp->__anon1.member.exp->expType->__anon1._class->string);
15714 if(e)
15715 {
15716 e->destType = type;
15717 e = e->next;
15718 type = functionType->__anon1.__anon2.params.first;
15719 }
15720 else
15721 type->refCount = 0;
15722 }
15723 else if(!memberExp && (functionType->__anon1.__anon2.thisClass || (methodType && methodType->__anon1.__anon3.methodClass)))
15724 {
15725 type = MkClassType(functionType->__anon1.__anon2.thisClass ? functionType->__anon1.__anon2.thisClass->string : (methodType ? methodType->__anon1.__anon3.methodClass->fullName : (((void *)0))));
15726 type->byReference = functionType->byReference;
15727 type->typedByReference = functionType->typedByReference;
15728 if(e)
15729 {
15730 if(e->next && type->kind == 8 && (functionType && functionType->__anon1.__anon2.thisClass) && functionType->classObjectType == 2)
15731 e = e->next;
15732 e->destType = type;
15733 e = e->next;
15734 type = functionType->__anon1.__anon2.params.first;
15735 }
15736 else
15737 type->refCount = 0;
15738 }
15739 }
15740 if(type && type->kind == 0)
15741 {
15742 noParams = 1;
15743 if(!type->refCount)
15744 FreeType(type);
15745 type = (((void *)0));
15746 }
15747 for(; e; e = e->next)
15748 {
15749 if(!type && !emptyParams)
15750 {
15751 yylloc = e->loc;
15752 if(methodType && methodType->__anon1.__anon3.methodClass)
15753 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);
15754 else
15755 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);
15756 break;
15757 }
15758 if(methodType && type && type->kind == 20 && type->__anon1.templateParameter->type == 0)
15759 {
15760 struct Type * templatedType = (((void *)0));
15761 struct __ecereNameSpace__ecere__com__Class * _class = methodType->__anon1.__anon3.usedClass;
15762 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15763 int id = 0;
15764
15765 if(_class && _class->templateArgs)
15766 {
15767 struct __ecereNameSpace__ecere__com__Class * sClass;
15768
15769 for(sClass = _class; sClass; sClass = sClass->base)
15770 {
15771 if(sClass->templateClass)
15772 sClass = sClass->templateClass;
15773 id = 0;
15774 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15775 {
15776 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
15777 {
15778 struct __ecereNameSpace__ecere__com__Class * nextClass;
15779
15780 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15781 {
15782 if(nextClass->templateClass)
15783 nextClass = nextClass->templateClass;
15784 id += nextClass->templateParams.count;
15785 }
15786 break;
15787 }
15788 id++;
15789 }
15790 if(curParam)
15791 break;
15792 }
15793 }
15794 if(curParam && _class->templateArgs[id].__anon1.__anon1.dataTypeString)
15795 {
15796 unsigned int constant = type->constant;
15797 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
15798
15799 {
15800 struct Context * context = SetupTemplatesContext(_class);
15801
15802 templatedType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
15803 FinishTemplatesContext(context);
15804 }
15805 if(templatedType->kind == 8 && constant)
15806 templatedType->constant = 1;
15807 else if(templatedType->kind == 13)
15808 {
15809 struct Type * t = templatedType->__anon1.type;
15810
15811 while(t->kind == 13)
15812 t = t->__anon1.type;
15813 if(constant)
15814 t->constant = constant;
15815 }
15816 e->destType = templatedType;
15817 if(templatedType)
15818 {
15819 templatedType->passAsTemplate = 1;
15820 }
15821 }
15822 else
15823 {
15824 e->destType = type;
15825 if(type)
15826 type->refCount++;
15827 }
15828 }
15829 else
15830 {
15831 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
15832 {
15833 e->destType = type->prev;
15834 e->destType->refCount++;
15835 }
15836 else
15837 {
15838 e->destType = type;
15839 if(type)
15840 type->refCount++;
15841 }
15842 }
15843 if(type && type->kind != 14)
15844 {
15845 struct Type * next = type->next;
15846
15847 if(!type->refCount)
15848 FreeType(type);
15849 type = next;
15850 }
15851 }
15852 if(type && type->kind != 14)
15853 {
15854 if(methodType && methodType->__anon1.__anon3.methodClass)
15855 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);
15856 else
15857 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);
15858 }
15859 yylloc = oldyylloc;
15860 if(type && !type->refCount)
15861 FreeType(type);
15862 }
15863 else
15864 {
15865 functionType = __extension__ ({
15866 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15867
15868 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
15869 });
15870 if(exp->__anon1.call.exp->type == 0)
15871 {
15872 char * string = exp->__anon1.call.exp->__anon1.__anon1.identifier->string;
15873
15874 if(inCompiler)
15875 {
15876 struct Symbol * symbol;
15877 struct Location oldyylloc = yylloc;
15878
15879 yylloc = exp->__anon1.call.exp->__anon1.__anon1.identifier->loc;
15880 if(strstr(string, "__builtin_") == string)
15881 {
15882 if(exp->destType)
15883 {
15884 functionType->__anon1.__anon2.returnType = exp->destType;
15885 exp->destType->refCount++;
15886 }
15887 }
15888 else
15889 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s undefined; assuming extern returning int\n", (((void *)0))), string);
15890 symbol = __extension__ ({
15891 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
15892
15893 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 1), __ecereInstance1;
15894 });
15895 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
15896 if(strstr(symbol->string, "::"))
15897 globalContext->hasNameSpace = 1;
15898 yylloc = oldyylloc;
15899 }
15900 }
15901 else if(exp->__anon1.call.exp->type == 8)
15902 {
15903 }
15904 else
15905 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "callable object undefined; extern assuming returning int\n", (((void *)0))));
15906 if(!functionType->__anon1.__anon2.returnType)
15907 {
15908 functionType->__anon1.__anon2.returnType = __extension__ ({
15909 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15910
15911 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15912 });
15913 }
15914 }
15915 if(functionType && functionType->kind == 11)
15916 {
15917 exp->expType = functionType->__anon1.__anon2.returnType;
15918 if(functionType->__anon1.__anon2.returnType)
15919 functionType->__anon1.__anon2.returnType->refCount++;
15920 if(!functionType->refCount)
15921 FreeType(functionType);
15922 }
15923 if(exp->__anon1.call.arguments)
15924 {
15925 for(e = (*exp->__anon1.call.arguments).first; e; e = e->next)
15926 ProcessExpressionType(e);
15927 }
15928 break;
15929 }
15930 case 8:
15931 {
15932 struct Type * type;
15933 struct Location oldyylloc = yylloc;
15934 unsigned int thisPtr;
15935 struct Expression * checkExp = exp->__anon1.member.exp;
15936
15937 while(checkExp)
15938 {
15939 if(checkExp->type == 11)
15940 checkExp = checkExp->__anon1.cast.exp;
15941 else if(checkExp->type == 5)
15942 checkExp = checkExp->__anon1.list ? (*checkExp->__anon1.list).first : (((void *)0));
15943 else
15944 break;
15945 }
15946 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->__anon1.__anon1.identifier->string, "this"));
15947 exp->thisPtr = thisPtr;
15948 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
15949 {
15950 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
15951 }
15952 ProcessExpressionType(exp->__anon1.member.exp);
15953 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)
15954 {
15955 exp->isConstant = 0;
15956 }
15957 else
15958 exp->isConstant = exp->__anon1.member.exp->isConstant;
15959 type = exp->__anon1.member.exp->expType;
15960 yylloc = exp->loc;
15961 if(type && (type->kind == 20))
15962 {
15963 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
15964 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
15965
15966 if(_class)
15967 {
15968 for(param = _class->templateParams.first; param; param = param->next)
15969 {
15970 if(param->type == 1 && exp->__anon1.member.member && exp->__anon1.member.member->string && !strcmp(param->name, exp->__anon1.member.member->string))
15971 break;
15972 }
15973 }
15974 if(param && param->defaultArg.__anon1.__anon2.__anon1.member)
15975 {
15976 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
15977
15978 if(argExp)
15979 {
15980 struct Expression * expMember = exp->__anon1.member.exp;
15981 struct Declarator * decl;
15982 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15983 char thisClassTypeString[1024];
15984
15985 FreeIdentifier(exp->__anon1.member.member);
15986 ProcessExpressionType(argExp);
15987 {
15988 char * colon = strstr(param->defaultArg.__anon1.__anon2.memberString, "::");
15989
15990 if(colon)
15991 {
15992 memcpy(thisClassTypeString, param->defaultArg.__anon1.__anon2.memberString, colon - param->defaultArg.__anon1.__anon2.memberString);
15993 thisClassTypeString[colon - param->defaultArg.__anon1.__anon2.memberString] = '\0';
15994 }
15995 else
15996 strcpy(thisClassTypeString, _class->fullName);
15997 }
15998 decl = SpecDeclFromString(param->defaultArg.__anon1.__anon2.__anon1.member->dataTypeString, specs, (((void *)0)));
15999 exp->expType = ProcessType(specs, decl);
16000 if(exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->templateClass)
16001 {
16002 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
16003 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
16004 int paramCount = 0;
16005 int lastParam = -1;
16006 char templateString[1024];
16007 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
16008
16009 sprintf(templateString, "%s<", expClass->templateClass->fullName);
16010 for(cClass = expClass; cClass; cClass = cClass->base)
16011 {
16012 int p = 0;
16013
16014 for(param = cClass->templateParams.first; param; param = param->next)
16015 {
16016 int id = p;
16017 struct __ecereNameSpace__ecere__com__Class * sClass;
16018 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
16019
16020 for(sClass = cClass->base; sClass; sClass = sClass->base)
16021 id += sClass->templateParams.count;
16022 arg = expClass->templateArgs[id];
16023 for(sClass = _class; sClass; sClass = sClass->base)
16024 {
16025 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
16026 int p = 0;
16027 struct __ecereNameSpace__ecere__com__Class * nextClass;
16028
16029 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
16030 p += nextClass->templateParams.count;
16031 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
16032 {
16033 if(cParam->type == 0 && arg.__anon1.__anon1.dataTypeString && !strcmp(cParam->name, arg.__anon1.__anon1.dataTypeString))
16034 {
16035 if(_class->templateArgs && arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
16036 {
16037 arg.__anon1.__anon1.dataTypeString = _class->templateArgs[p].__anon1.__anon1.dataTypeString;
16038 arg.__anon1.__anon1.dataTypeClass = _class->templateArgs[p].__anon1.__anon1.dataTypeClass;
16039 break;
16040 }
16041 }
16042 }
16043 }
16044 {
16045 char argument[256];
16046
16047 argument[0] = '\0';
16048 switch(param->type)
16049 {
16050 case 2:
16051 {
16052 char expString[1024];
16053 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16054 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
16055 struct Expression * exp;
16056 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
16057
16058 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
16059 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
16060 ProcessExpressionType(exp);
16061 ComputeExpression(exp);
16062 expString[0] = '\0';
16063 PrintExpression(exp, expString);
16064 strcat(argument, expString);
16065 FreeExpression(exp);
16066 break;
16067 }
16068 case 1:
16069 {
16070 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
16071 break;
16072 }
16073 case 0:
16074 {
16075 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
16076 {
16077 if(!strcmp(arg.__anon1.__anon1.dataTypeString, "thisclass"))
16078 strcat(argument, thisClassTypeString);
16079 else
16080 strcat(argument, arg.__anon1.__anon1.dataTypeString);
16081 }
16082 break;
16083 }
16084 }
16085 if(argument[0])
16086 {
16087 if(paramCount)
16088 strcat(templateString, ", ");
16089 if(lastParam != p - 1)
16090 {
16091 strcat(templateString, param->name);
16092 strcat(templateString, " = ");
16093 }
16094 strcat(templateString, argument);
16095 paramCount++;
16096 lastParam = p;
16097 }
16098 p++;
16099 }
16100 }
16101 }
16102 {
16103 int len = strlen(templateString);
16104
16105 if(templateString[len - 1] == '>')
16106 templateString[len++] = ' ';
16107 templateString[len++] = '>';
16108 templateString[len++] = '\0';
16109 }
16110 {
16111 struct Context * context = SetupTemplatesContext(_class);
16112
16113 FreeType(exp->expType);
16114 exp->expType = ProcessTypeString(templateString, 0);
16115 FinishTemplatesContext(context);
16116 }
16117 }
16118 exp->type = 5;
16119 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")))))))));
16120 }
16121 }
16122 else if(type->__anon1.templateParameter && type->__anon1.templateParameter->type == 0 && (type->__anon1.templateParameter->__anon1.dataType || type->__anon1.templateParameter->dataTypeString))
16123 {
16124 type = ProcessTemplateParameterType(type->__anon1.templateParameter);
16125 }
16126 }
16127 if(type && (type->kind == 20))
16128 ;
16129 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)))
16130 {
16131 struct Identifier * id = exp->__anon1.member.member;
16132 int typeKind = type->kind;
16133 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));
16134
16135 if(typeKind == 19 && exp->__anon1.member.exp->type == 24)
16136 {
16137 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
16138 typeKind = 8;
16139 }
16140 if(id)
16141 {
16142 if(typeKind == 3 || typeKind == 15)
16143 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
16144 else if(!_class)
16145 {
16146 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
16147 {
16148 _class = type->__anon1._class->__anon1.registered;
16149 }
16150 else if((type->kind == 12 || type->kind == 13) && type->__anon1.type && type->__anon1.type->kind == 1)
16151 {
16152 _class = FindClass("char *")->__anon1.registered;
16153 }
16154 else if(type->kind == 13)
16155 {
16156 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
16157 FreeType(exp->expType);
16158 exp->expType = ProcessTypeString("uintptr", 0);
16159 exp->byReference = 1;
16160 }
16161 else
16162 {
16163 char string[1024] = "";
16164 struct Symbol * classSym;
16165
16166 PrintTypeNoConst(type, string, 0, 1);
16167 classSym = FindClass(string);
16168 if(classSym)
16169 _class = classSym->__anon1.registered;
16170 }
16171 }
16172 }
16173 if(_class && id)
16174 {
16175 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
16176 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
16177 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
16178 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
16179 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
16180
16181 if(id && id->_class && id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))
16182 exp->__anon1.member.memberType = 1;
16183 if(id && id->_class && type->__anon1._class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->__anon1._class->__anon1.registered, _class))
16184 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->__anon1._class->string);
16185 if(typeKind != 19)
16186 {
16187 if((exp->__anon1.member.memberType == 0 && thisPtr) || exp->__anon1.member.memberType == 3)
16188 {
16189 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
16190 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->__anon1.member.memberType != 3)
16191 {
16192 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
16193 if(prop)
16194 member = (((void *)0));
16195 }
16196 if(!member && !prop)
16197 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
16198 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
16199 exp->__anon1.member.thisPtr = 1;
16200 }
16201 else
16202 {
16203 unsigned int useMemberForNonConst = 0;
16204
16205 if(!id->classSym)
16206 {
16207 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
16208 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);
16209 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
16210 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
16211 }
16212 if((!prop || useMemberForNonConst) && !member)
16213 {
16214 method = useMemberForNonConst ? (((void *)0)) : __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
16215 if(!method)
16216 {
16217 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
16218 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);
16219 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
16220 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
16221 }
16222 }
16223 if(member && prop)
16224 {
16225 if(useMemberForNonConst || (member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class)))
16226 prop = (((void *)0));
16227 else
16228 member = (((void *)0));
16229 }
16230 }
16231 }
16232 if(!prop && !member && !method)
16233 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
16234 if(!prop && !member && !method)
16235 {
16236 if(typeKind == 19)
16237 {
16238 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->__anon1._class->__anon1.registered, exp->__anon1.member.member->string);
16239 if(classProp)
16240 {
16241 exp->__anon1.member.memberType = 5;
16242 exp->expType = ProcessTypeString(classProp->dataTypeString, 0);
16243 }
16244 else
16245 {
16246 char structName[1024];
16247 struct Identifier * id = exp->__anon1.member.member;
16248 struct Expression * classExp = exp->__anon1.member.exp;
16249
16250 type->refCount++;
16251 FreeType(classExp->expType);
16252 classExp->expType = ProcessTypeString("ecere::com::Class", 0);
16253 strcpy(structName, "__ecereClassData_");
16254 FullClassNameCat(structName, type->__anon1._class->string, 0);
16255 exp->type = 9;
16256 exp->__anon1.member.member = id;
16257 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"))))))));
16258 FreeType(type);
16259 ProcessExpressionType(exp);
16260 return ;
16261 }
16262 }
16263 else
16264 {
16265 struct Symbol * classSym = FindClass(id->string);
16266
16267 if(classSym)
16268 {
16269 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->__anon1.registered;
16270
16271 if(convertClass)
16272 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
16273 }
16274 }
16275 }
16276 if(exp->__anon1.member.exp->destType)
16277 FreeType(exp->__anon1.member.exp->destType);
16278 {
16279 if(method && !method->_class->symbol)
16280 method->_class->symbol = FindClass(method->_class->fullName);
16281 if(prop && !prop->_class->symbol)
16282 prop->_class->symbol = FindClass(prop->_class->fullName);
16283 exp->__anon1.member.exp->destType = __extension__ ({
16284 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16285
16286 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 8, __ecereInstance1->__anon1._class = prop ? prop->_class->symbol : method ? method->_class->symbol : _class->symbol, __ecereInstance1;
16287 });
16288 }
16289 if(prop)
16290 {
16291 exp->__anon1.member.memberType = 1;
16292 if(!prop->dataType)
16293 ProcessPropertyType(prop);
16294 exp->expType = prop->dataType;
16295 if(!strcmp(_class->base->fullName, "eda::Row") && !exp->expType->constant && !exp->destType)
16296 {
16297 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16298
16299 CopyTypeInto(type, exp->expType);
16300 type->refCount = 1;
16301 type->constant = 1;
16302 exp->expType = type;
16303 }
16304 else if(prop->dataType)
16305 prop->dataType->refCount++;
16306 }
16307 else if(member)
16308 {
16309 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
16310 {
16311 FreeExpContents(exp);
16312 exp->type = 0;
16313 exp->__anon1.__anon1.identifier = MkIdentifier("class");
16314 ProcessExpressionType(exp);
16315 return ;
16316 }
16317 exp->__anon1.member.memberType = 3;
16318 DeclareStruct(_class->fullName, 0);
16319 if(!member->dataType)
16320 {
16321 struct Context * context = SetupTemplatesContext(_class);
16322
16323 member->dataType = ProcessTypeString(member->dataTypeString, 0);
16324 FinishTemplatesContext(context);
16325 }
16326 exp->expType = member->dataType;
16327 if(member->dataType)
16328 member->dataType->refCount++;
16329 }
16330 else if(revConvert)
16331 {
16332 exp->__anon1.member.memberType = 4;
16333 exp->expType = MkClassType(revConvert->_class->fullName);
16334 }
16335 else if(method)
16336 {
16337 {
16338 exp->__anon1.member.memberType = 2;
16339 }
16340 if(!method->dataType)
16341 ProcessMethodType(method);
16342 exp->expType = __extension__ ({
16343 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16344
16345 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1;
16346 });
16347 exp->expType->__anon1.__anon3.methodClass = (id && id->_class) ? _class : (((void *)0));
16348 exp->expType->__anon1.__anon3.usedClass = _class;
16349 }
16350 else if(!classProp)
16351 {
16352 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
16353 {
16354 FreeExpContents(exp);
16355 exp->type = 0;
16356 exp->__anon1.__anon1.identifier = MkIdentifier("class");
16357 FreeType(exp->expType);
16358 exp->expType = MkClassType("ecere::com::Class");
16359 return ;
16360 }
16361 yylloc = exp->__anon1.member.member->loc;
16362 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
16363 if(inCompiler)
16364 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
16365 }
16366 if(_class && exp->expType)
16367 {
16368 struct __ecereNameSpace__ecere__com__Class * tClass;
16369
16370 tClass = type->__anon1._class && type->__anon1._class->__anon1.registered ? type->__anon1._class->__anon1.registered : _class;
16371 while(tClass && !tClass->templateClass)
16372 tClass = tClass->base;
16373 if(tClass && exp->expType->kind == 20 && exp->expType->__anon1.templateParameter->type == 0)
16374 {
16375 int id = 0;
16376 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
16377 struct __ecereNameSpace__ecere__com__Class * sClass;
16378
16379 for(sClass = tClass; sClass; sClass = sClass->base)
16380 {
16381 id = 0;
16382 if(sClass->templateClass)
16383 sClass = sClass->templateClass;
16384 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
16385 {
16386 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.templateParameter->identifier->string, curParam->name))
16387 {
16388 for(sClass = sClass->base; sClass; sClass = sClass->base)
16389 id += sClass->templateParams.count;
16390 break;
16391 }
16392 id++;
16393 }
16394 if(curParam)
16395 break;
16396 }
16397 if(curParam && tClass->templateArgs[id].__anon1.__anon1.dataTypeString)
16398 {
16399 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
16400 struct Context * context = SetupTemplatesContext(tClass);
16401 unsigned int constant = exp->expType->constant;
16402
16403 FreeType(exp->expType);
16404 exp->expType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
16405 if(exp->expType->kind == 8 && constant)
16406 exp->expType->constant = 1;
16407 else if(exp->expType->kind == 13)
16408 {
16409 struct Type * t = exp->expType->__anon1.type;
16410
16411 while(t->kind == 13)
16412 t = t->__anon1.type;
16413 if(constant)
16414 t->constant = constant;
16415 }
16416 if(exp->expType)
16417 {
16418 if(exp->expType->kind == 21)
16419 {
16420 FreeType(exp->expType);
16421 exp->expType = ReplaceThisClassType(_class);
16422 }
16423 if(tClass->templateClass && (exp->expType->kind != 20 || (!exp->expType->__anon1.templateParameter || (!exp->expType->__anon1.templateParameter->dataTypeString && !exp->expType->__anon1.templateParameter->__anon1.dataType))))
16424 exp->expType->passAsTemplate = 1;
16425 if(!exp->destType)
16426 {
16427 exp->destType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
16428 if(exp->destType->kind == 8 && constant)
16429 exp->destType->constant = 1;
16430 else if(exp->destType->kind == 13)
16431 {
16432 struct Type * t = exp->destType->__anon1.type;
16433
16434 while(t->kind == 13)
16435 t = t->__anon1.type;
16436 if(constant)
16437 t->constant = constant;
16438 }
16439 if(exp->destType->kind == 21)
16440 {
16441 FreeType(exp->destType);
16442 exp->destType = ReplaceThisClassType(_class);
16443 }
16444 }
16445 }
16446 FinishTemplatesContext(context);
16447 }
16448 }
16449 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)
16450 {
16451 int id = 0;
16452 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
16453 struct __ecereNameSpace__ecere__com__Class * sClass;
16454
16455 for(sClass = tClass; sClass; sClass = sClass->base)
16456 {
16457 id = 0;
16458 if(sClass->templateClass)
16459 sClass = sClass->templateClass;
16460 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
16461 {
16462 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.type->__anon1.templateParameter->identifier->string, curParam->name))
16463 {
16464 for(sClass = sClass->base; sClass; sClass = sClass->base)
16465 id += sClass->templateParams.count;
16466 break;
16467 }
16468 id++;
16469 }
16470 if(curParam)
16471 break;
16472 }
16473 if(curParam)
16474 {
16475 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
16476 struct Context * context = SetupTemplatesContext(tClass);
16477 struct Type * basicType;
16478
16479 basicType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
16480 if(basicType)
16481 {
16482 if(basicType->kind == 21)
16483 {
16484 FreeType(basicType);
16485 basicType = ReplaceThisClassType(_class);
16486 }
16487 FreeType(exp->expType);
16488 exp->expType = __extension__ ({
16489 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16490
16491 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = basicType, __ecereInstance1;
16492 });
16493 if(!exp->destType)
16494 {
16495 exp->destType = exp->expType;
16496 exp->destType->refCount++;
16497 }
16498 {
16499 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16500 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16501 struct Declarator * decl;
16502
16503 decl = SpecDeclFromString(arg.__anon1.__anon1.dataTypeString, specs, (((void *)0)));
16504 *newExp = *exp;
16505 if(exp->destType)
16506 exp->destType->refCount++;
16507 if(exp->expType)
16508 exp->expType->refCount++;
16509 exp->type = 11;
16510 exp->__anon1.cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
16511 exp->__anon1.cast.exp = newExp;
16512 }
16513 }
16514 FinishTemplatesContext(context);
16515 }
16516 }
16517 else if(tClass && exp->expType->kind == 8 && exp->expType->__anon1._class && strchr(exp->expType->__anon1._class->string, '<'))
16518 {
16519 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
16520
16521 if(expClass)
16522 {
16523 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
16524 int p = 0;
16525 int paramCount = 0;
16526 int lastParam = -1;
16527 char templateString[1024];
16528 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
16529
16530 sprintf(templateString, "%s<", expClass->templateClass->fullName);
16531 while(cClass != expClass)
16532 {
16533 struct __ecereNameSpace__ecere__com__Class * sClass;
16534
16535 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
16536 ;
16537 cClass = sClass;
16538 for(param = cClass->templateParams.first; param; param = param->next)
16539 {
16540 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
16541 int cp = 0;
16542 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
16543 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
16544
16545 while(cClassCur != tClass && !paramCur)
16546 {
16547 struct __ecereNameSpace__ecere__com__Class * sClassCur;
16548
16549 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
16550 ;
16551 cClassCur = sClassCur;
16552 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
16553 {
16554 if(!strcmp(paramCur->name, param->name))
16555 {
16556 break;
16557 }
16558 cp++;
16559 }
16560 }
16561 if(paramCur && paramCur->type == 0)
16562 arg = tClass->templateArgs[cp];
16563 else
16564 arg = expClass->templateArgs[p];
16565 {
16566 char argument[256];
16567
16568 argument[0] = '\0';
16569 switch(param->type)
16570 {
16571 case 2:
16572 {
16573 char expString[1024];
16574 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16575 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
16576 struct Expression * exp;
16577 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
16578
16579 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
16580 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
16581 ProcessExpressionType(exp);
16582 ComputeExpression(exp);
16583 expString[0] = '\0';
16584 PrintExpression(exp, expString);
16585 strcat(argument, expString);
16586 FreeExpression(exp);
16587 break;
16588 }
16589 case 1:
16590 {
16591 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
16592 break;
16593 }
16594 case 0:
16595 {
16596 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
16597 strcat(argument, arg.__anon1.__anon1.dataTypeString);
16598 break;
16599 }
16600 }
16601 if(argument[0])
16602 {
16603 if(paramCount)
16604 strcat(templateString, ", ");
16605 if(lastParam != p - 1)
16606 {
16607 strcat(templateString, param->name);
16608 strcat(templateString, " = ");
16609 }
16610 strcat(templateString, argument);
16611 paramCount++;
16612 lastParam = p;
16613 }
16614 }
16615 p++;
16616 }
16617 }
16618 {
16619 int len = strlen(templateString);
16620
16621 if(templateString[len - 1] == '>')
16622 templateString[len++] = ' ';
16623 templateString[len++] = '>';
16624 templateString[len++] = '\0';
16625 }
16626 FreeType(exp->expType);
16627 {
16628 struct Context * context = SetupTemplatesContext(tClass);
16629
16630 exp->expType = ProcessTypeString(templateString, 0);
16631 FinishTemplatesContext(context);
16632 }
16633 }
16634 }
16635 }
16636 }
16637 else
16638 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)");
16639 }
16640 else if(type && (type->kind == 9 || type->kind == 10))
16641 {
16642 struct Type * memberType = exp->__anon1.member.member ? FindMember(type, exp->__anon1.member.member->string) : (((void *)0));
16643
16644 if(memberType)
16645 {
16646 exp->expType = memberType;
16647 if(memberType)
16648 memberType->refCount++;
16649 }
16650 }
16651 else
16652 {
16653 char expString[10240];
16654
16655 expString[0] = '\0';
16656 if(inCompiler)
16657 {
16658 PrintExpression(exp, expString);
16659 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16660 }
16661 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "member operator on non-structure type expression %s\n", (((void *)0))), expString);
16662 }
16663 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
16664 {
16665 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
16666 {
16667 struct Identifier * id = exp->__anon1.member.member;
16668 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));
16669
16670 if(_class)
16671 {
16672 FreeType(exp->expType);
16673 exp->expType = ReplaceThisClassType(_class);
16674 }
16675 }
16676 }
16677 yylloc = oldyylloc;
16678 break;
16679 }
16680 case 9:
16681 {
16682 struct Type * destType = exp->destType;
16683
16684 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
16685 {
16686 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
16687 }
16688 exp->__anon1.member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->__anon1.member.exp)));
16689 exp->type = 8;
16690 if(destType)
16691 destType->count++;
16692 ProcessExpressionType(exp);
16693 if(destType)
16694 destType->count--;
16695 break;
16696 }
16697 case 15:
16698 {
16699 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
16700
16701 if(classSym && classSym->__anon1.registered)
16702 {
16703 if(classSym->__anon1.registered->type == 5)
16704 {
16705 char name[1024];
16706
16707 name[0] = '\0';
16708 DeclareStruct(classSym->string, 0);
16709 FreeSpecifier(exp->__anon1._class);
16710 exp->type = 10;
16711 FullClassNameCat(name, classSym->string, 0);
16712 exp->__anon1.typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
16713 }
16714 else
16715 {
16716 if(classSym->__anon1.registered->fixed)
16717 {
16718 FreeSpecifier(exp->__anon1._class);
16719 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
16720 exp->type = 2;
16721 }
16722 else
16723 {
16724 char className[1024];
16725
16726 strcpy(className, "__ecereClass_");
16727 FullClassNameCat(className, classSym->string, 1);
16728 DeclareClass(classSym, className);
16729 FreeExpContents(exp);
16730 exp->type = 9;
16731 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
16732 exp->__anon1.member.member = MkIdentifier("structSize");
16733 }
16734 }
16735 }
16736 exp->expType = __extension__ ({
16737 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16738
16739 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
16740 });
16741 break;
16742 }
16743 case 10:
16744 {
16745 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
16746
16747 exp->expType = __extension__ ({
16748 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16749
16750 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
16751 });
16752 exp->isConstant = 1;
16753 DeclareType(type, 0, 0);
16754 FreeType(type);
16755 break;
16756 }
16757 case 11:
16758 {
16759 struct Type * type = ProcessType(exp->__anon1.cast.typeName->qualifiers, exp->__anon1.cast.typeName->declarator);
16760
16761 type->count = 1;
16762 FreeType(exp->__anon1.cast.exp->destType);
16763 exp->__anon1.cast.exp->destType = type;
16764 type->refCount++;
16765 type->casted = 1;
16766 ProcessExpressionType(exp->__anon1.cast.exp);
16767 type->casted = 0;
16768 type->count = 0;
16769 exp->expType = type;
16770 if(!exp->__anon1.cast.exp->needCast && !NeedCast(exp->__anon1.cast.exp->expType, type))
16771 {
16772 void * prev = exp->prev, * next = exp->next;
16773 struct Type * expType = exp->__anon1.cast.exp->destType;
16774 struct Expression * castExp = exp->__anon1.cast.exp;
16775 struct Type * destType = exp->destType;
16776
16777 if(expType)
16778 expType->refCount++;
16779 FreeType(exp->expType);
16780 FreeTypeName(exp->__anon1.cast.typeName);
16781 *exp = *castExp;
16782 FreeType(exp->expType);
16783 FreeType(exp->destType);
16784 exp->expType = expType;
16785 exp->destType = destType;
16786 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
16787 exp->prev = prev;
16788 exp->next = next;
16789 }
16790 else
16791 {
16792 exp->isConstant = exp->__anon1.cast.exp->isConstant;
16793 }
16794 break;
16795 }
16796 case 33:
16797 {
16798 struct Type * type = ProcessType(exp->__anon1.initializer.typeName->qualifiers, exp->__anon1.initializer.typeName->declarator);
16799
16800 exp->expType = type;
16801 break;
16802 }
16803 case 34:
16804 {
16805 struct Type * type = ProcessType(exp->__anon1.vaArg.typeName->qualifiers, exp->__anon1.vaArg.typeName->declarator);
16806
16807 ProcessExpressionType(exp->__anon1.vaArg.exp);
16808 exp->expType = type;
16809 break;
16810 }
16811 case 12:
16812 {
16813 struct Expression * e;
16814
16815 exp->isConstant = 1;
16816 FreeType(exp->__anon1.cond.cond->destType);
16817 exp->__anon1.cond.cond->destType = MkClassType("bool");
16818 exp->__anon1.cond.cond->destType->truth = 1;
16819 ProcessExpressionType(exp->__anon1.cond.cond);
16820 if(!exp->__anon1.cond.cond->isConstant)
16821 exp->isConstant = 0;
16822 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
16823 {
16824 if(!e->next)
16825 {
16826 FreeType(e->destType);
16827 e->destType = exp->destType;
16828 if(e->destType)
16829 e->destType->refCount++;
16830 }
16831 ProcessExpressionType(e);
16832 if(!e->next)
16833 {
16834 exp->expType = e->expType;
16835 if(e->expType)
16836 e->expType->refCount++;
16837 }
16838 if(!e->isConstant)
16839 exp->isConstant = 0;
16840 }
16841 FreeType(exp->__anon1.cond.elseExp->destType);
16842 exp->__anon1.cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
16843 if(exp->__anon1.cond.elseExp->destType)
16844 exp->__anon1.cond.elseExp->destType->refCount++;
16845 ProcessExpressionType(exp->__anon1.cond.elseExp);
16846 if(!exp->__anon1.cond.elseExp->isConstant)
16847 exp->isConstant = 0;
16848 break;
16849 }
16850 case 23:
16851 {
16852 if(exp->__anon1.compound && exp->__anon1.compound->__anon1.compound.statements && (*exp->__anon1.compound->__anon1.compound.statements).last)
16853 {
16854 struct Statement * last = (*exp->__anon1.compound->__anon1.compound.statements).last;
16855
16856 if(last->type == 3 && last->__anon1.expressions && (*last->__anon1.expressions).last)
16857 {
16858 ((struct Expression *)(*last->__anon1.expressions).last)->destType = exp->destType;
16859 if(exp->destType)
16860 exp->destType->refCount++;
16861 }
16862 ProcessStatement(exp->__anon1.compound);
16863 exp->expType = (last->__anon1.expressions && (*last->__anon1.expressions).last) ? ((struct Expression *)(*last->__anon1.expressions).last)->expType : (((void *)0));
16864 if(exp->expType)
16865 exp->expType->refCount++;
16866 }
16867 break;
16868 }
16869 case 24:
16870 {
16871 struct Specifier * spec = (*exp->__anon1._classExp.specifiers).first;
16872
16873 if(spec && spec->type == 1)
16874 {
16875 exp->expType = MkClassType(spec->__anon1.__anon1.name);
16876 exp->expType->kind = 19;
16877 exp->byReference = 1;
16878 }
16879 else
16880 {
16881 exp->expType = MkClassType("ecere::com::Class");
16882 exp->byReference = 1;
16883 }
16884 break;
16885 }
16886 case 25:
16887 {
16888 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
16889
16890 if(_class)
16891 {
16892 struct Identifier * id = exp->__anon1.classData.id;
16893 char structName[1024];
16894 struct Expression * classExp;
16895
16896 strcpy(structName, "__ecereClassData_");
16897 FullClassNameCat(structName, _class->fullName, 0);
16898 exp->type = 9;
16899 exp->__anon1.member.member = id;
16900 if(curCompound && FindSymbol("this", curContext, curCompound->__anon1.compound.context, 0, 0))
16901 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
16902 else
16903 classExp = MkExpIdentifier(MkIdentifier("class"));
16904 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"))))))));
16905 ProcessExpressionType(exp);
16906 return ;
16907 }
16908 break;
16909 }
16910 case 35:
16911 {
16912 struct Type * type = (((void *)0));
16913 const char * typeString = (((void *)0));
16914 char typeStringBuf[1024];
16915
16916 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))
16917 {
16918 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->__anon1._class->__anon1.registered;
16919
16920 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
16921 }
16922 else if(exp->__anon1.list)
16923 {
16924 struct Expression * e;
16925
16926 for(e = (*exp->__anon1.list).first; e; e = e->next)
16927 {
16928 ProcessExpressionType(e);
16929 if(e->expType)
16930 {
16931 if(!type)
16932 {
16933 type = e->expType;
16934 type->refCount++;
16935 }
16936 else
16937 {
16938 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
16939 {
16940 FreeType(type);
16941 type = e->expType;
16942 e->expType = (((void *)0));
16943 e = (*exp->__anon1.list).first;
16944 ProcessExpressionType(e);
16945 if(e->expType)
16946 {
16947 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
16948 {
16949 FreeType(e->expType);
16950 e->expType = (((void *)0));
16951 FreeType(type);
16952 type = (((void *)0));
16953 break;
16954 }
16955 }
16956 }
16957 }
16958 if(e->expType)
16959 {
16960 FreeType(e->expType);
16961 e->expType = (((void *)0));
16962 }
16963 }
16964 }
16965 if(type)
16966 {
16967 typeStringBuf[0] = '\0';
16968 PrintTypeNoConst(type, typeStringBuf, 0, 1);
16969 typeString = typeStringBuf;
16970 FreeType(type);
16971 type = (((void *)0));
16972 }
16973 }
16974 if(typeString)
16975 {
16976 char templateString[1024];
16977 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
16978 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
16979 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16980 struct Expression * expExt;
16981 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16982
16983 sprintf(templateString, "Container<%s>", typeString);
16984 if(exp->__anon1.list)
16985 {
16986 struct Expression * e;
16987
16988 type = ProcessTypeString(typeString, 0);
16989 while((e = (*exp->__anon1.list).first))
16990 {
16991 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->__anon1.list), e);
16992 e->destType = type;
16993 type->refCount++;
16994 ProcessExpressionType(e);
16995 ListAdd(initializers, MkInitializerAssignment(e));
16996 }
16997 FreeType(type);
16998 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
16999 }
17000 DeclareStruct("ecere::com::BuiltInContainer", 0);
17001 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
17002 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17003 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
17004 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17005 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
17006 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17007 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
17008 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17009 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
17010 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
17011
17012 __ecereInstance1->type = 2, __ecereInstance1->__anon1.__anon1.constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, (void *)0), __ecereInstance1;
17013 })));
17014 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17015 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
17016 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17017 exp->expType = ProcessTypeString(templateString, 0);
17018 exp->type = 5;
17019 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
17020 ProcessExpressionType(expExt);
17021 }
17022 else
17023 {
17024 exp->expType = ProcessTypeString("Container", 0);
17025 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
17026 }
17027 break;
17028 }
17029 }
17030 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
17031 {
17032 FreeType(exp->expType);
17033 exp->expType = ReplaceThisClassType(thisClass);
17034 }
17035 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)
17036 {
17037 struct Symbol * symbol = FindSymbol(exp->expType->__anon1.__anon1.enumName, curContext, globalContext, 1, 0);
17038
17039 if(symbol)
17040 {
17041 if(exp->expType->kind != 15)
17042 {
17043 struct Type * member;
17044 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->__anon1.__anon1.enumName);
17045
17046 FreeType(exp->expType);
17047 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17048 exp->expType->kind = symbol->type->kind;
17049 exp->expType->refCount++;
17050 exp->expType->__anon1.__anon1.enumName = enumName;
17051 exp->expType->__anon1.__anon1.members = symbol->type->__anon1.__anon1.members;
17052 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
17053 member->refCount++;
17054 }
17055 else
17056 {
17057 struct __ecereNameSpace__ecere__sys__NamedLink64 * member;
17058
17059 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
17060 {
17061 struct __ecereNameSpace__ecere__sys__NamedLink64 * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(structSize_NamedLink64), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
17062
17063 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->__anon1.__anon1.members, value);
17064 }
17065 }
17066 }
17067 }
17068 yylloc = exp->loc;
17069 if(exp->destType && (exp->destType->kind == 18))
17070 ;
17071 else if(exp->destType && !exp->destType->keepCast)
17072 {
17073 if(!exp->needTemplateCast && exp->expType && (exp->expType->kind == 20 || exp->expType->passAsTemplate))
17074 exp->needTemplateCast = 1;
17075 if(exp->destType->kind == 0)
17076 ;
17077 else if(!CheckExpressionType(exp, exp->destType, 0, !exp->destType->casted))
17078 {
17079 if(!exp->destType->count || unresolved)
17080 {
17081 if(!exp->expType)
17082 {
17083 yylloc = exp->loc;
17084 if(exp->destType->kind != 14)
17085 {
17086 char type2[1024];
17087
17088 type2[0] = '\0';
17089 if(inCompiler)
17090 {
17091 char expString[10240];
17092
17093 expString[0] = '\0';
17094 PrintType(exp->destType, type2, 0, 1);
17095 if(inCompiler)
17096 {
17097 PrintExpression(exp, expString);
17098 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17099 }
17100 if(unresolved)
17101 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
17102 else if(exp->type != 16)
17103 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
17104 }
17105 }
17106 else
17107 {
17108 char expString[10240];
17109
17110 expString[0] = '\0';
17111 if(inCompiler)
17112 {
17113 PrintExpression(exp, expString);
17114 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17115 }
17116 if(unresolved)
17117 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), expString);
17118 else if(exp->type != 16)
17119 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
17120 }
17121 }
17122 else
17123 {
17124 char type1[1024];
17125 char type2[1024];
17126
17127 type1[0] = '\0';
17128 type2[0] = '\0';
17129 if(inCompiler)
17130 {
17131 PrintType(exp->expType, type1, 0, 1);
17132 PrintType(exp->destType, type2, 0, 1);
17133 }
17134 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)))
17135 ;
17136 else
17137 {
17138 char expString[10240];
17139
17140 expString[0] = '\0';
17141 if(inCompiler)
17142 {
17143 PrintExpression(exp, expString);
17144 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17145 }
17146 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
17147 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
17148 FreeType(exp->expType);
17149 exp->destType->refCount++;
17150 exp->expType = exp->destType;
17151 }
17152 }
17153 }
17154 }
17155 }
17156 else if(unresolved)
17157 {
17158 if(exp->__anon1.__anon1.identifier->_class && exp->__anon1.__anon1.identifier->_class->__anon1.__anon1.name)
17159 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);
17160 else if(exp->__anon1.__anon1.identifier->string && exp->__anon1.__anon1.identifier->string[0])
17161 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), exp->__anon1.__anon1.identifier->string);
17162 }
17163 else if(!exp->expType && exp->type != 16)
17164 {
17165 char expString[10240];
17166
17167 expString[0] = '\0';
17168 if(inCompiler)
17169 {
17170 PrintExpression(exp, expString);
17171 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17172 }
17173 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
17174 }
17175 if(inCompiler)
17176 ApplyAnyObjectLogic(exp);
17177 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)))
17178 {
17179 exp->byReference = 1;
17180 }
17181 yylloc = oldyylloc;
17182 }
17183
17184 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)
17185 {
17186 if(*curMember)
17187 {
17188 *curMember = (*curMember)->next;
17189 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
17190 {
17191 *curMember = subMemberStack[--(*subMemberStackPos)];
17192 *curMember = (*curMember)->next;
17193 }
17194 while((*curMember) && (*curMember)->isProperty)
17195 *curMember = (*curMember)->next;
17196 if(subMemberStackPos)
17197 {
17198 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
17199 {
17200 subMemberStack[(*subMemberStackPos)++] = *curMember;
17201 *curMember = (*curMember)->members.first;
17202 while(*curMember && (*curMember)->isProperty)
17203 *curMember = (*curMember)->next;
17204 }
17205 }
17206 }
17207 while(!*curMember)
17208 {
17209 if(!*curMember)
17210 {
17211 if(subMemberStackPos && *subMemberStackPos)
17212 {
17213 *curMember = subMemberStack[--(*subMemberStackPos)];
17214 *curMember = (*curMember)->next;
17215 }
17216 else
17217 {
17218 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
17219
17220 if(*curClass == _class)
17221 break;
17222 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
17223 ;
17224 *curMember = (*curClass)->membersAndProperties.first;
17225 }
17226 while((*curMember) && (*curMember)->isProperty)
17227 *curMember = (*curMember)->next;
17228 if(subMemberStackPos)
17229 {
17230 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
17231 {
17232 subMemberStack[(*subMemberStackPos)++] = *curMember;
17233 *curMember = (*curMember)->members.first;
17234 while(*curMember && (*curMember)->isProperty)
17235 *curMember = (*curMember)->next;
17236 }
17237 }
17238 }
17239 }
17240 }
17241
17242 static void ProcessInitializer(struct Initializer * init, struct Type * type)
17243 {
17244 switch(init->type)
17245 {
17246 case 0:
17247 if(!init->__anon1.exp || init->__anon1.exp->type != 1 || !init->__anon1.exp->__anon1.instance || init->__anon1.exp->__anon1.instance->_class || !type || type->kind == 8)
17248 {
17249 if(init->__anon1.exp && !init->__anon1.exp->destType)
17250 {
17251 FreeType(init->__anon1.exp->destType);
17252 init->__anon1.exp->destType = type;
17253 if(type)
17254 type->refCount++;
17255 }
17256 if(init->__anon1.exp)
17257 {
17258 ProcessExpressionType(init->__anon1.exp);
17259 init->isConstant = init->__anon1.exp->isConstant;
17260 }
17261 break;
17262 }
17263 else
17264 {
17265 struct Expression * exp = init->__anon1.exp;
17266 struct Instantiation * inst = exp->__anon1.instance;
17267 struct MembersInit * members;
17268
17269 init->type = 1;
17270 init->__anon1.list = MkList();
17271 if(inst->members)
17272 {
17273 for(members = (*inst->members).first; members; members = members->next)
17274 {
17275 if(members->type == 0)
17276 {
17277 struct MemberInit * member;
17278
17279 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
17280 {
17281 ListAdd(init->__anon1.list, member->initializer);
17282 member->initializer = (((void *)0));
17283 }
17284 }
17285 }
17286 }
17287 FreeExpression(exp);
17288 }
17289 case 1:
17290 {
17291 struct Initializer * i;
17292 struct Type * initializerType = (((void *)0));
17293 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
17294 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
17295 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
17296 int subMemberStackPos = 0;
17297
17298 if(type && type->kind == 12)
17299 initializerType = Dereference(type);
17300 else if(type && (type->kind == 9 || type->kind == 10))
17301 initializerType = type->__anon1.__anon1.members.first;
17302 for(i = (*init->__anon1.list).first; i; i = i->next)
17303 {
17304 if(type && type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
17305 {
17306 FindNextDataMember(type->__anon1._class->__anon1.registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
17307 if(curMember)
17308 {
17309 if(!curMember->dataType)
17310 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0);
17311 initializerType = curMember->dataType;
17312 }
17313 }
17314 ProcessInitializer(i, initializerType);
17315 if(initializerType && type && (type->kind == 9 || type->kind == 10))
17316 initializerType = initializerType->next;
17317 if(!i->isConstant)
17318 init->isConstant = 0;
17319 }
17320 if(type && type->kind == 12)
17321 FreeType(initializerType);
17322 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))
17323 {
17324 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Assigning list initializer to non list\n", (((void *)0))));
17325 }
17326 break;
17327 }
17328 }
17329 }
17330
17331 extern struct Symbol * FindType(struct Context * ctx, const char *  name);
17332
17333 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
17334
17335 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
17336 {
17337 switch(spec->type)
17338 {
17339 case 0:
17340 {
17341 if(spec->__anon1.specifier == THISCLASS)
17342 {
17343 if(thisClass)
17344 {
17345 spec->type = 1;
17346 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
17347 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
17348 ProcessSpecifier(spec, declareStruct);
17349 }
17350 }
17351 break;
17352 }
17353 case 1:
17354 {
17355 struct Symbol * symbol = FindType(curContext, spec->__anon1.__anon1.name);
17356
17357 if(symbol)
17358 DeclareType(symbol->type, 1, 1);
17359 else if((symbol = spec->__anon1.__anon1.symbol) && symbol->__anon1.registered && symbol->__anon1.registered->type == 1 && declareStruct)
17360 DeclareStruct(spec->__anon1.__anon1.name, 0);
17361 break;
17362 }
17363 case 2:
17364 {
17365 struct Enumerator * e;
17366
17367 if(spec->__anon1.__anon2.list)
17368 {
17369 for(e = (*spec->__anon1.__anon2.list).first; e; e = e->next)
17370 {
17371 if(e->exp)
17372 ProcessExpressionType(e->exp);
17373 }
17374 }
17375 break;
17376 }
17377 case 3:
17378 case 4:
17379 {
17380 if(spec->__anon1.__anon2.definitions)
17381 {
17382 struct Symbol * symbol = spec->__anon1.__anon2.id ? FindClass(spec->__anon1.__anon2.id->string) : (((void *)0));
17383
17384 ProcessClass(spec->__anon1.__anon2.definitions, symbol);
17385 }
17386 break;
17387 }
17388 }
17389 }
17390
17391 static void ProcessDeclarator(struct Declarator * decl)
17392 {
17393 switch(decl->type)
17394 {
17395 case 1:
17396 if(decl->__anon1.identifier->classSym)
17397 {
17398 FreeSpecifier(decl->__anon1.identifier->_class);
17399 decl->__anon1.identifier->_class = (((void *)0));
17400 }
17401 break;
17402 case 3:
17403 if(decl->__anon1.array.exp)
17404 ProcessExpressionType(decl->__anon1.array.exp);
17405 case 0:
17406 case 2:
17407 case 4:
17408 case 5:
17409 case 6:
17410 case 7:
17411 if(decl->declarator)
17412 ProcessDeclarator(decl->declarator);
17413 if(decl->type == 4)
17414 {
17415 struct Identifier * id = GetDeclId(decl);
17416
17417 if(id && id->_class)
17418 {
17419 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
17420
17421 if(!decl->__anon1.function.parameters)
17422 decl->__anon1.function.parameters = MkList();
17423 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), (((void *)0)), param);
17424 id->_class = (((void *)0));
17425 }
17426 if(decl->__anon1.function.parameters)
17427 {
17428 struct TypeName * param;
17429
17430 for(param = (*decl->__anon1.function.parameters).first; param; param = param->next)
17431 {
17432 if(param->qualifiers && (*param->qualifiers).first)
17433 {
17434 struct Specifier * spec = (*param->qualifiers).first;
17435
17436 if(spec && spec->__anon1.specifier == TYPED_OBJECT)
17437 {
17438 struct Declarator * d = param->declarator;
17439 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);
17440
17441 if(d->type != 5)
17442 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*newParam->qualifiers), (((void *)0)), MkSpecifier(CONST));
17443 FreeList(param->qualifiers, FreeSpecifier);
17444 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
17445 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
17446 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), param, newParam);
17447 param = newParam;
17448 }
17449 else if(spec && spec->__anon1.specifier == ANY_OBJECT)
17450 {
17451 struct Declarator * d = param->declarator;
17452
17453 FreeList(param->qualifiers, FreeSpecifier);
17454 param->qualifiers = MkListOne(MkSpecifier(VOID));
17455 if(d->type != 5)
17456 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*param->qualifiers), (((void *)0)), MkSpecifier(CONST));
17457 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
17458 }
17459 else if(spec->__anon1.specifier == THISCLASS)
17460 {
17461 if(thisClass)
17462 {
17463 spec->type = 1;
17464 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
17465 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
17466 ProcessSpecifier(spec, 0);
17467 }
17468 }
17469 }
17470 if(param->declarator)
17471 ProcessDeclarator(param->declarator);
17472 }
17473 }
17474 }
17475 break;
17476 }
17477 }
17478
17479 extern struct Identifier * CopyIdentifier(struct Identifier * id);
17480
17481 extern void FreeInitDeclarator(struct InitDeclarator * decl);
17482
17483 static void ProcessDeclaration(struct Declaration * decl)
17484 {
17485 yylloc = decl->loc;
17486 switch(decl->type)
17487 {
17488 case 1:
17489 {
17490 unsigned int declareStruct = 0;
17491
17492 if(decl->__anon1.__anon1.declarators)
17493 {
17494 struct InitDeclarator * d;
17495
17496 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
17497 {
17498 struct Type * type, * subType;
17499
17500 ProcessDeclarator(d->declarator);
17501 type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
17502 if(d->initializer)
17503 {
17504 ProcessInitializer(d->initializer, type);
17505 if((*decl->__anon1.__anon1.declarators).count == 1 && d->initializer->type == 0 && d->initializer->__anon1.exp->type == 1)
17506 {
17507 if(type->kind == 8 && type->__anon1._class == d->initializer->__anon1.exp->expType->__anon1._class)
17508 {
17509 struct Instantiation * inst = d->initializer->__anon1.exp->__anon1.instance;
17510
17511 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
17512 d->initializer->__anon1.exp->__anon1.instance = (((void *)0));
17513 if(decl->__anon1.__anon1.specifiers)
17514 FreeList(decl->__anon1.__anon1.specifiers, FreeSpecifier);
17515 FreeList(decl->__anon1.__anon1.declarators, FreeInitDeclarator);
17516 d = (((void *)0));
17517 decl->type = 2;
17518 decl->__anon1.inst = inst;
17519 }
17520 }
17521 }
17522 for(subType = type; subType; )
17523 {
17524 if(subType->kind == 8)
17525 {
17526 declareStruct = 1;
17527 break;
17528 }
17529 else if(subType->kind == 13)
17530 break;
17531 else if(subType->kind == 12)
17532 subType = subType->__anon1.__anon4.arrayType;
17533 else
17534 break;
17535 }
17536 FreeType(type);
17537 if(!d)
17538 break;
17539 }
17540 }
17541 if(decl->__anon1.__anon1.specifiers)
17542 {
17543 struct Specifier * s;
17544
17545 for(s = (*decl->__anon1.__anon1.specifiers).first; s; s = s->next)
17546 {
17547 ProcessSpecifier(s, declareStruct);
17548 }
17549 }
17550 break;
17551 }
17552 case 2:
17553 {
17554 ProcessInstantiationType(decl->__anon1.inst);
17555 break;
17556 }
17557 case 0:
17558 {
17559 struct Specifier * spec;
17560 struct Declarator * d;
17561 unsigned int declareStruct = 0;
17562
17563 if(decl->__anon1.__anon1.declarators)
17564 {
17565 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
17566 {
17567 struct Type * type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
17568 struct Type * subType;
17569
17570 ProcessDeclarator(d);
17571 for(subType = type; subType; )
17572 {
17573 if(subType->kind == 8)
17574 {
17575 declareStruct = 1;
17576 break;
17577 }
17578 else if(subType->kind == 13)
17579 break;
17580 else if(subType->kind == 12)
17581 subType = subType->__anon1.__anon4.arrayType;
17582 else
17583 break;
17584 }
17585 FreeType(type);
17586 }
17587 }
17588 if(decl->__anon1.__anon1.specifiers)
17589 {
17590 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
17591 ProcessSpecifier(spec, declareStruct);
17592 }
17593 break;
17594 }
17595 }
17596 }
17597
17598 static struct FunctionDefinition * curFunction;
17599
17600 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
17601 {
17602 char propName[1024], propNameM[1024];
17603 char getName[1024], setName[1024];
17604 struct __ecereNameSpace__ecere__sys__OldList * args;
17605
17606 DeclareProperty(prop, setName, getName);
17607 strcpy(propName, "__ecereProp_");
17608 FullClassNameCat(propName, prop->_class->fullName, 0);
17609 strcat(propName, "_");
17610 FullClassNameCat(propName, prop->name, 1);
17611 strcpy(propNameM, "__ecerePropM_");
17612 FullClassNameCat(propNameM, prop->_class->fullName, 0);
17613 strcat(propNameM, "_");
17614 FullClassNameCat(propNameM, prop->name, 1);
17615 if(prop->isWatchable)
17616 {
17617 args = MkList();
17618 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17619 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17620 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17621 args = MkList();
17622 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17623 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17624 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17625 }
17626 {
17627 args = MkList();
17628 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17629 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17630 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17631 args = MkList();
17632 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17633 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17634 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17635 }
17636 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
17637 curFunction->propSet->fireWatchersDone = 1;
17638 }
17639
17640 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
17641
17642 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
17643
17644 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
17645
17646 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
17647
17648 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
17649
17650 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
17651
17652 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
17653
17654 extern void FreePropertyWatch(struct PropertyWatch * watcher);
17655
17656 static void ProcessStatement(struct Statement * stmt)
17657 {
17658 yylloc = stmt->loc;
17659 switch(stmt->type)
17660 {
17661 case 0:
17662 ProcessStatement(stmt->__anon1.labeled.stmt);
17663 break;
17664 case 1:
17665 if(stmt->__anon1.caseStmt.exp)
17666 {
17667 FreeType(stmt->__anon1.caseStmt.exp->destType);
17668 stmt->__anon1.caseStmt.exp->destType = curSwitchType;
17669 if(curSwitchType)
17670 curSwitchType->refCount++;
17671 ProcessExpressionType(stmt->__anon1.caseStmt.exp);
17672 ComputeExpression(stmt->__anon1.caseStmt.exp);
17673 }
17674 if(stmt->__anon1.caseStmt.stmt)
17675 ProcessStatement(stmt->__anon1.caseStmt.stmt);
17676 break;
17677 case 2:
17678 {
17679 if(stmt->__anon1.compound.context)
17680 {
17681 struct Declaration * decl;
17682 struct Statement * s;
17683 struct Statement * prevCompound = curCompound;
17684 struct Context * prevContext = curContext;
17685
17686 if(!stmt->__anon1.compound.isSwitch)
17687 curCompound = stmt;
17688 curContext = stmt->__anon1.compound.context;
17689 if(stmt->__anon1.compound.declarations)
17690 {
17691 for(decl = (*stmt->__anon1.compound.declarations).first; decl; decl = decl->next)
17692 ProcessDeclaration(decl);
17693 }
17694 if(stmt->__anon1.compound.statements)
17695 {
17696 for(s = (*stmt->__anon1.compound.statements).first; s; s = s->next)
17697 ProcessStatement(s);
17698 }
17699 curContext = prevContext;
17700 curCompound = prevCompound;
17701 }
17702 break;
17703 }
17704 case 3:
17705 {
17706 struct Expression * exp;
17707
17708 if(stmt->__anon1.expressions)
17709 {
17710 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
17711 ProcessExpressionType(exp);
17712 }
17713 break;
17714 }
17715 case 4:
17716 {
17717 struct Expression * exp;
17718
17719 FreeType(((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType);
17720 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType = MkClassType("bool");
17721 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType->truth = 1;
17722 for(exp = (*stmt->__anon1.ifStmt.exp).first; exp; exp = exp->next)
17723 {
17724 ProcessExpressionType(exp);
17725 }
17726 if(stmt->__anon1.ifStmt.stmt)
17727 ProcessStatement(stmt->__anon1.ifStmt.stmt);
17728 if(stmt->__anon1.ifStmt.elseStmt)
17729 ProcessStatement(stmt->__anon1.ifStmt.elseStmt);
17730 break;
17731 }
17732 case 5:
17733 {
17734 struct Type * oldSwitchType = curSwitchType;
17735
17736 if(stmt->__anon1.switchStmt.exp)
17737 {
17738 struct Expression * exp;
17739
17740 for(exp = (*stmt->__anon1.switchStmt.exp).first; exp; exp = exp->next)
17741 {
17742 if(!exp->next)
17743 {
17744 ProcessExpressionType(exp);
17745 }
17746 if(!exp->next)
17747 curSwitchType = exp->expType;
17748 }
17749 }
17750 ProcessStatement(stmt->__anon1.switchStmt.stmt);
17751 curSwitchType = oldSwitchType;
17752 break;
17753 }
17754 case 6:
17755 {
17756 if(stmt->__anon1.whileStmt.exp)
17757 {
17758 struct Expression * exp;
17759
17760 FreeType(((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType);
17761 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType = MkClassType("bool");
17762 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType->truth = 1;
17763 for(exp = (*stmt->__anon1.whileStmt.exp).first; exp; exp = exp->next)
17764 {
17765 ProcessExpressionType(exp);
17766 }
17767 }
17768 if(stmt->__anon1.whileStmt.stmt)
17769 ProcessStatement(stmt->__anon1.whileStmt.stmt);
17770 break;
17771 }
17772 case 7:
17773 {
17774 if(stmt->__anon1.doWhile.exp)
17775 {
17776 struct Expression * exp;
17777
17778 if((*stmt->__anon1.doWhile.exp).last)
17779 {
17780 FreeType(((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType);
17781 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType = MkClassType("bool");
17782 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType->truth = 1;
17783 }
17784 for(exp = (*stmt->__anon1.doWhile.exp).first; exp; exp = exp->next)
17785 {
17786 ProcessExpressionType(exp);
17787 }
17788 }
17789 if(stmt->__anon1.doWhile.stmt)
17790 ProcessStatement(stmt->__anon1.doWhile.stmt);
17791 break;
17792 }
17793 case 8:
17794 {
17795 struct Expression * exp;
17796
17797 if(stmt->__anon1.forStmt.init)
17798 ProcessStatement(stmt->__anon1.forStmt.init);
17799 if(stmt->__anon1.forStmt.check && stmt->__anon1.forStmt.check->__anon1.expressions)
17800 {
17801 FreeType(((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType);
17802 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType = MkClassType("bool");
17803 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType->truth = 1;
17804 }
17805 if(stmt->__anon1.forStmt.check)
17806 ProcessStatement(stmt->__anon1.forStmt.check);
17807 if(stmt->__anon1.forStmt.increment)
17808 {
17809 for(exp = (*stmt->__anon1.forStmt.increment).first; exp; exp = exp->next)
17810 ProcessExpressionType(exp);
17811 }
17812 if(stmt->__anon1.forStmt.stmt)
17813 ProcessStatement(stmt->__anon1.forStmt.stmt);
17814 break;
17815 }
17816 case 18:
17817 {
17818 struct Identifier * id = stmt->__anon1.forEachStmt.id;
17819 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->__anon1.forEachStmt.exp;
17820 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->__anon1.forEachStmt.filter;
17821 struct Statement * block = stmt->__anon1.forEachStmt.stmt;
17822 char iteratorType[1024];
17823 struct Type * source;
17824 struct Expression * e;
17825 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));
17826 struct Expression * arrayExp;
17827 const char * typeString = (((void *)0));
17828 int builtinCount = 0;
17829
17830 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
17831 {
17832 if(!e->next)
17833 {
17834 FreeType(e->destType);
17835 e->destType = ProcessTypeString("Container", 0);
17836 }
17837 if(!isBuiltin || e->next)
17838 ProcessExpressionType(e);
17839 }
17840 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
17841 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)))
17842 {
17843 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->__anon1._class->__anon1.registered : (((void *)0));
17844 struct Symbol * symbol;
17845 struct Expression * expIt = (((void *)0));
17846 unsigned int isMap = 0, isArray = 0, isLinkList = 0, isList = 0, isCustomAVLTree = 0;
17847 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
17848 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
17849 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
17850
17851 stmt->type = 2;
17852 stmt->__anon1.compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
17853 stmt->__anon1.compound.context->parent = curContext;
17854 curContext = stmt->__anon1.compound.context;
17855 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, customAVLTreeClass))
17856 {
17857 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
17858
17859 isCustomAVLTree = 1;
17860 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, mapClass))
17861 isMap = 1;
17862 }
17863 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, arrayClass))
17864 isArray = 1;
17865 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, linkListClass))
17866 {
17867 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
17868
17869 isLinkList = 1;
17870 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, listClass);
17871 }
17872 if(isArray)
17873 {
17874 struct Declarator * decl;
17875 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17876
17877 decl = SpecDeclFromString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
17878 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17879 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
17880 }
17881 else if(isBuiltin)
17882 {
17883 struct Type * type = (((void *)0));
17884 char typeStringBuf[1024];
17885
17886 arrayExp = (((struct Expression *)(*exp).last)->type == 35) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->__anon1.cast.exp;
17887 if(((struct Expression *)(*exp).last)->type == 11)
17888 {
17889 struct TypeName * typeName = ((struct Expression *)(*exp).last)->__anon1.cast.typeName;
17890
17891 if(typeName)
17892 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
17893 }
17894 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)
17895 {
17896 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->__anon1._class->__anon1.registered;
17897
17898 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
17899 }
17900 else if(arrayExp->__anon1.list)
17901 {
17902 struct Expression * e;
17903
17904 for(e = (*arrayExp->__anon1.list).first; e; e = e->next)
17905 {
17906 ProcessExpressionType(e);
17907 if(e->expType)
17908 {
17909 if(!type)
17910 {
17911 type = e->expType;
17912 type->refCount++;
17913 }
17914 else
17915 {
17916 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
17917 {
17918 FreeType(type);
17919 type = e->expType;
17920 e->expType = (((void *)0));
17921 e = (*arrayExp->__anon1.list).first;
17922 ProcessExpressionType(e);
17923 if(e->expType)
17924 {
17925 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
17926 {
17927 FreeType(e->expType);
17928 e->expType = (((void *)0));
17929 FreeType(type);
17930 type = (((void *)0));
17931 break;
17932 }
17933 }
17934 }
17935 }
17936 if(e->expType)
17937 {
17938 FreeType(e->expType);
17939 e->expType = (((void *)0));
17940 }
17941 }
17942 }
17943 if(type)
17944 {
17945 typeStringBuf[0] = '\0';
17946 PrintType(type, typeStringBuf, 0, 1);
17947 typeString = typeStringBuf;
17948 FreeType(type);
17949 }
17950 }
17951 if(typeString)
17952 {
17953 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
17954 struct Declarator * decl;
17955 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17956
17957 if(arrayExp->__anon1.list)
17958 {
17959 struct Expression * e;
17960
17961 builtinCount = (*arrayExp->__anon1.list).count;
17962 type = ProcessTypeString(typeString, 0);
17963 while((e = (*arrayExp->__anon1.list).first))
17964 {
17965 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->__anon1.list), e);
17966 e->destType = type;
17967 type->refCount++;
17968 ProcessExpressionType(e);
17969 ListAdd(initializers, MkInitializerAssignment(e));
17970 }
17971 FreeType(type);
17972 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->__anon1.list), arrayExp->__anon1.list = 0);
17973 }
17974 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
17975 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
17976 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
17977 FreeList(exp, FreeExpression);
17978 }
17979 else
17980 {
17981 arrayExp->expType = ProcessTypeString("Container", 0);
17982 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
17983 }
17984 }
17985 else if(isLinkList && !isList)
17986 {
17987 struct Declarator * decl;
17988 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17989
17990 decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, MkDeclaratorIdentifier(id));
17991 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17992 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
17993 }
17994 else if(_class->templateArgs)
17995 {
17996 if(isMap)
17997 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].__anon1.__anon1.dataTypeString, _class->templateArgs[6].__anon1.__anon1.dataTypeString);
17998 else
17999 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].__anon1.__anon1.dataTypeString, _class->templateArgs[1].__anon1.__anon1.dataTypeString);
18000 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)))))))));
18001 }
18002 symbol = FindSymbol(id->string, curContext, curContext, 0, 0);
18003 if(block)
18004 {
18005 switch(block->type)
18006 {
18007 case 2:
18008 if(block->__anon1.compound.context)
18009 block->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18010 break;
18011 case 4:
18012 if(block->__anon1.ifStmt.stmt && block->__anon1.ifStmt.stmt->type == 2 && block->__anon1.ifStmt.stmt->__anon1.compound.context)
18013 block->__anon1.ifStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18014 if(block->__anon1.ifStmt.elseStmt && block->__anon1.ifStmt.elseStmt->type == 2 && block->__anon1.ifStmt.elseStmt->__anon1.compound.context)
18015 block->__anon1.ifStmt.elseStmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18016 break;
18017 case 5:
18018 if(block->__anon1.switchStmt.stmt && block->__anon1.switchStmt.stmt->type == 2 && block->__anon1.switchStmt.stmt->__anon1.compound.context)
18019 block->__anon1.switchStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18020 break;
18021 case 6:
18022 if(block->__anon1.whileStmt.stmt && block->__anon1.whileStmt.stmt->type == 2 && block->__anon1.whileStmt.stmt->__anon1.compound.context)
18023 block->__anon1.whileStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18024 break;
18025 case 7:
18026 if(block->__anon1.doWhile.stmt && block->__anon1.doWhile.stmt->type == 2 && block->__anon1.doWhile.stmt->__anon1.compound.context)
18027 block->__anon1.doWhile.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18028 break;
18029 case 8:
18030 if(block->__anon1.forStmt.stmt && block->__anon1.forStmt.stmt->type == 2 && block->__anon1.forStmt.stmt->__anon1.compound.context)
18031 block->__anon1.forStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18032 break;
18033 case 18:
18034 if(block->__anon1.forEachStmt.stmt && block->__anon1.forEachStmt.stmt->type == 2 && block->__anon1.forEachStmt.stmt->__anon1.compound.context)
18035 block->__anon1.forEachStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18036 break;
18037 }
18038 }
18039 if(filter)
18040 {
18041 block = MkIfStmt(filter, block, (((void *)0)));
18042 }
18043 if(isArray)
18044 {
18045 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));
18046 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
18047 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
18048 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
18049 }
18050 else if(isBuiltin)
18051 {
18052 char count[128];
18053
18054 sprintf(count, "%d", builtinCount);
18055 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));
18056 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
18057 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
18058 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
18059 }
18060 else if(isLinkList && !isList)
18061 {
18062 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].__anon1.__anon1.dataTypeString);
18063 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
18064
18065 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].__anon1.__anon1.dataTypeString && !strcmp(_class->templateArgs[5].__anon1.__anon1.dataTypeString, "LT::link"))
18066 {
18067 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));
18068 }
18069 else
18070 {
18071 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18072 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, (((void *)0)));
18073
18074 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));
18075 }
18076 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
18077 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
18078 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
18079 }
18080 else
18081 {
18082 stmt->__anon1.compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
18083 }
18084 ProcessExpressionType(expIt);
18085 if((*stmt->__anon1.compound.declarations).first)
18086 ProcessDeclaration((*stmt->__anon1.compound.declarations).first);
18087 if(symbol)
18088 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
18089 ProcessStatement(stmt);
18090 curContext = stmt->__anon1.compound.context->parent;
18091 break;
18092 }
18093 else
18094 {
18095 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Expression is not a container\n", (((void *)0))));
18096 }
18097 break;
18098 }
18099 case 9:
18100 break;
18101 case 10:
18102 break;
18103 case 11:
18104 break;
18105 case 12:
18106 {
18107 struct Expression * exp;
18108
18109 if(stmt->__anon1.expressions)
18110 {
18111 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
18112 {
18113 if(!exp->next)
18114 {
18115 if(curFunction && !curFunction->type)
18116 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
18117 FreeType(exp->destType);
18118 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->__anon1.__anon2.returnType : (((void *)0));
18119 if(exp->destType)
18120 exp->destType->refCount++;
18121 }
18122 ProcessExpressionType(exp);
18123 }
18124 }
18125 break;
18126 }
18127 case 14:
18128 {
18129 ProcessDeclaration(stmt->__anon1.decl);
18130 break;
18131 }
18132 case 13:
18133 {
18134 struct AsmField * field;
18135
18136 if(stmt->__anon1.asmStmt.inputFields)
18137 {
18138 for(field = (*stmt->__anon1.asmStmt.inputFields).first; field; field = field->next)
18139 if(field->expression)
18140 ProcessExpressionType(field->expression);
18141 }
18142 if(stmt->__anon1.asmStmt.outputFields)
18143 {
18144 for(field = (*stmt->__anon1.asmStmt.outputFields).first; field; field = field->next)
18145 if(field->expression)
18146 ProcessExpressionType(field->expression);
18147 }
18148 if(stmt->__anon1.asmStmt.clobberedFields)
18149 {
18150 for(field = (*stmt->__anon1.asmStmt.clobberedFields).first; field; field = field->next)
18151 {
18152 if(field->expression)
18153 ProcessExpressionType(field->expression);
18154 }
18155 }
18156 break;
18157 }
18158 case 17:
18159 {
18160 struct PropertyWatch * propWatch;
18161 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
18162 struct Expression * object = stmt->__anon1._watch.object;
18163 struct Expression * watcher = stmt->__anon1._watch.watcher;
18164
18165 if(watcher)
18166 ProcessExpressionType(watcher);
18167 if(object)
18168 ProcessExpressionType(object);
18169 if(inCompiler)
18170 {
18171 if(watcher || thisClass)
18172 {
18173 struct External * external = curExternal;
18174 struct Context * context = curContext;
18175
18176 stmt->type = 3;
18177 stmt->__anon1.expressions = MkList();
18178 curExternal = external->prev;
18179 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
18180 {
18181 struct ClassFunction * func;
18182 char watcherName[1024];
18183 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;
18184 struct External * createdExternal;
18185 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
18186
18187 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
18188 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
18189 if(propWatch->deleteWatch)
18190 strcat(watcherName, "_delete");
18191 else
18192 {
18193 struct Identifier * propID;
18194
18195 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
18196 {
18197 strcat(watcherName, "_");
18198 strcat(watcherName, propID->string);
18199 }
18200 }
18201 if(object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class && object->expType->__anon1._class->__anon1.registered)
18202 {
18203 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)));
18204 ProcessClassFunctionBody(func, propWatch->compound);
18205 propWatch->compound = (((void *)0));
18206 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 1);
18207 createdExternal->symbol->idCode = external->symbol->idCode;
18208 curExternal = createdExternal;
18209 ProcessFunction(createdExternal->__anon1.function);
18210 {
18211 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->__anon1.function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->__anon1.function->declarator), (((void *)0)))));
18212
18213 externalDecl->__anon1.declaration = decl;
18214 if(decl->symbol && !decl->symbol->__anon2.__anon1.pointerExternal)
18215 decl->symbol->__anon2.__anon1.pointerExternal = externalDecl;
18216 }
18217 if(propWatch->deleteWatch)
18218 {
18219 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
18220
18221 ListAdd(args, CopyExpression(object));
18222 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18223 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
18224 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
18225 }
18226 else
18227 {
18228 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->__anon1._class->__anon1.registered;
18229 struct Identifier * propID;
18230
18231 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
18232 {
18233 char propName[1024];
18234 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
18235
18236 if(prop)
18237 {
18238 char getName[1024], setName[1024];
18239 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
18240
18241 DeclareProperty(prop, setName, getName);
18242 strcpy(propName, "__ecereProp_");
18243 FullClassNameCat(propName, prop->_class->fullName, 0);
18244 strcat(propName, "_");
18245 FullClassNameCat(propName, prop->name, 1);
18246 ListAdd(args, CopyExpression(object));
18247 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
18248 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18249 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
18250 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
18251 }
18252 else
18253 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
18254 }
18255 }
18256 }
18257 else
18258 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid watched object\n", (((void *)0))));
18259 }
18260 curExternal = external;
18261 curContext = context;
18262 if(watcher)
18263 FreeExpression(watcher);
18264 if(object)
18265 FreeExpression(object);
18266 FreeList(watches, FreePropertyWatch);
18267 }
18268 else
18269 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a _class\n", (((void *)0))));
18270 }
18271 else
18272 {
18273 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
18274 {
18275 ProcessStatement(propWatch->compound);
18276 }
18277 }
18278 break;
18279 }
18280 case 15:
18281 {
18282 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
18283 struct Expression * object = stmt->__anon1._watch.object;
18284 struct __ecereNameSpace__ecere__com__Class * _class;
18285
18286 if(object)
18287 ProcessExpressionType(object);
18288 if(inCompiler)
18289 {
18290 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0))) : thisClass;
18291 if(_class)
18292 {
18293 struct Identifier * propID;
18294
18295 stmt->type = 3;
18296 stmt->__anon1.expressions = MkList();
18297 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
18298 {
18299 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
18300 }
18301 else if(!watches)
18302 {
18303 }
18304 if(watches)
18305 {
18306 for(propID = (*watches).first; propID; propID = propID->next)
18307 {
18308 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
18309
18310 if(prop)
18311 {
18312 CreateFireWatcher(prop, object, stmt);
18313 }
18314 else
18315 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
18316 }
18317 }
18318 else
18319 {
18320 struct __ecereNameSpace__ecere__com__Property * prop;
18321 struct __ecereNameSpace__ecere__com__Class * base;
18322
18323 for(base = _class; base; base = base->base)
18324 {
18325 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
18326 {
18327 if(prop->isProperty && prop->isWatchable)
18328 {
18329 CreateFireWatcher(prop, object, stmt);
18330 }
18331 }
18332 }
18333 }
18334 if(object)
18335 FreeExpression(object);
18336 FreeList(watches, FreeIdentifier);
18337 }
18338 else
18339 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
18340 }
18341 break;
18342 }
18343 case 16:
18344 {
18345 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
18346 struct Expression * object = stmt->__anon1._watch.object;
18347 struct Expression * watcher = stmt->__anon1._watch.watcher;
18348 struct __ecereNameSpace__ecere__com__Class * _class;
18349
18350 if(object)
18351 ProcessExpressionType(object);
18352 if(watcher)
18353 ProcessExpressionType(watcher);
18354 if(inCompiler)
18355 {
18356 _class = (object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0));
18357 if(watcher || thisClass)
18358 {
18359 if(_class)
18360 {
18361 struct Identifier * propID;
18362
18363 stmt->type = 3;
18364 stmt->__anon1.expressions = MkList();
18365 if(!watches)
18366 {
18367 struct __ecereNameSpace__ecere__sys__OldList * args;
18368
18369 args = MkList();
18370 ListAdd(args, CopyExpression(object));
18371 ListAdd(args, MkExpConstant("0"));
18372 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18373 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
18374 }
18375 else
18376 {
18377 for(propID = (*watches).first; propID; propID = propID->next)
18378 {
18379 char propName[1024];
18380 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
18381
18382 if(prop)
18383 {
18384 char getName[1024], setName[1024];
18385 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
18386
18387 DeclareProperty(prop, setName, getName);
18388 strcpy(propName, "__ecereProp_");
18389 FullClassNameCat(propName, prop->_class->fullName, 0);
18390 strcat(propName, "_");
18391 FullClassNameCat(propName, prop->name, 1);
18392 ListAdd(args, CopyExpression(object));
18393 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
18394 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18395 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
18396 }
18397 else
18398 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
18399 }
18400 }
18401 if(object)
18402 FreeExpression(object);
18403 if(watcher)
18404 FreeExpression(watcher);
18405 FreeList(watches, FreeIdentifier);
18406 }
18407 else
18408 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
18409 }
18410 else
18411 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
18412 }
18413 break;
18414 }
18415 }
18416 }
18417
18418 extern struct Expression * QBrackets(struct Expression * exp);
18419
18420 extern struct TypeName * QMkType(const char *  spec, struct Declarator * decl);
18421
18422 extern struct Declarator * QMkPtrDecl(const char *  id);
18423
18424 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
18425
18426 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
18427
18428 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
18429
18430 static void ProcessFunction(struct FunctionDefinition * function)
18431 {
18432 struct Identifier * id = GetDeclId(function->declarator);
18433 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
18434 struct Type * type = symbol ? symbol->type : (((void *)0));
18435 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
18436 struct Context * oldTopContext = topContext;
18437
18438 yylloc = function->loc;
18439 if(type && type->__anon1.__anon2.thisClass)
18440 {
18441 struct Symbol * classSym = type->__anon1.__anon2.thisClass;
18442 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1.__anon2.thisClass->__anon1.registered;
18443 char className[1024];
18444 char structName[1024];
18445 struct Declarator * funcDecl;
18446 struct Symbol * thisSymbol;
18447 unsigned int typedObject = 0;
18448
18449 if(_class && !_class->base)
18450 {
18451 _class = currentClass;
18452 if(_class && !_class->symbol)
18453 _class->symbol = FindClass(_class->fullName);
18454 classSym = _class ? _class->symbol : (((void *)0));
18455 typedObject = 1;
18456 }
18457 thisClass = _class;
18458 if(inCompiler && _class)
18459 {
18460 if(type->kind == 11)
18461 {
18462 if(symbol->type->__anon1.__anon2.params.count == 1 && ((struct Type *)symbol->type->__anon1.__anon2.params.first)->kind == 0)
18463 {
18464 struct Type * param = symbol->type->__anon1.__anon2.params.first;
18465
18466 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->__anon1.__anon2.params, param);
18467 FreeType(param);
18468 }
18469 if(type->classObjectType != 1)
18470 {
18471 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->__anon1.__anon2.params, (((void *)0)), MkClassType(_class->fullName));
18472 symbol->type->__anon1.__anon2.staticMethod = 1;
18473 symbol->type->__anon1.__anon2.thisClass = (((void *)0));
18474 symbol->type->extraParam = 0;
18475 }
18476 }
18477 strcpy(className, "__ecereClass_");
18478 FullClassNameCat(className, _class->fullName, 1);
18479 structName[0] = (char)0;
18480 FullClassNameCat(structName, _class->fullName, 0);
18481 funcDecl = GetFuncDecl(function->declarator);
18482 if(funcDecl)
18483 {
18484 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
18485 {
18486 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
18487
18488 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
18489 {
18490 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
18491 FreeTypeName(param);
18492 }
18493 }
18494 if(!function->propertyNoThis)
18495 {
18496 struct TypeName * thisParam = (((void *)0));
18497
18498 if(type->classObjectType != 1)
18499 {
18500 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18501 if(!funcDecl->__anon1.function.parameters)
18502 funcDecl->__anon1.function.parameters = MkList();
18503 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18504 }
18505 if(typedObject)
18506 {
18507 if(type->classObjectType != 1)
18508 {
18509 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
18510 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
18511 }
18512 thisParam = __extension__ ({
18513 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
18514
18515 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
18516 });
18517 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18518 }
18519 }
18520 }
18521 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
18522 {
18523 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
18524
18525 funcDecl = GetFuncDecl(initDecl->declarator);
18526 if(funcDecl)
18527 {
18528 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
18529 {
18530 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
18531
18532 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
18533 {
18534 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
18535 FreeTypeName(param);
18536 }
18537 }
18538 if(type->classObjectType != 1)
18539 {
18540 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->__anon2.__anon2.externalSet)
18541 {
18542 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18543
18544 if(!funcDecl->__anon1.function.parameters)
18545 funcDecl->__anon1.function.parameters = MkList();
18546 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18547 }
18548 }
18549 }
18550 }
18551 }
18552 if(function->body)
18553 {
18554 if(type->classObjectType != 1)
18555 {
18556 thisSymbol = __extension__ ({
18557 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18558
18559 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
18560 });
18561 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18562 if(typedObject && thisSymbol->type)
18563 {
18564 thisSymbol->type->classObjectType = 2;
18565 thisSymbol->type->byReference = type->byReference;
18566 thisSymbol->type->typedByReference = type->byReference;
18567 }
18568 }
18569 }
18570 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
18571 {
18572 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
18573
18574 {
18575 struct __ecereNameSpace__ecere__com__Class * base;
18576
18577 for(base = _class; base && base->type != 1000; base = base->next)
18578 {
18579 for(member = base->membersAndProperties.first; member; member = member->next)
18580 if(!member->isProperty)
18581 break;
18582 if(member)
18583 break;
18584 }
18585 }
18586 for(member = _class->membersAndProperties.first; member; member = member->next)
18587 if(!member->isProperty)
18588 break;
18589 if(member)
18590 {
18591 char pointerName[1024];
18592 struct Declaration * decl;
18593 struct Initializer * initializer;
18594 struct Expression * exp, * bytePtr;
18595
18596 strcpy(pointerName, "__ecerePointer_");
18597 FullClassNameCat(pointerName, _class->fullName, 0);
18598 {
18599 char className[1024];
18600
18601 strcpy(className, "__ecereClass_");
18602 FullClassNameCat(className, classSym->string, 1);
18603 DeclareClass(classSym, className);
18604 }
18605 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
18606 if(_class->fixed)
18607 {
18608 char string[256];
18609
18610 sprintf(string, "%d", _class->offset);
18611 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
18612 }
18613 else
18614 {
18615 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
18616 }
18617 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
18618 exp->expType = __extension__ ({
18619 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18620
18621 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
18622 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18623
18624 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
18625 }), __ecereInstance2;
18626 });
18627 if(function->body)
18628 {
18629 yylloc = function->body->loc;
18630 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
18631 {
18632 struct Context * prevContext = curContext;
18633
18634 curContext = function->body->__anon1.compound.context;
18635 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
18636 curContext = prevContext;
18637 }
18638 decl->symbol = (((void *)0));
18639 if(!function->body->__anon1.compound.declarations)
18640 function->body->__anon1.compound.declarations = MkList();
18641 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->__anon1.compound.declarations), (((void *)0)), decl);
18642 }
18643 }
18644 }
18645 }
18646 else
18647 thisClass = (((void *)0));
18648 if(id)
18649 {
18650 FreeSpecifier(id->_class);
18651 id->_class = (((void *)0));
18652 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
18653 {
18654 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
18655
18656 id = GetDeclId(initDecl->declarator);
18657 FreeSpecifier(id->_class);
18658 id->_class = (((void *)0));
18659 }
18660 }
18661 if(function->body)
18662 topContext = function->body->__anon1.compound.context;
18663 {
18664 struct FunctionDefinition * oldFunction = curFunction;
18665
18666 curFunction = function;
18667 if(function->body)
18668 ProcessStatement(function->body);
18669 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
18670 {
18671 struct Statement * prevCompound = curCompound;
18672 struct Context * prevContext = curContext;
18673 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
18674
18675 if(!function->body->__anon1.compound.statements)
18676 function->body->__anon1.compound.statements = MkList();
18677 ListAdd(function->body->__anon1.compound.statements, fireWatchers);
18678 curCompound = function->body;
18679 curContext = function->body->__anon1.compound.context;
18680 ProcessStatement(fireWatchers);
18681 curContext = prevContext;
18682 curCompound = prevCompound;
18683 }
18684 curFunction = oldFunction;
18685 }
18686 if(function->declarator)
18687 {
18688 ProcessDeclarator(function->declarator);
18689 }
18690 topContext = oldTopContext;
18691 thisClass = oldThisClass;
18692 }
18693
18694 extern void FreeSymbol(struct Symbol * symbol);
18695
18696 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
18697
18698 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
18699 {
18700 struct ClassDef * def;
18701 struct External * external = curExternal;
18702 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->__anon1.registered : (((void *)0));
18703
18704 for(def = definitions->first; def; def = def->next)
18705 {
18706 if(def->type == 0)
18707 {
18708 if(def->__anon1.function->declarator)
18709 curExternal = def->__anon1.function->declarator->symbol->__anon2.__anon1.pointerExternal;
18710 else
18711 curExternal = external;
18712 ProcessFunction((struct FunctionDefinition *)def->__anon1.function);
18713 }
18714 else if(def->type == 2)
18715 {
18716 if(def->__anon1.decl->type == 2)
18717 {
18718 thisClass = regClass;
18719 ProcessInstantiationType(def->__anon1.decl->__anon1.inst);
18720 thisClass = (((void *)0));
18721 }
18722 else
18723 {
18724 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
18725
18726 if(regClass)
18727 thisClass = regClass;
18728 ProcessDeclaration(def->__anon1.decl);
18729 thisClass = backThisClass;
18730 }
18731 }
18732 else if(def->type == 1 && def->__anon1.defProperties)
18733 {
18734 struct MemberInit * defProperty;
18735 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);
18736
18737 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18738 for(defProperty = (*def->__anon1.defProperties).first; defProperty; defProperty = defProperty->next)
18739 {
18740 thisClass = regClass;
18741 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
18742 thisClass = (((void *)0));
18743 }
18744 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18745 FreeSymbol(thisSymbol);
18746 }
18747 else if(def->type == 3 && def->__anon1.propertyDef)
18748 {
18749 struct PropertyDef * prop = def->__anon1.propertyDef;
18750
18751 thisClass = regClass;
18752 if(prop->setStmt)
18753 {
18754 if(regClass)
18755 {
18756 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18757
18758 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18759 }
18760 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalSet : (((void *)0));
18761 ProcessStatement(prop->setStmt);
18762 }
18763 if(prop->getStmt)
18764 {
18765 if(regClass)
18766 {
18767 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18768
18769 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18770 }
18771 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalGet : (((void *)0));
18772 ProcessStatement(prop->getStmt);
18773 }
18774 if(prop->issetStmt)
18775 {
18776 if(regClass)
18777 {
18778 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18779
18780 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18781 }
18782 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalIsSet : (((void *)0));
18783 ProcessStatement(prop->issetStmt);
18784 }
18785 thisClass = (((void *)0));
18786 }
18787 else if(def->type == 4 && def->__anon1.propertyWatch)
18788 {
18789 struct PropertyWatch * propertyWatch = def->__anon1.propertyWatch;
18790
18791 thisClass = regClass;
18792 if(propertyWatch->compound)
18793 {
18794 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);
18795
18796 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18797 curExternal = (((void *)0));
18798 ProcessStatement(propertyWatch->compound);
18799 }
18800 thisClass = (((void *)0));
18801 }
18802 }
18803 }
18804
18805 void DeclareFunctionUtil(const char * s)
18806 {
18807 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
18808
18809 if(function)
18810 {
18811 char name[1024];
18812
18813 name[0] = (char)0;
18814 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
18815 strcpy(name, "__ecereFunction_");
18816 FullClassNameCat(name, s, 0);
18817 DeclareFunction(function, name);
18818 }
18819 }
18820
18821 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
18822
18823 void ComputeDataTypes()
18824 {
18825 struct External * external;
18826 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
18827 struct External * after = (((void *)0));
18828
18829 currentClass = (((void *)0));
18830 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
18831 for(external = (*ast).first; external; external = external->next)
18832 {
18833 if(external->type == 1)
18834 {
18835 struct Declaration * decl = external->__anon1.declaration;
18836
18837 if(decl)
18838 {
18839 struct __ecereNameSpace__ecere__sys__OldList * decls = decl->__anon1.__anon1.declarators;
18840
18841 if(decls)
18842 {
18843 struct InitDeclarator * initDecl = (*decls).first;
18844
18845 if(initDecl)
18846 {
18847 struct Declarator * declarator = initDecl->declarator;
18848
18849 if(declarator && declarator->type == 1)
18850 {
18851 struct Identifier * id = declarator->__anon1.identifier;
18852
18853 if(id && id->string)
18854 {
18855 if(!strcmp(id->string, "uintptr_t") || !strcmp(id->string, "intptr_t") || !strcmp(id->string, "size_t") || !strcmp(id->string, "ssize_t"))
18856 {
18857 external->symbol->id = -1001, external->symbol->idCode = -1001;
18858 after = external;
18859 }
18860 }
18861 }
18862 }
18863 }
18864 }
18865 }
18866 }
18867 {
18868 struct External * e = MkExternalDeclaration(MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Instance"), (((void *)0)))), (((void *)0))));
18869
18870 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, e);
18871 after = e;
18872 }
18873 temp->symbol = __extension__ ({
18874 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18875
18876 __ecereInstance1->id = -1000, __ecereInstance1->idCode = -1000, __ecereInstance1;
18877 });
18878 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
18879 curExternal = temp;
18880 DeclareFunctionUtil("eSystem_New");
18881 DeclareFunctionUtil("eSystem_New0");
18882 DeclareFunctionUtil("eSystem_Renew");
18883 DeclareFunctionUtil("eSystem_Renew0");
18884 DeclareFunctionUtil("eSystem_Delete");
18885 DeclareFunctionUtil("eClass_GetProperty");
18886 DeclareFunctionUtil("eClass_SetProperty");
18887 DeclareFunctionUtil("eInstance_FireSelfWatchers");
18888 DeclareFunctionUtil("eInstance_SetMethod");
18889 DeclareFunctionUtil("eInstance_IncRef");
18890 DeclareFunctionUtil("eInstance_StopWatching");
18891 DeclareFunctionUtil("eInstance_Watch");
18892 DeclareFunctionUtil("eInstance_FireWatchers");
18893 DeclareStruct("ecere::com::Class", 0);
18894 DeclareStruct("ecere::com::Instance", 0);
18895 DeclareStruct("ecere::com::Property", 0);
18896 DeclareStruct("ecere::com::DataMember", 0);
18897 DeclareStruct("ecere::com::Method", 0);
18898 DeclareStruct("ecere::com::SerialBuffer", 0);
18899 DeclareStruct("ecere::com::ClassTemplateArgument", 0);
18900 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
18901 for(external = (*ast).first; external; external = external->next)
18902 {
18903 afterExternal = curExternal = external;
18904 if(external->type == 0)
18905 {
18906 currentClass = external->__anon1.function->_class;
18907 ProcessFunction(external->__anon1.function);
18908 }
18909 else if(external->type == 1)
18910 {
18911 currentClass = (((void *)0));
18912 if(external->__anon1.declaration)
18913 ProcessDeclaration(external->__anon1.declaration);
18914 }
18915 else if(external->type == 2)
18916 {
18917 struct ClassDefinition * _class = external->__anon1._class;
18918
18919 currentClass = external->symbol->__anon1.registered;
18920 if(_class->definitions)
18921 {
18922 ProcessClass(_class->definitions, _class->symbol);
18923 }
18924 if(inCompiler)
18925 {
18926 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
18927 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor((void *)external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
18928 }
18929 }
18930 else if(external->type == 4)
18931 {
18932 thisNameSpace = external->__anon1.id->string;
18933 }
18934 }
18935 currentClass = (((void *)0));
18936 thisNameSpace = (((void *)0));
18937 curExternal = (((void *)0));
18938 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor((void *)temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
18939 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor((void *)temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
18940 }
18941
18942 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);
18943
18944 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);
18945
18946 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
18947
18948 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
18949 {
18950 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
18951
18952 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
18953 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
18954 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
18955 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
18956 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
18957 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
18958 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
18959 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
18960 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
18961 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
18962 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
18963 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
18964 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
18965 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
18966 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
18967 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
18968 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
18969 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
18970 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt", "bool GetOpInt(Operand op2, int * value2)", GetOpInt, module, 1);
18971 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
18972 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt", "bool GetOpUInt(Operand op2, uint * value2)", GetOpUInt, module, 1);
18973 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
18974 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt64", "bool GetOpInt64(Operand op2, int64 * value2)", GetOpInt64, module, 1);
18975 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
18976 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt64", "bool GetOpUInt64(Operand op2, uint64 * value2)", GetOpUInt64, module, 1);
18977 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
18978 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntPtr", "bool GetOpIntPtr(Operand op2, intptr * value2)", GetOpIntPtr, module, 1);
18979 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
18980 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntPtr", "bool GetOpUIntPtr(Operand op2, uintptr * value2)", GetOpUIntPtr, module, 1);
18981 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
18982 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntSize", "bool GetOpIntSize(Operand op2, intsize * value2)", GetOpIntSize, module, 1);
18983 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
18984 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntSize", "bool GetOpUIntSize(Operand op2, uintsize * value2)", GetOpUIntSize, module, 1);
18985 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
18986 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpShort", "bool GetOpShort(Operand op2, short * value2)", GetOpShort, module, 1);
18987 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
18988 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUShort", "bool GetOpUShort(Operand op2, uint16 * value2)", GetOpUShort, module, 1);
18989 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
18990 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpChar", "bool GetOpChar(Operand op2, char * value2)", GetOpChar, module, 1);
18991 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
18992 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUChar", "bool GetOpUChar(Operand op2, byte * value2)", GetOpUChar, module, 1);
18993 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
18994 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpFloat", "bool GetOpFloat(Operand op2, float * value2)", GetOpFloat, module, 1);
18995 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
18996 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpDouble", "bool GetOpDouble(Operand op2, double * value2)", GetOpDouble, module, 1);
18997 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
18998 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
18999 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
19000 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
19001 __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);
19002 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(const char * name, bool skipNoHead)", DeclareStruct, module, 2);
19003 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
19004 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
19005 __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);
19006 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
19007 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
19008 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
19009 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
19010 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
19011 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
19012 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, const char * name)", DeclareMethod, module, 1);
19013 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
19014 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
19015 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
19016 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
19017 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
19018 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
19019 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
19020 __ecereClass_Conversion = class;
19021 __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);
19022 __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);
19023 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
19024 __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);
19025 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla, bool warnConst)", MatchTypeExpression, module, 2);
19026 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
19027 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("UnescapeString", "int UnescapeString(char * d, char * s, int len)", UnescapeString, module, 1);
19028 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("OffsetEscapedString", "char * OffsetEscapedString(char * s, int len, int offset)", OffsetEscapedString, module, 1);
19029 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
19030 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
19031 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
19032 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
19033 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
19034 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
19035 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(const char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
19036 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
19037 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
19038 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
19039 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetParseError", "bool GetParseError(void)", GetParseError, module, 1);
19040 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
19041 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
19042 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
19043 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyLocation", "void ApplyLocation(Expression exp, Location loc)", ApplyLocation, module, 1);
19044 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
19045 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(const String s)", DeclareFunctionUtil, module, 1);
19046 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
19047 }
19048
19049 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
19050 {
19051
19052 }
19053