compiler/libec: Generated code warning fixes (unused stuff)
[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 Specifier * MkSpecifierExtended(struct ExtDecl * extDecl);
3339
3340 extern struct ExtDecl * MkExtDeclAttrib(struct Attrib * attr);
3341
3342 extern struct Attrib * MkAttrib(int type, struct __ecereNameSpace__ecere__sys__OldList *  attribs);
3343
3344 extern struct Attribute * MkAttribute(char * attr, struct Expression * exp);
3345
3346 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
3347
3348 struct PropertyImport
3349 {
3350 struct PropertyImport * prev;
3351 struct PropertyImport * next;
3352 char *  name;
3353 unsigned int isVirtual;
3354 unsigned int hasSet;
3355 unsigned int hasGet;
3356 } __attribute__ ((gcc_struct));
3357
3358 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
3359
3360 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
3361 {
3362 struct Symbol * symbol = prop->symbol;
3363
3364 strcpy(setName, "__ecereProp_");
3365 FullClassNameCat(setName, prop->_class->fullName, 0);
3366 strcat(setName, "_Set_");
3367 FullClassNameCat(setName, prop->name, 1);
3368 strcpy(getName, "__ecereProp_");
3369 FullClassNameCat(getName, prop->_class->fullName, 0);
3370 strcat(getName, "_Get_");
3371 FullClassNameCat(getName, prop->name, 1);
3372 if(prop->_class->type == 1)
3373 DeclareStruct(prop->_class->fullName, 0);
3374 if(!symbol || curExternal->symbol->idCode < symbol->id)
3375 {
3376 unsigned int imported = 0;
3377 unsigned int dllImport = 0;
3378
3379 if(!symbol || symbol->_import)
3380 {
3381 if(!symbol)
3382 {
3383 struct Symbol * classSym;
3384
3385 if(!prop->_class->symbol)
3386 prop->_class->symbol = FindClass(prop->_class->fullName);
3387 classSym = prop->_class->symbol;
3388 if(classSym && !classSym->_import)
3389 {
3390 struct ModuleImport * module;
3391
3392 if(prop->_class->module)
3393 module = FindModule(prop->_class->module);
3394 else
3395 module = mainModule;
3396 classSym->_import = __extension__ ({
3397 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
3398
3399 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
3400 });
3401 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3402 }
3403 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3404 symbol->_import = (struct ClassImport *)__extension__ ({
3405 struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
3406
3407 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0, __ecereInstance1->hasSet = prop->Set ? 1 : 0, __ecereInstance1->hasGet = prop->Get ? 1 : 0, __ecereInstance1;
3408 });
3409 if(classSym)
3410 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3411 }
3412 imported = 1;
3413 if((prop->_class->module != privateModule || !strcmp(prop->_class->name, "float") || !strcmp(prop->_class->name, "double")) && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)prop->_class->module + structSize_Instance)))->importType != 1)
3414 dllImport = 1;
3415 }
3416 if(!symbol->type)
3417 {
3418 struct Context * context = SetupTemplatesContext(prop->_class);
3419
3420 symbol->type = ProcessTypeString(prop->dataTypeString, 0);
3421 FinishTemplatesContext(context);
3422 }
3423 if(prop->Get)
3424 {
3425 if(!symbol->__anon2.__anon2.externalGet || symbol->__anon2.__anon2.externalGet->type == 0)
3426 {
3427 struct Declaration * decl;
3428 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3429 struct Declarator * d;
3430 struct __ecereNameSpace__ecere__sys__OldList * params;
3431 struct Specifier * spec;
3432 struct External * external;
3433 struct Declarator * typeDecl;
3434 unsigned int simple = 0;
3435
3436 specifiers = MkList();
3437 declarators = MkList();
3438 params = MkList();
3439 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3440 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3441 if(dllImport)
3442 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3443 {
3444 struct Context * context = SetupTemplatesContext(prop->_class);
3445
3446 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3447 FinishTemplatesContext(context);
3448 }
3449 for(spec = (*specifiers).first; spec; spec = spec->next)
3450 {
3451 if(spec->type == 1)
3452 {
3453 if((!typeDecl || typeDecl->type == 1))
3454 {
3455 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
3456
3457 symbol->_class = classSym->__anon1.registered;
3458 if(classSym->__anon1.registered && classSym->__anon1.registered->type == 1)
3459 {
3460 DeclareStruct(spec->__anon1.__anon1.name, 0);
3461 simple = 1;
3462 }
3463 }
3464 }
3465 }
3466 if(!simple)
3467 d = PlugDeclarator(typeDecl, d);
3468 else
3469 {
3470 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3471 specifiers = MkList();
3472 }
3473 d = MkDeclaratorFunction(d, params);
3474 if(dllImport)
3475 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3476 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3477 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3478 if(simple)
3479 ListAdd(specifiers, MkSpecifier(VOID));
3480 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3481 decl = MkDeclaration(specifiers, declarators);
3482 external = MkExternalDeclaration(decl);
3483 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3484 external->symbol = symbol;
3485 symbol->__anon2.__anon2.externalGet = external;
3486 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3487 if(typeDecl)
3488 FreeDeclarator(typeDecl);
3489 }
3490 else
3491 {
3492 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon2.externalGet, curExternal->prev);
3493 }
3494 }
3495 if(prop->Set)
3496 {
3497 if(!symbol->__anon2.__anon2.externalSet || symbol->__anon2.__anon2.externalSet->type == 0)
3498 {
3499 struct Declaration * decl;
3500 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3501 struct Declarator * d;
3502 struct __ecereNameSpace__ecere__sys__OldList * params;
3503 struct Specifier * spec;
3504 struct External * external;
3505 struct Declarator * typeDecl;
3506
3507 declarators = MkList();
3508 params = MkList();
3509 if(!prop->conversion || prop->_class->type == 1)
3510 {
3511 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3512 }
3513 specifiers = MkList();
3514 {
3515 struct Context * context = SetupTemplatesContext(prop->_class);
3516
3517 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3518 FinishTemplatesContext(context);
3519 }
3520 if(!strcmp(prop->_class->base->fullName, "eda::Row") || !strcmp(prop->_class->base->fullName, "eda::Id"))
3521 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(CONST));
3522 ListAdd(params, MkTypeName(specifiers, d));
3523 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3524 if(dllImport)
3525 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3526 d = MkDeclaratorFunction(d, params);
3527 for(spec = (*specifiers).first; spec; spec = spec->next)
3528 {
3529 if(spec->type == 1)
3530 {
3531 if((!typeDecl || typeDecl->type == 1))
3532 {
3533 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
3534
3535 symbol->_class = classSym->__anon1.registered;
3536 if(classSym->__anon1.registered && classSym->__anon1.registered->type == 1)
3537 DeclareStruct(spec->__anon1.__anon1.name, 0);
3538 }
3539 }
3540 }
3541 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3542 specifiers = MkList();
3543 if(dllImport)
3544 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3545 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3546 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3547 if(!prop->conversion || prop->_class->type == 1)
3548 ListAdd(specifiers, MkSpecifier(VOID));
3549 else
3550 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3551 decl = MkDeclaration(specifiers, declarators);
3552 external = MkExternalDeclaration(decl);
3553 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3554 external->symbol = symbol;
3555 symbol->__anon2.__anon2.externalSet = external;
3556 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3557 }
3558 else
3559 {
3560 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon2.externalSet, curExternal->prev);
3561 }
3562 }
3563 if(!symbol->__anon2.__anon2.externalPtr)
3564 {
3565 struct Declaration * decl;
3566 struct External * external;
3567 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3568 char propName[1024];
3569
3570 if(imported)
3571 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3572 else
3573 {
3574 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3575 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*specifiers), MkSpecifierExtended(MkExtDeclAttrib(MkAttrib(ATTRIB, MkListOne(MkAttribute(__ecereNameSpace__ecere__sys__CopyString("unused"), (((void *)0))))))));
3576 }
3577 ListAdd(specifiers, MkSpecifierName("Property"));
3578 strcpy(propName, "__ecereProp_");
3579 FullClassNameCat(propName, prop->_class->fullName, 0);
3580 strcat(propName, "_");
3581 FullClassNameCat(propName, prop->name, 1);
3582 {
3583 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3584
3585 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3586 if(!imported)
3587 {
3588 strcpy(propName, "__ecerePropM_");
3589 FullClassNameCat(propName, prop->_class->fullName, 0);
3590 strcat(propName, "_");
3591 FullClassNameCat(propName, prop->name, 1);
3592 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3593 }
3594 decl = MkDeclaration(specifiers, list);
3595 }
3596 external = MkExternalDeclaration(decl);
3597 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3598 external->symbol = symbol;
3599 symbol->__anon2.__anon2.externalPtr = external;
3600 }
3601 else
3602 {
3603 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon2.externalPtr, curExternal->prev);
3604 }
3605 symbol->id = curExternal->symbol->idCode;
3606 }
3607 }
3608
3609 struct Type * Dereference(struct Type * source)
3610 {
3611 struct Type * type = (((void *)0));
3612
3613 if(source)
3614 {
3615 if(source->kind == 13 || source->kind == 12)
3616 {
3617 type = source->__anon1.type;
3618 source->__anon1.type->refCount++;
3619 }
3620 else if(source->kind == 8 && !strcmp(source->__anon1._class->string, "String"))
3621 {
3622 type = __extension__ ({
3623 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3624
3625 __ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
3626 });
3627 }
3628 else if(source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 5)
3629 {
3630 type = source;
3631 source->refCount++;
3632 }
3633 else
3634 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot dereference type\n", (((void *)0))));
3635 }
3636 return type;
3637 }
3638
3639 static struct Type * Reference(struct Type * source)
3640 {
3641 struct Type * type = (((void *)0));
3642
3643 if(source)
3644 {
3645 type = __extension__ ({
3646 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3647
3648 __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
3649 });
3650 source->refCount++;
3651 }
3652 return type;
3653 }
3654
3655 extern void __ecereNameSpace__ecere__com__eClass_FindNextMember(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class **  curClass, struct __ecereNameSpace__ecere__com__DataMember **  curMember, struct __ecereNameSpace__ecere__com__DataMember **  subMemberStack, int *  subMemberStackPos);
3656
3657 extern void *  memcpy(void * , const void * , size_t size);
3658
3659 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3660
3661 extern void FreeExpression(struct Expression * exp);
3662
3663 extern void __ecereNameSpace__ecere__sys__ChangeCh(char *  string, char ch1, char ch2);
3664
3665 unsigned int MatchTypes(struct Type * source, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, struct __ecereNameSpace__ecere__com__Class * owningClassSource, struct __ecereNameSpace__ecere__com__Class * owningClassDest, unsigned int doConversion, unsigned int enumBaseType, unsigned int acceptReversedParams, unsigned int isConversionExploration, unsigned int warnConst);
3666
3667 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3668
3669 extern struct Type * MkClassType(const char *  name);
3670
3671 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_AddDataMember(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, const char *  type, unsigned int size, unsigned int alignment, int declMode);
3672
3673 void ProcessMemberInitData(struct MemberInit * member, struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class ** curClass, struct __ecereNameSpace__ecere__com__DataMember ** curMember, struct __ecereNameSpace__ecere__com__DataMember ** subMemberStack, int * subMemberStackPos)
3674 {
3675 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3676 unsigned int found = 0;
3677 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3678 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3679 unsigned int freeType = 0;
3680
3681 yylloc = member->loc;
3682 if(!ident)
3683 {
3684 if(curMember)
3685 {
3686 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3687 if(*curMember)
3688 {
3689 found = 1;
3690 dataMember = *curMember;
3691 }
3692 }
3693 }
3694 else
3695 {
3696 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3697 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3698 int _subMemberStackPos = 0;
3699
3700 if(!thisMember)
3701 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3702 if(thisMember)
3703 {
3704 dataMember = thisMember;
3705 if(curMember && thisMember->memberAccess == 1)
3706 {
3707 *curMember = thisMember;
3708 *curClass = thisMember->_class;
3709 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
3710 *subMemberStackPos = _subMemberStackPos;
3711 }
3712 found = 1;
3713 }
3714 else
3715 {
3716 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3717 if(method && method->type == 1)
3718 found = 1;
3719 else
3720 method = (((void *)0));
3721 }
3722 }
3723 if(found)
3724 {
3725 struct Type * type = (((void *)0));
3726
3727 if(dataMember)
3728 {
3729 if(!dataMember->dataType && dataMember->dataTypeString)
3730 {
3731 struct Context * context = SetupTemplatesContext(_class);
3732
3733 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
3734 FinishTemplatesContext(context);
3735 }
3736 type = dataMember->dataType;
3737 }
3738 else if(method)
3739 {
3740 if(!method->dataType)
3741 ProcessMethodType(method);
3742 type = method->dataType;
3743 }
3744 if(ident && ident->next)
3745 {
3746 for(ident = ident->next; ident && type; ident = ident->next)
3747 {
3748 if(type->kind == 8)
3749 {
3750 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->__anon1._class->__anon1.registered, ident->string, privateModule);
3751 if(!dataMember)
3752 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->__anon1._class->__anon1.registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3753 if(dataMember)
3754 type = dataMember->dataType;
3755 }
3756 else if(type->kind == 9 || type->kind == 10)
3757 {
3758 struct Type * memberType;
3759
3760 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
3761 {
3762 if(!strcmp(memberType->name, ident->string))
3763 {
3764 type = memberType;
3765 break;
3766 }
3767 }
3768 }
3769 }
3770 }
3771 if(type && type->kind == 20 && type->__anon1.templateParameter->type == 0 && _class->templateArgs)
3772 {
3773 int id = 0;
3774 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3775 struct __ecereNameSpace__ecere__com__Class * sClass;
3776
3777 for(sClass = _class; sClass; sClass = sClass->base)
3778 {
3779 id = 0;
3780 if(sClass->templateClass)
3781 sClass = sClass->templateClass;
3782 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3783 {
3784 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
3785 {
3786 for(sClass = sClass->base; sClass; sClass = sClass->base)
3787 {
3788 if(sClass->templateClass)
3789 sClass = sClass->templateClass;
3790 id += sClass->templateParams.count;
3791 }
3792 break;
3793 }
3794 id++;
3795 }
3796 if(curParam)
3797 break;
3798 }
3799 if(curParam)
3800 {
3801 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3802
3803 if(arg.__anon1.__anon1.dataTypeString)
3804 {
3805 unsigned int constant = type->constant;
3806
3807 type = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
3808 if(type->kind == 8 && constant)
3809 type->constant = 1;
3810 else if(type->kind == 13)
3811 {
3812 struct Type * t = type->__anon1.type;
3813
3814 while(t->kind == 13)
3815 t = t->__anon1.type;
3816 if(constant)
3817 t->constant = constant;
3818 }
3819 freeType = 1;
3820 if(type && _class->templateClass)
3821 type->passAsTemplate = 1;
3822 if(type)
3823 {
3824 }
3825 }
3826 }
3827 }
3828 if(type && type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered && strchr(type->__anon1._class->__anon1.registered->fullName, '<'))
3829 {
3830 struct __ecereNameSpace__ecere__com__Class * expClass = type->__anon1._class->__anon1.registered;
3831 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3832 int paramCount = 0;
3833 int lastParam = -1;
3834 char templateString[1024];
3835 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3836
3837 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3838 for(cClass = expClass; cClass; cClass = cClass->base)
3839 {
3840 int p = 0;
3841
3842 if(cClass->templateClass)
3843 cClass = cClass->templateClass;
3844 for(param = cClass->templateParams.first; param; param = param->next)
3845 {
3846 int id = p;
3847 struct __ecereNameSpace__ecere__com__Class * sClass;
3848 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3849
3850 for(sClass = cClass->base; sClass; sClass = sClass->base)
3851 {
3852 if(sClass->templateClass)
3853 sClass = sClass->templateClass;
3854 id += sClass->templateParams.count;
3855 }
3856 arg = expClass->templateArgs[id];
3857 for(sClass = _class; sClass; sClass = sClass->base)
3858 {
3859 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3860 int p = 0;
3861 struct __ecereNameSpace__ecere__com__Class * nextClass;
3862
3863 if(sClass->templateClass)
3864 sClass = sClass->templateClass;
3865 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3866 {
3867 if(nextClass->templateClass)
3868 nextClass = nextClass->templateClass;
3869 p += nextClass->templateParams.count;
3870 }
3871 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3872 {
3873 if(cParam->type == 0 && arg.__anon1.__anon1.dataTypeString && !strcmp(cParam->name, arg.__anon1.__anon1.dataTypeString))
3874 {
3875 if(_class->templateArgs && arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
3876 {
3877 arg.__anon1.__anon1.dataTypeString = _class->templateArgs[p].__anon1.__anon1.dataTypeString;
3878 arg.__anon1.__anon1.dataTypeClass = _class->templateArgs[p].__anon1.__anon1.dataTypeClass;
3879 break;
3880 }
3881 }
3882 }
3883 }
3884 {
3885 char argument[256];
3886
3887 argument[0] = '\0';
3888 switch(param->type)
3889 {
3890 case 2:
3891 {
3892 char expString[1024];
3893 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3894 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
3895 struct Expression * exp;
3896 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
3897
3898 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3899 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
3900 ProcessExpressionType(exp);
3901 ComputeExpression(exp);
3902 expString[0] = '\0';
3903 PrintExpression(exp, expString);
3904 strcat(argument, expString);
3905 FreeExpression(exp);
3906 break;
3907 }
3908 case 1:
3909 {
3910 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
3911 break;
3912 }
3913 case 0:
3914 {
3915 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
3916 strcat(argument, arg.__anon1.__anon1.dataTypeString);
3917 break;
3918 }
3919 }
3920 if(argument[0])
3921 {
3922 if(paramCount)
3923 strcat(templateString, ", ");
3924 if(lastParam != p - 1)
3925 {
3926 strcat(templateString, param->name);
3927 strcat(templateString, " = ");
3928 }
3929 strcat(templateString, argument);
3930 paramCount++;
3931 lastParam = p;
3932 }
3933 p++;
3934 }
3935 }
3936 }
3937 {
3938 int len = strlen(templateString);
3939
3940 if(templateString[len - 1] == '<')
3941 len--;
3942 else
3943 {
3944 if(templateString[len - 1] == '>')
3945 templateString[len++] = ' ';
3946 templateString[len++] = '>';
3947 }
3948 templateString[len++] = '\0';
3949 }
3950 {
3951 struct Context * context = SetupTemplatesContext(_class);
3952
3953 if(freeType)
3954 FreeType(type);
3955 type = ProcessTypeString(templateString, 0);
3956 freeType = 1;
3957 FinishTemplatesContext(context);
3958 }
3959 }
3960 if(method && member->initializer && member->initializer->type == 0 && member->initializer->__anon1.exp)
3961 {
3962 ProcessExpressionType(member->initializer->__anon1.exp);
3963 if(!member->initializer->__anon1.exp->expType)
3964 {
3965 if(inCompiler)
3966 {
3967 char expString[10240];
3968
3969 expString[0] = '\0';
3970 PrintExpression(member->initializer->__anon1.exp, expString);
3971 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3972 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3973 }
3974 }
3975 else if(!MatchTypes(member->initializer->__anon1.exp->expType, type, (((void *)0)), (((void *)0)), _class, 1, 1, 0, 0, 1))
3976 {
3977 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible instance method %s\n", (((void *)0))), ident->string);
3978 }
3979 }
3980 else if(member->initializer)
3981 {
3982 ProcessInitializer(member->initializer, type);
3983 }
3984 if(freeType)
3985 FreeType(type);
3986 }
3987 else
3988 {
3989 if(_class && _class->type == 3)
3990 {
3991 if(member->initializer)
3992 {
3993 struct Type * type = MkClassType(_class->fullName);
3994
3995 ProcessInitializer(member->initializer, type);
3996 FreeType(type);
3997 }
3998 }
3999 else
4000 {
4001 if(member->initializer)
4002 {
4003 ProcessInitializer(member->initializer, (((void *)0)));
4004 }
4005 if(ident)
4006 {
4007 if(method)
4008 {
4009 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
4010 }
4011 else if(_class)
4012 {
4013 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
4014 if(inCompiler)
4015 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
4016 }
4017 }
4018 else if(_class)
4019 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
4020 }
4021 }
4022 }
4023
4024 extern struct External * ProcessClassFunction(struct __ecereNameSpace__ecere__com__Class * owningClass, struct ClassFunction * func, struct __ecereNameSpace__ecere__sys__OldList * defs, struct External * after, unsigned int makeStatic);
4025
4026 extern void FreeSpecifier(struct Specifier * spec);
4027
4028 static void ProcessFunction(struct FunctionDefinition * function);
4029
4030 extern struct __ecereNameSpace__ecere__sys__OldList *  CopyList(struct __ecereNameSpace__ecere__sys__OldList *  source, void *  (*  CopyFunction)(void * ));
4031
4032 extern struct Specifier * CopySpecifier(struct Specifier * spec);
4033
4034 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
4035
4036 extern void FreeClassFunction(struct ClassFunction * func);
4037
4038 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
4039
4040 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
4041
4042 void ProcessInstantiationType(struct Instantiation * inst)
4043 {
4044 yylloc = inst->loc;
4045 if(inst->_class)
4046 {
4047 struct MembersInit * members;
4048 struct Symbol * classSym;
4049 struct __ecereNameSpace__ecere__com__Class * _class;
4050
4051 classSym = inst->_class->__anon1.__anon1.symbol;
4052 _class = classSym ? classSym->__anon1.registered : (((void *)0));
4053 if(!_class || _class->type != 5)
4054 DeclareStruct(inst->_class->__anon1.__anon1.name, 0);
4055 afterExternal = afterExternal ? afterExternal : curExternal;
4056 if(inst->exp)
4057 ProcessExpressionType(inst->exp);
4058 inst->isConstant = 1;
4059 if(inst->members)
4060 {
4061 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
4062 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
4063 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
4064 int subMemberStackPos = 0;
4065
4066 for(members = (*inst->members).first; members; members = members->next)
4067 {
4068 switch(members->type)
4069 {
4070 case 1:
4071 {
4072 char name[1024];
4073 static unsigned int instMethodID = 0;
4074 struct External * external = curExternal;
4075 struct Context * context = curContext;
4076 struct Declarator * declarator = members->__anon1.function->declarator;
4077 struct Identifier * nameID = GetDeclId(declarator);
4078 char * unmangled = nameID ? nameID->string : (((void *)0));
4079 struct Expression * exp;
4080 struct External * createdExternal = (((void *)0));
4081
4082 if(inCompiler)
4083 {
4084 char number[16];
4085
4086 strcpy(name, "__ecereInstMeth_");
4087 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0);
4088 strcat(name, "_");
4089 strcat(name, nameID->string);
4090 strcat(name, "_");
4091 sprintf(number, "_%08d", instMethodID++);
4092 strcat(name, number);
4093 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
4094 }
4095 if(declarator)
4096 {
4097 struct Symbol * symbol = declarator->symbol;
4098 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
4099
4100 if(method && method->type == 1)
4101 {
4102 symbol->__anon1.method = method;
4103 ProcessMethodType(method);
4104 if(!symbol->type->__anon1.__anon2.thisClass)
4105 {
4106 if(method->dataType->__anon1.__anon2.thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->__anon1.__anon2.thisClass->__anon1.registered))
4107 {
4108 if(!currentClass->symbol)
4109 currentClass->symbol = FindClass(currentClass->fullName);
4110 symbol->type->__anon1.__anon2.thisClass = currentClass->symbol;
4111 }
4112 else
4113 {
4114 if(!_class->symbol)
4115 _class->symbol = FindClass(_class->fullName);
4116 symbol->type->__anon1.__anon2.thisClass = _class->symbol;
4117 }
4118 }
4119 DeclareType(symbol->type, 1, 1);
4120 }
4121 else if(classSym)
4122 {
4123 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
4124 }
4125 }
4126 createdExternal = ProcessClassFunction(classSym ? classSym->__anon1.registered : (((void *)0)), members->__anon1.function, ast, afterExternal, 1);
4127 if(nameID)
4128 {
4129 FreeSpecifier(nameID->_class);
4130 nameID->_class = (((void *)0));
4131 }
4132 if(inCompiler)
4133 {
4134 struct External * oldExternal = curExternal;
4135
4136 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
4137 {
4138 struct External * externalDecl;
4139
4140 externalDecl = MkExternalDeclaration((((void *)0)));
4141 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
4142 if(createdExternal->__anon1.function)
4143 {
4144 ProcessFunction(createdExternal->__anon1.function);
4145 {
4146 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->__anon1.function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
4147
4148 externalDecl->__anon1.declaration = decl;
4149 if(decl->symbol && !decl->symbol->__anon2.__anon1.pointerExternal)
4150 decl->symbol->__anon2.__anon1.pointerExternal = externalDecl;
4151 declarator->symbol->__anon2.__anon1.pointerExternal = externalDecl;
4152 }
4153 }
4154 }
4155 }
4156 else if(declarator)
4157 {
4158 curExternal = declarator->symbol->__anon2.__anon1.pointerExternal;
4159 ProcessFunction((struct FunctionDefinition *)members->__anon1.function);
4160 }
4161 curExternal = external;
4162 curContext = context;
4163 if(inCompiler)
4164 {
4165 FreeClassFunction(members->__anon1.function);
4166 exp = QMkExpId(name);
4167 members->type = 0;
4168 members->__anon1.dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
4169 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
4170 }
4171 break;
4172 }
4173 case 0:
4174 {
4175 if(members->__anon1.dataMembers && classSym)
4176 {
4177 struct MemberInit * member;
4178 struct Location oldyyloc = yylloc;
4179
4180 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
4181 {
4182 ProcessMemberInitData(member, classSym->__anon1.registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
4183 if(member->initializer && !member->initializer->isConstant)
4184 inst->isConstant = 0;
4185 }
4186 yylloc = oldyyloc;
4187 }
4188 break;
4189 }
4190 }
4191 }
4192 }
4193 }
4194 }
4195
4196 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
4197 {
4198 if(inCompiler)
4199 {
4200 if(type->kind == 11)
4201 {
4202 struct Type * param;
4203
4204 if(declareParams)
4205 {
4206 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
4207 DeclareType(param, declarePointers, 1);
4208 }
4209 DeclareType(type->__anon1.__anon2.returnType, declarePointers, 1);
4210 }
4211 else if(type->kind == 13 && declarePointers)
4212 DeclareType(type->__anon1.type, declarePointers, 0);
4213 else if(type->kind == 8)
4214 {
4215 if(type->__anon1._class->__anon1.registered && (type->__anon1._class->__anon1.registered->type == 1 || type->__anon1._class->__anon1.registered->type == 5) && !type->__anon1._class->declaring)
4216 DeclareStruct(type->__anon1._class->__anon1.registered->fullName, type->__anon1._class->__anon1.registered->type == 5);
4217 }
4218 else if(type->kind == 9 || type->kind == 10)
4219 {
4220 struct Type * member;
4221
4222 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
4223 DeclareType(member, 0, 0);
4224 }
4225 else if(type->kind == 12)
4226 DeclareType(type->__anon1.__anon4.arrayType, declarePointers, 0);
4227 }
4228 }
4229
4230 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
4231
4232 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
4233 {
4234 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
4235 int id = 0;
4236 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4237 struct __ecereNameSpace__ecere__com__Class * sClass;
4238
4239 for(sClass = _class; sClass; sClass = sClass->base)
4240 {
4241 id = 0;
4242 if(sClass->templateClass)
4243 sClass = sClass->templateClass;
4244 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4245 {
4246 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
4247 {
4248 for(sClass = sClass->base; sClass; sClass = sClass->base)
4249 {
4250 if(sClass->templateClass)
4251 sClass = sClass->templateClass;
4252 id += sClass->templateParams.count;
4253 }
4254 break;
4255 }
4256 id++;
4257 }
4258 if(curParam)
4259 break;
4260 }
4261 if(curParam)
4262 {
4263 arg = &_class->templateArgs[id];
4264 if(arg && param->type == 0)
4265 (*arg).__anon1.__anon1.dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).__anon1.__anon1.dataTypeString);
4266 }
4267 return arg;
4268 }
4269
4270 extern struct Context * PushContext(void);
4271
4272 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
4273
4274 struct TemplatedType
4275 {
4276 uintptr_t key;
4277 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4278 struct __ecereNameSpace__ecere__sys__BTNode * left;
4279 struct __ecereNameSpace__ecere__sys__BTNode * right;
4280 int depth;
4281 struct TemplateParameter * param;
4282 } __attribute__ ((gcc_struct));
4283
4284 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
4285
4286 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
4287 {
4288 struct Context * context = PushContext();
4289
4290 context->templateTypesOnly = 1;
4291 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
4292 {
4293 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
4294
4295 for(; param; param = param->next)
4296 {
4297 if(param->type == 0 && param->identifier)
4298 {
4299 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
4300
4301 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4302 }
4303 }
4304 }
4305 else if(_class)
4306 {
4307 struct __ecereNameSpace__ecere__com__Class * sClass;
4308
4309 for(sClass = _class; sClass; sClass = sClass->base)
4310 {
4311 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
4312
4313 for(p = sClass->templateParams.first; p; p = p->next)
4314 {
4315 if(p->type == 0)
4316 {
4317 struct TemplateParameter * param = p->param;
4318 struct TemplatedType * type;
4319
4320 if(!param)
4321 {
4322 p->param = param = __extension__ ({
4323 struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
4324
4325 __ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->__anon1.dataTypeString, __ecereInstance1;
4326 });
4327 }
4328 type = __extension__ ({
4329 struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
4330
4331 __ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
4332 });
4333 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4334 }
4335 }
4336 }
4337 }
4338 return context;
4339 }
4340
4341 extern void PopContext(struct Context * ctx);
4342
4343 extern void FreeContext(struct Context * context);
4344
4345 void FinishTemplatesContext(struct Context * context)
4346 {
4347 PopContext(context);
4348 FreeContext(context);
4349 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor((void *)context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
4350 }
4351
4352 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
4353 {
4354 if(!method->dataType)
4355 {
4356 struct Context * context = SetupTemplatesContext(method->_class);
4357
4358 method->dataType = ProcessTypeString(method->dataTypeString, 0);
4359 FinishTemplatesContext(context);
4360 if(method->type != 1 && method->dataType)
4361 {
4362 if(!method->dataType->__anon1.__anon2.thisClass && !method->dataType->__anon1.__anon2.staticMethod)
4363 {
4364 if(!method->_class->symbol)
4365 method->_class->symbol = FindClass(method->_class->fullName);
4366 method->dataType->__anon1.__anon2.thisClass = method->_class->symbol;
4367 }
4368 }
4369 }
4370 }
4371
4372 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
4373 {
4374 if(!prop->dataType)
4375 {
4376 struct Context * context = SetupTemplatesContext(prop->_class);
4377
4378 prop->dataType = ProcessTypeString(prop->dataTypeString, 0);
4379 FinishTemplatesContext(context);
4380 }
4381 }
4382
4383 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4384
4385 extern void FreeTypeName(struct TypeName * typeName);
4386
4387 static void ProcessDeclarator(struct Declarator * decl);
4388
4389 extern struct __ecereNameSpace__ecere__sys__OldList *  excludedSymbols;
4390
4391 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4392
4393 struct MethodImport
4394 {
4395 struct MethodImport * prev;
4396 struct MethodImport * next;
4397 char *  name;
4398 unsigned int isVirtual;
4399 } __attribute__ ((gcc_struct));
4400
4401 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
4402
4403 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, const char * name)
4404 {
4405 struct Symbol * symbol = method->symbol;
4406
4407 if(!symbol || (!symbol->__anon2.__anon1.pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4408 {
4409 unsigned int dllImport = 0;
4410
4411 if(!method->dataType)
4412 method->dataType = ProcessTypeString(method->dataTypeString, 0);
4413 if(!symbol || symbol->_import || method->type == 1)
4414 {
4415 if(!symbol || method->type == 1)
4416 {
4417 struct Symbol * classSym;
4418
4419 if(!method->_class->symbol)
4420 method->_class->symbol = FindClass(method->_class->fullName);
4421 classSym = method->_class->symbol;
4422 if(!classSym->_import)
4423 {
4424 struct ModuleImport * module;
4425
4426 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->name)
4427 module = FindModule(method->_class->module);
4428 else
4429 module = mainModule;
4430 classSym->_import = __extension__ ({
4431 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
4432
4433 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
4434 });
4435 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4436 }
4437 if(!symbol)
4438 {
4439 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4440 }
4441 if(!symbol->_import)
4442 {
4443 symbol->_import = (struct ClassImport *)__extension__ ({
4444 struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
4445
4446 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
4447 });
4448 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4449 }
4450 if(!symbol)
4451 {
4452 symbol->type = method->dataType;
4453 if(symbol->type)
4454 symbol->type->refCount++;
4455 }
4456 }
4457 if(!method->dataType->dllExport)
4458 {
4459 if((method->_class->module != privateModule || !strcmp(method->_class->name, "float") || !strcmp(method->_class->name, "double")) && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->importType != 1)
4460 dllImport = 1;
4461 }
4462 }
4463 if(method->type != 1 && method->dataType)
4464 DeclareType(method->dataType, 1, 1);
4465 if(!symbol->__anon2.__anon1.pointerExternal || symbol->__anon2.__anon1.pointerExternal->type == 0)
4466 {
4467 struct Declaration * decl;
4468 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4469 struct Declarator * d;
4470 struct Declarator * funcDecl;
4471 struct External * external;
4472
4473 specifiers = MkList();
4474 declarators = MkList();
4475 if(dllImport)
4476 ListAdd(specifiers, MkSpecifier(EXTERN));
4477 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4478 ListAdd(specifiers, MkSpecifier(STATIC));
4479 if(method->type == 1)
4480 {
4481 ListAdd(specifiers, MkSpecifier(INT));
4482 d = MkDeclaratorIdentifier(MkIdentifier(name));
4483 }
4484 else
4485 {
4486 d = MkDeclaratorIdentifier(MkIdentifier(name));
4487 if(dllImport)
4488 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4489 {
4490 struct Context * context = SetupTemplatesContext(method->_class);
4491
4492 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4493 FinishTemplatesContext(context);
4494 }
4495 funcDecl = GetFuncDecl(d);
4496 if(dllImport)
4497 {
4498 struct Specifier * spec, * next;
4499
4500 for(spec = (*specifiers).first; spec; spec = next)
4501 {
4502 next = spec->next;
4503 if(spec->type == 5)
4504 {
4505 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4506 FreeSpecifier(spec);
4507 }
4508 }
4509 }
4510 if(method->dataType && !method->dataType->__anon1.__anon2.staticMethod)
4511 {
4512 if(funcDecl && funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count)
4513 {
4514 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->__anon1.__anon2.thisClass ? method->dataType->__anon1.__anon2.thisClass->__anon1.registered : method->_class;
4515 struct TypeName * thisParam = MkTypeName(MkListOne(MkSpecifierName(method->dataType->__anon1.__anon2.thisClass ? method->dataType->__anon1.__anon2.thisClass->string : method->_class->fullName)), (_class && _class->type == 1000) ? MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("this"))) : MkDeclaratorIdentifier(MkIdentifier("this")));
4516 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->__anon1.function.parameters).first);
4517 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4518
4519 if(firstSpec && firstSpec->type == 0 && firstSpec->__anon1.specifier == VOID && !firstParam->declarator)
4520 {
4521 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
4522
4523 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
4524 FreeTypeName(param);
4525 }
4526 if(!funcDecl->__anon1.function.parameters)
4527 funcDecl->__anon1.function.parameters = MkList();
4528 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
4529 }
4530 }
4531 }
4532 ProcessDeclarator(d);
4533 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4534 decl = MkDeclaration(specifiers, declarators);
4535 ReplaceThisClassSpecifiers(specifiers, method->_class);
4536 if(symbol->__anon2.__anon1.pointerExternal)
4537 {
4538 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4539
4540 {
4541 *functionSymbol = *symbol;
4542 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4543 if(functionSymbol->type)
4544 functionSymbol->type->refCount++;
4545 }
4546 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4547 symbol->__anon2.__anon1.pointerExternal->symbol = functionSymbol;
4548 }
4549 external = MkExternalDeclaration(decl);
4550 if(curExternal)
4551 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4552 external->symbol = symbol;
4553 symbol->__anon2.__anon1.pointerExternal = external;
4554 }
4555 else if(ast)
4556 {
4557 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon1.pointerExternal, curExternal->prev);
4558 }
4559 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4560 }
4561 }
4562
4563 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4564 {
4565 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4566 {
4567 unsigned int first = 1;
4568 int p = 0;
4569 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4570 int lastParam = -1;
4571 char className[1024];
4572
4573 strcpy(className, _class->fullName);
4574 for(param = _class->templateParams.first; param; param = param->next)
4575 {
4576 {
4577 if(first)
4578 strcat(className, "<");
4579 if(!first)
4580 strcat(className, ", ");
4581 if(lastParam + 1 != p)
4582 {
4583 strcat(className, param->name);
4584 strcat(className, " = ");
4585 }
4586 strcat(className, param->name);
4587 first = 0;
4588 lastParam = p;
4589 }
4590 p++;
4591 }
4592 if(!first)
4593 {
4594 int len = strlen(className);
4595
4596 if(className[len - 1] == '>')
4597 className[len++] = ' ';
4598 className[len++] = '>';
4599 className[len++] = '\0';
4600 }
4601 return __ecereNameSpace__ecere__sys__CopyString(className);
4602 }
4603 else
4604 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4605 }
4606
4607 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4608 {
4609 struct Type * type;
4610
4611 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4612 {
4613 unsigned int first = 1;
4614 int p = 0;
4615 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4616 int lastParam = -1;
4617 char className[1024];
4618
4619 strcpy(className, _class->fullName);
4620 for(param = _class->templateParams.first; param; param = param->next)
4621 {
4622 {
4623 if(first)
4624 strcat(className, "<");
4625 if(!first)
4626 strcat(className, ", ");
4627 if(lastParam + 1 != p)
4628 {
4629 strcat(className, param->name);
4630 strcat(className, " = ");
4631 }
4632 strcat(className, param->name);
4633 first = 0;
4634 lastParam = p;
4635 }
4636 p++;
4637 }
4638 if(!first)
4639 {
4640 int len = strlen(className);
4641
4642 if(className[len - 1] == '>')
4643 className[len++] = ' ';
4644 className[len++] = '>';
4645 className[len++] = '\0';
4646 }
4647 type = MkClassType(className);
4648 }
4649 else
4650 {
4651 type = MkClassType(_class->fullName);
4652 }
4653 return type;
4654 }
4655
4656 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4657 {
4658 if(specs != (((void *)0)) && _class)
4659 {
4660 struct Specifier * spec;
4661
4662 for(spec = specs->first; spec; spec = spec->next)
4663 {
4664 if(spec->type == 0 && spec->__anon1.specifier == THISCLASS)
4665 {
4666 spec->type = 1;
4667 spec->__anon1.__anon1.name = ReplaceThisClass(_class);
4668 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
4669 }
4670 }
4671 }
4672 }
4673
4674 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4675
4676 struct __ecereNameSpace__ecere__com__GlobalFunction
4677 {
4678 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4679 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4680 const char *  name;
4681 int (*  function)();
4682 struct __ecereNameSpace__ecere__com__Instance * module;
4683 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
4684 const char *  dataTypeString;
4685 struct Type * dataType;
4686 void *  symbol;
4687 } __attribute__ ((gcc_struct));
4688
4689 extern struct Context * globalContext;
4690
4691 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4692
4693 struct FunctionImport
4694 {
4695 struct FunctionImport * prev;
4696 struct FunctionImport * next;
4697 char *  name;
4698 } __attribute__ ((gcc_struct));
4699
4700 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4701 {
4702 struct Symbol * symbol = function->symbol;
4703
4704 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4705 {
4706 unsigned int imported = 0;
4707 unsigned int dllImport = 0;
4708
4709 if(!function->dataType)
4710 {
4711 function->dataType = ProcessTypeString(function->dataTypeString, 0);
4712 if(!function->dataType->__anon1.__anon2.thisClass)
4713 function->dataType->__anon1.__anon2.staticMethod = 1;
4714 }
4715 if(inCompiler)
4716 {
4717 if(!symbol)
4718 {
4719 struct ModuleImport * module = FindModule(function->module);
4720
4721 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4722 if(module->name)
4723 {
4724 if(!function->dataType->dllExport)
4725 {
4726 symbol->_import = (struct ClassImport *)__extension__ ({
4727 struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
4728
4729 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
4730 });
4731 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4732 }
4733 }
4734 {
4735 symbol->type = ProcessTypeString(function->dataTypeString, 0);
4736 if(!symbol->type->__anon1.__anon2.thisClass)
4737 symbol->type->__anon1.__anon2.staticMethod = 1;
4738 }
4739 }
4740 imported = symbol->_import ? 1 : 0;
4741 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1)
4742 dllImport = 1;
4743 }
4744 DeclareType(function->dataType, 1, 1);
4745 if(inCompiler)
4746 {
4747 if(!symbol->__anon2.__anon1.pointerExternal || symbol->__anon2.__anon1.pointerExternal->type == 0)
4748 {
4749 struct Declaration * decl;
4750 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4751 struct Declarator * d;
4752 struct Declarator * funcDecl;
4753 struct External * external;
4754
4755 specifiers = MkList();
4756 declarators = MkList();
4757 ListAdd(specifiers, MkSpecifier(EXTERN));
4758 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4759 if(dllImport)
4760 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4761 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4762 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType == 1)
4763 {
4764 struct Specifier * spec;
4765
4766 for(spec = (*specifiers).first; spec; spec = spec->next)
4767 if(spec->type == 5 && spec->__anon1.__anon1.extDecl && spec->__anon1.__anon1.extDecl->type == 0 && !strcmp(spec->__anon1.__anon1.extDecl->__anon1.s, "dllexport"))
4768 {
4769 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4770 FreeSpecifier(spec);
4771 break;
4772 }
4773 }
4774 funcDecl = GetFuncDecl(d);
4775 if(funcDecl && !funcDecl->__anon1.function.parameters)
4776 {
4777 funcDecl->__anon1.function.parameters = MkList();
4778 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4779 }
4780 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4781 {
4782 struct Context * oldCtx = curContext;
4783
4784 curContext = globalContext;
4785 decl = MkDeclaration(specifiers, declarators);
4786 curContext = oldCtx;
4787 }
4788 if(symbol->__anon2.__anon1.pointerExternal)
4789 {
4790 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4791
4792 {
4793 *functionSymbol = *symbol;
4794 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4795 if(functionSymbol->type)
4796 functionSymbol->type->refCount++;
4797 }
4798 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4799 symbol->__anon2.__anon1.pointerExternal->symbol = functionSymbol;
4800 }
4801 external = MkExternalDeclaration(decl);
4802 if(curExternal)
4803 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4804 external->symbol = symbol;
4805 symbol->__anon2.__anon1.pointerExternal = external;
4806 }
4807 else
4808 {
4809 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon1.pointerExternal, curExternal->prev);
4810 }
4811 if(curExternal)
4812 symbol->id = curExternal->symbol->idCode;
4813 }
4814 }
4815 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1) ? 1 : 0;
4816 }
4817
4818 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4819
4820 struct GlobalData
4821 {
4822 uintptr_t key;
4823 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4824 struct __ecereNameSpace__ecere__sys__BTNode * left;
4825 struct __ecereNameSpace__ecere__sys__BTNode * right;
4826 int depth;
4827 struct __ecereNameSpace__ecere__com__Instance * module;
4828 char *  dataTypeString;
4829 struct Type * dataType;
4830 void *  symbol;
4831 char *  fullName;
4832 } __attribute__ ((gcc_struct));
4833
4834 void DeclareGlobalData(struct GlobalData * data)
4835 {
4836 struct Symbol * symbol = data->symbol;
4837
4838 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4839 {
4840 if(inCompiler)
4841 {
4842 if(!symbol)
4843 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4844 }
4845 if(!data->dataType)
4846 data->dataType = ProcessTypeString(data->dataTypeString, 0);
4847 DeclareType(data->dataType, 1, 1);
4848 if(inCompiler)
4849 {
4850 if(!symbol->__anon2.__anon1.pointerExternal)
4851 {
4852 struct Declaration * decl;
4853 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4854 struct Declarator * d;
4855 struct External * external;
4856
4857 specifiers = MkList();
4858 declarators = MkList();
4859 ListAdd(specifiers, MkSpecifier(EXTERN));
4860 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4861 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4862 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4863 decl = MkDeclaration(specifiers, declarators);
4864 external = MkExternalDeclaration(decl);
4865 if(curExternal)
4866 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4867 external->symbol = symbol;
4868 symbol->__anon2.__anon1.pointerExternal = external;
4869 }
4870 else
4871 {
4872 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon1.pointerExternal, curExternal->prev);
4873 }
4874 if(curExternal)
4875 symbol->id = curExternal->symbol->idCode;
4876 }
4877 }
4878 }
4879
4880 struct Conversion
4881 {
4882 struct Conversion * prev, * next;
4883 struct __ecereNameSpace__ecere__com__Property * convert;
4884 unsigned int isGet;
4885 struct Type * resultType;
4886 } __attribute__ ((gcc_struct));
4887
4888 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4889
4890 extern void Compiler_Warning(const char *  format, ...);
4891
4892 static unsigned int CheckConstCompatibility(struct Type * source, struct Type * dest, unsigned int warn)
4893 {
4894 unsigned int status = 1;
4895
4896 if(((source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered) || source->kind == 12 || source->kind == 13) && ((dest->kind == 8 && dest->__anon1._class && dest->__anon1._class->__anon1.registered) || dest->kind == 13))
4897 {
4898 struct __ecereNameSpace__ecere__com__Class * sourceClass = source->kind == 8 ? source->__anon1._class->__anon1.registered : (((void *)0));
4899 struct __ecereNameSpace__ecere__com__Class * destClass = dest->kind == 8 ? dest->__anon1._class->__anon1.registered : (((void *)0));
4900
4901 if((!sourceClass || (sourceClass && sourceClass->type == 0 && !sourceClass->structSize)) && (!destClass || (destClass && destClass->type == 0 && !destClass->structSize)))
4902 {
4903 struct Type * sourceType = source, * destType = dest;
4904
4905 while((sourceType->kind == 13 || sourceType->kind == 12) && sourceType->__anon1.type)
4906 sourceType = sourceType->__anon1.type;
4907 while((destType->kind == 13 || destType->kind == 12) && destType->__anon1.type)
4908 destType = destType->__anon1.type;
4909 if(!destType->constant && sourceType->constant)
4910 {
4911 status = 0;
4912 if(warn)
4913 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "discarding const qualifier\n", (((void *)0))));
4914 }
4915 }
4916 }
4917 return status;
4918 }
4919
4920 extern void CopyTypeInto(struct Type * type, struct Type * src);
4921
4922 void PrintType(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
4923
4924 unsigned int MatchTypes(struct Type * source, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, struct __ecereNameSpace__ecere__com__Class * owningClassSource, struct __ecereNameSpace__ecere__com__Class * owningClassDest, unsigned int doConversion, unsigned int enumBaseType, unsigned int acceptReversedParams, unsigned int isConversionExploration, unsigned int warnConst)
4925 {
4926 if(source && dest)
4927 {
4928 if(warnConst)
4929 CheckConstCompatibility(source, dest, 1);
4930 if(source->kind == 20 && dest->kind != 20)
4931 {
4932 struct Type * type = ProcessTemplateParameterType(source->__anon1.templateParameter);
4933
4934 if(type)
4935 source = type;
4936 }
4937 if(dest->kind == 20 && source->kind != 20)
4938 {
4939 struct Type * type = ProcessTemplateParameterType(dest->__anon1.templateParameter);
4940
4941 if(type)
4942 dest = type;
4943 }
4944 if(dest->classObjectType == 2 && dest->kind != 11)
4945 {
4946 if(source->classObjectType != 3)
4947 return 1;
4948 else
4949 {
4950 if((dest->__anon1._class && strcmp(dest->__anon1._class->string, "class")) || (source->__anon1._class && strcmp(source->__anon1._class->string, "class")))
4951 {
4952 return 1;
4953 }
4954 }
4955 }
4956 else
4957 {
4958 if(source->kind != 11 && source->classObjectType == 3)
4959 return 1;
4960 if(dest->kind != 11 && dest->classObjectType == 3 && source->classObjectType != 2)
4961 return 1;
4962 }
4963 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4964 {
4965 if((dest->__anon1.__anon1.enumName && source->__anon1.__anon1.enumName && !strcmp(dest->__anon1.__anon1.enumName, source->__anon1.__anon1.enumName)) || (source->__anon1.__anon1.members.first && source->__anon1.__anon1.members.first == dest->__anon1.__anon1.members.first))
4966 return 1;
4967 }
4968 if(dest->kind == 14 && source->kind != 0)
4969 return 1;
4970 if(dest->kind == 13 && dest->__anon1.type->kind == 0 && ((source->kind == 8 && (!source->__anon1._class || !source->__anon1._class->__anon1.registered || source->__anon1._class->__anon1.registered->type == 1 || source->__anon1._class->__anon1.registered->type == 0 || source->__anon1._class->__anon1.registered->type == 5 || source->__anon1._class->__anon1.registered->type == 1000)) || source->kind == 19 || source->kind == 13 || source->kind == 12 || source->kind == 11 || source->kind == 21))
4971 return 1;
4972 if(!isConversionExploration && source->kind == 13 && source->__anon1.type->kind == 0 && ((dest->kind == 8 && (!dest->__anon1._class || !dest->__anon1._class->__anon1.registered || dest->__anon1._class->__anon1.registered->type == 1 || dest->__anon1._class->__anon1.registered->type == 0 || dest->__anon1._class->__anon1.registered->type == 5 || dest->__anon1._class->__anon1.registered->type == 1000)) || dest->kind == 19 || dest->kind == 13 || dest->kind == 12 || dest->kind == 11 || dest->kind == 21))
4973 return 1;
4974 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->__anon1._class)
4975 {
4976 if(source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 3)
4977 {
4978 if(conversions != (((void *)0)))
4979 {
4980 if(source->__anon1._class->__anon1.registered == dest->__anon1._class->__anon1.registered)
4981 return 1;
4982 }
4983 else
4984 {
4985 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4986
4987 for(sourceBase = source->__anon1._class->__anon1.registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4988 ;
4989 for(destBase = dest->__anon1._class->__anon1.registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4990 ;
4991 if(sourceBase == destBase)
4992 return 1;
4993 }
4994 }
4995 else if(source->__anon1._class && dest->__anon1._class && (dest->classObjectType == source->classObjectType || !dest->classObjectType) && (enumBaseType || (!source->__anon1._class->__anon1.registered || source->__anon1._class->__anon1.registered->type != 4) || (!dest->__anon1._class->__anon1.registered || dest->__anon1._class->__anon1.registered->type != 4)) && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, dest->__anon1._class->__anon1.registered))
4996 return 1;
4997 else
4998 {
4999 if(enumBaseType && dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4 && ((source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type != 4) || source->kind == 8))
5000 {
5001 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->__anon1._class->__anon1.registered, source->__anon1._class->__anon1.registered))
5002 {
5003 return 1;
5004 }
5005 }
5006 }
5007 }
5008 if(source->kind == 19 && dest->kind == 8 && dest->__anon1._class && !strcmp(dest->__anon1._class->string, "ecere::com::Class"))
5009 return 1;
5010 if(doConversion)
5011 {
5012 if(source->kind == 8)
5013 {
5014 struct __ecereNameSpace__ecere__com__Class * _class;
5015
5016 for(_class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
5017 {
5018 struct __ecereNameSpace__ecere__com__Property * convert;
5019
5020 for(convert = _class->conversions.first; convert; convert = convert->next)
5021 {
5022 if(convert->memberAccess == 1 || _class->module == privateModule)
5023 {
5024 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
5025
5026 if(!convert->dataType)
5027 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
5028 if((!isConversionExploration || convert->dataType->kind == 8 || !strcmp(_class->name, "String")) && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), (convert->dataType->kind == 8 && !strcmp(convert->dataTypeString, "String")) ? 1 : 0, convert->dataType->kind == 8, 0, 1, warnConst))
5029 {
5030 if(!conversions && !convert->Get)
5031 return 1;
5032 else if(conversions != (((void *)0)))
5033 {
5034 if(_class->type == 3 && convert->dataType->kind == 8 && convert->dataType->__anon1._class && convert->dataType->__anon1._class->__anon1.registered && _class->base == convert->dataType->__anon1._class->__anon1.registered->base && (dest->kind != 8 || dest->__anon1._class->__anon1.registered != _class->base))
5035 return 1;
5036 else
5037 {
5038 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 1, conv);
5039
5040 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
5041 return 1;
5042 }
5043 }
5044 }
5045 }
5046 }
5047 }
5048 }
5049 if(dest->kind == 8)
5050 {
5051 struct __ecereNameSpace__ecere__com__Class * _class;
5052
5053 for(_class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
5054 {
5055 struct __ecereNameSpace__ecere__com__Property * convert;
5056
5057 for(convert = _class->conversions.first; convert; convert = convert->next)
5058 {
5059 if(convert->memberAccess == 1 || _class->module == privateModule)
5060 {
5061 struct Type * constType = (((void *)0));
5062 unsigned int success = 0;
5063
5064 if(!convert->dataType)
5065 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
5066 if(warnConst && convert->dataType->kind == 13 && convert->dataType->__anon1.type && dest->constant)
5067 {
5068 struct Type * ptrType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5069
5070 constType = __extension__ ({
5071 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5072
5073 __ecereInstance1->kind = 13, __ecereInstance1->refCount = 1, __ecereInstance1->__anon1.type = ptrType, __ecereInstance1;
5074 });
5075 CopyTypeInto(ptrType, convert->dataType->__anon1.type);
5076 ptrType->constant = 1;
5077 }
5078 if((constType || convert->dataType != dest) && MatchTypes(source, constType ? constType : convert->dataType, conversions, (((void *)0)), (((void *)0)), 1, 0, 0, 1, warnConst))
5079 {
5080 if(!conversions && !convert->Set)
5081 success = 1;
5082 else if(conversions != (((void *)0)))
5083 {
5084 if(_class->type == 3 && convert->dataType->kind == 8 && convert->dataType->__anon1._class && convert->dataType->__anon1._class->__anon1.registered && _class->base == convert->dataType->__anon1._class->__anon1.registered->base && (source->kind != 8 || source->__anon1._class->__anon1.registered != _class->base))
5085 success = 1;
5086 else
5087 {
5088 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
5089
5090 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
5091 success = 1;
5092 }
5093 }
5094 }
5095 if(constType)
5096 FreeType(constType);
5097 if(success)
5098 return 1;
5099 }
5100 }
5101 }
5102 if(enumBaseType && dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
5103 {
5104 if(!dest->__anon1._class->__anon1.registered->dataType)
5105 dest->__anon1._class->__anon1.registered->dataType = ProcessTypeString(dest->__anon1._class->__anon1.registered->dataTypeString, 0);
5106 if(dest->__anon1._class->__anon1.registered->dataType->kind == 8 || source->truth || dest->truth)
5107 {
5108 if(MatchTypes(source, dest->__anon1._class->__anon1.registered->dataType, conversions, (((void *)0)), (((void *)0)), 1, dest->__anon1._class->__anon1.registered->dataType->kind == 8, 0, 0, warnConst))
5109 {
5110 return 1;
5111 }
5112 }
5113 }
5114 }
5115 if(source->kind == 8)
5116 {
5117 struct __ecereNameSpace__ecere__com__Class * _class;
5118
5119 for(_class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
5120 {
5121 struct __ecereNameSpace__ecere__com__Property * convert;
5122
5123 for(convert = _class->conversions.first; convert; convert = convert->next)
5124 {
5125 if(convert->memberAccess == 1 || _class->module == privateModule)
5126 {
5127 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
5128
5129 if(!convert->dataType)
5130 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
5131 if(convert->dataType != source && (!isConversionExploration || convert->dataType->kind == 8 || !strcmp(_class->name, "String")) && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), convert->dataType->kind == 8, convert->dataType->kind == 8, 0, 1, warnConst))
5132 {
5133 if(!conversions && !convert->Get)
5134 return 1;
5135 else if(conversions != (((void *)0)))
5136 {
5137 if(_class->type == 3 && convert->dataType->kind == 8 && convert->dataType->__anon1._class && convert->dataType->__anon1._class->__anon1.registered && _class->base == convert->dataType->__anon1._class->__anon1.registered->base && (dest->kind != 8 || dest->__anon1._class->__anon1.registered != _class->base))
5138 return 1;
5139 else
5140 {
5141 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 1, conv);
5142
5143 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
5144 return 1;
5145 }
5146 }
5147 }
5148 }
5149 }
5150 }
5151 if(enumBaseType && source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 4)
5152 {
5153 if(!source->__anon1._class->__anon1.registered->dataType)
5154 source->__anon1._class->__anon1.registered->dataType = ProcessTypeString(source->__anon1._class->__anon1.registered->dataTypeString, 0);
5155 if(!isConversionExploration || source->__anon1._class->__anon1.registered->dataType->kind == 8 || !strcmp(source->__anon1._class->__anon1.registered->name, "String"))
5156 {
5157 if(MatchTypes(source->__anon1._class->__anon1.registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), source->__anon1._class->__anon1.registered->dataType->kind == 8, source->__anon1._class->__anon1.registered->dataType->kind == 8, 0, 0, warnConst))
5158 return 1;
5159 else if(MatchTypes(dest, source->__anon1._class->__anon1.registered->dataType, (((void *)0)), (((void *)0)), (((void *)0)), 0, 0, 0, 0, warnConst))
5160 return 1;
5161 }
5162 }
5163 }
5164 }
5165 if(source->kind == 8 || source->kind == 19)
5166 ;
5167 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
5168 return 1;
5169 else if(dest->kind == 7 && source->kind == 6)
5170 return 1;
5171 else if(dest->kind == 2 && (source->kind == 1 || source->kind == 24))
5172 return 1;
5173 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 23))
5174 return 1;
5175 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 22 || source->kind == 23))
5176 return 1;
5177 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 23 || source->kind == 4))
5178 return 1;
5179 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 4 || source->kind == 22))
5180 return 1;
5181 else if(source->kind == 15 && (dest->kind == 3 || dest->kind == 2 || dest->kind == 1 || source->kind == 24 || dest->kind == 5 || dest->kind == 4 || dest->kind == 22 || dest->kind == 23))
5182 return 1;
5183 else if(dest->kind == 15 && !isConversionExploration && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 5 || source->kind == 4 || source->kind == 22 || source->kind == 23))
5184 return 1;
5185 else if((dest->kind == 11 || (dest->kind == 13 && dest->__anon1.type->kind == 11) || dest->kind == 16) && ((source->kind == 11 || (source->kind == 13 && source->__anon1.type->kind == 11) || source->kind == 16)))
5186 {
5187 struct Type * paramSource, * paramDest;
5188
5189 if(dest->kind == 16)
5190 owningClassDest = dest->__anon1.__anon3.methodClass ? dest->__anon1.__anon3.methodClass : dest->__anon1.__anon3.method->_class;
5191 if(source->kind == 16)
5192 owningClassSource = source->__anon1.__anon3.methodClass ? source->__anon1.__anon3.methodClass : source->__anon1.__anon3.method->_class;
5193 if(dest->kind == 13 && dest->__anon1.type->kind == 11)
5194 dest = dest->__anon1.type;
5195 if(source->kind == 13 && source->__anon1.type->kind == 11)
5196 source = source->__anon1.type;
5197 if(dest->kind == 16)
5198 dest = dest->__anon1.__anon3.method->dataType;
5199 if(source->kind == 16)
5200 source = source->__anon1.__anon3.method->dataType;
5201 paramSource = source->__anon1.__anon2.params.first;
5202 if(paramSource && paramSource->kind == 0)
5203 paramSource = (((void *)0));
5204 paramDest = dest->__anon1.__anon2.params.first;
5205 if(paramDest && paramDest->kind == 0)
5206 paramDest = (((void *)0));
5207 if((dest->__anon1.__anon2.staticMethod || (!dest->__anon1.__anon2.thisClass && !owningClassDest)) && !(source->__anon1.__anon2.staticMethod || (!source->__anon1.__anon2.thisClass && !owningClassSource)))
5208 {
5209 if(!paramDest || (!(paramDest->kind == 13 && paramDest->__anon1.type && paramDest->__anon1.type->kind == 0) && (paramDest->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1.__anon2.thisClass ? source->__anon1.__anon2.thisClass->__anon1.registered : owningClassSource, paramDest->__anon1._class->__anon1.registered))))
5210 {
5211 if(paramDest && paramDest->kind == 8)
5212 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), paramDest->__anon1._class->string);
5213 else
5214 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class should not take an object\n", (((void *)0))));
5215 return 0;
5216 }
5217 paramDest = paramDest->next;
5218 }
5219 else if(!dest->__anon1.__anon2.staticMethod && (dest->__anon1.__anon2.thisClass || owningClassDest))
5220 {
5221 if((source->__anon1.__anon2.staticMethod || (!source->__anon1.__anon2.thisClass && !owningClassSource)))
5222 {
5223 if(dest->__anon1.__anon2.thisClass)
5224 {
5225 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->__anon1._class->__anon1.registered, dest->__anon1.__anon2.thisClass->__anon1.registered))
5226 {
5227 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->__anon1.__anon2.thisClass->string);
5228 return 0;
5229 }
5230 }
5231 else
5232 {
5233 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->__anon1._class->__anon1.registered, owningClassDest)))
5234 {
5235 if(owningClassDest)
5236 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
5237 else
5238 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "overriding class expected to be derived from method class\n", (((void *)0))));
5239 return 0;
5240 }
5241 }
5242 paramSource = paramSource->next;
5243 }
5244 else
5245 {
5246 if(dest->__anon1.__anon2.thisClass)
5247 {
5248 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1.__anon2.thisClass ? source->__anon1.__anon2.thisClass->__anon1.registered : owningClassSource, dest->__anon1.__anon2.thisClass->__anon1.registered))
5249 {
5250 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->__anon1.__anon2.thisClass->string);
5251 return 0;
5252 }
5253 }
5254 else
5255 {
5256 if(source->__anon1.__anon2.thisClass && source->__anon1.__anon2.thisClass->__anon1.registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1.__anon2.thisClass->__anon1.registered, owningClassDest))
5257 {
5258 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), source->__anon1.__anon2.thisClass->__anon1.registered->fullName);
5259 return 0;
5260 }
5261 }
5262 }
5263 }
5264 if(!MatchTypes(source->__anon1.__anon2.returnType, dest->__anon1.__anon2.returnType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
5265 {
5266 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible return type for function\n", (((void *)0))));
5267 return 0;
5268 }
5269 else
5270 CheckConstCompatibility(dest->__anon1.__anon2.returnType, source->__anon1.__anon2.returnType, 1);
5271 for(; paramDest; paramDest = paramDest->next)
5272 {
5273 if(!paramSource)
5274 {
5275 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "not enough parameters\n", (((void *)0))));
5276 return 0;
5277 }
5278 {
5279 struct Type * paramDestType = paramDest;
5280 struct Type * paramSourceType = paramSource;
5281 struct Type * type = paramDestType;
5282
5283 if(paramDest->kind == 20 && paramDest->__anon1.templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
5284 {
5285 int id = 0;
5286 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
5287 struct __ecereNameSpace__ecere__com__Class * sClass;
5288
5289 for(sClass = owningClassSource; sClass; sClass = sClass->base)
5290 {
5291 id = 0;
5292 if(sClass->templateClass)
5293 sClass = sClass->templateClass;
5294 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
5295 {
5296 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
5297 {
5298 for(sClass = sClass->base; sClass; sClass = sClass->base)
5299 {
5300 if(sClass->templateClass)
5301 sClass = sClass->templateClass;
5302 id += sClass->templateParams.count;
5303 }
5304 break;
5305 }
5306 id++;
5307 }
5308 if(curParam)
5309 break;
5310 }
5311 if(curParam)
5312 {
5313 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
5314
5315 paramDestType = type = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
5316 }
5317 }
5318 if(!MatchTypes(paramDestType, paramSourceType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst) && (!acceptReversedParams || !MatchTypes(paramSourceType, paramDestType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst)))
5319 {
5320 char type[1024];
5321
5322 type[0] = (char)0;
5323 PrintType(paramDest, type, 0, 1);
5324 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
5325 if(paramDestType != paramDest)
5326 FreeType(paramDestType);
5327 return 0;
5328 }
5329 if(paramDestType != paramDest)
5330 FreeType(paramDestType);
5331 }
5332 paramSource = paramSource->next;
5333 }
5334 if(paramSource)
5335 {
5336 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many parameters\n", (((void *)0))));
5337 return 0;
5338 }
5339 return 1;
5340 }
5341 else if((dest->kind == 11 || (dest->kind == 13 && dest->__anon1.type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->__anon1.type->kind == 0))
5342 {
5343 return 1;
5344 }
5345 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
5346 {
5347 if(MatchTypes(source->__anon1.type, dest->__anon1.type, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
5348 return 1;
5349 }
5350 }
5351 return 0;
5352 }
5353
5354 static void FreeConvert(struct Conversion * convert)
5355 {
5356 if(convert->resultType)
5357 FreeType(convert->resultType);
5358 }
5359
5360 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
5361
5362 struct __ecereNameSpace__ecere__com__BTNamedLink
5363 {
5364 const char *  name;
5365 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
5366 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
5367 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
5368 int depth;
5369 void *  data;
5370 } __attribute__ ((gcc_struct));
5371
5372 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
5373
5374 struct __ecereNameSpace__ecere__com__EnumClassData
5375 {
5376 struct __ecereNameSpace__ecere__sys__OldList values;
5377 long long largest;
5378 } __attribute__ ((gcc_struct));
5379
5380 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink64;
5381
5382 struct __ecereNameSpace__ecere__sys__NamedLink64
5383 {
5384 struct __ecereNameSpace__ecere__sys__NamedLink64 * prev;
5385 struct __ecereNameSpace__ecere__sys__NamedLink64 * next;
5386 char *  name;
5387 long long data;
5388 } __attribute__ ((gcc_struct));
5389
5390 extern void FreeExpContents(struct Expression * exp);
5391
5392 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
5393
5394 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
5395
5396 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
5397
5398 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
5399
5400 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (*  freeFn)(void * ));
5401
5402 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5403 {
5404 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
5405
5406 for(link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(&nameSpace->classes); link; link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(((struct __ecereNameSpace__ecere__sys__BTNode *)link)))
5407 {
5408 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
5409
5410 if(_class->type == 4)
5411 {
5412 struct __ecereNameSpace__ecere__sys__OldList converts =
5413 {
5414 0, 0, 0, 0, 0
5415 };
5416 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5417
5418 type->kind = 8;
5419 if(!_class->symbol)
5420 _class->symbol = FindClass(_class->fullName);
5421 type->__anon1._class = _class->symbol;
5422 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 1, 0, 0, 0, 0))
5423 {
5424 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
5425 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5426
5427 if(enumClass)
5428 {
5429 struct __ecereNameSpace__ecere__com__Class * baseClass;
5430
5431 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
5432 {
5433 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
5434
5435 for(value = e->values.first; value; value = value->next)
5436 {
5437 if(!strcmp(value->name, string))
5438 break;
5439 }
5440 if(value)
5441 {
5442 FreeExpContents(sourceExp);
5443 FreeType(sourceExp->expType);
5444 sourceExp->isConstant = 1;
5445 sourceExp->expType = MkClassType(baseClass->fullName);
5446 {
5447 char constant[256];
5448
5449 sourceExp->type = 2;
5450 if(!strcmp(baseClass->dataTypeString, "int") || !strcmp(baseClass->dataTypeString, "int64") || !strcmp(baseClass->dataTypeString, "short") || !strcmp(baseClass->dataTypeString, "char"))
5451 sprintf(constant, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), value->data);
5452 else
5453 sprintf(constant, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), value->data);
5454 sourceExp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5455 }
5456 while(converts.first)
5457 {
5458 struct Conversion * convert = converts.first;
5459
5460 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
5461 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5462 }
5463 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5464 return 1;
5465 }
5466 }
5467 }
5468 }
5469 if(converts.first)
5470 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
5471 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5472 }
5473 }
5474 for(nameSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(&nameSpace->nameSpaces); nameSpace != (((void *)0)); nameSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(((struct __ecereNameSpace__ecere__sys__BTNode *)nameSpace)))
5475 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5476 return 1;
5477 return 0;
5478 }
5479
5480 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5481
5482 struct __ecereNameSpace__ecere__com__SubModule
5483 {
5484 struct __ecereNameSpace__ecere__com__SubModule * prev;
5485 struct __ecereNameSpace__ecere__com__SubModule * next;
5486 struct __ecereNameSpace__ecere__com__Instance * module;
5487 int importMode;
5488 } __attribute__ ((gcc_struct));
5489
5490 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5491 {
5492 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5493
5494 if(searchFor == searchIn)
5495 return 1;
5496 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
5497 {
5498 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->application)
5499 {
5500 if(ModuleVisibility(subModule->module, searchFor))
5501 return 1;
5502 }
5503 }
5504 return 0;
5505 }
5506
5507 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5508
5509 struct __ecereNameSpace__ecere__com__Application
5510 {
5511 int argc;
5512 const char * *  argv;
5513 int exitCode;
5514 unsigned int isGUIApp;
5515 struct __ecereNameSpace__ecere__sys__OldList allModules;
5516 char *  parsedCommand;
5517 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5518 } __attribute__ ((gcc_struct));
5519
5520 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5521 {
5522 struct __ecereNameSpace__ecere__com__Instance * module;
5523
5524 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + structSize_Instance)))->application + structSize_Module)))->systemNameSpace, sourceExp, dest, string, conversions))
5525 return 1;
5526 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + structSize_Instance)))->application + structSize_Instance)))->privateNameSpace, sourceExp, dest, string, conversions))
5527 return 1;
5528 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + structSize_Instance)))->application + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5529 return 1;
5530 for(module = ((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + structSize_Instance)))->application + structSize_Module)))->allModules.first; module; module = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->next)
5531 {
5532 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5533 return 1;
5534 }
5535 return 0;
5536 }
5537
5538 extern struct Expression * CopyExpression(struct Expression * exp);
5539
5540 extern unsigned long strtoul(const char *  nptr, char * *  endptr, int base);
5541
5542 void ReadString(char *  output, char *  string);
5543
5544 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5545
5546 extern struct TypeName * QMkClass(const char *  spec, struct Declarator * decl);
5547
5548 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5549
5550 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla, unsigned int warnConst)
5551 {
5552 struct Type * source;
5553 struct Type * realDest = dest;
5554 struct Type * backupSourceExpType = (((void *)0));
5555 struct Expression * computedExp = sourceExp;
5556
5557 dest->refCount++;
5558 if(sourceExp->isConstant && sourceExp->type != 2 && sourceExp->type != 0 && sourceExp->type != 11 && dest->kind == 8 && dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
5559 {
5560 computedExp = CopyExpression(sourceExp);
5561 ComputeExpression(computedExp);
5562 }
5563 source = sourceExp->expType;
5564 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->__anon1.__anon1.constant, (((void *)0)), 0))
5565 {
5566 if(computedExp != sourceExp)
5567 {
5568 FreeExpression(computedExp);
5569 computedExp = sourceExp;
5570 }
5571 FreeType(dest);
5572 return 1;
5573 }
5574 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5575 {
5576 if(source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 3)
5577 {
5578 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5579
5580 for(sourceBase = source->__anon1._class->__anon1.registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5581 ;
5582 for(destBase = dest->__anon1._class->__anon1.registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5583 ;
5584 if(sourceBase == destBase)
5585 {
5586 if(computedExp != sourceExp)
5587 {
5588 FreeExpression(computedExp);
5589 computedExp = sourceExp;
5590 }
5591 FreeType(dest);
5592 return 1;
5593 }
5594 }
5595 }
5596 if(source)
5597 {
5598 struct __ecereNameSpace__ecere__sys__OldList * specs;
5599 unsigned int flag = 0;
5600 long long value = (((int)0x7fffffff));
5601
5602 source->refCount++;
5603 if(computedExp->type == 2)
5604 {
5605 if(source->isSigned)
5606 value = strtoll(computedExp->__anon1.__anon1.constant, (((void *)0)), 0);
5607 else
5608 value = strtoull(computedExp->__anon1.__anon1.constant, (((void *)0)), 0);
5609 }
5610 else if(computedExp->type == 4 && sourceExp->__anon1.op.op == '-' && !computedExp->__anon1.op.exp1 && computedExp->__anon1.op.exp2 && computedExp->__anon1.op.exp2->type == 2)
5611 {
5612 if(source->isSigned)
5613 value = -strtoll(computedExp->__anon1.op.exp2->__anon1.__anon1.constant, (((void *)0)), 0);
5614 else
5615 value = -strtoull(computedExp->__anon1.op.exp2->__anon1.__anon1.constant, (((void *)0)), 0);
5616 }
5617 if(computedExp != sourceExp)
5618 {
5619 FreeExpression(computedExp);
5620 computedExp = sourceExp;
5621 }
5622 if(dest->kind != 8 && source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered && !strcmp(source->__anon1._class->__anon1.registered->fullName, "ecere::com::unichar"))
5623 {
5624 FreeType(source);
5625 source = __extension__ ({
5626 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5627
5628 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0, __ecereInstance1->refCount = 1, __ecereInstance1;
5629 });
5630 }
5631 if(dest->kind == 8)
5632 {
5633 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0));
5634
5635 if(_class && _class->type == 3)
5636 {
5637 if(source->kind != 8)
5638 {
5639 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5640 struct Type * tempDest, * tempSource;
5641
5642 for(; _class->base->type != 1000; _class = _class->base)
5643 ;
5644 tempSource = dest;
5645 tempDest = tempType;
5646 tempType->kind = 8;
5647 if(!_class->symbol)
5648 _class->symbol = FindClass(_class->fullName);
5649 tempType->__anon1._class = _class->symbol;
5650 tempType->truth = dest->truth;
5651 if(tempType->__anon1._class)
5652 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
5653 backupSourceExpType = sourceExp->expType;
5654 sourceExp->expType = dest;
5655 dest->refCount++;
5656 flag = 1;
5657 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5658 }
5659 }
5660 if(_class && _class->type == 2 && source->kind != 8)
5661 {
5662 if(!dest->__anon1._class->__anon1.registered->dataType)
5663 dest->__anon1._class->__anon1.registered->dataType = ProcessTypeString(dest->__anon1._class->__anon1.registered->dataTypeString, 0);
5664 if(MatchTypes(source, dest->__anon1._class->__anon1.registered->dataType, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
5665 {
5666 FreeType(source);
5667 FreeType(sourceExp->expType);
5668 source = sourceExp->expType = MkClassType(dest->__anon1._class->string);
5669 source->refCount++;
5670 }
5671 }
5672 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->__anon1.type && source->__anon1.type->kind == 1 && sourceExp->type == 3)
5673 {
5674 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5675 struct Declarator * decl;
5676 char string[1024];
5677
5678 ReadString(string, sourceExp->__anon1.__anon2.string);
5679 decl = SpecDeclFromString(string, specs, (((void *)0)));
5680 FreeExpContents(sourceExp);
5681 FreeType(sourceExp->expType);
5682 sourceExp->type = 24;
5683 sourceExp->__anon1._classExp.specifiers = specs;
5684 sourceExp->__anon1._classExp.decl = decl;
5685 sourceExp->expType = dest;
5686 dest->refCount++;
5687 FreeType(source);
5688 FreeType(dest);
5689 if(backupSourceExpType)
5690 FreeType(backupSourceExpType);
5691 return 1;
5692 }
5693 }
5694 else if(source->kind == 8)
5695 {
5696 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0));
5697
5698 if(_class && (_class->type == 3 || _class->type == 2))
5699 {
5700 if(dest->kind != 8)
5701 {
5702 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5703 struct Type * tempDest, * tempSource;
5704
5705 if(!source->__anon1._class->__anon1.registered->dataType)
5706 source->__anon1._class->__anon1.registered->dataType = ProcessTypeString(source->__anon1._class->__anon1.registered->dataTypeString, 0);
5707 for(; _class->base->type != 1000; _class = _class->base)
5708 ;
5709 tempDest = source;
5710 tempSource = tempType;
5711 tempType->kind = 8;
5712 tempType->__anon1._class = FindClass(_class->fullName);
5713 tempType->truth = source->truth;
5714 tempType->classObjectType = source->classObjectType;
5715 if(tempType->__anon1._class)
5716 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
5717 if(conversions->last)
5718 {
5719 ((struct Conversion *)conversions->last)->resultType = dest;
5720 dest->refCount++;
5721 }
5722 FreeType(sourceExp->expType);
5723 sourceExp->expType = MkClassType(_class->fullName);
5724 sourceExp->expType->truth = source->truth;
5725 sourceExp->expType->classObjectType = source->classObjectType;
5726 if(!sourceExp->destType)
5727 {
5728 FreeType(sourceExp->destType);
5729 sourceExp->destType = sourceExp->expType;
5730 if(sourceExp->expType)
5731 sourceExp->expType->refCount++;
5732 }
5733 if(!_class->dataType)
5734 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
5735 FreeType(dest);
5736 dest = MkClassType(source->__anon1._class->string);
5737 dest->truth = source->truth;
5738 dest->classObjectType = source->classObjectType;
5739 FreeType(source);
5740 source = _class->dataType;
5741 source->refCount++;
5742 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5743 }
5744 }
5745 }
5746 if(!flag)
5747 {
5748 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
5749 {
5750 FreeType(source);
5751 FreeType(dest);
5752 return 1;
5753 }
5754 }
5755 if(dest->kind == 8)
5756 {
5757 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0));
5758 unsigned int fittingValue = 0;
5759
5760 if(_class && _class->type == 4)
5761 {
5762 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5763 struct __ecereNameSpace__ecere__com__EnumClassData * c = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5764
5765 if(c && value >= 0 && value <= c->largest)
5766 fittingValue = 1;
5767 }
5768 if(_class && !dest->truth && (_class->type == 3 || fittingValue || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5769 {
5770 if(_class->type == 0 || _class->type == 5)
5771 {
5772 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5773
5774 *newExp = *sourceExp;
5775 if(sourceExp->destType)
5776 sourceExp->destType->refCount++;
5777 if(sourceExp->expType)
5778 sourceExp->expType->refCount++;
5779 sourceExp->type = 11;
5780 sourceExp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5781 sourceExp->__anon1.cast.exp = newExp;
5782 FreeType(sourceExp->expType);
5783 sourceExp->expType = (((void *)0));
5784 ProcessExpressionType(sourceExp);
5785 if(!inCompiler)
5786 {
5787 FreeType(sourceExp->expType);
5788 sourceExp->expType = dest;
5789 }
5790 FreeType(source);
5791 if(inCompiler)
5792 FreeType(dest);
5793 if(backupSourceExpType)
5794 FreeType(backupSourceExpType);
5795 return 1;
5796 }
5797 if(!_class->dataType)
5798 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
5799 FreeType(dest);
5800 dest = _class->dataType;
5801 dest->refCount++;
5802 }
5803 if(dest->kind == 7 && (source->kind == 7 || source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24))
5804 {
5805 specs = MkListOne(MkSpecifier(DOUBLE));
5806 }
5807 else if(dest->kind == 6 && (source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 7))
5808 {
5809 specs = MkListOne(MkSpecifier(FLOAT));
5810 }
5811 else if(dest->kind == 4 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
5812 {
5813 specs = MkList();
5814 if(!dest->isSigned)
5815 ListAdd(specs, MkSpecifier(UNSIGNED));
5816 ListAdd(specs, MkSpecifier(INT64));
5817 }
5818 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
5819 {
5820 specs = MkList();
5821 if(!dest->isSigned)
5822 ListAdd(specs, MkSpecifier(UNSIGNED));
5823 ListAdd(specs, MkSpecifier(INT));
5824 }
5825 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5826 {
5827 specs = MkList();
5828 if(!dest->isSigned)
5829 ListAdd(specs, MkSpecifier(UNSIGNED));
5830 ListAdd(specs, MkSpecifier(SHORT));
5831 }
5832 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 24 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5833 {
5834 specs = MkList();
5835 if(!dest->isSigned)
5836 ListAdd(specs, MkSpecifier(UNSIGNED));
5837 ListAdd(specs, MkSpecifier(CHAR));
5838 }
5839 else
5840 {
5841 FreeType(source);
5842 FreeType(dest);
5843 if(backupSourceExpType)
5844 {
5845 if(sourceExp->expType)
5846 FreeType(sourceExp->expType);
5847 sourceExp->expType = backupSourceExpType;
5848 }
5849 return 0;
5850 }
5851 }
5852 else if(dest->kind == 7 && (source->kind == 7 || source->kind == 6 || source->kind == 4 || source->kind == 3 || source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1))
5853 {
5854 specs = MkListOne(MkSpecifier(DOUBLE));
5855 }
5856 else if(dest->kind == 6 && (source->kind == 6 || source->kind == 15 || source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
5857 {
5858 specs = MkListOne(MkSpecifier(FLOAT));
5859 }
5860 else if(dest->kind == 24 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (value == 1 || value == 0))
5861 {
5862 specs = MkList();
5863 ListAdd(specs, MkSpecifier(BOOL));
5864 }
5865 else if(dest->kind == 1 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (dest->isSigned ? (value >= -128 && value <= 127) : (value >= 0 && value <= 255)))
5866 {
5867 specs = MkList();
5868 if(!dest->isSigned)
5869 ListAdd(specs, MkSpecifier(UNSIGNED));
5870 ListAdd(specs, MkSpecifier(CHAR));
5871 }
5872 else if(dest->kind == 2 && (source->kind == 15 || source->kind == 24 || source->kind == 1 || source->kind == 2 || (source->kind == 3 && (dest->isSigned ? (value >= -32768 && value <= 32767) : (value >= 0 && value <= 65535)))))
5873 {
5874 specs = MkList();
5875 if(!dest->isSigned)
5876 ListAdd(specs, MkSpecifier(UNSIGNED));
5877 ListAdd(specs, MkSpecifier(SHORT));
5878 }
5879 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3))
5880 {
5881 specs = MkList();
5882 if(!dest->isSigned)
5883 ListAdd(specs, MkSpecifier(UNSIGNED));
5884 ListAdd(specs, MkSpecifier(INT));
5885 }
5886 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5887 {
5888 specs = MkList();
5889 if(!dest->isSigned)
5890 ListAdd(specs, MkSpecifier(UNSIGNED));
5891 ListAdd(specs, MkSpecifier(INT64));
5892 }
5893 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
5894 {
5895 specs = MkListOne(MkEnum(MkIdentifier(dest->__anon1.__anon1.enumName), (((void *)0))));
5896 }
5897 else
5898 {
5899 FreeType(source);
5900 FreeType(dest);
5901 if(backupSourceExpType)
5902 {
5903 if(sourceExp->expType)
5904 FreeType(sourceExp->expType);
5905 sourceExp->expType = backupSourceExpType;
5906 }
5907 return 0;
5908 }
5909 if(!flag && !sourceExp->opDestType)
5910 {
5911 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5912
5913 *newExp = *sourceExp;
5914 newExp->prev = (((void *)0));
5915 newExp->next = (((void *)0));
5916 if(sourceExp->destType)
5917 sourceExp->destType->refCount++;
5918 if(sourceExp->expType)
5919 sourceExp->expType->refCount++;
5920 sourceExp->type = 11;
5921 if(realDest->kind == 8)
5922 {
5923 sourceExp->__anon1.cast.typeName = QMkClass(realDest->__anon1._class->string, (((void *)0)));
5924 FreeList(specs, FreeSpecifier);
5925 }
5926 else
5927 sourceExp->__anon1.cast.typeName = MkTypeName(specs, (((void *)0)));
5928 if(newExp->type == 4)
5929 {
5930 sourceExp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
5931 }
5932 else
5933 sourceExp->__anon1.cast.exp = newExp;
5934 FreeType(sourceExp->expType);
5935 sourceExp->expType = (((void *)0));
5936 ProcessExpressionType(sourceExp);
5937 }
5938 else
5939 FreeList(specs, FreeSpecifier);
5940 FreeType(dest);
5941 FreeType(source);
5942 if(backupSourceExpType)
5943 FreeType(backupSourceExpType);
5944 return 1;
5945 }
5946 else
5947 {
5948 if(computedExp != sourceExp)
5949 {
5950 FreeExpression(computedExp);
5951 computedExp = sourceExp;
5952 }
5953 while((sourceExp->type == 5 || sourceExp->type == 32) && sourceExp->__anon1.list)
5954 sourceExp = (*sourceExp->__anon1.list).last;
5955 if(sourceExp->type == 0)
5956 {
5957 struct Identifier * id = sourceExp->__anon1.__anon1.identifier;
5958
5959 if(dest->kind == 8)
5960 {
5961 if(dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
5962 {
5963 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class->__anon1.registered;
5964 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5965
5966 if(enumClass)
5967 {
5968 for(; _class && _class->type == 4; _class = _class->base)
5969 {
5970 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
5971 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5972
5973 for(value = e->values.first; value; value = value->next)
5974 {
5975 if(!strcmp(value->name, id->string))
5976 break;
5977 }
5978 if(value)
5979 {
5980 FreeExpContents(sourceExp);
5981 FreeType(sourceExp->expType);
5982 sourceExp->isConstant = 1;
5983 sourceExp->expType = MkClassType(_class->fullName);
5984 {
5985 sourceExp->type = 2;
5986 if(_class->dataTypeString && (!strcmp(_class->dataTypeString, "int") || !strcmp(_class->dataTypeString, "int64") || !strcmp(_class->dataTypeString, "short") || !strcmp(_class->dataTypeString, "char")))
5987 sourceExp->__anon1.__anon1.constant = PrintInt64(value->data);
5988 else
5989 sourceExp->__anon1.__anon1.constant = PrintUInt64(value->data);
5990 }
5991 FreeType(dest);
5992 return 1;
5993 }
5994 }
5995 }
5996 }
5997 }
5998 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5999 {
6000 FreeType(dest);
6001 return 1;
6002 }
6003 }
6004 FreeType(dest);
6005 }
6006 return 0;
6007 }
6008
6009 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6010 {
6011 int value2 = op2->__anon1.i;
6012
6013 exp->type = 2;
6014 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i + value2));
6015 if(!exp->expType)
6016 {
6017 exp->expType = op1->type;
6018 if(op1->type)
6019 op1->type->refCount++;
6020 }
6021 return 1;
6022 }
6023
6024 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6025 {
6026 unsigned int value2 = op2->__anon1.ui;
6027
6028 exp->type = 2;
6029 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui + value2));
6030 if(!exp->expType)
6031 {
6032 exp->expType = op1->type;
6033 if(op1->type)
6034 op1->type->refCount++;
6035 }
6036 return 1;
6037 }
6038
6039 static unsigned int Int64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6040 {
6041 long long value2 = op2->__anon1.i64;
6042
6043 exp->type = 2;
6044 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 + value2));
6045 if(!exp->expType)
6046 {
6047 exp->expType = op1->type;
6048 if(op1->type)
6049 op1->type->refCount++;
6050 }
6051 return 1;
6052 }
6053
6054 static unsigned int UInt64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6055 {
6056 uint64 value2 = op2->__anon1.ui64;
6057
6058 exp->type = 2;
6059 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 + value2));
6060 if(!exp->expType)
6061 {
6062 exp->expType = op1->type;
6063 if(op1->type)
6064 op1->type->refCount++;
6065 }
6066 return 1;
6067 }
6068
6069 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6070 {
6071 short value2 = op2->__anon1.s;
6072
6073 exp->type = 2;
6074 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s + value2));
6075 if(!exp->expType)
6076 {
6077 exp->expType = op1->type;
6078 if(op1->type)
6079 op1->type->refCount++;
6080 }
6081 return 1;
6082 }
6083
6084 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6085 {
6086 unsigned short value2 = op2->__anon1.us;
6087
6088 exp->type = 2;
6089 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us + value2));
6090 if(!exp->expType)
6091 {
6092 exp->expType = op1->type;
6093 if(op1->type)
6094 op1->type->refCount++;
6095 }
6096 return 1;
6097 }
6098
6099 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6100 {
6101 char value2 = op2->__anon1.c;
6102
6103 exp->type = 2;
6104 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c + value2));
6105 if(!exp->expType)
6106 {
6107 exp->expType = op1->type;
6108 if(op1->type)
6109 op1->type->refCount++;
6110 }
6111 return 1;
6112 }
6113
6114 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6115 {
6116 unsigned char value2 = op2->__anon1.uc;
6117
6118 exp->type = 2;
6119 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc + value2));
6120 if(!exp->expType)
6121 {
6122 exp->expType = op1->type;
6123 if(op1->type)
6124 op1->type->refCount++;
6125 }
6126 return 1;
6127 }
6128
6129 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6130 {
6131 float value2 = op2->__anon1.f;
6132
6133 exp->type = 2;
6134 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f + value2));
6135 if(!exp->expType)
6136 {
6137 exp->expType = op1->type;
6138 if(op1->type)
6139 op1->type->refCount++;
6140 }
6141 return 1;
6142 }
6143
6144 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6145 {
6146 double value2 = op2->__anon1.d;
6147
6148 exp->type = 2;
6149 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d + value2));
6150 if(!exp->expType)
6151 {
6152 exp->expType = op1->type;
6153 if(op1->type)
6154 op1->type->refCount++;
6155 }
6156 return 1;
6157 }
6158
6159 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6160 {
6161 int value2 = op2->__anon1.i;
6162
6163 exp->type = 2;
6164 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i - value2));
6165 if(!exp->expType)
6166 {
6167 exp->expType = op1->type;
6168 if(op1->type)
6169 op1->type->refCount++;
6170 }
6171 return 1;
6172 }
6173
6174 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6175 {
6176 unsigned int value2 = op2->__anon1.ui;
6177
6178 exp->type = 2;
6179 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui - value2));
6180 if(!exp->expType)
6181 {
6182 exp->expType = op1->type;
6183 if(op1->type)
6184 op1->type->refCount++;
6185 }
6186 return 1;
6187 }
6188
6189 static unsigned int Int64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6190 {
6191 long long value2 = op2->__anon1.i64;
6192
6193 exp->type = 2;
6194 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 - value2));
6195 if(!exp->expType)
6196 {
6197 exp->expType = op1->type;
6198 if(op1->type)
6199 op1->type->refCount++;
6200 }
6201 return 1;
6202 }
6203
6204 static unsigned int UInt64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6205 {
6206 uint64 value2 = op2->__anon1.ui64;
6207
6208 exp->type = 2;
6209 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 - value2));
6210 if(!exp->expType)
6211 {
6212 exp->expType = op1->type;
6213 if(op1->type)
6214 op1->type->refCount++;
6215 }
6216 return 1;
6217 }
6218
6219 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6220 {
6221 short value2 = op2->__anon1.s;
6222
6223 exp->type = 2;
6224 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s - value2));
6225 if(!exp->expType)
6226 {
6227 exp->expType = op1->type;
6228 if(op1->type)
6229 op1->type->refCount++;
6230 }
6231 return 1;
6232 }
6233
6234 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6235 {
6236 unsigned short value2 = op2->__anon1.us;
6237
6238 exp->type = 2;
6239 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us - value2));
6240 if(!exp->expType)
6241 {
6242 exp->expType = op1->type;
6243 if(op1->type)
6244 op1->type->refCount++;
6245 }
6246 return 1;
6247 }
6248
6249 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6250 {
6251 char value2 = op2->__anon1.c;
6252
6253 exp->type = 2;
6254 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c - value2));
6255 if(!exp->expType)
6256 {
6257 exp->expType = op1->type;
6258 if(op1->type)
6259 op1->type->refCount++;
6260 }
6261 return 1;
6262 }
6263
6264 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6265 {
6266 unsigned char value2 = op2->__anon1.uc;
6267
6268 exp->type = 2;
6269 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc - value2));
6270 if(!exp->expType)
6271 {
6272 exp->expType = op1->type;
6273 if(op1->type)
6274 op1->type->refCount++;
6275 }
6276 return 1;
6277 }
6278
6279 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6280 {
6281 float value2 = op2->__anon1.f;
6282
6283 exp->type = 2;
6284 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f - value2));
6285 if(!exp->expType)
6286 {
6287 exp->expType = op1->type;
6288 if(op1->type)
6289 op1->type->refCount++;
6290 }
6291 return 1;
6292 }
6293
6294 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6295 {
6296 double value2 = op2->__anon1.d;
6297
6298 exp->type = 2;
6299 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d - value2));
6300 if(!exp->expType)
6301 {
6302 exp->expType = op1->type;
6303 if(op1->type)
6304 op1->type->refCount++;
6305 }
6306 return 1;
6307 }
6308
6309 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6310 {
6311 int value2 = op2->__anon1.i;
6312
6313 exp->type = 2;
6314 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i * value2));
6315 if(!exp->expType)
6316 {
6317 exp->expType = op1->type;
6318 if(op1->type)
6319 op1->type->refCount++;
6320 }
6321 return 1;
6322 }
6323
6324 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6325 {
6326 unsigned int value2 = op2->__anon1.ui;
6327
6328 exp->type = 2;
6329 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui * value2));
6330 if(!exp->expType)
6331 {
6332 exp->expType = op1->type;
6333 if(op1->type)
6334 op1->type->refCount++;
6335 }
6336 return 1;
6337 }
6338
6339 static unsigned int Int64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6340 {
6341 long long value2 = op2->__anon1.i64;
6342
6343 exp->type = 2;
6344 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 * value2));
6345 if(!exp->expType)
6346 {
6347 exp->expType = op1->type;
6348 if(op1->type)
6349 op1->type->refCount++;
6350 }
6351 return 1;
6352 }
6353
6354 static unsigned int UInt64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6355 {
6356 uint64 value2 = op2->__anon1.ui64;
6357
6358 exp->type = 2;
6359 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 * value2));
6360 if(!exp->expType)
6361 {
6362 exp->expType = op1->type;
6363 if(op1->type)
6364 op1->type->refCount++;
6365 }
6366 return 1;
6367 }
6368
6369 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6370 {
6371 short value2 = op2->__anon1.s;
6372
6373 exp->type = 2;
6374 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s * value2));
6375 if(!exp->expType)
6376 {
6377 exp->expType = op1->type;
6378 if(op1->type)
6379 op1->type->refCount++;
6380 }
6381 return 1;
6382 }
6383
6384 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6385 {
6386 unsigned short value2 = op2->__anon1.us;
6387
6388 exp->type = 2;
6389 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us * value2));
6390 if(!exp->expType)
6391 {
6392 exp->expType = op1->type;
6393 if(op1->type)
6394 op1->type->refCount++;
6395 }
6396 return 1;
6397 }
6398
6399 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6400 {
6401 char value2 = op2->__anon1.c;
6402
6403 exp->type = 2;
6404 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c * value2));
6405 if(!exp->expType)
6406 {
6407 exp->expType = op1->type;
6408 if(op1->type)
6409 op1->type->refCount++;
6410 }
6411 return 1;
6412 }
6413
6414 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6415 {
6416 unsigned char value2 = op2->__anon1.uc;
6417
6418 exp->type = 2;
6419 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc * value2));
6420 if(!exp->expType)
6421 {
6422 exp->expType = op1->type;
6423 if(op1->type)
6424 op1->type->refCount++;
6425 }
6426 return 1;
6427 }
6428
6429 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6430 {
6431 float value2 = op2->__anon1.f;
6432
6433 exp->type = 2;
6434 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f * value2));
6435 if(!exp->expType)
6436 {
6437 exp->expType = op1->type;
6438 if(op1->type)
6439 op1->type->refCount++;
6440 }
6441 return 1;
6442 }
6443
6444 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6445 {
6446 double value2 = op2->__anon1.d;
6447
6448 exp->type = 2;
6449 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d * value2));
6450 if(!exp->expType)
6451 {
6452 exp->expType = op1->type;
6453 if(op1->type)
6454 op1->type->refCount++;
6455 }
6456 return 1;
6457 }
6458
6459 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6460 {
6461 int value2 = op2->__anon1.i;
6462
6463 exp->type = 2;
6464 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i / value2) : 0);
6465 if(!exp->expType)
6466 {
6467 exp->expType = op1->type;
6468 if(op1->type)
6469 op1->type->refCount++;
6470 }
6471 return 1;
6472 }
6473
6474 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6475 {
6476 unsigned int value2 = op2->__anon1.ui;
6477
6478 exp->type = 2;
6479 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui / value2) : 0);
6480 if(!exp->expType)
6481 {
6482 exp->expType = op1->type;
6483 if(op1->type)
6484 op1->type->refCount++;
6485 }
6486 return 1;
6487 }
6488
6489 static unsigned int Int64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6490 {
6491 long long value2 = op2->__anon1.i64;
6492
6493 exp->type = 2;
6494 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 / value2) : 0);
6495 if(!exp->expType)
6496 {
6497 exp->expType = op1->type;
6498 if(op1->type)
6499 op1->type->refCount++;
6500 }
6501 return 1;
6502 }
6503
6504 static unsigned int UInt64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6505 {
6506 uint64 value2 = op2->__anon1.ui64;
6507
6508 exp->type = 2;
6509 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 / value2) : 0);
6510 if(!exp->expType)
6511 {
6512 exp->expType = op1->type;
6513 if(op1->type)
6514 op1->type->refCount++;
6515 }
6516 return 1;
6517 }
6518
6519 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6520 {
6521 short value2 = op2->__anon1.s;
6522
6523 exp->type = 2;
6524 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s / value2) : (short)0);
6525 if(!exp->expType)
6526 {
6527 exp->expType = op1->type;
6528 if(op1->type)
6529 op1->type->refCount++;
6530 }
6531 return 1;
6532 }
6533
6534 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6535 {
6536 unsigned short value2 = op2->__anon1.us;
6537
6538 exp->type = 2;
6539 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us / value2) : (unsigned short)0);
6540 if(!exp->expType)
6541 {
6542 exp->expType = op1->type;
6543 if(op1->type)
6544 op1->type->refCount++;
6545 }
6546 return 1;
6547 }
6548
6549 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6550 {
6551 char value2 = op2->__anon1.c;
6552
6553 exp->type = 2;
6554 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c / value2) : (char)0);
6555 if(!exp->expType)
6556 {
6557 exp->expType = op1->type;
6558 if(op1->type)
6559 op1->type->refCount++;
6560 }
6561 return 1;
6562 }
6563
6564 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6565 {
6566 unsigned char value2 = op2->__anon1.uc;
6567
6568 exp->type = 2;
6569 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc / value2) : (unsigned char)0);
6570 if(!exp->expType)
6571 {
6572 exp->expType = op1->type;
6573 if(op1->type)
6574 op1->type->refCount++;
6575 }
6576 return 1;
6577 }
6578
6579 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6580 {
6581 float value2 = op2->__anon1.f;
6582
6583 exp->type = 2;
6584 exp->__anon1.__anon2.string = PrintFloat(op1->__anon1.f / value2);
6585 if(!exp->expType)
6586 {
6587 exp->expType = op1->type;
6588 if(op1->type)
6589 op1->type->refCount++;
6590 }
6591 return 1;
6592 }
6593
6594 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6595 {
6596 double value2 = op2->__anon1.d;
6597
6598 exp->type = 2;
6599 exp->__anon1.__anon2.string = PrintDouble(op1->__anon1.d / value2);
6600 if(!exp->expType)
6601 {
6602 exp->expType = op1->type;
6603 if(op1->type)
6604 op1->type->refCount++;
6605 }
6606 return 1;
6607 }
6608
6609 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6610 {
6611 int value2 = op2->__anon1.i;
6612
6613 exp->type = 2;
6614 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i % value2) : 0);
6615 if(!exp->expType)
6616 {
6617 exp->expType = op1->type;
6618 if(op1->type)
6619 op1->type->refCount++;
6620 }
6621 return 1;
6622 }
6623
6624 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6625 {
6626 unsigned int value2 = op2->__anon1.ui;
6627
6628 exp->type = 2;
6629 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui % value2) : 0);
6630 if(!exp->expType)
6631 {
6632 exp->expType = op1->type;
6633 if(op1->type)
6634 op1->type->refCount++;
6635 }
6636 return 1;
6637 }
6638
6639 static unsigned int Int64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6640 {
6641 long long value2 = op2->__anon1.i64;
6642
6643 exp->type = 2;
6644 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 % value2) : 0);
6645 if(!exp->expType)
6646 {
6647 exp->expType = op1->type;
6648 if(op1->type)
6649 op1->type->refCount++;
6650 }
6651 return 1;
6652 }
6653
6654 static unsigned int UInt64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6655 {
6656 uint64 value2 = op2->__anon1.ui64;
6657
6658 exp->type = 2;
6659 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 % value2) : 0);
6660 if(!exp->expType)
6661 {
6662 exp->expType = op1->type;
6663 if(op1->type)
6664 op1->type->refCount++;
6665 }
6666 return 1;
6667 }
6668
6669 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6670 {
6671 short value2 = op2->__anon1.s;
6672
6673 exp->type = 2;
6674 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s % value2) : (short)0);
6675 if(!exp->expType)
6676 {
6677 exp->expType = op1->type;
6678 if(op1->type)
6679 op1->type->refCount++;
6680 }
6681 return 1;
6682 }
6683
6684 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6685 {
6686 unsigned short value2 = op2->__anon1.us;
6687
6688 exp->type = 2;
6689 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us % value2) : (unsigned short)0);
6690 if(!exp->expType)
6691 {
6692 exp->expType = op1->type;
6693 if(op1->type)
6694 op1->type->refCount++;
6695 }
6696 return 1;
6697 }
6698
6699 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6700 {
6701 char value2 = op2->__anon1.c;
6702
6703 exp->type = 2;
6704 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c % value2) : (char)0);
6705 if(!exp->expType)
6706 {
6707 exp->expType = op1->type;
6708 if(op1->type)
6709 op1->type->refCount++;
6710 }
6711 return 1;
6712 }
6713
6714 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6715 {
6716 unsigned char value2 = op2->__anon1.uc;
6717
6718 exp->type = 2;
6719 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc % value2) : (unsigned char)0);
6720 if(!exp->expType)
6721 {
6722 exp->expType = op1->type;
6723 if(op1->type)
6724 op1->type->refCount++;
6725 }
6726 return 1;
6727 }
6728
6729 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6730 {
6731 exp->type = 2;
6732 exp->__anon1.__anon2.string = PrintInt((-op1->__anon1.i));
6733 if(!exp->expType)
6734 {
6735 exp->expType = op1->type;
6736 if(op1->type)
6737 op1->type->refCount++;
6738 }
6739 return 1;
6740 }
6741
6742 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6743 {
6744 exp->type = 2;
6745 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(-op1->__anon1.ui));
6746 if(!exp->expType)
6747 {
6748 exp->expType = op1->type;
6749 if(op1->type)
6750 op1->type->refCount++;
6751 }
6752 return 1;
6753 }
6754
6755 static unsigned int Int64Neg(struct Expression * exp, struct Operand * op1)
6756 {
6757 exp->type = 2;
6758 exp->__anon1.__anon2.string = PrintInt64((-op1->__anon1.i64));
6759 if(!exp->expType)
6760 {
6761 exp->expType = op1->type;
6762 if(op1->type)
6763 op1->type->refCount++;
6764 }
6765 return 1;
6766 }
6767
6768 static unsigned int UInt64Neg(struct Expression * exp, struct Operand * op1)
6769 {
6770 exp->type = 2;
6771 exp->__anon1.__anon2.string = PrintUInt64((uint64)(-op1->__anon1.ui64));
6772 if(!exp->expType)
6773 {
6774 exp->expType = op1->type;
6775 if(op1->type)
6776 op1->type->refCount++;
6777 }
6778 return 1;
6779 }
6780
6781 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6782 {
6783 exp->type = 2;
6784 exp->__anon1.__anon2.string = PrintShort((-op1->__anon1.s));
6785 if(!exp->expType)
6786 {
6787 exp->expType = op1->type;
6788 if(op1->type)
6789 op1->type->refCount++;
6790 }
6791 return 1;
6792 }
6793
6794 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6795 {
6796 exp->type = 2;
6797 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(-op1->__anon1.us));
6798 if(!exp->expType)
6799 {
6800 exp->expType = op1->type;
6801 if(op1->type)
6802 op1->type->refCount++;
6803 }
6804 return 1;
6805 }
6806
6807 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6808 {
6809 exp->type = 2;
6810 exp->__anon1.__anon2.string = PrintChar((-op1->__anon1.c));
6811 if(!exp->expType)
6812 {
6813 exp->expType = op1->type;
6814 if(op1->type)
6815 op1->type->refCount++;
6816 }
6817 return 1;
6818 }
6819
6820 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6821 {
6822 exp->type = 2;
6823 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(-op1->__anon1.uc));
6824 if(!exp->expType)
6825 {
6826 exp->expType = op1->type;
6827 if(op1->type)
6828 op1->type->refCount++;
6829 }
6830 return 1;
6831 }
6832
6833 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6834 {
6835 exp->type = 2;
6836 exp->__anon1.__anon2.string = PrintFloat((float)(-op1->__anon1.f));
6837 if(!exp->expType)
6838 {
6839 exp->expType = op1->type;
6840 if(op1->type)
6841 op1->type->refCount++;
6842 }
6843 return 1;
6844 }
6845
6846 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6847 {
6848 exp->type = 2;
6849 exp->__anon1.__anon2.string = PrintDouble((double)(-op1->__anon1.d));
6850 if(!exp->expType)
6851 {
6852 exp->expType = op1->type;
6853 if(op1->type)
6854 op1->type->refCount++;
6855 }
6856 return 1;
6857 }
6858
6859 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6860 {
6861 exp->type = 2;
6862 exp->__anon1.__anon2.string = PrintInt((++op1->__anon1.i));
6863 if(!exp->expType)
6864 {
6865 exp->expType = op1->type;
6866 if(op1->type)
6867 op1->type->refCount++;
6868 }
6869 return 1;
6870 }
6871
6872 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6873 {
6874 exp->type = 2;
6875 exp->__anon1.__anon2.string = PrintUInt((++op1->__anon1.ui));
6876 if(!exp->expType)
6877 {
6878 exp->expType = op1->type;
6879 if(op1->type)
6880 op1->type->refCount++;
6881 }
6882 return 1;
6883 }
6884
6885 static unsigned int Int64Inc(struct Expression * exp, struct Operand * op1)
6886 {
6887 exp->type = 2;
6888 exp->__anon1.__anon2.string = PrintInt64((++op1->__anon1.i64));
6889 if(!exp->expType)
6890 {
6891 exp->expType = op1->type;
6892 if(op1->type)
6893 op1->type->refCount++;
6894 }
6895 return 1;
6896 }
6897
6898 static unsigned int UInt64Inc(struct Expression * exp, struct Operand * op1)
6899 {
6900 exp->type = 2;
6901 exp->__anon1.__anon2.string = PrintUInt64((++op1->__anon1.ui64));
6902 if(!exp->expType)
6903 {
6904 exp->expType = op1->type;
6905 if(op1->type)
6906 op1->type->refCount++;
6907 }
6908 return 1;
6909 }
6910
6911 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6912 {
6913 exp->type = 2;
6914 exp->__anon1.__anon2.string = PrintShort((++op1->__anon1.s));
6915 if(!exp->expType)
6916 {
6917 exp->expType = op1->type;
6918 if(op1->type)
6919 op1->type->refCount++;
6920 }
6921 return 1;
6922 }
6923
6924 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6925 {
6926 exp->type = 2;
6927 exp->__anon1.__anon2.string = PrintUShort((++op1->__anon1.us));
6928 if(!exp->expType)
6929 {
6930 exp->expType = op1->type;
6931 if(op1->type)
6932 op1->type->refCount++;
6933 }
6934 return 1;
6935 }
6936
6937 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6938 {
6939 exp->type = 2;
6940 exp->__anon1.__anon2.string = PrintChar((++op1->__anon1.c));
6941 if(!exp->expType)
6942 {
6943 exp->expType = op1->type;
6944 if(op1->type)
6945 op1->type->refCount++;
6946 }
6947 return 1;
6948 }
6949
6950 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6951 {
6952 exp->type = 2;
6953 exp->__anon1.__anon2.string = PrintUChar((++op1->__anon1.uc));
6954 if(!exp->expType)
6955 {
6956 exp->expType = op1->type;
6957 if(op1->type)
6958 op1->type->refCount++;
6959 }
6960 return 1;
6961 }
6962
6963 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6964 {
6965 exp->type = 2;
6966 exp->__anon1.__anon2.string = PrintFloat((float)(++op1->__anon1.f));
6967 if(!exp->expType)
6968 {
6969 exp->expType = op1->type;
6970 if(op1->type)
6971 op1->type->refCount++;
6972 }
6973 return 1;
6974 }
6975
6976 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6977 {
6978 exp->type = 2;
6979 exp->__anon1.__anon2.string = PrintDouble((double)(++op1->__anon1.d));
6980 if(!exp->expType)
6981 {
6982 exp->expType = op1->type;
6983 if(op1->type)
6984 op1->type->refCount++;
6985 }
6986 return 1;
6987 }
6988
6989 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6990 {
6991 exp->type = 2;
6992 exp->__anon1.__anon2.string = PrintInt((--op1->__anon1.i));
6993 if(!exp->expType)
6994 {
6995 exp->expType = op1->type;
6996 if(op1->type)
6997 op1->type->refCount++;
6998 }
6999 return 1;
7000 }
7001
7002 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
7003 {
7004 exp->type = 2;
7005 exp->__anon1.__anon2.string = PrintUInt((--op1->__anon1.ui));
7006 if(!exp->expType)
7007 {
7008 exp->expType = op1->type;
7009 if(op1->type)
7010 op1->type->refCount++;
7011 }
7012 return 1;
7013 }
7014
7015 static unsigned int Int64Dec(struct Expression * exp, struct Operand * op1)
7016 {
7017 exp->type = 2;
7018 exp->__anon1.__anon2.string = PrintInt64((--op1->__anon1.i64));
7019 if(!exp->expType)
7020 {
7021 exp->expType = op1->type;
7022 if(op1->type)
7023 op1->type->refCount++;
7024 }
7025 return 1;
7026 }
7027
7028 static unsigned int UInt64Dec(struct Expression * exp, struct Operand * op1)
7029 {
7030 exp->type = 2;
7031 exp->__anon1.__anon2.string = PrintUInt64((--op1->__anon1.ui64));
7032 if(!exp->expType)
7033 {
7034 exp->expType = op1->type;
7035 if(op1->type)
7036 op1->type->refCount++;
7037 }
7038 return 1;
7039 }
7040
7041 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
7042 {
7043 exp->type = 2;
7044 exp->__anon1.__anon2.string = PrintShort((--op1->__anon1.s));
7045 if(!exp->expType)
7046 {
7047 exp->expType = op1->type;
7048 if(op1->type)
7049 op1->type->refCount++;
7050 }
7051 return 1;
7052 }
7053
7054 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
7055 {
7056 exp->type = 2;
7057 exp->__anon1.__anon2.string = PrintUShort((--op1->__anon1.us));
7058 if(!exp->expType)
7059 {
7060 exp->expType = op1->type;
7061 if(op1->type)
7062 op1->type->refCount++;
7063 }
7064 return 1;
7065 }
7066
7067 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
7068 {
7069 exp->type = 2;
7070 exp->__anon1.__anon2.string = PrintChar((--op1->__anon1.c));
7071 if(!exp->expType)
7072 {
7073 exp->expType = op1->type;
7074 if(op1->type)
7075 op1->type->refCount++;
7076 }
7077 return 1;
7078 }
7079
7080 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
7081 {
7082 exp->type = 2;
7083 exp->__anon1.__anon2.string = PrintUChar((--op1->__anon1.uc));
7084 if(!exp->expType)
7085 {
7086 exp->expType = op1->type;
7087 if(op1->type)
7088 op1->type->refCount++;
7089 }
7090 return 1;
7091 }
7092
7093 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
7094 {
7095 exp->type = 2;
7096 exp->__anon1.__anon2.string = PrintFloat((float)(--op1->__anon1.f));
7097 if(!exp->expType)
7098 {
7099 exp->expType = op1->type;
7100 if(op1->type)
7101 op1->type->refCount++;
7102 }
7103 return 1;
7104 }
7105
7106 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
7107 {
7108 exp->type = 2;
7109 exp->__anon1.__anon2.string = PrintDouble((double)(--op1->__anon1.d));
7110 if(!exp->expType)
7111 {
7112 exp->expType = op1->type;
7113 if(op1->type)
7114 op1->type->refCount++;
7115 }
7116 return 1;
7117 }
7118
7119 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7120 {
7121 int value2 = op2->__anon1.i;
7122
7123 exp->type = 2;
7124 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i = value2));
7125 if(!exp->expType)
7126 {
7127 exp->expType = op1->type;
7128 if(op1->type)
7129 op1->type->refCount++;
7130 }
7131 return 1;
7132 }
7133
7134 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7135 {
7136 unsigned int value2 = op2->__anon1.ui;
7137
7138 exp->type = 2;
7139 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui = value2));
7140 if(!exp->expType)
7141 {
7142 exp->expType = op1->type;
7143 if(op1->type)
7144 op1->type->refCount++;
7145 }
7146 return 1;
7147 }
7148
7149 static unsigned int Int64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7150 {
7151 long long value2 = op2->__anon1.i64;
7152
7153 exp->type = 2;
7154 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 = value2));
7155 if(!exp->expType)
7156 {
7157 exp->expType = op1->type;
7158 if(op1->type)
7159 op1->type->refCount++;
7160 }
7161 return 1;
7162 }
7163
7164 static unsigned int UInt64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7165 {
7166 uint64 value2 = op2->__anon1.ui64;
7167
7168 exp->type = 2;
7169 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 = value2));
7170 if(!exp->expType)
7171 {
7172 exp->expType = op1->type;
7173 if(op1->type)
7174 op1->type->refCount++;
7175 }
7176 return 1;
7177 }
7178
7179 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7180 {
7181 short value2 = op2->__anon1.s;
7182
7183 exp->type = 2;
7184 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s = value2));
7185 if(!exp->expType)
7186 {
7187 exp->expType = op1->type;
7188 if(op1->type)
7189 op1->type->refCount++;
7190 }
7191 return 1;
7192 }
7193
7194 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7195 {
7196 unsigned short value2 = op2->__anon1.us;
7197
7198 exp->type = 2;
7199 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us = value2));
7200 if(!exp->expType)
7201 {
7202 exp->expType = op1->type;
7203 if(op1->type)
7204 op1->type->refCount++;
7205 }
7206 return 1;
7207 }
7208
7209 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7210 {
7211 char value2 = op2->__anon1.c;
7212
7213 exp->type = 2;
7214 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c = value2));
7215 if(!exp->expType)
7216 {
7217 exp->expType = op1->type;
7218 if(op1->type)
7219 op1->type->refCount++;
7220 }
7221 return 1;
7222 }
7223
7224 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7225 {
7226 unsigned char value2 = op2->__anon1.uc;
7227
7228 exp->type = 2;
7229 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc = value2));
7230 if(!exp->expType)
7231 {
7232 exp->expType = op1->type;
7233 if(op1->type)
7234 op1->type->refCount++;
7235 }
7236 return 1;
7237 }
7238
7239 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7240 {
7241 float value2 = op2->__anon1.f;
7242
7243 exp->type = 2;
7244 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f = value2));
7245 if(!exp->expType)
7246 {
7247 exp->expType = op1->type;
7248 if(op1->type)
7249 op1->type->refCount++;
7250 }
7251 return 1;
7252 }
7253
7254 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7255 {
7256 double value2 = op2->__anon1.d;
7257
7258 exp->type = 2;
7259 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d = value2));
7260 if(!exp->expType)
7261 {
7262 exp->expType = op1->type;
7263 if(op1->type)
7264 op1->type->refCount++;
7265 }
7266 return 1;
7267 }
7268
7269 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7270 {
7271 int value2 = op2->__anon1.i;
7272
7273 exp->type = 2;
7274 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i += value2));
7275 if(!exp->expType)
7276 {
7277 exp->expType = op1->type;
7278 if(op1->type)
7279 op1->type->refCount++;
7280 }
7281 return 1;
7282 }
7283
7284 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7285 {
7286 unsigned int value2 = op2->__anon1.ui;
7287
7288 exp->type = 2;
7289 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui += value2));
7290 if(!exp->expType)
7291 {
7292 exp->expType = op1->type;
7293 if(op1->type)
7294 op1->type->refCount++;
7295 }
7296 return 1;
7297 }
7298
7299 static unsigned int Int64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7300 {
7301 long long value2 = op2->__anon1.i64;
7302
7303 exp->type = 2;
7304 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 += value2));
7305 if(!exp->expType)
7306 {
7307 exp->expType = op1->type;
7308 if(op1->type)
7309 op1->type->refCount++;
7310 }
7311 return 1;
7312 }
7313
7314 static unsigned int UInt64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7315 {
7316 uint64 value2 = op2->__anon1.ui64;
7317
7318 exp->type = 2;
7319 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 += value2));
7320 if(!exp->expType)
7321 {
7322 exp->expType = op1->type;
7323 if(op1->type)
7324 op1->type->refCount++;
7325 }
7326 return 1;
7327 }
7328
7329 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7330 {
7331 short value2 = op2->__anon1.s;
7332
7333 exp->type = 2;
7334 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s += value2));
7335 if(!exp->expType)
7336 {
7337 exp->expType = op1->type;
7338 if(op1->type)
7339 op1->type->refCount++;
7340 }
7341 return 1;
7342 }
7343
7344 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7345 {
7346 unsigned short value2 = op2->__anon1.us;
7347
7348 exp->type = 2;
7349 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us += value2));
7350 if(!exp->expType)
7351 {
7352 exp->expType = op1->type;
7353 if(op1->type)
7354 op1->type->refCount++;
7355 }
7356 return 1;
7357 }
7358
7359 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7360 {
7361 char value2 = op2->__anon1.c;
7362
7363 exp->type = 2;
7364 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c += value2));
7365 if(!exp->expType)
7366 {
7367 exp->expType = op1->type;
7368 if(op1->type)
7369 op1->type->refCount++;
7370 }
7371 return 1;
7372 }
7373
7374 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7375 {
7376 unsigned char value2 = op2->__anon1.uc;
7377
7378 exp->type = 2;
7379 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc += value2));
7380 if(!exp->expType)
7381 {
7382 exp->expType = op1->type;
7383 if(op1->type)
7384 op1->type->refCount++;
7385 }
7386 return 1;
7387 }
7388
7389 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7390 {
7391 float value2 = op2->__anon1.f;
7392
7393 exp->type = 2;
7394 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f += value2));
7395 if(!exp->expType)
7396 {
7397 exp->expType = op1->type;
7398 if(op1->type)
7399 op1->type->refCount++;
7400 }
7401 return 1;
7402 }
7403
7404 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7405 {
7406 double value2 = op2->__anon1.d;
7407
7408 exp->type = 2;
7409 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d += value2));
7410 if(!exp->expType)
7411 {
7412 exp->expType = op1->type;
7413 if(op1->type)
7414 op1->type->refCount++;
7415 }
7416 return 1;
7417 }
7418
7419 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7420 {
7421 int value2 = op2->__anon1.i;
7422
7423 exp->type = 2;
7424 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i -= value2));
7425 if(!exp->expType)
7426 {
7427 exp->expType = op1->type;
7428 if(op1->type)
7429 op1->type->refCount++;
7430 }
7431 return 1;
7432 }
7433
7434 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7435 {
7436 unsigned int value2 = op2->__anon1.ui;
7437
7438 exp->type = 2;
7439 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui -= value2));
7440 if(!exp->expType)
7441 {
7442 exp->expType = op1->type;
7443 if(op1->type)
7444 op1->type->refCount++;
7445 }
7446 return 1;
7447 }
7448
7449 static unsigned int Int64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7450 {
7451 long long value2 = op2->__anon1.i64;
7452
7453 exp->type = 2;
7454 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 -= value2));
7455 if(!exp->expType)
7456 {
7457 exp->expType = op1->type;
7458 if(op1->type)
7459 op1->type->refCount++;
7460 }
7461 return 1;
7462 }
7463
7464 static unsigned int UInt64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7465 {
7466 uint64 value2 = op2->__anon1.ui64;
7467
7468 exp->type = 2;
7469 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 -= value2));
7470 if(!exp->expType)
7471 {
7472 exp->expType = op1->type;
7473 if(op1->type)
7474 op1->type->refCount++;
7475 }
7476 return 1;
7477 }
7478
7479 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7480 {
7481 short value2 = op2->__anon1.s;
7482
7483 exp->type = 2;
7484 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s -= value2));
7485 if(!exp->expType)
7486 {
7487 exp->expType = op1->type;
7488 if(op1->type)
7489 op1->type->refCount++;
7490 }
7491 return 1;
7492 }
7493
7494 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7495 {
7496 unsigned short value2 = op2->__anon1.us;
7497
7498 exp->type = 2;
7499 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us -= value2));
7500 if(!exp->expType)
7501 {
7502 exp->expType = op1->type;
7503 if(op1->type)
7504 op1->type->refCount++;
7505 }
7506 return 1;
7507 }
7508
7509 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7510 {
7511 char value2 = op2->__anon1.c;
7512
7513 exp->type = 2;
7514 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c -= value2));
7515 if(!exp->expType)
7516 {
7517 exp->expType = op1->type;
7518 if(op1->type)
7519 op1->type->refCount++;
7520 }
7521 return 1;
7522 }
7523
7524 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7525 {
7526 unsigned char value2 = op2->__anon1.uc;
7527
7528 exp->type = 2;
7529 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc -= value2));
7530 if(!exp->expType)
7531 {
7532 exp->expType = op1->type;
7533 if(op1->type)
7534 op1->type->refCount++;
7535 }
7536 return 1;
7537 }
7538
7539 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7540 {
7541 float value2 = op2->__anon1.f;
7542
7543 exp->type = 2;
7544 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f -= value2));
7545 if(!exp->expType)
7546 {
7547 exp->expType = op1->type;
7548 if(op1->type)
7549 op1->type->refCount++;
7550 }
7551 return 1;
7552 }
7553
7554 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7555 {
7556 double value2 = op2->__anon1.d;
7557
7558 exp->type = 2;
7559 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d -= value2));
7560 if(!exp->expType)
7561 {
7562 exp->expType = op1->type;
7563 if(op1->type)
7564 op1->type->refCount++;
7565 }
7566 return 1;
7567 }
7568
7569 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7570 {
7571 int value2 = op2->__anon1.i;
7572
7573 exp->type = 2;
7574 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i *= value2));
7575 if(!exp->expType)
7576 {
7577 exp->expType = op1->type;
7578 if(op1->type)
7579 op1->type->refCount++;
7580 }
7581 return 1;
7582 }
7583
7584 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7585 {
7586 unsigned int value2 = op2->__anon1.ui;
7587
7588 exp->type = 2;
7589 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui *= value2));
7590 if(!exp->expType)
7591 {
7592 exp->expType = op1->type;
7593 if(op1->type)
7594 op1->type->refCount++;
7595 }
7596 return 1;
7597 }
7598
7599 static unsigned int Int64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7600 {
7601 long long value2 = op2->__anon1.i64;
7602
7603 exp->type = 2;
7604 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 *= value2));
7605 if(!exp->expType)
7606 {
7607 exp->expType = op1->type;
7608 if(op1->type)
7609 op1->type->refCount++;
7610 }
7611 return 1;
7612 }
7613
7614 static unsigned int UInt64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7615 {
7616 uint64 value2 = op2->__anon1.ui64;
7617
7618 exp->type = 2;
7619 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 *= value2));
7620 if(!exp->expType)
7621 {
7622 exp->expType = op1->type;
7623 if(op1->type)
7624 op1->type->refCount++;
7625 }
7626 return 1;
7627 }
7628
7629 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7630 {
7631 short value2 = op2->__anon1.s;
7632
7633 exp->type = 2;
7634 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s *= value2));
7635 if(!exp->expType)
7636 {
7637 exp->expType = op1->type;
7638 if(op1->type)
7639 op1->type->refCount++;
7640 }
7641 return 1;
7642 }
7643
7644 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7645 {
7646 unsigned short value2 = op2->__anon1.us;
7647
7648 exp->type = 2;
7649 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us *= value2));
7650 if(!exp->expType)
7651 {
7652 exp->expType = op1->type;
7653 if(op1->type)
7654 op1->type->refCount++;
7655 }
7656 return 1;
7657 }
7658
7659 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7660 {
7661 char value2 = op2->__anon1.c;
7662
7663 exp->type = 2;
7664 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c *= value2));
7665 if(!exp->expType)
7666 {
7667 exp->expType = op1->type;
7668 if(op1->type)
7669 op1->type->refCount++;
7670 }
7671 return 1;
7672 }
7673
7674 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7675 {
7676 unsigned char value2 = op2->__anon1.uc;
7677
7678 exp->type = 2;
7679 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc *= value2));
7680 if(!exp->expType)
7681 {
7682 exp->expType = op1->type;
7683 if(op1->type)
7684 op1->type->refCount++;
7685 }
7686 return 1;
7687 }
7688
7689 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7690 {
7691 float value2 = op2->__anon1.f;
7692
7693 exp->type = 2;
7694 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f *= value2));
7695 if(!exp->expType)
7696 {
7697 exp->expType = op1->type;
7698 if(op1->type)
7699 op1->type->refCount++;
7700 }
7701 return 1;
7702 }
7703
7704 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7705 {
7706 double value2 = op2->__anon1.d;
7707
7708 exp->type = 2;
7709 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d *= value2));
7710 if(!exp->expType)
7711 {
7712 exp->expType = op1->type;
7713 if(op1->type)
7714 op1->type->refCount++;
7715 }
7716 return 1;
7717 }
7718
7719 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7720 {
7721 int value2 = op2->__anon1.i;
7722
7723 exp->type = 2;
7724 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i /= value2) : 0);
7725 if(!exp->expType)
7726 {
7727 exp->expType = op1->type;
7728 if(op1->type)
7729 op1->type->refCount++;
7730 }
7731 return 1;
7732 }
7733
7734 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7735 {
7736 unsigned int value2 = op2->__anon1.ui;
7737
7738 exp->type = 2;
7739 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui /= value2) : 0);
7740 if(!exp->expType)
7741 {
7742 exp->expType = op1->type;
7743 if(op1->type)
7744 op1->type->refCount++;
7745 }
7746 return 1;
7747 }
7748
7749 static unsigned int Int64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7750 {
7751 long long value2 = op2->__anon1.i64;
7752
7753 exp->type = 2;
7754 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 /= value2) : 0);
7755 if(!exp->expType)
7756 {
7757 exp->expType = op1->type;
7758 if(op1->type)
7759 op1->type->refCount++;
7760 }
7761 return 1;
7762 }
7763
7764 static unsigned int UInt64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7765 {
7766 uint64 value2 = op2->__anon1.ui64;
7767
7768 exp->type = 2;
7769 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 /= value2) : 0);
7770 if(!exp->expType)
7771 {
7772 exp->expType = op1->type;
7773 if(op1->type)
7774 op1->type->refCount++;
7775 }
7776 return 1;
7777 }
7778
7779 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7780 {
7781 short value2 = op2->__anon1.s;
7782
7783 exp->type = 2;
7784 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s /= value2) : (short)0);
7785 if(!exp->expType)
7786 {
7787 exp->expType = op1->type;
7788 if(op1->type)
7789 op1->type->refCount++;
7790 }
7791 return 1;
7792 }
7793
7794 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7795 {
7796 unsigned short value2 = op2->__anon1.us;
7797
7798 exp->type = 2;
7799 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us /= value2) : (unsigned short)0);
7800 if(!exp->expType)
7801 {
7802 exp->expType = op1->type;
7803 if(op1->type)
7804 op1->type->refCount++;
7805 }
7806 return 1;
7807 }
7808
7809 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7810 {
7811 char value2 = op2->__anon1.c;
7812
7813 exp->type = 2;
7814 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c /= value2) : (char)0);
7815 if(!exp->expType)
7816 {
7817 exp->expType = op1->type;
7818 if(op1->type)
7819 op1->type->refCount++;
7820 }
7821 return 1;
7822 }
7823
7824 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7825 {
7826 unsigned char value2 = op2->__anon1.uc;
7827
7828 exp->type = 2;
7829 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc /= value2) : (unsigned char)0);
7830 if(!exp->expType)
7831 {
7832 exp->expType = op1->type;
7833 if(op1->type)
7834 op1->type->refCount++;
7835 }
7836 return 1;
7837 }
7838
7839 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7840 {
7841 float value2 = op2->__anon1.f;
7842
7843 exp->type = 2;
7844 exp->__anon1.__anon2.string = PrintFloat(op1->__anon1.f /= value2);
7845 if(!exp->expType)
7846 {
7847 exp->expType = op1->type;
7848 if(op1->type)
7849 op1->type->refCount++;
7850 }
7851 return 1;
7852 }
7853
7854 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7855 {
7856 double value2 = op2->__anon1.d;
7857
7858 exp->type = 2;
7859 exp->__anon1.__anon2.string = PrintDouble(op1->__anon1.d /= value2);
7860 if(!exp->expType)
7861 {
7862 exp->expType = op1->type;
7863 if(op1->type)
7864 op1->type->refCount++;
7865 }
7866 return 1;
7867 }
7868
7869 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7870 {
7871 int value2 = op2->__anon1.i;
7872
7873 exp->type = 2;
7874 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i %= value2) : 0);
7875 if(!exp->expType)
7876 {
7877 exp->expType = op1->type;
7878 if(op1->type)
7879 op1->type->refCount++;
7880 }
7881 return 1;
7882 }
7883
7884 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7885 {
7886 unsigned int value2 = op2->__anon1.ui;
7887
7888 exp->type = 2;
7889 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui %= value2) : 0);
7890 if(!exp->expType)
7891 {
7892 exp->expType = op1->type;
7893 if(op1->type)
7894 op1->type->refCount++;
7895 }
7896 return 1;
7897 }
7898
7899 static unsigned int Int64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7900 {
7901 long long value2 = op2->__anon1.i64;
7902
7903 exp->type = 2;
7904 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 %= value2) : 0);
7905 if(!exp->expType)
7906 {
7907 exp->expType = op1->type;
7908 if(op1->type)
7909 op1->type->refCount++;
7910 }
7911 return 1;
7912 }
7913
7914 static unsigned int UInt64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7915 {
7916 uint64 value2 = op2->__anon1.ui64;
7917
7918 exp->type = 2;
7919 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 %= value2) : 0);
7920 if(!exp->expType)
7921 {
7922 exp->expType = op1->type;
7923 if(op1->type)
7924 op1->type->refCount++;
7925 }
7926 return 1;
7927 }
7928
7929 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7930 {
7931 short value2 = op2->__anon1.s;
7932
7933 exp->type = 2;
7934 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s %= value2) : (short)0);
7935 if(!exp->expType)
7936 {
7937 exp->expType = op1->type;
7938 if(op1->type)
7939 op1->type->refCount++;
7940 }
7941 return 1;
7942 }
7943
7944 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7945 {
7946 unsigned short value2 = op2->__anon1.us;
7947
7948 exp->type = 2;
7949 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us %= value2) : (unsigned short)0);
7950 if(!exp->expType)
7951 {
7952 exp->expType = op1->type;
7953 if(op1->type)
7954 op1->type->refCount++;
7955 }
7956 return 1;
7957 }
7958
7959 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7960 {
7961 char value2 = op2->__anon1.c;
7962
7963 exp->type = 2;
7964 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c %= value2) : (char)0);
7965 if(!exp->expType)
7966 {
7967 exp->expType = op1->type;
7968 if(op1->type)
7969 op1->type->refCount++;
7970 }
7971 return 1;
7972 }
7973
7974 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7975 {
7976 unsigned char value2 = op2->__anon1.uc;
7977
7978 exp->type = 2;
7979 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc %= value2) : (unsigned char)0);
7980 if(!exp->expType)
7981 {
7982 exp->expType = op1->type;
7983 if(op1->type)
7984 op1->type->refCount++;
7985 }
7986 return 1;
7987 }
7988
7989 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7990 {
7991 int value2 = op2->__anon1.i;
7992
7993 exp->type = 2;
7994 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i & value2));
7995 if(!exp->expType)
7996 {
7997 exp->expType = op1->type;
7998 if(op1->type)
7999 op1->type->refCount++;
8000 }
8001 return 1;
8002 }
8003
8004 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8005 {
8006 unsigned int value2 = op2->__anon1.ui;
8007
8008 exp->type = 2;
8009 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui & value2));
8010 if(!exp->expType)
8011 {
8012 exp->expType = op1->type;
8013 if(op1->type)
8014 op1->type->refCount++;
8015 }
8016 return 1;
8017 }
8018
8019 static unsigned int Int64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8020 {
8021 long long value2 = op2->__anon1.i64;
8022
8023 exp->type = 2;
8024 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 & value2));
8025 if(!exp->expType)
8026 {
8027 exp->expType = op1->type;
8028 if(op1->type)
8029 op1->type->refCount++;
8030 }
8031 return 1;
8032 }
8033
8034 static unsigned int UInt64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8035 {
8036 uint64 value2 = op2->__anon1.ui64;
8037
8038 exp->type = 2;
8039 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 & value2));
8040 if(!exp->expType)
8041 {
8042 exp->expType = op1->type;
8043 if(op1->type)
8044 op1->type->refCount++;
8045 }
8046 return 1;
8047 }
8048
8049 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8050 {
8051 short value2 = op2->__anon1.s;
8052
8053 exp->type = 2;
8054 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s & value2));
8055 if(!exp->expType)
8056 {
8057 exp->expType = op1->type;
8058 if(op1->type)
8059 op1->type->refCount++;
8060 }
8061 return 1;
8062 }
8063
8064 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8065 {
8066 unsigned short value2 = op2->__anon1.us;
8067
8068 exp->type = 2;
8069 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us & value2));
8070 if(!exp->expType)
8071 {
8072 exp->expType = op1->type;
8073 if(op1->type)
8074 op1->type->refCount++;
8075 }
8076 return 1;
8077 }
8078
8079 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8080 {
8081 char value2 = op2->__anon1.c;
8082
8083 exp->type = 2;
8084 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c & value2));
8085 if(!exp->expType)
8086 {
8087 exp->expType = op1->type;
8088 if(op1->type)
8089 op1->type->refCount++;
8090 }
8091 return 1;
8092 }
8093
8094 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8095 {
8096 unsigned char value2 = op2->__anon1.uc;
8097
8098 exp->type = 2;
8099 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc & value2));
8100 if(!exp->expType)
8101 {
8102 exp->expType = op1->type;
8103 if(op1->type)
8104 op1->type->refCount++;
8105 }
8106 return 1;
8107 }
8108
8109 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8110 {
8111 int value2 = op2->__anon1.i;
8112
8113 exp->type = 2;
8114 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i | value2));
8115 if(!exp->expType)
8116 {
8117 exp->expType = op1->type;
8118 if(op1->type)
8119 op1->type->refCount++;
8120 }
8121 return 1;
8122 }
8123
8124 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8125 {
8126 unsigned int value2 = op2->__anon1.ui;
8127
8128 exp->type = 2;
8129 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui | value2));
8130 if(!exp->expType)
8131 {
8132 exp->expType = op1->type;
8133 if(op1->type)
8134 op1->type->refCount++;
8135 }
8136 return 1;
8137 }
8138
8139 static unsigned int Int64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8140 {
8141 long long value2 = op2->__anon1.i64;
8142
8143 exp->type = 2;
8144 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 | value2));
8145 if(!exp->expType)
8146 {
8147 exp->expType = op1->type;
8148 if(op1->type)
8149 op1->type->refCount++;
8150 }
8151 return 1;
8152 }
8153
8154 static unsigned int UInt64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8155 {
8156 uint64 value2 = op2->__anon1.ui64;
8157
8158 exp->type = 2;
8159 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 | value2));
8160 if(!exp->expType)
8161 {
8162 exp->expType = op1->type;
8163 if(op1->type)
8164 op1->type->refCount++;
8165 }
8166 return 1;
8167 }
8168
8169 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8170 {
8171 short value2 = op2->__anon1.s;
8172
8173 exp->type = 2;
8174 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s | value2));
8175 if(!exp->expType)
8176 {
8177 exp->expType = op1->type;
8178 if(op1->type)
8179 op1->type->refCount++;
8180 }
8181 return 1;
8182 }
8183
8184 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8185 {
8186 unsigned short value2 = op2->__anon1.us;
8187
8188 exp->type = 2;
8189 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us | value2));
8190 if(!exp->expType)
8191 {
8192 exp->expType = op1->type;
8193 if(op1->type)
8194 op1->type->refCount++;
8195 }
8196 return 1;
8197 }
8198
8199 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8200 {
8201 char value2 = op2->__anon1.c;
8202
8203 exp->type = 2;
8204 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c | value2));
8205 if(!exp->expType)
8206 {
8207 exp->expType = op1->type;
8208 if(op1->type)
8209 op1->type->refCount++;
8210 }
8211 return 1;
8212 }
8213
8214 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8215 {
8216 unsigned char value2 = op2->__anon1.uc;
8217
8218 exp->type = 2;
8219 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc | value2));
8220 if(!exp->expType)
8221 {
8222 exp->expType = op1->type;
8223 if(op1->type)
8224 op1->type->refCount++;
8225 }
8226 return 1;
8227 }
8228
8229 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8230 {
8231 int value2 = op2->__anon1.i;
8232
8233 exp->type = 2;
8234 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i ^ value2));
8235 if(!exp->expType)
8236 {
8237 exp->expType = op1->type;
8238 if(op1->type)
8239 op1->type->refCount++;
8240 }
8241 return 1;
8242 }
8243
8244 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8245 {
8246 unsigned int value2 = op2->__anon1.ui;
8247
8248 exp->type = 2;
8249 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui ^ value2));
8250 if(!exp->expType)
8251 {
8252 exp->expType = op1->type;
8253 if(op1->type)
8254 op1->type->refCount++;
8255 }
8256 return 1;
8257 }
8258
8259 static unsigned int Int64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8260 {
8261 long long value2 = op2->__anon1.i64;
8262
8263 exp->type = 2;
8264 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 ^ value2));
8265 if(!exp->expType)
8266 {
8267 exp->expType = op1->type;
8268 if(op1->type)
8269 op1->type->refCount++;
8270 }
8271 return 1;
8272 }
8273
8274 static unsigned int UInt64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8275 {
8276 uint64 value2 = op2->__anon1.ui64;
8277
8278 exp->type = 2;
8279 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 ^ value2));
8280 if(!exp->expType)
8281 {
8282 exp->expType = op1->type;
8283 if(op1->type)
8284 op1->type->refCount++;
8285 }
8286 return 1;
8287 }
8288
8289 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8290 {
8291 short value2 = op2->__anon1.s;
8292
8293 exp->type = 2;
8294 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s ^ value2));
8295 if(!exp->expType)
8296 {
8297 exp->expType = op1->type;
8298 if(op1->type)
8299 op1->type->refCount++;
8300 }
8301 return 1;
8302 }
8303
8304 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8305 {
8306 unsigned short value2 = op2->__anon1.us;
8307
8308 exp->type = 2;
8309 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us ^ value2));
8310 if(!exp->expType)
8311 {
8312 exp->expType = op1->type;
8313 if(op1->type)
8314 op1->type->refCount++;
8315 }
8316 return 1;
8317 }
8318
8319 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8320 {
8321 char value2 = op2->__anon1.c;
8322
8323 exp->type = 2;
8324 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c ^ value2));
8325 if(!exp->expType)
8326 {
8327 exp->expType = op1->type;
8328 if(op1->type)
8329 op1->type->refCount++;
8330 }
8331 return 1;
8332 }
8333
8334 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8335 {
8336 unsigned char value2 = op2->__anon1.uc;
8337
8338 exp->type = 2;
8339 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc ^ value2));
8340 if(!exp->expType)
8341 {
8342 exp->expType = op1->type;
8343 if(op1->type)
8344 op1->type->refCount++;
8345 }
8346 return 1;
8347 }
8348
8349 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8350 {
8351 int value2 = op2->__anon1.i;
8352
8353 exp->type = 2;
8354 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i << value2));
8355 if(!exp->expType)
8356 {
8357 exp->expType = op1->type;
8358 if(op1->type)
8359 op1->type->refCount++;
8360 }
8361 return 1;
8362 }
8363
8364 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8365 {
8366 unsigned int value2 = op2->__anon1.ui;
8367
8368 exp->type = 2;
8369 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui << value2));
8370 if(!exp->expType)
8371 {
8372 exp->expType = op1->type;
8373 if(op1->type)
8374 op1->type->refCount++;
8375 }
8376 return 1;
8377 }
8378
8379 static unsigned int Int64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8380 {
8381 long long value2 = op2->__anon1.i64;
8382
8383 exp->type = 2;
8384 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 << value2));
8385 if(!exp->expType)
8386 {
8387 exp->expType = op1->type;
8388 if(op1->type)
8389 op1->type->refCount++;
8390 }
8391 return 1;
8392 }
8393
8394 static unsigned int UInt64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8395 {
8396 uint64 value2 = op2->__anon1.ui64;
8397
8398 exp->type = 2;
8399 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 << value2));
8400 if(!exp->expType)
8401 {
8402 exp->expType = op1->type;
8403 if(op1->type)
8404 op1->type->refCount++;
8405 }
8406 return 1;
8407 }
8408
8409 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8410 {
8411 short value2 = op2->__anon1.s;
8412
8413 exp->type = 2;
8414 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s << value2));
8415 if(!exp->expType)
8416 {
8417 exp->expType = op1->type;
8418 if(op1->type)
8419 op1->type->refCount++;
8420 }
8421 return 1;
8422 }
8423
8424 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8425 {
8426 unsigned short value2 = op2->__anon1.us;
8427
8428 exp->type = 2;
8429 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us << value2));
8430 if(!exp->expType)
8431 {
8432 exp->expType = op1->type;
8433 if(op1->type)
8434 op1->type->refCount++;
8435 }
8436 return 1;
8437 }
8438
8439 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8440 {
8441 char value2 = op2->__anon1.c;
8442
8443 exp->type = 2;
8444 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c << value2));
8445 if(!exp->expType)
8446 {
8447 exp->expType = op1->type;
8448 if(op1->type)
8449 op1->type->refCount++;
8450 }
8451 return 1;
8452 }
8453
8454 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8455 {
8456 unsigned char value2 = op2->__anon1.uc;
8457
8458 exp->type = 2;
8459 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc << value2));
8460 if(!exp->expType)
8461 {
8462 exp->expType = op1->type;
8463 if(op1->type)
8464 op1->type->refCount++;
8465 }
8466 return 1;
8467 }
8468
8469 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8470 {
8471 int value2 = op2->__anon1.i;
8472
8473 exp->type = 2;
8474 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i >> value2));
8475 if(!exp->expType)
8476 {
8477 exp->expType = op1->type;
8478 if(op1->type)
8479 op1->type->refCount++;
8480 }
8481 return 1;
8482 }
8483
8484 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8485 {
8486 unsigned int value2 = op2->__anon1.ui;
8487
8488 exp->type = 2;
8489 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui >> value2));
8490 if(!exp->expType)
8491 {
8492 exp->expType = op1->type;
8493 if(op1->type)
8494 op1->type->refCount++;
8495 }
8496 return 1;
8497 }
8498
8499 static unsigned int Int64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8500 {
8501 long long value2 = op2->__anon1.i64;
8502
8503 exp->type = 2;
8504 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 >> value2));
8505 if(!exp->expType)
8506 {
8507 exp->expType = op1->type;
8508 if(op1->type)
8509 op1->type->refCount++;
8510 }
8511 return 1;
8512 }
8513
8514 static unsigned int UInt64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8515 {
8516 uint64 value2 = op2->__anon1.ui64;
8517
8518 exp->type = 2;
8519 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 >> value2));
8520 if(!exp->expType)
8521 {
8522 exp->expType = op1->type;
8523 if(op1->type)
8524 op1->type->refCount++;
8525 }
8526 return 1;
8527 }
8528
8529 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8530 {
8531 short value2 = op2->__anon1.s;
8532
8533 exp->type = 2;
8534 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s >> value2));
8535 if(!exp->expType)
8536 {
8537 exp->expType = op1->type;
8538 if(op1->type)
8539 op1->type->refCount++;
8540 }
8541 return 1;
8542 }
8543
8544 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8545 {
8546 unsigned short value2 = op2->__anon1.us;
8547
8548 exp->type = 2;
8549 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us >> value2));
8550 if(!exp->expType)
8551 {
8552 exp->expType = op1->type;
8553 if(op1->type)
8554 op1->type->refCount++;
8555 }
8556 return 1;
8557 }
8558
8559 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8560 {
8561 char value2 = op2->__anon1.c;
8562
8563 exp->type = 2;
8564 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c >> value2));
8565 if(!exp->expType)
8566 {
8567 exp->expType = op1->type;
8568 if(op1->type)
8569 op1->type->refCount++;
8570 }
8571 return 1;
8572 }
8573
8574 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8575 {
8576 unsigned char value2 = op2->__anon1.uc;
8577
8578 exp->type = 2;
8579 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc >> value2));
8580 if(!exp->expType)
8581 {
8582 exp->expType = op1->type;
8583 if(op1->type)
8584 op1->type->refCount++;
8585 }
8586 return 1;
8587 }
8588
8589 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
8590 {
8591 exp->type = 2;
8592 exp->__anon1.__anon2.string = PrintInt((~op1->__anon1.i));
8593 if(!exp->expType)
8594 {
8595 exp->expType = op1->type;
8596 if(op1->type)
8597 op1->type->refCount++;
8598 }
8599 return 1;
8600 }
8601
8602 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
8603 {
8604 exp->type = 2;
8605 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(~op1->__anon1.ui));
8606 if(!exp->expType)
8607 {
8608 exp->expType = op1->type;
8609 if(op1->type)
8610 op1->type->refCount++;
8611 }
8612 return 1;
8613 }
8614
8615 static unsigned int Int64BitNot(struct Expression * exp, struct Operand * op1)
8616 {
8617 exp->type = 2;
8618 exp->__anon1.__anon2.string = PrintInt64((long long)(~op1->__anon1.i64));
8619 if(!exp->expType)
8620 {
8621 exp->expType = op1->type;
8622 if(op1->type)
8623 op1->type->refCount++;
8624 }
8625 return 1;
8626 }
8627
8628 static unsigned int UInt64BitNot(struct Expression * exp, struct Operand * op1)
8629 {
8630 exp->type = 2;
8631 exp->__anon1.__anon2.string = PrintUInt64((uint64)(~op1->__anon1.ui64));
8632 if(!exp->expType)
8633 {
8634 exp->expType = op1->type;
8635 if(op1->type)
8636 op1->type->refCount++;
8637 }
8638 return 1;
8639 }
8640
8641 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
8642 {
8643 exp->type = 2;
8644 exp->__anon1.__anon2.string = PrintShort((short)(~op1->__anon1.s));
8645 if(!exp->expType)
8646 {
8647 exp->expType = op1->type;
8648 if(op1->type)
8649 op1->type->refCount++;
8650 }
8651 return 1;
8652 }
8653
8654 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
8655 {
8656 exp->type = 2;
8657 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(~op1->__anon1.us));
8658 if(!exp->expType)
8659 {
8660 exp->expType = op1->type;
8661 if(op1->type)
8662 op1->type->refCount++;
8663 }
8664 return 1;
8665 }
8666
8667 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
8668 {
8669 exp->type = 2;
8670 exp->__anon1.__anon2.string = PrintChar((char)(~op1->__anon1.c));
8671 if(!exp->expType)
8672 {
8673 exp->expType = op1->type;
8674 if(op1->type)
8675 op1->type->refCount++;
8676 }
8677 return 1;
8678 }
8679
8680 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
8681 {
8682 exp->type = 2;
8683 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(~op1->__anon1.uc));
8684 if(!exp->expType)
8685 {
8686 exp->expType = op1->type;
8687 if(op1->type)
8688 op1->type->refCount++;
8689 }
8690 return 1;
8691 }
8692
8693 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8694 {
8695 int value2 = op2->__anon1.i;
8696
8697 exp->type = 2;
8698 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i &= value2));
8699 if(!exp->expType)
8700 {
8701 exp->expType = op1->type;
8702 if(op1->type)
8703 op1->type->refCount++;
8704 }
8705 return 1;
8706 }
8707
8708 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8709 {
8710 unsigned int value2 = op2->__anon1.ui;
8711
8712 exp->type = 2;
8713 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui &= value2));
8714 if(!exp->expType)
8715 {
8716 exp->expType = op1->type;
8717 if(op1->type)
8718 op1->type->refCount++;
8719 }
8720 return 1;
8721 }
8722
8723 static unsigned int Int64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8724 {
8725 long long value2 = op2->__anon1.i64;
8726
8727 exp->type = 2;
8728 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 &= value2));
8729 if(!exp->expType)
8730 {
8731 exp->expType = op1->type;
8732 if(op1->type)
8733 op1->type->refCount++;
8734 }
8735 return 1;
8736 }
8737
8738 static unsigned int UInt64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8739 {
8740 uint64 value2 = op2->__anon1.ui64;
8741
8742 exp->type = 2;
8743 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 &= value2));
8744 if(!exp->expType)
8745 {
8746 exp->expType = op1->type;
8747 if(op1->type)
8748 op1->type->refCount++;
8749 }
8750 return 1;
8751 }
8752
8753 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8754 {
8755 short value2 = op2->__anon1.s;
8756
8757 exp->type = 2;
8758 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s &= value2));
8759 if(!exp->expType)
8760 {
8761 exp->expType = op1->type;
8762 if(op1->type)
8763 op1->type->refCount++;
8764 }
8765 return 1;
8766 }
8767
8768 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8769 {
8770 unsigned short value2 = op2->__anon1.us;
8771
8772 exp->type = 2;
8773 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us &= value2));
8774 if(!exp->expType)
8775 {
8776 exp->expType = op1->type;
8777 if(op1->type)
8778 op1->type->refCount++;
8779 }
8780 return 1;
8781 }
8782
8783 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8784 {
8785 char value2 = op2->__anon1.c;
8786
8787 exp->type = 2;
8788 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c &= value2));
8789 if(!exp->expType)
8790 {
8791 exp->expType = op1->type;
8792 if(op1->type)
8793 op1->type->refCount++;
8794 }
8795 return 1;
8796 }
8797
8798 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8799 {
8800 unsigned char value2 = op2->__anon1.uc;
8801
8802 exp->type = 2;
8803 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc &= value2));
8804 if(!exp->expType)
8805 {
8806 exp->expType = op1->type;
8807 if(op1->type)
8808 op1->type->refCount++;
8809 }
8810 return 1;
8811 }
8812
8813 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8814 {
8815 int value2 = op2->__anon1.i;
8816
8817 exp->type = 2;
8818 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i |= value2));
8819 if(!exp->expType)
8820 {
8821 exp->expType = op1->type;
8822 if(op1->type)
8823 op1->type->refCount++;
8824 }
8825 return 1;
8826 }
8827
8828 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8829 {
8830 unsigned int value2 = op2->__anon1.ui;
8831
8832 exp->type = 2;
8833 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui |= value2));
8834 if(!exp->expType)
8835 {
8836 exp->expType = op1->type;
8837 if(op1->type)
8838 op1->type->refCount++;
8839 }
8840 return 1;
8841 }
8842
8843 static unsigned int Int64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8844 {
8845 long long value2 = op2->__anon1.i64;
8846
8847 exp->type = 2;
8848 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 |= value2));
8849 if(!exp->expType)
8850 {
8851 exp->expType = op1->type;
8852 if(op1->type)
8853 op1->type->refCount++;
8854 }
8855 return 1;
8856 }
8857
8858 static unsigned int UInt64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8859 {
8860 uint64 value2 = op2->__anon1.ui64;
8861
8862 exp->type = 2;
8863 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 |= value2));
8864 if(!exp->expType)
8865 {
8866 exp->expType = op1->type;
8867 if(op1->type)
8868 op1->type->refCount++;
8869 }
8870 return 1;
8871 }
8872
8873 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8874 {
8875 short value2 = op2->__anon1.s;
8876
8877 exp->type = 2;
8878 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s |= value2));
8879 if(!exp->expType)
8880 {
8881 exp->expType = op1->type;
8882 if(op1->type)
8883 op1->type->refCount++;
8884 }
8885 return 1;
8886 }
8887
8888 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8889 {
8890 unsigned short value2 = op2->__anon1.us;
8891
8892 exp->type = 2;
8893 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us |= value2));
8894 if(!exp->expType)
8895 {
8896 exp->expType = op1->type;
8897 if(op1->type)
8898 op1->type->refCount++;
8899 }
8900 return 1;
8901 }
8902
8903 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8904 {
8905 char value2 = op2->__anon1.c;
8906
8907 exp->type = 2;
8908 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c |= value2));
8909 if(!exp->expType)
8910 {
8911 exp->expType = op1->type;
8912 if(op1->type)
8913 op1->type->refCount++;
8914 }
8915 return 1;
8916 }
8917
8918 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8919 {
8920 unsigned char value2 = op2->__anon1.uc;
8921
8922 exp->type = 2;
8923 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc |= value2));
8924 if(!exp->expType)
8925 {
8926 exp->expType = op1->type;
8927 if(op1->type)
8928 op1->type->refCount++;
8929 }
8930 return 1;
8931 }
8932
8933 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8934 {
8935 int value2 = op2->__anon1.i;
8936
8937 exp->type = 2;
8938 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i ^= value2));
8939 if(!exp->expType)
8940 {
8941 exp->expType = op1->type;
8942 if(op1->type)
8943 op1->type->refCount++;
8944 }
8945 return 1;
8946 }
8947
8948 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8949 {
8950 unsigned int value2 = op2->__anon1.ui;
8951
8952 exp->type = 2;
8953 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui ^= value2));
8954 if(!exp->expType)
8955 {
8956 exp->expType = op1->type;
8957 if(op1->type)
8958 op1->type->refCount++;
8959 }
8960 return 1;
8961 }
8962
8963 static unsigned int Int64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8964 {
8965 long long value2 = op2->__anon1.i64;
8966
8967 exp->type = 2;
8968 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 ^= value2));
8969 if(!exp->expType)
8970 {
8971 exp->expType = op1->type;
8972 if(op1->type)
8973 op1->type->refCount++;
8974 }
8975 return 1;
8976 }
8977
8978 static unsigned int UInt64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8979 {
8980 uint64 value2 = op2->__anon1.ui64;
8981
8982 exp->type = 2;
8983 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 ^= value2));
8984 if(!exp->expType)
8985 {
8986 exp->expType = op1->type;
8987 if(op1->type)
8988 op1->type->refCount++;
8989 }
8990 return 1;
8991 }
8992
8993 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8994 {
8995 short value2 = op2->__anon1.s;
8996
8997 exp->type = 2;
8998 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s ^= value2));
8999 if(!exp->expType)
9000 {
9001 exp->expType = op1->type;
9002 if(op1->type)
9003 op1->type->refCount++;
9004 }
9005 return 1;
9006 }
9007
9008 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9009 {
9010 unsigned short value2 = op2->__anon1.us;
9011
9012 exp->type = 2;
9013 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us ^= value2));
9014 if(!exp->expType)
9015 {
9016 exp->expType = op1->type;
9017 if(op1->type)
9018 op1->type->refCount++;
9019 }
9020 return 1;
9021 }
9022
9023 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9024 {
9025 char value2 = op2->__anon1.c;
9026
9027 exp->type = 2;
9028 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c ^= value2));
9029 if(!exp->expType)
9030 {
9031 exp->expType = op1->type;
9032 if(op1->type)
9033 op1->type->refCount++;
9034 }
9035 return 1;
9036 }
9037
9038 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9039 {
9040 unsigned char value2 = op2->__anon1.uc;
9041
9042 exp->type = 2;
9043 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc ^= value2));
9044 if(!exp->expType)
9045 {
9046 exp->expType = op1->type;
9047 if(op1->type)
9048 op1->type->refCount++;
9049 }
9050 return 1;
9051 }
9052
9053 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9054 {
9055 int value2 = op2->__anon1.i;
9056
9057 exp->type = 2;
9058 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i <<= value2));
9059 if(!exp->expType)
9060 {
9061 exp->expType = op1->type;
9062 if(op1->type)
9063 op1->type->refCount++;
9064 }
9065 return 1;
9066 }
9067
9068 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9069 {
9070 unsigned int value2 = op2->__anon1.ui;
9071
9072 exp->type = 2;
9073 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui <<= value2));
9074 if(!exp->expType)
9075 {
9076 exp->expType = op1->type;
9077 if(op1->type)
9078 op1->type->refCount++;
9079 }
9080 return 1;
9081 }
9082
9083 static unsigned int Int64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9084 {
9085 long long value2 = op2->__anon1.i64;
9086
9087 exp->type = 2;
9088 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 <<= value2));
9089 if(!exp->expType)
9090 {
9091 exp->expType = op1->type;
9092 if(op1->type)
9093 op1->type->refCount++;
9094 }
9095 return 1;
9096 }
9097
9098 static unsigned int UInt64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9099 {
9100 uint64 value2 = op2->__anon1.ui64;
9101
9102 exp->type = 2;
9103 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 <<= value2));
9104 if(!exp->expType)
9105 {
9106 exp->expType = op1->type;
9107 if(op1->type)
9108 op1->type->refCount++;
9109 }
9110 return 1;
9111 }
9112
9113 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9114 {
9115 short value2 = op2->__anon1.s;
9116
9117 exp->type = 2;
9118 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s <<= value2));
9119 if(!exp->expType)
9120 {
9121 exp->expType = op1->type;
9122 if(op1->type)
9123 op1->type->refCount++;
9124 }
9125 return 1;
9126 }
9127
9128 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9129 {
9130 unsigned short value2 = op2->__anon1.us;
9131
9132 exp->type = 2;
9133 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us <<= value2));
9134 if(!exp->expType)
9135 {
9136 exp->expType = op1->type;
9137 if(op1->type)
9138 op1->type->refCount++;
9139 }
9140 return 1;
9141 }
9142
9143 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9144 {
9145 char value2 = op2->__anon1.c;
9146
9147 exp->type = 2;
9148 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c <<= value2));
9149 if(!exp->expType)
9150 {
9151 exp->expType = op1->type;
9152 if(op1->type)
9153 op1->type->refCount++;
9154 }
9155 return 1;
9156 }
9157
9158 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9159 {
9160 unsigned char value2 = op2->__anon1.uc;
9161
9162 exp->type = 2;
9163 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc <<= value2));
9164 if(!exp->expType)
9165 {
9166 exp->expType = op1->type;
9167 if(op1->type)
9168 op1->type->refCount++;
9169 }
9170 return 1;
9171 }
9172
9173 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9174 {
9175 int value2 = op2->__anon1.i;
9176
9177 exp->type = 2;
9178 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i >>= value2));
9179 if(!exp->expType)
9180 {
9181 exp->expType = op1->type;
9182 if(op1->type)
9183 op1->type->refCount++;
9184 }
9185 return 1;
9186 }
9187
9188 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9189 {
9190 unsigned int value2 = op2->__anon1.ui;
9191
9192 exp->type = 2;
9193 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui >>= value2));
9194 if(!exp->expType)
9195 {
9196 exp->expType = op1->type;
9197 if(op1->type)
9198 op1->type->refCount++;
9199 }
9200 return 1;
9201 }
9202
9203 static unsigned int Int64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9204 {
9205 long long value2 = op2->__anon1.i64;
9206
9207 exp->type = 2;
9208 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 >>= value2));
9209 if(!exp->expType)
9210 {
9211 exp->expType = op1->type;
9212 if(op1->type)
9213 op1->type->refCount++;
9214 }
9215 return 1;
9216 }
9217
9218 static unsigned int UInt64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9219 {
9220 uint64 value2 = op2->__anon1.ui64;
9221
9222 exp->type = 2;
9223 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 >>= value2));
9224 if(!exp->expType)
9225 {
9226 exp->expType = op1->type;
9227 if(op1->type)
9228 op1->type->refCount++;
9229 }
9230 return 1;
9231 }
9232
9233 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9234 {
9235 short value2 = op2->__anon1.s;
9236
9237 exp->type = 2;
9238 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s >>= value2));
9239 if(!exp->expType)
9240 {
9241 exp->expType = op1->type;
9242 if(op1->type)
9243 op1->type->refCount++;
9244 }
9245 return 1;
9246 }
9247
9248 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9249 {
9250 unsigned short value2 = op2->__anon1.us;
9251
9252 exp->type = 2;
9253 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us >>= value2));
9254 if(!exp->expType)
9255 {
9256 exp->expType = op1->type;
9257 if(op1->type)
9258 op1->type->refCount++;
9259 }
9260 return 1;
9261 }
9262
9263 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9264 {
9265 char value2 = op2->__anon1.c;
9266
9267 exp->type = 2;
9268 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c >>= value2));
9269 if(!exp->expType)
9270 {
9271 exp->expType = op1->type;
9272 if(op1->type)
9273 op1->type->refCount++;
9274 }
9275 return 1;
9276 }
9277
9278 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9279 {
9280 unsigned char value2 = op2->__anon1.uc;
9281
9282 exp->type = 2;
9283 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc >>= value2));
9284 if(!exp->expType)
9285 {
9286 exp->expType = op1->type;
9287 if(op1->type)
9288 op1->type->refCount++;
9289 }
9290 return 1;
9291 }
9292
9293 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
9294 {
9295 exp->type = 2;
9296 exp->__anon1.__anon2.string = PrintInt((int)(!op1->__anon1.i));
9297 if(!exp->expType)
9298 {
9299 exp->expType = op1->type;
9300 if(op1->type)
9301 op1->type->refCount++;
9302 }
9303 return 1;
9304 }
9305
9306 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
9307 {
9308 exp->type = 2;
9309 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(!op1->__anon1.ui));
9310 if(!exp->expType)
9311 {
9312 exp->expType = op1->type;
9313 if(op1->type)
9314 op1->type->refCount++;
9315 }
9316 return 1;
9317 }
9318
9319 static unsigned int Int64Not(struct Expression * exp, struct Operand * op1)
9320 {
9321 exp->type = 2;
9322 exp->__anon1.__anon2.string = PrintInt64((long long)(!op1->__anon1.i64));
9323 if(!exp->expType)
9324 {
9325 exp->expType = op1->type;
9326 if(op1->type)
9327 op1->type->refCount++;
9328 }
9329 return 1;
9330 }
9331
9332 static unsigned int UInt64Not(struct Expression * exp, struct Operand * op1)
9333 {
9334 exp->type = 2;
9335 exp->__anon1.__anon2.string = PrintUInt64((uint64)(!op1->__anon1.ui64));
9336 if(!exp->expType)
9337 {
9338 exp->expType = op1->type;
9339 if(op1->type)
9340 op1->type->refCount++;
9341 }
9342 return 1;
9343 }
9344
9345 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
9346 {
9347 exp->type = 2;
9348 exp->__anon1.__anon2.string = PrintShort((short)(!op1->__anon1.s));
9349 if(!exp->expType)
9350 {
9351 exp->expType = op1->type;
9352 if(op1->type)
9353 op1->type->refCount++;
9354 }
9355 return 1;
9356 }
9357
9358 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
9359 {
9360 exp->type = 2;
9361 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(!op1->__anon1.us));
9362 if(!exp->expType)
9363 {
9364 exp->expType = op1->type;
9365 if(op1->type)
9366 op1->type->refCount++;
9367 }
9368 return 1;
9369 }
9370
9371 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
9372 {
9373 exp->type = 2;
9374 exp->__anon1.__anon2.string = PrintChar((char)(!op1->__anon1.c));
9375 if(!exp->expType)
9376 {
9377 exp->expType = op1->type;
9378 if(op1->type)
9379 op1->type->refCount++;
9380 }
9381 return 1;
9382 }
9383
9384 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
9385 {
9386 exp->type = 2;
9387 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(!op1->__anon1.uc));
9388 if(!exp->expType)
9389 {
9390 exp->expType = op1->type;
9391 if(op1->type)
9392 op1->type->refCount++;
9393 }
9394 return 1;
9395 }
9396
9397 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9398 {
9399 int value2 = op2->__anon1.i;
9400
9401 exp->type = 2;
9402 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i == value2));
9403 if(!exp->expType)
9404 {
9405 exp->expType = op1->type;
9406 if(op1->type)
9407 op1->type->refCount++;
9408 }
9409 return 1;
9410 }
9411
9412 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9413 {
9414 unsigned int value2 = op2->__anon1.ui;
9415
9416 exp->type = 2;
9417 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui == value2));
9418 if(!exp->expType)
9419 {
9420 exp->expType = op1->type;
9421 if(op1->type)
9422 op1->type->refCount++;
9423 }
9424 return 1;
9425 }
9426
9427 static unsigned int Int64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9428 {
9429 long long value2 = op2->__anon1.i64;
9430
9431 exp->type = 2;
9432 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 == value2));
9433 if(!exp->expType)
9434 {
9435 exp->expType = op1->type;
9436 if(op1->type)
9437 op1->type->refCount++;
9438 }
9439 return 1;
9440 }
9441
9442 static unsigned int UInt64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9443 {
9444 uint64 value2 = op2->__anon1.ui64;
9445
9446 exp->type = 2;
9447 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 == value2));
9448 if(!exp->expType)
9449 {
9450 exp->expType = op1->type;
9451 if(op1->type)
9452 op1->type->refCount++;
9453 }
9454 return 1;
9455 }
9456
9457 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9458 {
9459 short value2 = op2->__anon1.s;
9460
9461 exp->type = 2;
9462 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s == value2));
9463 if(!exp->expType)
9464 {
9465 exp->expType = op1->type;
9466 if(op1->type)
9467 op1->type->refCount++;
9468 }
9469 return 1;
9470 }
9471
9472 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9473 {
9474 unsigned short value2 = op2->__anon1.us;
9475
9476 exp->type = 2;
9477 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us == value2));
9478 if(!exp->expType)
9479 {
9480 exp->expType = op1->type;
9481 if(op1->type)
9482 op1->type->refCount++;
9483 }
9484 return 1;
9485 }
9486
9487 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9488 {
9489 char value2 = op2->__anon1.c;
9490
9491 exp->type = 2;
9492 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c == value2));
9493 if(!exp->expType)
9494 {
9495 exp->expType = op1->type;
9496 if(op1->type)
9497 op1->type->refCount++;
9498 }
9499 return 1;
9500 }
9501
9502 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9503 {
9504 unsigned char value2 = op2->__anon1.uc;
9505
9506 exp->type = 2;
9507 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc == value2));
9508 if(!exp->expType)
9509 {
9510 exp->expType = op1->type;
9511 if(op1->type)
9512 op1->type->refCount++;
9513 }
9514 return 1;
9515 }
9516
9517 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9518 {
9519 float value2 = op2->__anon1.f;
9520
9521 exp->type = 2;
9522 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f == value2));
9523 if(!exp->expType)
9524 {
9525 exp->expType = op1->type;
9526 if(op1->type)
9527 op1->type->refCount++;
9528 }
9529 return 1;
9530 }
9531
9532 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9533 {
9534 double value2 = op2->__anon1.d;
9535
9536 exp->type = 2;
9537 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d == value2));
9538 if(!exp->expType)
9539 {
9540 exp->expType = op1->type;
9541 if(op1->type)
9542 op1->type->refCount++;
9543 }
9544 return 1;
9545 }
9546
9547 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9548 {
9549 int value2 = op2->__anon1.i;
9550
9551 exp->type = 2;
9552 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i != value2));
9553 if(!exp->expType)
9554 {
9555 exp->expType = op1->type;
9556 if(op1->type)
9557 op1->type->refCount++;
9558 }
9559 return 1;
9560 }
9561
9562 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9563 {
9564 unsigned int value2 = op2->__anon1.ui;
9565
9566 exp->type = 2;
9567 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui != value2));
9568 if(!exp->expType)
9569 {
9570 exp->expType = op1->type;
9571 if(op1->type)
9572 op1->type->refCount++;
9573 }
9574 return 1;
9575 }
9576
9577 static unsigned int Int64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9578 {
9579 long long value2 = op2->__anon1.i64;
9580
9581 exp->type = 2;
9582 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 != value2));
9583 if(!exp->expType)
9584 {
9585 exp->expType = op1->type;
9586 if(op1->type)
9587 op1->type->refCount++;
9588 }
9589 return 1;
9590 }
9591
9592 static unsigned int UInt64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9593 {
9594 uint64 value2 = op2->__anon1.ui64;
9595
9596 exp->type = 2;
9597 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 != value2));
9598 if(!exp->expType)
9599 {
9600 exp->expType = op1->type;
9601 if(op1->type)
9602 op1->type->refCount++;
9603 }
9604 return 1;
9605 }
9606
9607 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9608 {
9609 short value2 = op2->__anon1.s;
9610
9611 exp->type = 2;
9612 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s != value2));
9613 if(!exp->expType)
9614 {
9615 exp->expType = op1->type;
9616 if(op1->type)
9617 op1->type->refCount++;
9618 }
9619 return 1;
9620 }
9621
9622 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9623 {
9624 unsigned short value2 = op2->__anon1.us;
9625
9626 exp->type = 2;
9627 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us != value2));
9628 if(!exp->expType)
9629 {
9630 exp->expType = op1->type;
9631 if(op1->type)
9632 op1->type->refCount++;
9633 }
9634 return 1;
9635 }
9636
9637 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9638 {
9639 char value2 = op2->__anon1.c;
9640
9641 exp->type = 2;
9642 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c != value2));
9643 if(!exp->expType)
9644 {
9645 exp->expType = op1->type;
9646 if(op1->type)
9647 op1->type->refCount++;
9648 }
9649 return 1;
9650 }
9651
9652 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9653 {
9654 unsigned char value2 = op2->__anon1.uc;
9655
9656 exp->type = 2;
9657 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc != value2));
9658 if(!exp->expType)
9659 {
9660 exp->expType = op1->type;
9661 if(op1->type)
9662 op1->type->refCount++;
9663 }
9664 return 1;
9665 }
9666
9667 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9668 {
9669 float value2 = op2->__anon1.f;
9670
9671 exp->type = 2;
9672 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f != value2));
9673 if(!exp->expType)
9674 {
9675 exp->expType = op1->type;
9676 if(op1->type)
9677 op1->type->refCount++;
9678 }
9679 return 1;
9680 }
9681
9682 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9683 {
9684 double value2 = op2->__anon1.d;
9685
9686 exp->type = 2;
9687 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d != value2));
9688 if(!exp->expType)
9689 {
9690 exp->expType = op1->type;
9691 if(op1->type)
9692 op1->type->refCount++;
9693 }
9694 return 1;
9695 }
9696
9697 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9698 {
9699 int value2 = op2->__anon1.i;
9700
9701 exp->type = 2;
9702 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i && value2));
9703 if(!exp->expType)
9704 {
9705 exp->expType = op1->type;
9706 if(op1->type)
9707 op1->type->refCount++;
9708 }
9709 return 1;
9710 }
9711
9712 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9713 {
9714 unsigned int value2 = op2->__anon1.ui;
9715
9716 exp->type = 2;
9717 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui && value2));
9718 if(!exp->expType)
9719 {
9720 exp->expType = op1->type;
9721 if(op1->type)
9722 op1->type->refCount++;
9723 }
9724 return 1;
9725 }
9726
9727 static unsigned int Int64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9728 {
9729 long long value2 = op2->__anon1.i64;
9730
9731 exp->type = 2;
9732 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 && value2));
9733 if(!exp->expType)
9734 {
9735 exp->expType = op1->type;
9736 if(op1->type)
9737 op1->type->refCount++;
9738 }
9739 return 1;
9740 }
9741
9742 static unsigned int UInt64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9743 {
9744 uint64 value2 = op2->__anon1.ui64;
9745
9746 exp->type = 2;
9747 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 && value2));
9748 if(!exp->expType)
9749 {
9750 exp->expType = op1->type;
9751 if(op1->type)
9752 op1->type->refCount++;
9753 }
9754 return 1;
9755 }
9756
9757 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9758 {
9759 short value2 = op2->__anon1.s;
9760
9761 exp->type = 2;
9762 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s && value2));
9763 if(!exp->expType)
9764 {
9765 exp->expType = op1->type;
9766 if(op1->type)
9767 op1->type->refCount++;
9768 }
9769 return 1;
9770 }
9771
9772 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9773 {
9774 unsigned short value2 = op2->__anon1.us;
9775
9776 exp->type = 2;
9777 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us && value2));
9778 if(!exp->expType)
9779 {
9780 exp->expType = op1->type;
9781 if(op1->type)
9782 op1->type->refCount++;
9783 }
9784 return 1;
9785 }
9786
9787 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9788 {
9789 char value2 = op2->__anon1.c;
9790
9791 exp->type = 2;
9792 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c && value2));
9793 if(!exp->expType)
9794 {
9795 exp->expType = op1->type;
9796 if(op1->type)
9797 op1->type->refCount++;
9798 }
9799 return 1;
9800 }
9801
9802 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9803 {
9804 unsigned char value2 = op2->__anon1.uc;
9805
9806 exp->type = 2;
9807 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc && value2));
9808 if(!exp->expType)
9809 {
9810 exp->expType = op1->type;
9811 if(op1->type)
9812 op1->type->refCount++;
9813 }
9814 return 1;
9815 }
9816
9817 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9818 {
9819 float value2 = op2->__anon1.f;
9820
9821 exp->type = 2;
9822 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f && value2));
9823 if(!exp->expType)
9824 {
9825 exp->expType = op1->type;
9826 if(op1->type)
9827 op1->type->refCount++;
9828 }
9829 return 1;
9830 }
9831
9832 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9833 {
9834 double value2 = op2->__anon1.d;
9835
9836 exp->type = 2;
9837 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d && value2));
9838 if(!exp->expType)
9839 {
9840 exp->expType = op1->type;
9841 if(op1->type)
9842 op1->type->refCount++;
9843 }
9844 return 1;
9845 }
9846
9847 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9848 {
9849 int value2 = op2->__anon1.i;
9850
9851 exp->type = 2;
9852 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i || value2));
9853 if(!exp->expType)
9854 {
9855 exp->expType = op1->type;
9856 if(op1->type)
9857 op1->type->refCount++;
9858 }
9859 return 1;
9860 }
9861
9862 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9863 {
9864 unsigned int value2 = op2->__anon1.ui;
9865
9866 exp->type = 2;
9867 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui || value2));
9868 if(!exp->expType)
9869 {
9870 exp->expType = op1->type;
9871 if(op1->type)
9872 op1->type->refCount++;
9873 }
9874 return 1;
9875 }
9876
9877 static unsigned int Int64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9878 {
9879 long long value2 = op2->__anon1.i64;
9880
9881 exp->type = 2;
9882 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 || value2));
9883 if(!exp->expType)
9884 {
9885 exp->expType = op1->type;
9886 if(op1->type)
9887 op1->type->refCount++;
9888 }
9889 return 1;
9890 }
9891
9892 static unsigned int UInt64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9893 {
9894 uint64 value2 = op2->__anon1.ui64;
9895
9896 exp->type = 2;
9897 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 || value2));
9898 if(!exp->expType)
9899 {
9900 exp->expType = op1->type;
9901 if(op1->type)
9902 op1->type->refCount++;
9903 }
9904 return 1;
9905 }
9906
9907 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9908 {
9909 short value2 = op2->__anon1.s;
9910
9911 exp->type = 2;
9912 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s || value2));
9913 if(!exp->expType)
9914 {
9915 exp->expType = op1->type;
9916 if(op1->type)
9917 op1->type->refCount++;
9918 }
9919 return 1;
9920 }
9921
9922 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9923 {
9924 unsigned short value2 = op2->__anon1.us;
9925
9926 exp->type = 2;
9927 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us || value2));
9928 if(!exp->expType)
9929 {
9930 exp->expType = op1->type;
9931 if(op1->type)
9932 op1->type->refCount++;
9933 }
9934 return 1;
9935 }
9936
9937 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9938 {
9939 char value2 = op2->__anon1.c;
9940
9941 exp->type = 2;
9942 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c || value2));
9943 if(!exp->expType)
9944 {
9945 exp->expType = op1->type;
9946 if(op1->type)
9947 op1->type->refCount++;
9948 }
9949 return 1;
9950 }
9951
9952 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9953 {
9954 unsigned char value2 = op2->__anon1.uc;
9955
9956 exp->type = 2;
9957 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc || value2));
9958 if(!exp->expType)
9959 {
9960 exp->expType = op1->type;
9961 if(op1->type)
9962 op1->type->refCount++;
9963 }
9964 return 1;
9965 }
9966
9967 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9968 {
9969 float value2 = op2->__anon1.f;
9970
9971 exp->type = 2;
9972 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f || value2));
9973 if(!exp->expType)
9974 {
9975 exp->expType = op1->type;
9976 if(op1->type)
9977 op1->type->refCount++;
9978 }
9979 return 1;
9980 }
9981
9982 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9983 {
9984 double value2 = op2->__anon1.d;
9985
9986 exp->type = 2;
9987 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d || value2));
9988 if(!exp->expType)
9989 {
9990 exp->expType = op1->type;
9991 if(op1->type)
9992 op1->type->refCount++;
9993 }
9994 return 1;
9995 }
9996
9997 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9998 {
9999 int value2 = op2->__anon1.i;
10000
10001 exp->type = 2;
10002 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i > value2));
10003 if(!exp->expType)
10004 {
10005 exp->expType = op1->type;
10006 if(op1->type)
10007 op1->type->refCount++;
10008 }
10009 return 1;
10010 }
10011
10012 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10013 {
10014 unsigned int value2 = op2->__anon1.ui;
10015
10016 exp->type = 2;
10017 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui > value2));
10018 if(!exp->expType)
10019 {
10020 exp->expType = op1->type;
10021 if(op1->type)
10022 op1->type->refCount++;
10023 }
10024 return 1;
10025 }
10026
10027 static unsigned int Int64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10028 {
10029 long long value2 = op2->__anon1.i64;
10030
10031 exp->type = 2;
10032 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 > value2));
10033 if(!exp->expType)
10034 {
10035 exp->expType = op1->type;
10036 if(op1->type)
10037 op1->type->refCount++;
10038 }
10039 return 1;
10040 }
10041
10042 static unsigned int UInt64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10043 {
10044 uint64 value2 = op2->__anon1.ui64;
10045
10046 exp->type = 2;
10047 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 > value2));
10048 if(!exp->expType)
10049 {
10050 exp->expType = op1->type;
10051 if(op1->type)
10052 op1->type->refCount++;
10053 }
10054 return 1;
10055 }
10056
10057 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10058 {
10059 short value2 = op2->__anon1.s;
10060
10061 exp->type = 2;
10062 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s > value2));
10063 if(!exp->expType)
10064 {
10065 exp->expType = op1->type;
10066 if(op1->type)
10067 op1->type->refCount++;
10068 }
10069 return 1;
10070 }
10071
10072 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10073 {
10074 unsigned short value2 = op2->__anon1.us;
10075
10076 exp->type = 2;
10077 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us > value2));
10078 if(!exp->expType)
10079 {
10080 exp->expType = op1->type;
10081 if(op1->type)
10082 op1->type->refCount++;
10083 }
10084 return 1;
10085 }
10086
10087 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10088 {
10089 char value2 = op2->__anon1.c;
10090
10091 exp->type = 2;
10092 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c > value2));
10093 if(!exp->expType)
10094 {
10095 exp->expType = op1->type;
10096 if(op1->type)
10097 op1->type->refCount++;
10098 }
10099 return 1;
10100 }
10101
10102 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10103 {
10104 unsigned char value2 = op2->__anon1.uc;
10105
10106 exp->type = 2;
10107 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc > value2));
10108 if(!exp->expType)
10109 {
10110 exp->expType = op1->type;
10111 if(op1->type)
10112 op1->type->refCount++;
10113 }
10114 return 1;
10115 }
10116
10117 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10118 {
10119 float value2 = op2->__anon1.f;
10120
10121 exp->type = 2;
10122 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f > value2));
10123 if(!exp->expType)
10124 {
10125 exp->expType = op1->type;
10126 if(op1->type)
10127 op1->type->refCount++;
10128 }
10129 return 1;
10130 }
10131
10132 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10133 {
10134 double value2 = op2->__anon1.d;
10135
10136 exp->type = 2;
10137 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d > value2));
10138 if(!exp->expType)
10139 {
10140 exp->expType = op1->type;
10141 if(op1->type)
10142 op1->type->refCount++;
10143 }
10144 return 1;
10145 }
10146
10147 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10148 {
10149 int value2 = op2->__anon1.i;
10150
10151 exp->type = 2;
10152 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i < value2));
10153 if(!exp->expType)
10154 {
10155 exp->expType = op1->type;
10156 if(op1->type)
10157 op1->type->refCount++;
10158 }
10159 return 1;
10160 }
10161
10162 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10163 {
10164 unsigned int value2 = op2->__anon1.ui;
10165
10166 exp->type = 2;
10167 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui < value2));
10168 if(!exp->expType)
10169 {
10170 exp->expType = op1->type;
10171 if(op1->type)
10172 op1->type->refCount++;
10173 }
10174 return 1;
10175 }
10176
10177 static unsigned int Int64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10178 {
10179 long long value2 = op2->__anon1.i64;
10180
10181 exp->type = 2;
10182 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 < value2));
10183 if(!exp->expType)
10184 {
10185 exp->expType = op1->type;
10186 if(op1->type)
10187 op1->type->refCount++;
10188 }
10189 return 1;
10190 }
10191
10192 static unsigned int UInt64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10193 {
10194 uint64 value2 = op2->__anon1.ui64;
10195
10196 exp->type = 2;
10197 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 < value2));
10198 if(!exp->expType)
10199 {
10200 exp->expType = op1->type;
10201 if(op1->type)
10202 op1->type->refCount++;
10203 }
10204 return 1;
10205 }
10206
10207 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10208 {
10209 short value2 = op2->__anon1.s;
10210
10211 exp->type = 2;
10212 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s < value2));
10213 if(!exp->expType)
10214 {
10215 exp->expType = op1->type;
10216 if(op1->type)
10217 op1->type->refCount++;
10218 }
10219 return 1;
10220 }
10221
10222 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10223 {
10224 unsigned short value2 = op2->__anon1.us;
10225
10226 exp->type = 2;
10227 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us < value2));
10228 if(!exp->expType)
10229 {
10230 exp->expType = op1->type;
10231 if(op1->type)
10232 op1->type->refCount++;
10233 }
10234 return 1;
10235 }
10236
10237 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10238 {
10239 char value2 = op2->__anon1.c;
10240
10241 exp->type = 2;
10242 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c < value2));
10243 if(!exp->expType)
10244 {
10245 exp->expType = op1->type;
10246 if(op1->type)
10247 op1->type->refCount++;
10248 }
10249 return 1;
10250 }
10251
10252 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10253 {
10254 unsigned char value2 = op2->__anon1.uc;
10255
10256 exp->type = 2;
10257 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc < value2));
10258 if(!exp->expType)
10259 {
10260 exp->expType = op1->type;
10261 if(op1->type)
10262 op1->type->refCount++;
10263 }
10264 return 1;
10265 }
10266
10267 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10268 {
10269 float value2 = op2->__anon1.f;
10270
10271 exp->type = 2;
10272 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f < value2));
10273 if(!exp->expType)
10274 {
10275 exp->expType = op1->type;
10276 if(op1->type)
10277 op1->type->refCount++;
10278 }
10279 return 1;
10280 }
10281
10282 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10283 {
10284 double value2 = op2->__anon1.d;
10285
10286 exp->type = 2;
10287 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d < value2));
10288 if(!exp->expType)
10289 {
10290 exp->expType = op1->type;
10291 if(op1->type)
10292 op1->type->refCount++;
10293 }
10294 return 1;
10295 }
10296
10297 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10298 {
10299 int value2 = op2->__anon1.i;
10300
10301 exp->type = 2;
10302 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i >= value2));
10303 if(!exp->expType)
10304 {
10305 exp->expType = op1->type;
10306 if(op1->type)
10307 op1->type->refCount++;
10308 }
10309 return 1;
10310 }
10311
10312 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10313 {
10314 unsigned int value2 = op2->__anon1.ui;
10315
10316 exp->type = 2;
10317 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui >= value2));
10318 if(!exp->expType)
10319 {
10320 exp->expType = op1->type;
10321 if(op1->type)
10322 op1->type->refCount++;
10323 }
10324 return 1;
10325 }
10326
10327 static unsigned int Int64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10328 {
10329 long long value2 = op2->__anon1.i64;
10330
10331 exp->type = 2;
10332 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 >= value2));
10333 if(!exp->expType)
10334 {
10335 exp->expType = op1->type;
10336 if(op1->type)
10337 op1->type->refCount++;
10338 }
10339 return 1;
10340 }
10341
10342 static unsigned int UInt64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10343 {
10344 uint64 value2 = op2->__anon1.ui64;
10345
10346 exp->type = 2;
10347 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 >= value2));
10348 if(!exp->expType)
10349 {
10350 exp->expType = op1->type;
10351 if(op1->type)
10352 op1->type->refCount++;
10353 }
10354 return 1;
10355 }
10356
10357 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10358 {
10359 short value2 = op2->__anon1.s;
10360
10361 exp->type = 2;
10362 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s >= value2));
10363 if(!exp->expType)
10364 {
10365 exp->expType = op1->type;
10366 if(op1->type)
10367 op1->type->refCount++;
10368 }
10369 return 1;
10370 }
10371
10372 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10373 {
10374 unsigned short value2 = op2->__anon1.us;
10375
10376 exp->type = 2;
10377 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us >= value2));
10378 if(!exp->expType)
10379 {
10380 exp->expType = op1->type;
10381 if(op1->type)
10382 op1->type->refCount++;
10383 }
10384 return 1;
10385 }
10386
10387 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10388 {
10389 char value2 = op2->__anon1.c;
10390
10391 exp->type = 2;
10392 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c >= value2));
10393 if(!exp->expType)
10394 {
10395 exp->expType = op1->type;
10396 if(op1->type)
10397 op1->type->refCount++;
10398 }
10399 return 1;
10400 }
10401
10402 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10403 {
10404 unsigned char value2 = op2->__anon1.uc;
10405
10406 exp->type = 2;
10407 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc >= value2));
10408 if(!exp->expType)
10409 {
10410 exp->expType = op1->type;
10411 if(op1->type)
10412 op1->type->refCount++;
10413 }
10414 return 1;
10415 }
10416
10417 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10418 {
10419 float value2 = op2->__anon1.f;
10420
10421 exp->type = 2;
10422 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f >= value2));
10423 if(!exp->expType)
10424 {
10425 exp->expType = op1->type;
10426 if(op1->type)
10427 op1->type->refCount++;
10428 }
10429 return 1;
10430 }
10431
10432 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10433 {
10434 double value2 = op2->__anon1.d;
10435
10436 exp->type = 2;
10437 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d >= value2));
10438 if(!exp->expType)
10439 {
10440 exp->expType = op1->type;
10441 if(op1->type)
10442 op1->type->refCount++;
10443 }
10444 return 1;
10445 }
10446
10447 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10448 {
10449 int value2 = op2->__anon1.i;
10450
10451 exp->type = 2;
10452 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i <= value2));
10453 if(!exp->expType)
10454 {
10455 exp->expType = op1->type;
10456 if(op1->type)
10457 op1->type->refCount++;
10458 }
10459 return 1;
10460 }
10461
10462 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10463 {
10464 unsigned int value2 = op2->__anon1.ui;
10465
10466 exp->type = 2;
10467 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui <= value2));
10468 if(!exp->expType)
10469 {
10470 exp->expType = op1->type;
10471 if(op1->type)
10472 op1->type->refCount++;
10473 }
10474 return 1;
10475 }
10476
10477 static unsigned int Int64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10478 {
10479 long long value2 = op2->__anon1.i64;
10480
10481 exp->type = 2;
10482 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 <= value2));
10483 if(!exp->expType)
10484 {
10485 exp->expType = op1->type;
10486 if(op1->type)
10487 op1->type->refCount++;
10488 }
10489 return 1;
10490 }
10491
10492 static unsigned int UInt64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10493 {
10494 uint64 value2 = op2->__anon1.ui64;
10495
10496 exp->type = 2;
10497 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 <= value2));
10498 if(!exp->expType)
10499 {
10500 exp->expType = op1->type;
10501 if(op1->type)
10502 op1->type->refCount++;
10503 }
10504 return 1;
10505 }
10506
10507 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10508 {
10509 short value2 = op2->__anon1.s;
10510
10511 exp->type = 2;
10512 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s <= value2));
10513 if(!exp->expType)
10514 {
10515 exp->expType = op1->type;
10516 if(op1->type)
10517 op1->type->refCount++;
10518 }
10519 return 1;
10520 }
10521
10522 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10523 {
10524 unsigned short value2 = op2->__anon1.us;
10525
10526 exp->type = 2;
10527 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us <= value2));
10528 if(!exp->expType)
10529 {
10530 exp->expType = op1->type;
10531 if(op1->type)
10532 op1->type->refCount++;
10533 }
10534 return 1;
10535 }
10536
10537 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10538 {
10539 char value2 = op2->__anon1.c;
10540
10541 exp->type = 2;
10542 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c <= value2));
10543 if(!exp->expType)
10544 {
10545 exp->expType = op1->type;
10546 if(op1->type)
10547 op1->type->refCount++;
10548 }
10549 return 1;
10550 }
10551
10552 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10553 {
10554 unsigned char value2 = op2->__anon1.uc;
10555
10556 exp->type = 2;
10557 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc <= value2));
10558 if(!exp->expType)
10559 {
10560 exp->expType = op1->type;
10561 if(op1->type)
10562 op1->type->refCount++;
10563 }
10564 return 1;
10565 }
10566
10567 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10568 {
10569 float value2 = op2->__anon1.f;
10570
10571 exp->type = 2;
10572 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f <= value2));
10573 if(!exp->expType)
10574 {
10575 exp->expType = op1->type;
10576 if(op1->type)
10577 op1->type->refCount++;
10578 }
10579 return 1;
10580 }
10581
10582 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10583 {
10584 double value2 = op2->__anon1.d;
10585
10586 exp->type = 2;
10587 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d <= value2));
10588 if(!exp->expType)
10589 {
10590 exp->expType = op1->type;
10591 if(op1->type)
10592 op1->type->refCount++;
10593 }
10594 return 1;
10595 }
10596
10597 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10598 {
10599 exp->type = 2;
10600 exp->__anon1.__anon2.string = PrintInt(op1->__anon1.i ? op2->__anon1.i : op3->__anon1.i);
10601 if(!exp->expType)
10602 {
10603 exp->expType = op1->type;
10604 if(op1->type)
10605 op1->type->refCount++;
10606 }
10607 return 1;
10608 }
10609
10610 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10611 {
10612 exp->type = 2;
10613 exp->__anon1.__anon2.string = PrintUInt(op1->__anon1.ui ? op2->__anon1.ui : op3->__anon1.ui);
10614 if(!exp->expType)
10615 {
10616 exp->expType = op1->type;
10617 if(op1->type)
10618 op1->type->refCount++;
10619 }
10620 return 1;
10621 }
10622
10623 static unsigned int Int64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10624 {
10625 exp->type = 2;
10626 exp->__anon1.__anon2.string = PrintInt64(op1->__anon1.i64 ? op2->__anon1.i64 : op3->__anon1.i64);
10627 if(!exp->expType)
10628 {
10629 exp->expType = op1->type;
10630 if(op1->type)
10631 op1->type->refCount++;
10632 }
10633 return 1;
10634 }
10635
10636 static unsigned int UInt64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10637 {
10638 exp->type = 2;
10639 exp->__anon1.__anon2.string = PrintUInt64(op1->__anon1.ui64 ? op2->__anon1.ui64 : op3->__anon1.ui64);
10640 if(!exp->expType)
10641 {
10642 exp->expType = op1->type;
10643 if(op1->type)
10644 op1->type->refCount++;
10645 }
10646 return 1;
10647 }
10648
10649 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10650 {
10651 exp->type = 2;
10652 exp->__anon1.__anon2.string = PrintShort(op1->__anon1.s ? op2->__anon1.s : op3->__anon1.s);
10653 if(!exp->expType)
10654 {
10655 exp->expType = op1->type;
10656 if(op1->type)
10657 op1->type->refCount++;
10658 }
10659 return 1;
10660 }
10661
10662 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10663 {
10664 exp->type = 2;
10665 exp->__anon1.__anon2.string = PrintUShort(op1->__anon1.us ? op2->__anon1.us : op3->__anon1.us);
10666 if(!exp->expType)
10667 {
10668 exp->expType = op1->type;
10669 if(op1->type)
10670 op1->type->refCount++;
10671 }
10672 return 1;
10673 }
10674
10675 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10676 {
10677 exp->type = 2;
10678 exp->__anon1.__anon2.string = PrintChar(op1->__anon1.c ? op2->__anon1.c : op3->__anon1.c);
10679 if(!exp->expType)
10680 {
10681 exp->expType = op1->type;
10682 if(op1->type)
10683 op1->type->refCount++;
10684 }
10685 return 1;
10686 }
10687
10688 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10689 {
10690 exp->type = 2;
10691 exp->__anon1.__anon2.string = PrintUChar(op1->__anon1.uc ? op2->__anon1.uc : op3->__anon1.uc);
10692 if(!exp->expType)
10693 {
10694 exp->expType = op1->type;
10695 if(op1->type)
10696 op1->type->refCount++;
10697 }
10698 return 1;
10699 }
10700
10701 struct OpTable intOps =
10702 {
10703 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
10704 };
10705
10706 struct OpTable uintOps =
10707 {
10708 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
10709 };
10710
10711 struct OpTable int64Ops =
10712 {
10713 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
10714 };
10715
10716 struct OpTable uint64Ops =
10717 {
10718 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
10719 };
10720
10721 struct OpTable shortOps =
10722 {
10723 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
10724 };
10725
10726 struct OpTable ushortOps =
10727 {
10728 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
10729 };
10730
10731 struct OpTable floatOps =
10732 {
10733 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
10734 };
10735
10736 struct OpTable doubleOps =
10737 {
10738 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
10739 };
10740
10741 struct OpTable charOps =
10742 {
10743 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
10744 };
10745
10746 struct OpTable ucharOps =
10747 {
10748 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
10749 };
10750
10751 void ReadString(char * output, char * string)
10752 {
10753 int len = strlen(string);
10754 int c, d = 0;
10755 unsigned int quoted = 0, escaped = 0;
10756
10757 for(c = 0; c < len; c++)
10758 {
10759 char ch = string[c];
10760
10761 if(escaped)
10762 {
10763 switch(ch)
10764 {
10765 case 'n':
10766 output[d] = '\n';
10767 break;
10768 case 't':
10769 output[d] = '\t';
10770 break;
10771 case 'a':
10772 output[d] = '\a';
10773 break;
10774 case 'b':
10775 output[d] = '\b';
10776 break;
10777 case 'f':
10778 output[d] = '\f';
10779 break;
10780 case 'r':
10781 output[d] = '\r';
10782 break;
10783 case 'v':
10784 output[d] = '\v';
10785 break;
10786 case '\\':
10787 output[d] = '\\';
10788 break;
10789 case '\"':
10790 output[d] = '\"';
10791 break;
10792 case '\'':
10793 output[d] = '\'';
10794 break;
10795 default:
10796 output[d] = ch;
10797 }
10798 d++;
10799 escaped = 0;
10800 }
10801 else
10802 {
10803 if(ch == '\"')
10804 quoted ^= 1;
10805 else if(quoted)
10806 {
10807 if(ch == '\\')
10808 escaped = 1;
10809 else
10810 output[d++] = ch;
10811 }
10812 }
10813 }
10814 output[d] = '\0';
10815 }
10816
10817 int UnescapeString(char * d, char * s, int len)
10818 {
10819 int j = 0, k = 0;
10820 char ch;
10821
10822 while(j < len && (ch = s[j]))
10823 {
10824 switch(ch)
10825 {
10826 case '\\':
10827 switch((ch = s[++j]))
10828 {
10829 case 'n':
10830 d[k] = '\n';
10831 break;
10832 case 't':
10833 d[k] = '\t';
10834 break;
10835 case 'a':
10836 d[k] = '\a';
10837 break;
10838 case 'b':
10839 d[k] = '\b';
10840 break;
10841 case 'f':
10842 d[k] = '\f';
10843 break;
10844 case 'r':
10845 d[k] = '\r';
10846 break;
10847 case 'v':
10848 d[k] = '\v';
10849 break;
10850 case '\\':
10851 d[k] = '\\';
10852 break;
10853 case '\"':
10854 d[k] = '\"';
10855 break;
10856 case '\'':
10857 d[k] = '\'';
10858 break;
10859 default:
10860 d[k] = '\\';
10861 d[k] = ch;
10862 }
10863 break;
10864 default:
10865 d[k] = ch;
10866 }
10867 j++, k++;
10868 }
10869 d[k] = '\0';
10870 return k;
10871 }
10872
10873 char * OffsetEscapedString(char * s, int len, int offset)
10874 {
10875 char ch;
10876 int j = 0, k = 0;
10877
10878 while(j < len && k < offset && (ch = s[j]))
10879 {
10880 if(ch == '\\')
10881 ++j;
10882 j++, k++;
10883 }
10884 return (k == offset) ? s + j : (((void *)0));
10885 }
10886
10887 extern long long __ecereNameSpace__ecere__com___strtoi64(const char *  string, const char * *  endString, int base);
10888
10889 extern uint64 __ecereNameSpace__ecere__com___strtoui64(const char *  string, const char * *  endString, int base);
10890
10891 extern double strtod(const char * , char * * );
10892
10893 extern float (* __ecereMethod_float_inf)(void);
10894
10895 extern float (* __ecereMethod_float_nan)(void);
10896
10897 extern double (* __ecereMethod_double_inf)(void);
10898
10899 extern double (* __ecereMethod_double_nan)(void);
10900
10901 struct Operand GetOperand(struct Expression * exp)
10902 {
10903 struct Operand op =
10904 {
10905 0, 0, 0,
10906 .__anon1 = {
10907 .c = 0
10908 },
10909 {
10910 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10911 }
10912 };
10913 struct Type * type = exp->expType;
10914
10915 if(type)
10916 {
10917 while(type->kind == 8 && type->__anon1._class->__anon1.registered && (type->__anon1._class->__anon1.registered->type == 2 || type->__anon1._class->__anon1.registered->type == 3 || type->__anon1._class->__anon1.registered->type == 4))
10918 {
10919 if(!type->__anon1._class->__anon1.registered->dataType)
10920 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
10921 type = type->__anon1._class->__anon1.registered->dataType;
10922 }
10923 if(exp->type == 3 && op.kind == 13)
10924 {
10925 op.__anon1.ui64 = (uint64)exp->__anon1.__anon2.string;
10926 op.kind = 13;
10927 op.ops = uint64Ops;
10928 }
10929 else if(exp->isConstant && exp->type == 2)
10930 {
10931 op.kind = type->kind;
10932 op.type = type;
10933 switch(op.kind)
10934 {
10935 case 24:
10936 case 1:
10937 {
10938 if(exp->__anon1.__anon1.constant[0] == '\'')
10939 {
10940 op.__anon1.c = exp->__anon1.__anon1.constant[1];
10941 op.ops = charOps;
10942 }
10943 else if(type->isSigned)
10944 {
10945 op.__anon1.c = (char)strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10946 op.ops = charOps;
10947 }
10948 else
10949 {
10950 op.__anon1.uc = (unsigned char)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10951 op.ops = ucharOps;
10952 }
10953 break;
10954 }
10955 case 2:
10956 if(type->isSigned)
10957 {
10958 op.__anon1.s = (short)strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10959 op.ops = shortOps;
10960 }
10961 else
10962 {
10963 op.__anon1.us = (unsigned short)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10964 op.ops = ushortOps;
10965 }
10966 break;
10967 case 3:
10968 case 5:
10969 if(type->isSigned)
10970 {
10971 op.__anon1.i = strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10972 op.ops = intOps;
10973 }
10974 else
10975 {
10976 op.__anon1.ui = strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10977 op.ops = uintOps;
10978 }
10979 op.kind = 3;
10980 break;
10981 case 4:
10982 if(type->isSigned)
10983 {
10984 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10985 op.ops = int64Ops;
10986 }
10987 else
10988 {
10989 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10990 op.ops = uint64Ops;
10991 }
10992 op.kind = 4;
10993 break;
10994 case 22:
10995 if(type->isSigned)
10996 {
10997 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
10998 op.ops = int64Ops;
10999 }
11000 else
11001 {
11002 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11003 op.ops = uint64Ops;
11004 }
11005 op.kind = 4;
11006 break;
11007 case 23:
11008 if(type->isSigned)
11009 {
11010 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11011 op.ops = int64Ops;
11012 }
11013 else
11014 {
11015 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11016 op.ops = uint64Ops;
11017 }
11018 op.kind = 4;
11019 break;
11020 case 6:
11021 if(!strcmp(exp->__anon1.__anon1.constant, "inf"))
11022 op.__anon1.f = __ecereMethod_float_inf();
11023 else if(!strcmp(exp->__anon1.__anon1.constant, "-inf"))
11024 op.__anon1.f = -__ecereMethod_float_inf();
11025 else if(!strcmp(exp->__anon1.__anon1.constant, "nan"))
11026 op.__anon1.f = __ecereMethod_float_nan();
11027 else if(!strcmp(exp->__anon1.__anon1.constant, "-nan"))
11028 op.__anon1.f = -__ecereMethod_float_nan();
11029 else
11030 op.__anon1.f = (float)strtod(exp->__anon1.__anon1.constant, (((void *)0)));
11031 op.ops = floatOps;
11032 break;
11033 case 7:
11034 if(!strcmp(exp->__anon1.__anon1.constant, "inf"))
11035 op.__anon1.d = __ecereMethod_double_inf();
11036 else if(!strcmp(exp->__anon1.__anon1.constant, "-inf"))
11037 op.__anon1.d = -__ecereMethod_double_inf();
11038 else if(!strcmp(exp->__anon1.__anon1.constant, "nan"))
11039 op.__anon1.d = __ecereMethod_double_nan();
11040 else if(!strcmp(exp->__anon1.__anon1.constant, "-nan"))
11041 op.__anon1.d = -__ecereMethod_double_nan();
11042 else
11043 op.__anon1.d = (double)strtod(exp->__anon1.__anon1.constant, (((void *)0)));
11044 op.ops = doubleOps;
11045 break;
11046 case 12:
11047 case 13:
11048 case 8:
11049 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
11050 op.kind = 13;
11051 op.ops = uint64Ops;
11052 break;
11053 }
11054 }
11055 }
11056 return op;
11057 }
11058
11059 static long long GetEnumValue(struct __ecereNameSpace__ecere__com__Class * _class, void * ptr)
11060 {
11061 long long v = 0;
11062
11063 switch(_class->typeSize)
11064 {
11065 case 8:
11066 if(!strcmp(_class->dataTypeString, "uint64"))
11067 v = (long long)*(uint64 *)ptr;
11068 else
11069 v = *(long long *)ptr;
11070 break;
11071 case 4:
11072 if(!strcmp(_class->dataTypeString, "uint"))
11073 v = (long long)*(unsigned int *)ptr;
11074 else
11075 v = (long long)*(int *)ptr;
11076 break;
11077 case 2:
11078 if(!strcmp(_class->dataTypeString, "uint16"))
11079 v = (long long)*(unsigned short *)ptr;
11080 else
11081 v = (long long)*(short *)ptr;
11082 break;
11083 case 1:
11084 if(!strcmp(_class->dataTypeString, "byte"))
11085 v = (long long)*(unsigned char *)ptr;
11086 else
11087 v = (long long)*(char *)ptr;
11088 break;
11089 }
11090 return v;
11091 }
11092
11093 int __ecereVMethodID_class_OnGetString;
11094
11095 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
11096
11097 static __attribute__((unused)) void UnusedFunction()
11098 {
11099 int a;
11100
11101 ((const char *  (*)(struct __ecereNameSpace__ecere__com__Class *, const void *, char *  tempString, void *  fieldData, unsigned int *  needClass))__ecereClass_int->_vTbl[__ecereVMethodID_class_OnGetString])(__ecereClass_int, &a, 0, 0, 0);
11102 }
11103
11104 extern int __ecereVMethodID_class_OnGetString;
11105
11106 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
11107 {
11108 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
11109
11110 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
11111 {
11112 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
11113 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
11114 else
11115 {
11116 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11117 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
11118 struct Type * type;
11119 void * ptr = inst->data + dataMember->offset + offset;
11120 char * result = (((void *)0));
11121
11122 exp->loc = member->loc = inst->loc;
11123 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
11124 if(!dataMember->dataType)
11125 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
11126 type = dataMember->dataType;
11127 if(type->kind == 8)
11128 {
11129 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11130
11131 if(_class->type == 4)
11132 {
11133 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11134
11135 if(enumClass)
11136 {
11137 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
11138 struct __ecereNameSpace__ecere__sys__NamedLink64 * item;
11139
11140 for(item = e->values.first; item; item = item->next)
11141 {
11142 if(item->data == GetEnumValue(_class, ptr))
11143 {
11144 result = item->name;
11145 break;
11146 }
11147 }
11148 if(result)
11149 {
11150 exp->__anon1.__anon1.identifier = MkIdentifier(result);
11151 exp->type = 0;
11152 exp->destType = MkClassType(_class->fullName);
11153 ProcessExpressionType(exp);
11154 }
11155 }
11156 }
11157 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
11158 {
11159 if(!_class->dataType)
11160 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11161 type = _class->dataType;
11162 }
11163 }
11164 if(!result)
11165 {
11166 switch(type->kind)
11167 {
11168 case 6:
11169 {
11170 FreeExpContents(exp);
11171 exp->__anon1.__anon1.constant = PrintFloat(*(float *)ptr);
11172 exp->type = 2;
11173 break;
11174 }
11175 case 7:
11176 {
11177 FreeExpContents(exp);
11178 exp->__anon1.__anon1.constant = PrintDouble(*(double *)ptr);
11179 exp->type = 2;
11180 break;
11181 }
11182 case 3:
11183 {
11184 FreeExpContents(exp);
11185 exp->__anon1.__anon1.constant = PrintInt(*(int *)ptr);
11186 exp->type = 2;
11187 break;
11188 }
11189 case 4:
11190 {
11191 FreeExpContents(exp);
11192 exp->__anon1.__anon1.constant = PrintInt64(*(long long *)ptr);
11193 exp->type = 2;
11194 break;
11195 }
11196 case 22:
11197 {
11198 FreeExpContents(exp);
11199 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
11200 exp->type = 2;
11201 break;
11202 }
11203 case 23:
11204 {
11205 FreeExpContents(exp);
11206 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
11207 exp->type = 2;
11208 break;
11209 }
11210 default:
11211 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
11212 }
11213 }
11214 ListAdd(memberList, member);
11215 }
11216 if(parentDataMember->type == 1)
11217 break;
11218 }
11219 }
11220
11221 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
11222
11223 void PopulateInstance(struct Instantiation * inst)
11224 {
11225 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
11226 struct __ecereNameSpace__ecere__com__Class * _class = classSym->__anon1.registered;
11227 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
11228 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
11229
11230 if(!inst->members)
11231 inst->members = MkListOne(MkMembersInitList(memberList));
11232 else
11233 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
11234 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
11235 {
11236 if(!dataMember->isProperty)
11237 {
11238 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
11239 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
11240 else
11241 {
11242 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11243 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
11244 struct Type * type;
11245 void * ptr = inst->data + dataMember->offset;
11246 char * result = (((void *)0));
11247
11248 exp->loc = member->loc = inst->loc;
11249 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
11250 if(!dataMember->dataType)
11251 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
11252 type = dataMember->dataType;
11253 if(type->kind == 8)
11254 {
11255 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11256
11257 if(_class->type == 4)
11258 {
11259 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11260
11261 if(enumClass)
11262 {
11263 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
11264 struct __ecereNameSpace__ecere__sys__NamedLink64 * item;
11265
11266 for(item = e->values.first; item; item = item->next)
11267 {
11268 if(item->data == GetEnumValue(_class, ptr))
11269 {
11270 result = item->name;
11271 break;
11272 }
11273 }
11274 }
11275 if(result)
11276 {
11277 exp->__anon1.__anon1.identifier = MkIdentifier(result);
11278 exp->type = 0;
11279 exp->destType = MkClassType(_class->fullName);
11280 ProcessExpressionType(exp);
11281 }
11282 }
11283 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
11284 {
11285 if(!_class->dataType)
11286 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11287 type = _class->dataType;
11288 }
11289 }
11290 if(!result)
11291 {
11292 switch(type->kind)
11293 {
11294 case 6:
11295 {
11296 exp->__anon1.__anon1.constant = PrintFloat(*(float *)ptr);
11297 exp->type = 2;
11298 break;
11299 }
11300 case 7:
11301 {
11302 exp->__anon1.__anon1.constant = PrintDouble(*(double *)ptr);
11303 exp->type = 2;
11304 break;
11305 }
11306 case 3:
11307 {
11308 exp->__anon1.__anon1.constant = PrintInt(*(int *)ptr);
11309 exp->type = 2;
11310 break;
11311 }
11312 case 4:
11313 {
11314 exp->__anon1.__anon1.constant = PrintInt64(*(long long *)ptr);
11315 exp->type = 2;
11316 break;
11317 }
11318 case 22:
11319 {
11320 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
11321 exp->type = 2;
11322 break;
11323 }
11324 default:
11325 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
11326 }
11327 }
11328 ListAdd(memberList, member);
11329 }
11330 }
11331 }
11332 }
11333
11334 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, unsigned int *  offset, struct __ecereNameSpace__ecere__com__Instance * module, struct __ecereNameSpace__ecere__com__DataMember **  subMemberStack, int *  subMemberStackPos);
11335
11336 extern void FreeInstance(struct Instantiation * inst);
11337
11338 void ComputeInstantiation(struct Expression * exp)
11339 {
11340 struct Instantiation * inst = exp->__anon1.instance;
11341 struct MembersInit * members;
11342 struct Symbol * classSym = inst->_class ? inst->_class->__anon1.__anon1.symbol : (((void *)0));
11343 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->__anon1.registered : (((void *)0));
11344 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
11345 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
11346 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
11347 int subMemberStackPos = 0;
11348 uint64 bits = 0;
11349
11350 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11351 {
11352 if(inst->data)
11353 return ;
11354 if(_class->type == 0 || _class->type == 5)
11355 {
11356 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
11357 if(_class->type == 0)
11358 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)inst->data))->_refCount++;
11359 }
11360 else
11361 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11362 }
11363 if(inst->members)
11364 {
11365 for(members = (*inst->members).first; members; members = members->next)
11366 {
11367 switch(members->type)
11368 {
11369 case 0:
11370 {
11371 if(members->__anon1.dataMembers)
11372 {
11373 struct MemberInit * member;
11374
11375 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
11376 {
11377 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
11378 unsigned int found = 0;
11379 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11380 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
11381 unsigned int dataMemberOffset;
11382
11383 if(!ident)
11384 {
11385 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
11386 if(curMember)
11387 {
11388 if(curMember->isProperty)
11389 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
11390 else
11391 {
11392 dataMember = curMember;
11393 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11394 if(_class->type == 0)
11395 dataMemberOffset += _class->base->structSize;
11396 }
11397 found = 1;
11398 }
11399 }
11400 else
11401 {
11402 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
11403 if(prop)
11404 {
11405 found = 1;
11406 if(prop->memberAccess == 1)
11407 {
11408 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
11409 curClass = prop->_class;
11410 }
11411 }
11412 else
11413 {
11414 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
11415 int _subMemberStackPos = 0;
11416
11417 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
11418 if(dataMember)
11419 {
11420 found = 1;
11421 if(dataMember->memberAccess == 1)
11422 {
11423 curMember = dataMember;
11424 curClass = dataMember->_class;
11425 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
11426 subMemberStackPos = _subMemberStackPos;
11427 }
11428 }
11429 }
11430 }
11431 if(found && member->initializer && member->initializer->type == 0)
11432 {
11433 struct Expression * value = member->initializer->__anon1.exp;
11434 struct Type * type = (((void *)0));
11435 unsigned int deepMember = 0;
11436
11437 if(prop)
11438 {
11439 type = prop->dataType;
11440 }
11441 else if(dataMember)
11442 {
11443 if(!dataMember->dataType)
11444 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
11445 type = dataMember->dataType;
11446 }
11447 if(ident && ident->next)
11448 {
11449 deepMember = 1;
11450 for(ident = ident->next; ident && type; ident = ident->next)
11451 {
11452 if(type->kind == 8)
11453 {
11454 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->__anon1._class->__anon1.registered, ident->string, privateModule);
11455 if(prop)
11456 type = prop->dataType;
11457 else
11458 {
11459 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->__anon1._class->__anon1.registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11460 if(dataMember)
11461 type = dataMember->dataType;
11462 }
11463 }
11464 else if(type->kind == 9 || type->kind == 10)
11465 {
11466 struct Type * memberType;
11467
11468 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
11469 {
11470 if(!strcmp(memberType->name, ident->string))
11471 {
11472 type = memberType;
11473 break;
11474 }
11475 }
11476 }
11477 }
11478 }
11479 if(value)
11480 {
11481 FreeType(value->destType);
11482 value->destType = type;
11483 if(type)
11484 type->refCount++;
11485 ComputeExpression(value);
11486 }
11487 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11488 {
11489 if(type->kind == 8)
11490 {
11491 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11492
11493 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
11494 {
11495 if(!_class->dataType)
11496 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11497 type = _class->dataType;
11498 }
11499 }
11500 if(dataMember)
11501 {
11502 void * ptr = inst->data + dataMemberOffset;
11503
11504 if(value->type == 2)
11505 {
11506 switch(type->kind)
11507 {
11508 case 3:
11509 {
11510 GetInt(value, (int *)ptr);
11511 break;
11512 }
11513 case 4:
11514 {
11515 GetInt64(value, (long long *)ptr);
11516 break;
11517 }
11518 case 22:
11519 {
11520 GetIntPtr(value, (intptr_t *)ptr);
11521 break;
11522 }
11523 case 23:
11524 {
11525 GetIntSize(value, (ssize_t *)ptr);
11526 break;
11527 }
11528 case 6:
11529 {
11530 GetFloat(value, (float *)ptr);
11531 break;
11532 }
11533 case 7:
11534 {
11535 GetDouble(value, (double *)ptr);
11536 break;
11537 }
11538 }
11539 }
11540 else if(value->type == 1)
11541 {
11542 if(type->kind == 8)
11543 {
11544 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11545
11546 if(_class->type == 1)
11547 {
11548 ComputeTypeSize(type);
11549 if(value->__anon1.instance->data)
11550 memcpy(ptr, value->__anon1.instance->data, type->size);
11551 }
11552 }
11553 }
11554 }
11555 else if(prop)
11556 {
11557 if(value->type == 1 && value->__anon1.instance->data)
11558 {
11559 if(type->kind == 8)
11560 {
11561 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11562
11563 if(_class && (_class->type != 0 || __ecereNameSpace__ecere__com__eClass_IsDerived(((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)value->__anon1.instance->data))->_class, _class)))
11564 {
11565 void (* Set)(void *, void *) = (void *)prop->Set;
11566
11567 Set(inst->data, value->__anon1.instance->data);
11568 PopulateInstance(inst);
11569 }
11570 }
11571 }
11572 else if(value->type == 2)
11573 {
11574 switch(type->kind)
11575 {
11576 case 7:
11577 {
11578 void (* Set)(void *, double) = (void *)prop->Set;
11579
11580 Set(inst->data, strtod(value->__anon1.__anon1.constant, (((void *)0))));
11581 break;
11582 }
11583 case 6:
11584 {
11585 void (* Set)(void *, float) = (void *)prop->Set;
11586
11587 Set(inst->data, (float)(strtod(value->__anon1.__anon1.constant, (((void *)0)))));
11588 break;
11589 }
11590 case 3:
11591 {
11592 void (* Set)(void *, int) = (void *)prop->Set;
11593
11594 Set(inst->data, strtol(value->__anon1.__anon1.constant, (((void *)0)), 0));
11595 break;
11596 }
11597 case 4:
11598 {
11599 void (* Set)(void *, long long) = (void *)prop->Set;
11600
11601 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11602 break;
11603 }
11604 case 22:
11605 {
11606 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11607
11608 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11609 break;
11610 }
11611 case 23:
11612 {
11613 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11614
11615 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11616 break;
11617 }
11618 }
11619 }
11620 else if(value->type == 3)
11621 {
11622 char temp[1024];
11623
11624 ReadString(temp, value->__anon1.__anon2.string);
11625 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
11626 }
11627 }
11628 }
11629 else if(!deepMember && type && _class->type == 3)
11630 {
11631 if(prop)
11632 {
11633 if(value->type == 2)
11634 {
11635 if(type->kind == 8)
11636 {
11637 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11638
11639 if(_class->type == 3)
11640 {
11641 if(!_class->dataType)
11642 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11643 type = _class->dataType;
11644 }
11645 }
11646 switch(type->kind)
11647 {
11648 case 6:
11649 {
11650 float fValue;
11651 float (* Set)(float) = (void *)prop->Set;
11652
11653 GetFloat(member->initializer->__anon1.exp, &fValue);
11654 exp->__anon1.__anon1.constant = PrintFloat(Set(fValue));
11655 exp->type = 2;
11656 break;
11657 }
11658 case 7:
11659 {
11660 double dValue;
11661 double (* Set)(double) = (void *)prop->Set;
11662
11663 GetDouble(member->initializer->__anon1.exp, &dValue);
11664 exp->__anon1.__anon1.constant = PrintDouble(Set(dValue));
11665 exp->type = 2;
11666 break;
11667 }
11668 }
11669 }
11670 }
11671 }
11672 else if(!deepMember && type && _class->type == 2)
11673 {
11674 if(prop)
11675 {
11676 if(value->type == 1 && value->__anon1.instance->data)
11677 {
11678 unsigned int (* Set)(void *) = (void *)prop->Set;
11679
11680 bits = Set(value->__anon1.instance->data);
11681 }
11682 else if(value->type == 2)
11683 {
11684 }
11685 }
11686 else if(dataMember)
11687 {
11688 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
11689 struct Type * type;
11690 uint64 part = 0;
11691
11692 bits = (bits & ~bitMember->mask);
11693 if(!bitMember->dataType)
11694 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0);
11695 type = bitMember->dataType;
11696 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
11697 {
11698 if(!type->__anon1._class->__anon1.registered->dataType)
11699 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
11700 type = type->__anon1._class->__anon1.registered->dataType;
11701 }
11702 switch(type->kind)
11703 {
11704 case 24:
11705 case 1:
11706 {
11707 unsigned char v;
11708
11709 type->isSigned ? GetChar(value, (char *)&v) : GetUChar(value, &v);
11710 part = (uint64)v;
11711 break;
11712 }
11713 case 2:
11714 {
11715 unsigned short v;
11716
11717 type->isSigned ? GetShort(value, (short *)&v) : GetUShort(value, &v);
11718 part = (uint64)v;
11719 break;
11720 }
11721 case 3:
11722 case 5:
11723 {
11724 unsigned int v;
11725
11726 type->isSigned ? GetInt(value, (int *)&v) : GetUInt(value, &v);
11727 part = (uint64)v;
11728 break;
11729 }
11730 case 4:
11731 {
11732 uint64 v;
11733
11734 type->isSigned ? GetInt64(value, (long long *)&v) : GetUInt64(value, &v);
11735 part = v;
11736 break;
11737 }
11738 case 22:
11739 {
11740 uintptr_t v;
11741
11742 type->isSigned ? GetIntPtr(value, (intptr_t *)&v) : GetUIntPtr(value, &v);
11743 part = (uint64)v;
11744 break;
11745 }
11746 case 23:
11747 {
11748 size_t v;
11749
11750 type->isSigned ? GetIntSize(value, (ssize_t *)&v) : GetUIntSize(value, &v);
11751 part = (uint64)v;
11752 break;
11753 }
11754 }
11755 bits |= part << bitMember->pos;
11756 }
11757 }
11758 }
11759 else
11760 {
11761 if(_class && _class->type == 3)
11762 {
11763 ComputeExpression(member->initializer->__anon1.exp);
11764 exp->__anon1.__anon1.constant = member->initializer->__anon1.exp->__anon1.__anon1.constant;
11765 exp->type = 2;
11766 member->initializer->__anon1.exp->__anon1.__anon1.constant = (((void *)0));
11767 }
11768 }
11769 }
11770 }
11771 break;
11772 }
11773 }
11774 }
11775 }
11776 if(_class && _class->type == 2)
11777 {
11778 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
11779 exp->type = 2;
11780 }
11781 if(exp->type != 1)
11782 {
11783 FreeInstance(inst);
11784 }
11785 }
11786
11787 static unsigned int Promote(struct Operand * op, int kind, unsigned int isSigned)
11788 {
11789 unsigned int result = 0;
11790
11791 switch(kind)
11792 {
11793 case 2:
11794 if(op->kind == 1 || op->kind == 15 || op->kind == 24)
11795 result = isSigned ? GetOpShort(op, &op->__anon1.s) : GetOpUShort(op, &op->__anon1.us);
11796 break;
11797 case 3:
11798 case 5:
11799 if(op->kind == 1 || op->kind == 2 || op->kind == 15 || op->kind == 24)
11800 result = isSigned ? GetOpInt(op, &op->__anon1.i) : GetOpUInt(op, &op->__anon1.ui);
11801 break;
11802 case 4:
11803 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 4 || op->kind == 5 || op->kind == 6 || op->kind == 7 || op->kind == 13 || op->kind == 15 || op->kind == 22 || op->kind == 23 || op->kind == 24)
11804 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
11805 break;
11806 case 6:
11807 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 4 || op->kind == 5 || op->kind == 15 || op->kind == 22 || op->kind == 23 || op->kind == 24)
11808 result = GetOpFloat(op, &op->__anon1.f);
11809 break;
11810 case 7:
11811 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 4 || op->kind == 5 || op->kind == 6 || op->kind == 15 || op->kind == 22 || op->kind == 23 || op->kind == 24)
11812 result = GetOpDouble(op, &op->__anon1.d);
11813 break;
11814 case 13:
11815 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 4 || op->kind == 5 || op->kind == 6 || op->kind == 7 || op->kind == 13 || op->kind == 15 || op->kind == 22 || op->kind == 23 || op->kind == 24)
11816 result = GetOpUInt64(op, &op->__anon1.ui64);
11817 break;
11818 case 15:
11819 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 4 || op->kind == 5 || op->kind == 6 || op->kind == 7 || op->kind == 13 || op->kind == 15 || op->kind == 22 || op->kind == 23 || op->kind == 24)
11820 result = isSigned ? GetOpInt(op, &op->__anon1.i) : GetOpUInt(op, &op->__anon1.ui);
11821 break;
11822 case 22:
11823 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11824 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
11825 break;
11826 case 23:
11827 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11828 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
11829 break;
11830 }
11831 return result;
11832 }
11833
11834 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
11835 {
11836 if(exp->__anon1.op.op == SIZEOF)
11837 {
11838 FreeExpContents(exp);
11839 exp->type = 2;
11840 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(op1->type));
11841 }
11842 else
11843 {
11844 if(!exp->__anon1.op.exp1)
11845 {
11846 switch(exp->__anon1.op.op)
11847 {
11848 case '+':
11849 {
11850 struct Expression * exp2 = exp->__anon1.op.exp2;
11851
11852 exp->__anon1.op.exp2 = (((void *)0));
11853 FreeExpContents(exp);
11854 FreeType(exp->expType);
11855 FreeType(exp->destType);
11856 *exp = *exp2;
11857 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
11858 break;
11859 }
11860 case '-':
11861 if(op1->ops.Neg)
11862 {
11863 FreeExpContents(exp);
11864 op1->ops.Neg(exp, op1);
11865 }
11866 break;
11867 case '~':
11868 if(op1->ops.BitNot)
11869 {
11870 FreeExpContents(exp);
11871 op1->ops.BitNot(exp, op1);
11872 }
11873 break;
11874 case '!':
11875 if(op1->ops.Not)
11876 {
11877 FreeExpContents(exp);
11878 op1->ops.Not(exp, op1);
11879 }
11880 break;
11881 }
11882 }
11883 else
11884 {
11885 if(op1 && op2 && op1->type && op2->type && op1->kind != op2->kind)
11886 {
11887 if(Promote(op2, op1->kind, op1->type->isSigned))
11888 op2->kind = op1->kind, op2->ops = op1->ops;
11889 else if(Promote(op1, op2->kind, op2->type->isSigned))
11890 op1->kind = op2->kind, op1->ops = op2->ops;
11891 }
11892 switch(exp->__anon1.op.op)
11893 {
11894 case '+':
11895 if(op1->ops.Add)
11896 {
11897 FreeExpContents(exp);
11898 op1->ops.Add(exp, op1, op2);
11899 }
11900 break;
11901 case '-':
11902 if(op1->ops.Sub)
11903 {
11904 FreeExpContents(exp);
11905 op1->ops.Sub(exp, op1, op2);
11906 }
11907 break;
11908 case '*':
11909 if(op1->ops.Mul)
11910 {
11911 FreeExpContents(exp);
11912 op1->ops.Mul(exp, op1, op2);
11913 }
11914 break;
11915 case '/':
11916 if(op1->ops.Div)
11917 {
11918 FreeExpContents(exp);
11919 op1->ops.Div(exp, op1, op2);
11920 }
11921 break;
11922 case '%':
11923 if(op1->ops.Mod)
11924 {
11925 FreeExpContents(exp);
11926 op1->ops.Mod(exp, op1, op2);
11927 }
11928 break;
11929 case '&':
11930 if(exp->__anon1.op.exp2)
11931 {
11932 if(op1->ops.BitAnd)
11933 {
11934 FreeExpContents(exp);
11935 op1->ops.BitAnd(exp, op1, op2);
11936 }
11937 }
11938 break;
11939 case '|':
11940 if(op1->ops.BitOr)
11941 {
11942 FreeExpContents(exp);
11943 op1->ops.BitOr(exp, op1, op2);
11944 }
11945 break;
11946 case '^':
11947 if(op1->ops.BitXor)
11948 {
11949 FreeExpContents(exp);
11950 op1->ops.BitXor(exp, op1, op2);
11951 }
11952 break;
11953 case LEFT_OP:
11954 if(op1->ops.LShift)
11955 {
11956 FreeExpContents(exp);
11957 op1->ops.LShift(exp, op1, op2);
11958 }
11959 break;
11960 case RIGHT_OP:
11961 if(op1->ops.RShift)
11962 {
11963 FreeExpContents(exp);
11964 op1->ops.RShift(exp, op1, op2);
11965 }
11966 break;
11967 case EQ_OP:
11968 if(op1->ops.Equ)
11969 {
11970 FreeExpContents(exp);
11971 op1->ops.Equ(exp, op1, op2);
11972 }
11973 break;
11974 case NE_OP:
11975 if(op1->ops.Nqu)
11976 {
11977 FreeExpContents(exp);
11978 op1->ops.Nqu(exp, op1, op2);
11979 }
11980 break;
11981 case AND_OP:
11982 if(op1->ops.And)
11983 {
11984 FreeExpContents(exp);
11985 op1->ops.And(exp, op1, op2);
11986 }
11987 break;
11988 case OR_OP:
11989 if(op1->ops.Or)
11990 {
11991 FreeExpContents(exp);
11992 op1->ops.Or(exp, op1, op2);
11993 }
11994 break;
11995 case '>':
11996 if(op1->ops.Grt)
11997 {
11998 FreeExpContents(exp);
11999 op1->ops.Grt(exp, op1, op2);
12000 }
12001 break;
12002 case '<':
12003 if(op1->ops.Sma)
12004 {
12005 FreeExpContents(exp);
12006 op1->ops.Sma(exp, op1, op2);
12007 }
12008 break;
12009 case GE_OP:
12010 if(op1->ops.GrtEqu)
12011 {
12012 FreeExpContents(exp);
12013 op1->ops.GrtEqu(exp, op1, op2);
12014 }
12015 break;
12016 case LE_OP:
12017 if(op1->ops.SmaEqu)
12018 {
12019 FreeExpContents(exp);
12020 op1->ops.SmaEqu(exp, op1, op2);
12021 }
12022 break;
12023 }
12024 }
12025 }
12026 }
12027
12028 void PrintTypeNoConst(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
12029
12030 extern struct Expression * MkExpIdentifier(struct Identifier * id);
12031
12032 void ComputeExpression(struct Expression * exp)
12033 {
12034 switch(exp->type)
12035 {
12036 case 1:
12037 {
12038 ComputeInstantiation(exp);
12039 break;
12040 }
12041 case 4:
12042 {
12043 struct Expression * exp1, * exp2 = (((void *)0));
12044 struct Operand op1 =
12045 {
12046 0, 0, 0,
12047 .__anon1 = {
12048 .c = 0
12049 },
12050 {
12051 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12052 }
12053 };
12054 struct Operand op2 =
12055 {
12056 0, 0, 0,
12057 .__anon1 = {
12058 .c = 0
12059 },
12060 {
12061 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12062 }
12063 };
12064
12065 if(exp->__anon1.op.exp2)
12066 {
12067 struct Expression * e = exp->__anon1.op.exp2;
12068
12069 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
12070 {
12071 if(e->type == 5 || e->type == 32 || e->type == 23)
12072 {
12073 if(e->type == 23)
12074 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
12075 else
12076 e = (*e->__anon1.list).last;
12077 }
12078 }
12079 if(exp->__anon1.op.op == 261 && e && e->expType)
12080 {
12081 if(e->type == 3 && e->__anon1.__anon2.string)
12082 {
12083 char * string = e->__anon1.__anon2.string;
12084 int len = strlen(string);
12085 char * tmp = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (len - 2 + 1));
12086
12087 len = UnescapeString(tmp, string + 1, len - 2);
12088 (__ecereNameSpace__ecere__com__eSystem_Delete(tmp), tmp = 0);
12089 FreeExpContents(exp);
12090 exp->type = 2;
12091 exp->__anon1.__anon1.constant = PrintUInt(len + 1);
12092 }
12093 else
12094 {
12095 struct Type * type = e->expType;
12096
12097 type->refCount++;
12098 FreeExpContents(exp);
12099 exp->type = 2;
12100 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(type));
12101 FreeType(type);
12102 }
12103 break;
12104 }
12105 else
12106 ComputeExpression(exp->__anon1.op.exp2);
12107 }
12108 if(exp->__anon1.op.exp1)
12109 {
12110 ComputeExpression(exp->__anon1.op.exp1);
12111 exp1 = exp->__anon1.op.exp1;
12112 exp2 = exp->__anon1.op.exp2;
12113 op1 = GetOperand(exp1);
12114 if(op1.type)
12115 op1.type->refCount++;
12116 if(exp2)
12117 {
12118 op2 = GetOperand(exp2);
12119 if(op2.type)
12120 op2.type->refCount++;
12121 }
12122 }
12123 else
12124 {
12125 exp1 = exp->__anon1.op.exp2;
12126 op1 = GetOperand(exp1);
12127 if(op1.type)
12128 op1.type->refCount++;
12129 }
12130 CallOperator(exp, exp1, exp2, &op1, &op2);
12131 if(op1.type)
12132 FreeType(op1.type);
12133 if(op2.type)
12134 FreeType(op2.type);
12135 break;
12136 }
12137 case 5:
12138 case 32:
12139 {
12140 struct Expression * e, * n;
12141
12142 for(e = (*exp->__anon1.list).first; e; e = n)
12143 {
12144 n = e->next;
12145 if(!n)
12146 {
12147 struct __ecereNameSpace__ecere__sys__OldList * list = exp->__anon1.list;
12148 struct Expression * prev = exp->prev;
12149 struct Expression * next = exp->next;
12150
12151 ComputeExpression(e);
12152 FreeType(exp->expType);
12153 FreeType(exp->destType);
12154 *exp = *e;
12155 exp->prev = prev;
12156 exp->next = next;
12157 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
12158 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
12159 }
12160 else
12161 {
12162 FreeExpression(e);
12163 }
12164 }
12165 break;
12166 }
12167 case 8:
12168 {
12169 struct Expression * memberExp = exp->__anon1.member.exp;
12170 struct Identifier * memberID = exp->__anon1.member.member;
12171 struct Type * type;
12172
12173 ComputeExpression(exp->__anon1.member.exp);
12174 type = exp->__anon1.member.exp->expType;
12175 if(type)
12176 {
12177 struct __ecereNameSpace__ecere__com__Class * _class = (exp->__anon1.member.member && exp->__anon1.member.member->classSym) ? exp->__anon1.member.member->classSym->__anon1.registered : (((type->kind == 8 || type->kind == 19) && type->__anon1._class) ? type->__anon1._class->__anon1.registered : (((void *)0)));
12178 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
12179 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
12180 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
12181
12182 if(type->kind == 19 && exp->__anon1.member.exp->type == 24)
12183 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
12184 if(!_class)
12185 {
12186 char string[256];
12187 struct Symbol * classSym;
12188
12189 string[0] = '\0';
12190 PrintTypeNoConst(type, string, 0, 1);
12191 classSym = FindClass(string);
12192 _class = classSym ? classSym->__anon1.registered : (((void *)0));
12193 }
12194 if(exp->__anon1.member.member)
12195 {
12196 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->__anon1.member.member->string, privateModule);
12197 if(!prop)
12198 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->__anon1.member.member->string, privateModule, (((void *)0)), (((void *)0)));
12199 }
12200 if(!prop && !member && _class && exp->__anon1.member.member)
12201 {
12202 struct Symbol * classSym = FindClass(exp->__anon1.member.member->string);
12203
12204 convertTo = _class;
12205 _class = classSym ? classSym->__anon1.registered : (((void *)0));
12206 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
12207 }
12208 if(prop)
12209 {
12210 if(prop->compiled)
12211 {
12212 struct Type * type = prop->dataType;
12213
12214 if(_class->type == 3)
12215 {
12216 if(type->kind == 8)
12217 {
12218 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12219
12220 if(_class->type == 3)
12221 {
12222 if(!_class->dataType)
12223 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
12224 type = _class->dataType;
12225 }
12226 }
12227 switch(type->kind)
12228 {
12229 case 6:
12230 {
12231 float value;
12232 float (* Get)(float) = (void *)prop->Get;
12233
12234 GetFloat(exp->__anon1.member.exp, &value);
12235 exp->__anon1.__anon1.constant = PrintFloat(Get ? Get(value) : value);
12236 exp->type = 2;
12237 break;
12238 }
12239 case 7:
12240 {
12241 double value;
12242 double (* Get)(double);
12243
12244 GetDouble(exp->__anon1.member.exp, &value);
12245 if(convertTo)
12246 Get = (void *)prop->Set;
12247 else
12248 Get = (void *)prop->Get;
12249 exp->__anon1.__anon1.constant = PrintDouble(Get ? Get(value) : value);
12250 exp->type = 2;
12251 break;
12252 }
12253 }
12254 }
12255 else
12256 {
12257 if(convertTo)
12258 {
12259 struct Expression * value = exp->__anon1.member.exp;
12260 struct Type * type;
12261
12262 if(!prop->dataType)
12263 ProcessPropertyType(prop);
12264 type = prop->dataType;
12265 if(!type)
12266 {
12267 }
12268 else if(_class->type == 1)
12269 {
12270 switch(type->kind)
12271 {
12272 case 8:
12273 {
12274 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->__anon1._class->__anon1.registered;
12275
12276 if(propertyClass->type == 1 && value->type == 1)
12277 {
12278 void (* Set)(void *, void *) = (void *)prop->Set;
12279
12280 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12281 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12282 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12283 exp->__anon1.instance->loc = exp->loc;
12284 exp->type = 1;
12285 Set(exp->__anon1.instance->data, value->__anon1.instance->data);
12286 PopulateInstance(exp->__anon1.instance);
12287 }
12288 break;
12289 }
12290 case 3:
12291 {
12292 int intValue;
12293 void (* Set)(void *, int) = (void *)prop->Set;
12294
12295 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12296 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12297 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12298 exp->__anon1.instance->loc = exp->loc;
12299 exp->type = 1;
12300 GetInt(value, &intValue);
12301 Set(exp->__anon1.instance->data, intValue);
12302 PopulateInstance(exp->__anon1.instance);
12303 break;
12304 }
12305 case 4:
12306 {
12307 long long intValue;
12308 void (* Set)(void *, long long) = (void *)prop->Set;
12309
12310 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12311 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12312 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12313 exp->__anon1.instance->loc = exp->loc;
12314 exp->type = 1;
12315 GetInt64(value, &intValue);
12316 Set(exp->__anon1.instance->data, intValue);
12317 PopulateInstance(exp->__anon1.instance);
12318 break;
12319 }
12320 case 22:
12321 {
12322 intptr_t intValue;
12323 void (* Set)(void *, intptr_t) = (void *)prop->Set;
12324
12325 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12326 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12327 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12328 exp->__anon1.instance->loc = exp->loc;
12329 exp->type = 1;
12330 GetIntPtr(value, &intValue);
12331 Set(exp->__anon1.instance->data, intValue);
12332 PopulateInstance(exp->__anon1.instance);
12333 break;
12334 }
12335 case 23:
12336 {
12337 ssize_t intValue;
12338 void (* Set)(void *, ssize_t) = (void *)prop->Set;
12339
12340 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12341 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12342 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12343 exp->__anon1.instance->loc = exp->loc;
12344 exp->type = 1;
12345 GetIntSize(value, &intValue);
12346 Set(exp->__anon1.instance->data, intValue);
12347 PopulateInstance(exp->__anon1.instance);
12348 break;
12349 }
12350 case 6:
12351 {
12352 float floatValue;
12353 void (* Set)(void *, float) = (void *)prop->Set;
12354
12355 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12356 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12357 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12358 exp->__anon1.instance->loc = exp->loc;
12359 exp->type = 1;
12360 GetFloat(value, &floatValue);
12361 Set(exp->__anon1.instance->data, floatValue);
12362 PopulateInstance(exp->__anon1.instance);
12363 break;
12364 }
12365 case 7:
12366 {
12367 double doubleValue;
12368 void (* Set)(void *, double) = (void *)prop->Set;
12369
12370 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12371 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12372 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12373 exp->__anon1.instance->loc = exp->loc;
12374 exp->type = 1;
12375 GetDouble(value, &doubleValue);
12376 Set(exp->__anon1.instance->data, doubleValue);
12377 PopulateInstance(exp->__anon1.instance);
12378 break;
12379 }
12380 }
12381 }
12382 else if(_class->type == 2)
12383 {
12384 switch(type->kind)
12385 {
12386 case 8:
12387 {
12388 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->__anon1._class->__anon1.registered;
12389
12390 if(propertyClass->type == 1 && value->__anon1.instance->data)
12391 {
12392 unsigned int (* Set)(void *) = (void *)prop->Set;
12393 unsigned int bits = Set(value->__anon1.instance->data);
12394
12395 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
12396 exp->type = 2;
12397 break;
12398 }
12399 else if(_class->type == 2)
12400 {
12401 unsigned int value;
12402 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
12403 unsigned int bits;
12404
12405 GetUInt(exp->__anon1.member.exp, &value);
12406 bits = Set(value);
12407 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
12408 exp->type = 2;
12409 }
12410 }
12411 }
12412 }
12413 }
12414 else
12415 {
12416 if(_class->type == 2)
12417 {
12418 unsigned int value;
12419
12420 GetUInt(exp->__anon1.member.exp, &value);
12421 switch(type->kind)
12422 {
12423 case 8:
12424 {
12425 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12426
12427 if(_class->type == 1)
12428 {
12429 void (* Get)(unsigned int, void *) = (void *)prop->Get;
12430
12431 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12432 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12433 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12434 exp->__anon1.instance->loc = exp->loc;
12435 exp->type = 1;
12436 Get(value, exp->__anon1.instance->data);
12437 PopulateInstance(exp->__anon1.instance);
12438 }
12439 else if(_class->type == 2)
12440 {
12441 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
12442 uint64 bits = Get(value);
12443
12444 exp->__anon1.__anon1.constant = PrintHexUInt64(bits);
12445 exp->type = 2;
12446 }
12447 break;
12448 }
12449 }
12450 }
12451 else if(_class->type == 1)
12452 {
12453 unsigned char * value = (exp->__anon1.member.exp->type == 1) ? exp->__anon1.member.exp->__anon1.instance->data : (((void *)0));
12454
12455 switch(type->kind)
12456 {
12457 case 8:
12458 {
12459 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12460
12461 if(_class->type == 1 && value)
12462 {
12463 void (* Get)(void *, void *) = (void *)prop->Get;
12464
12465 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12466 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12467 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
12468 exp->__anon1.instance->loc = exp->loc;
12469 exp->type = 1;
12470 Get(value, exp->__anon1.instance->data);
12471 PopulateInstance(exp->__anon1.instance);
12472 }
12473 break;
12474 }
12475 }
12476 }
12477 }
12478 }
12479 }
12480 else
12481 {
12482 exp->isConstant = 0;
12483 }
12484 }
12485 else if(member)
12486 {
12487 }
12488 }
12489 if(exp->type != 8)
12490 {
12491 FreeExpression(memberExp);
12492 FreeIdentifier(memberID);
12493 }
12494 break;
12495 }
12496 case 10:
12497 {
12498 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
12499
12500 FreeExpContents(exp);
12501 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(type));
12502 exp->type = 2;
12503 FreeType(type);
12504 break;
12505 }
12506 case 15:
12507 {
12508 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
12509
12510 if(classSym && classSym->__anon1.registered)
12511 {
12512 if(classSym->__anon1.registered->fixed)
12513 {
12514 FreeSpecifier(exp->__anon1._class);
12515 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
12516 exp->type = 2;
12517 }
12518 else
12519 {
12520 char className[1024];
12521
12522 strcpy(className, "__ecereClass_");
12523 FullClassNameCat(className, classSym->string, 1);
12524 DeclareClass(classSym, className);
12525 FreeExpContents(exp);
12526 exp->type = 9;
12527 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
12528 exp->__anon1.member.member = MkIdentifier("structSize");
12529 }
12530 }
12531 break;
12532 }
12533 case 11:
12534 {
12535 struct Type * type;
12536 struct Expression * e = exp;
12537
12538 if(exp->type == 11)
12539 {
12540 if(exp->__anon1.cast.exp)
12541 ComputeExpression(exp->__anon1.cast.exp);
12542 e = exp->__anon1.cast.exp;
12543 }
12544 if(e && exp->expType)
12545 {
12546 type = exp->expType;
12547 if(type->kind == 8)
12548 {
12549 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12550
12551 if(_class && (_class->type == 3 || _class->type == 2))
12552 {
12553 if(!_class->dataType)
12554 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
12555 type = _class->dataType;
12556 }
12557 }
12558 switch(type->kind)
12559 {
12560 case 24:
12561 case 1:
12562 if(type->isSigned)
12563 {
12564 char value = (char)0;
12565
12566 if(GetChar(e, &value))
12567 {
12568 FreeExpContents(exp);
12569 exp->__anon1.__anon1.constant = PrintChar(value);
12570 exp->type = 2;
12571 }
12572 }
12573 else
12574 {
12575 unsigned char value = (unsigned char)0;
12576
12577 if(GetUChar(e, &value))
12578 {
12579 FreeExpContents(exp);
12580 exp->__anon1.__anon1.constant = PrintUChar(value);
12581 exp->type = 2;
12582 }
12583 }
12584 break;
12585 case 2:
12586 if(type->isSigned)
12587 {
12588 short value = (short)0;
12589
12590 if(GetShort(e, &value))
12591 {
12592 FreeExpContents(exp);
12593 exp->__anon1.__anon1.constant = PrintShort(value);
12594 exp->type = 2;
12595 }
12596 }
12597 else
12598 {
12599 unsigned short value = (unsigned short)0;
12600
12601 if(GetUShort(e, &value))
12602 {
12603 FreeExpContents(exp);
12604 exp->__anon1.__anon1.constant = PrintUShort(value);
12605 exp->type = 2;
12606 }
12607 }
12608 break;
12609 case 3:
12610 if(type->isSigned)
12611 {
12612 int value = 0;
12613
12614 if(GetInt(e, &value))
12615 {
12616 FreeExpContents(exp);
12617 exp->__anon1.__anon1.constant = PrintInt(value);
12618 exp->type = 2;
12619 }
12620 }
12621 else
12622 {
12623 unsigned int value = 0;
12624
12625 if(GetUInt(e, &value))
12626 {
12627 FreeExpContents(exp);
12628 exp->__anon1.__anon1.constant = PrintUInt(value);
12629 exp->type = 2;
12630 }
12631 }
12632 break;
12633 case 4:
12634 if(type->isSigned)
12635 {
12636 long long value = 0;
12637
12638 if(GetInt64(e, &value))
12639 {
12640 FreeExpContents(exp);
12641 exp->__anon1.__anon1.constant = PrintInt64(value);
12642 exp->type = 2;
12643 }
12644 }
12645 else
12646 {
12647 uint64 value = 0;
12648
12649 if(GetUInt64(e, &value))
12650 {
12651 FreeExpContents(exp);
12652 exp->__anon1.__anon1.constant = PrintUInt64(value);
12653 exp->type = 2;
12654 }
12655 }
12656 break;
12657 case 22:
12658 if(type->isSigned)
12659 {
12660 intptr_t value = 0;
12661
12662 if(GetIntPtr(e, &value))
12663 {
12664 FreeExpContents(exp);
12665 exp->__anon1.__anon1.constant = PrintInt64((long long)value);
12666 exp->type = 2;
12667 }
12668 }
12669 else
12670 {
12671 uintptr_t value = 0;
12672
12673 if(GetUIntPtr(e, &value))
12674 {
12675 FreeExpContents(exp);
12676 exp->__anon1.__anon1.constant = PrintUInt64((uint64)value);
12677 exp->type = 2;
12678 }
12679 }
12680 break;
12681 case 23:
12682 if(type->isSigned)
12683 {
12684 ssize_t value = 0;
12685
12686 if(GetIntSize(e, &value))
12687 {
12688 FreeExpContents(exp);
12689 exp->__anon1.__anon1.constant = PrintInt64((long long)value);
12690 exp->type = 2;
12691 }
12692 }
12693 else
12694 {
12695 size_t value = 0;
12696
12697 if(GetUIntSize(e, &value))
12698 {
12699 FreeExpContents(exp);
12700 exp->__anon1.__anon1.constant = PrintUInt64((uint64)value);
12701 exp->type = 2;
12702 }
12703 }
12704 break;
12705 case 6:
12706 {
12707 float value = 0;
12708
12709 if(GetFloat(e, &value))
12710 {
12711 FreeExpContents(exp);
12712 exp->__anon1.__anon1.constant = PrintFloat(value);
12713 exp->type = 2;
12714 }
12715 break;
12716 }
12717 case 7:
12718 {
12719 double value = 0;
12720
12721 if(GetDouble(e, &value))
12722 {
12723 FreeExpContents(exp);
12724 exp->__anon1.__anon1.constant = PrintDouble(value);
12725 exp->type = 2;
12726 }
12727 break;
12728 }
12729 }
12730 }
12731 break;
12732 }
12733 case 12:
12734 {
12735 struct Operand op1 =
12736 {
12737 0, 0, 0,
12738 .__anon1 = {
12739 .c = 0
12740 },
12741 {
12742 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12743 }
12744 };
12745 struct Operand op2 =
12746 {
12747 0, 0, 0,
12748 .__anon1 = {
12749 .c = 0
12750 },
12751 {
12752 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12753 }
12754 };
12755 struct Operand op3 =
12756 {
12757 0, 0, 0,
12758 .__anon1 = {
12759 .c = 0
12760 },
12761 {
12762 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12763 }
12764 };
12765
12766 if(exp->__anon1.cond.exp)
12767 ComputeExpression((*exp->__anon1.cond.exp).last);
12768 if(exp->__anon1.cond.elseExp)
12769 ComputeExpression(exp->__anon1.cond.elseExp);
12770 if(exp->__anon1.cond.cond)
12771 ComputeExpression(exp->__anon1.cond.cond);
12772 op1 = GetOperand(exp->__anon1.cond.cond);
12773 if(op1.type)
12774 op1.type->refCount++;
12775 op2 = GetOperand((*exp->__anon1.cond.exp).last);
12776 if(op2.type)
12777 op2.type->refCount++;
12778 op3 = GetOperand(exp->__anon1.cond.elseExp);
12779 if(op3.type)
12780 op3.type->refCount++;
12781 if(op1.ops.Cond)
12782 {
12783 FreeExpContents(exp);
12784 op1.ops.Cond(exp, &op1, &op2, &op3);
12785 }
12786 if(op1.type)
12787 FreeType(op1.type);
12788 if(op2.type)
12789 FreeType(op2.type);
12790 if(op3.type)
12791 FreeType(op3.type);
12792 break;
12793 }
12794 }
12795 }
12796
12797 void ApplyAnyObjectLogic(struct Expression * e);
12798
12799 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla, unsigned int warnConst)
12800 {
12801 unsigned int result = 1;
12802
12803 if(destType)
12804 {
12805 struct __ecereNameSpace__ecere__sys__OldList converts =
12806 {
12807 0, 0, 0, 0, 0
12808 };
12809 struct Conversion * convert;
12810
12811 if(destType->kind == 0)
12812 return 0;
12813 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla, warnConst))
12814 result = 0;
12815 if(converts.count)
12816 {
12817 for(convert = converts.first; convert; convert = convert->next)
12818 {
12819 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
12820
12821 if(!empty)
12822 {
12823 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12824 int objectType = exp->expType ? exp->expType->classObjectType : 0;
12825
12826 *newExp = *exp;
12827 newExp->prev = (((void *)0));
12828 newExp->next = (((void *)0));
12829 newExp->destType = (((void *)0));
12830 if(convert->isGet)
12831 {
12832 exp->type = 8;
12833 exp->addedThis = 1;
12834 exp->__anon1.member.exp = newExp;
12835 FreeType(exp->__anon1.member.exp->expType);
12836 exp->__anon1.member.exp->expType = MkClassType(convert->convert->_class->fullName);
12837 exp->__anon1.member.exp->expType->classObjectType = objectType;
12838 exp->__anon1.member.member = MkIdentifier(convert->convert->dataTypeString);
12839 exp->__anon1.member.memberType = 1;
12840 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12841 exp->needCast = 1;
12842 if(exp->expType)
12843 exp->expType->refCount++;
12844 ApplyAnyObjectLogic(exp->__anon1.member.exp);
12845 }
12846 else
12847 {
12848 {
12849 exp->type = 8;
12850 exp->addedThis = 1;
12851 exp->__anon1.member.exp = newExp;
12852 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->__anon1._class && newExp->expType->__anon1._class->__anon1.registered && newExp->expType->__anon1._class->__anon1.registered->type == 5)
12853 {
12854 newExp->byReference = 1;
12855 }
12856 FreeType(exp->__anon1.member.exp->expType);
12857 exp->__anon1.member.exp->expType = (((void *)0));
12858 if(convert->convert->dataType)
12859 {
12860 exp->__anon1.member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12861 CopyTypeInto(exp->__anon1.member.exp->expType, convert->convert->dataType);
12862 exp->__anon1.member.exp->expType->refCount = 1;
12863 exp->__anon1.member.exp->expType->classObjectType = objectType;
12864 ApplyAnyObjectLogic(exp->__anon1.member.exp);
12865 }
12866 exp->__anon1.member.member = MkIdentifier(convert->convert->_class->fullName);
12867 exp->__anon1.member.memberType = 4;
12868 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12869 exp->needCast = 1;
12870 if(convert->resultType)
12871 convert->resultType->refCount++;
12872 }
12873 }
12874 }
12875 else
12876 {
12877 FreeType(exp->expType);
12878 if(convert->isGet)
12879 {
12880 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12881 if(exp->destType->casted)
12882 exp->needCast = 1;
12883 if(exp->expType)
12884 exp->expType->refCount++;
12885 }
12886 else
12887 {
12888 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12889 if(exp->destType->casted)
12890 exp->needCast = 1;
12891 if(convert->resultType)
12892 convert->resultType->refCount++;
12893 }
12894 }
12895 }
12896 if(exp->isConstant && inCompiler)
12897 ComputeExpression(exp);
12898 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
12899 }
12900 if(!result && exp->expType && converts.count)
12901 {
12902 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
12903 }
12904 if(!result && exp->expType && exp->destType)
12905 {
12906 if((exp->destType->kind == 8 && exp->expType->kind == 13 && exp->expType->__anon1.type->kind == 8 && exp->expType->__anon1.type->__anon1._class == exp->destType->__anon1._class && exp->destType->__anon1._class->__anon1.registered && exp->destType->__anon1._class->__anon1.registered->type == 1) || (exp->expType->kind == 8 && exp->destType->kind == 13 && exp->destType->__anon1.type->kind == 8 && exp->destType->__anon1.type->__anon1._class == exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->type == 1))
12907 result = 1;
12908 }
12909 }
12910 return result;
12911 }
12912
12913 extern struct Expression * GetNonBracketsExp(struct Expression * exp);
12914
12915 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
12916
12917 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
12918
12919 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
12920
12921 void CheckTemplateTypes(struct Expression * exp)
12922 {
12923 struct Expression * nbExp = GetNonBracketsExp(exp);
12924
12925 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate && (nbExp == exp || nbExp->type != 11))
12926 {
12927 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12928 struct Context * context;
12929
12930 *newExp = *exp;
12931 if(exp->destType)
12932 exp->destType->refCount++;
12933 if(exp->expType)
12934 exp->expType->refCount++;
12935 newExp->prev = (((void *)0));
12936 newExp->next = (((void *)0));
12937 switch(exp->expType->kind)
12938 {
12939 case 7:
12940 if(exp->destType->classObjectType)
12941 {
12942 if(exp->destType)
12943 exp->destType->refCount--;
12944 if(exp->expType)
12945 exp->expType->refCount--;
12946 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12947 }
12948 else
12949 {
12950 struct __ecereNameSpace__ecere__sys__OldList * specs;
12951 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12952 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12953
12954 context = PushContext();
12955 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12956 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12957 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12958 exp->type = 23;
12959 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12960 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
12961 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
12962 exp->__anon1.compound->__anon1.compound.context = context;
12963 PopContext(context);
12964 }
12965 break;
12966 default:
12967 exp->type = 11;
12968 exp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
12969 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
12970 exp->needCast = 1;
12971 break;
12972 }
12973 }
12974 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
12975 {
12976 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12977 struct Context * context;
12978
12979 *newExp = *exp;
12980 if(exp->destType)
12981 exp->destType->refCount++;
12982 if(exp->expType)
12983 exp->expType->refCount++;
12984 newExp->prev = (((void *)0));
12985 newExp->next = (((void *)0));
12986 switch(exp->expType->kind)
12987 {
12988 case 7:
12989 if(exp->destType->classObjectType)
12990 {
12991 if(exp->destType)
12992 exp->destType->refCount--;
12993 if(exp->expType)
12994 exp->expType->refCount--;
12995 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12996 }
12997 else
12998 {
12999 struct __ecereNameSpace__ecere__sys__OldList * specs;
13000 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
13001 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
13002
13003 context = PushContext();
13004 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
13005 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
13006 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
13007 exp->type = 23;
13008 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
13009 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
13010 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
13011 exp->__anon1.compound->__anon1.compound.context = context;
13012 PopContext(context);
13013 }
13014 break;
13015 case 8:
13016 {
13017 if(exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->type == 1)
13018 {
13019 exp->type = 5;
13020 exp->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->__anon1._class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
13021 ProcessExpressionType((*exp->__anon1.list).first);
13022 break;
13023 }
13024 else
13025 {
13026 exp->type = 5;
13027 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->__anon1._class->string)), (((void *)0))), newExp));
13028 exp->needTemplateCast = 2;
13029 newExp->needCast = 1;
13030 newExp->needTemplateCast = 2;
13031 ProcessExpressionType((*exp->__anon1.list).first);
13032 break;
13033 }
13034 }
13035 default:
13036 {
13037 if(exp->expType->kind == 20)
13038 {
13039 struct Type * type = ProcessTemplateParameterType(exp->expType->__anon1.templateParameter);
13040
13041 if(type)
13042 {
13043 FreeType(exp->destType);
13044 FreeType(exp->expType);
13045 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13046 break;
13047 }
13048 }
13049 if(newExp->type == 8 && newExp->__anon1.member.memberType == 3)
13050 {
13051 exp->type = 4;
13052 exp->__anon1.op.op = '*';
13053 exp->__anon1.op.exp1 = (((void *)0));
13054 exp->__anon1.op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
13055 }
13056 else
13057 {
13058 char typeString[1024];
13059 struct Declarator * decl;
13060 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13061
13062 typeString[0] = '\0';
13063 PrintType(exp->expType, typeString, 0, 0);
13064 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13065 exp->type = 11;
13066 exp->__anon1.cast.typeName = MkTypeName(specs, decl);
13067 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
13068 exp->__anon1.cast.exp->needCast = 1;
13069 }
13070 break;
13071 }
13072 }
13073 }
13074 }
13075
13076 extern int strncmp(const char * , const char * , size_t n);
13077
13078 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char *  key);
13079
13080 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * nameSpace, const char * name)
13081 {
13082 int nsLen = strlen(nameSpace);
13083 struct Symbol * symbol;
13084
13085 for(symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(tree, nameSpace); symbol; symbol = (struct Symbol *)__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(((struct __ecereNameSpace__ecere__sys__BTNode *)symbol)))
13086 {
13087 char * s = symbol->string;
13088
13089 if(!strncmp(s, nameSpace, nsLen))
13090 {
13091 int c;
13092 char * namePart;
13093
13094 for(c = strlen(s) - 1; c >= 0; c--)
13095 if(s[c] == ':')
13096 break;
13097 namePart = s + c + 1;
13098 if(!strcmp(namePart, name))
13099 {
13100 return symbol;
13101 }
13102 }
13103 else
13104 break;
13105 }
13106 return (((void *)0));
13107 }
13108
13109 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * name)
13110 {
13111 int c;
13112 char nameSpace[1024];
13113 const char * namePart;
13114 unsigned int gotColon = 0;
13115
13116 nameSpace[0] = '\0';
13117 for(c = strlen(name) - 1; c >= 0; c--)
13118 if(name[c] == ':')
13119 {
13120 gotColon = 1;
13121 break;
13122 }
13123 namePart = name + c + 1;
13124 while(c >= 0 && name[c] == ':')
13125 c--;
13126 if(c >= 0)
13127 {
13128 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
13129
13130 if(symbol)
13131 return symbol;
13132 memcpy(nameSpace, name, c + 1);
13133 nameSpace[c + 1] = (char)0;
13134 return ScanWithNameSpace(tree, nameSpace, namePart);
13135 }
13136 else if(gotColon)
13137 {
13138 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
13139
13140 return symbol;
13141 }
13142 else
13143 {
13144 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
13145
13146 if(symbol)
13147 return symbol;
13148 return ScanWithNameSpace(tree, "", namePart);
13149 }
13150 return (((void *)0));
13151 }
13152
13153 static void ProcessDeclaration(struct Declaration * decl);
13154
13155 struct Symbol * FindSymbol(const char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
13156 {
13157 struct Context * ctx;
13158 struct Symbol * symbol = (((void *)0));
13159
13160 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
13161 {
13162 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
13163 {
13164 symbol = (((void *)0));
13165 if(thisNameSpace)
13166 {
13167 char curName[1024];
13168
13169 strcpy(curName, thisNameSpace);
13170 strcat(curName, "::");
13171 strcat(curName, name);
13172 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
13173 }
13174 if(!symbol)
13175 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
13176 }
13177 else
13178 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
13179 if(symbol || ctx == endContext)
13180 break;
13181 }
13182 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->__anon2.__anon1.pointerExternal)
13183 {
13184 if(symbol->__anon2.__anon1.pointerExternal->type == 0)
13185 {
13186 struct FunctionDefinition * function = symbol->__anon2.__anon1.pointerExternal->__anon1.function;
13187 struct Context * tmpContext = curContext;
13188
13189 curContext = (((void *)0));
13190 symbol->__anon2.__anon1.pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
13191 curContext = tmpContext;
13192 symbol->__anon2.__anon1.pointerExternal->symbol = symbol;
13193 DeclareType(symbol->type, 1, 1);
13194 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->__anon2.__anon1.pointerExternal);
13195 symbol->id = curExternal->symbol->idCode;
13196 }
13197 else if(symbol->__anon2.__anon1.pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->__anon2.__anon1.pointerExternal->symbol->id)
13198 {
13199 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->__anon2.__anon1.pointerExternal, curExternal->prev);
13200 symbol->id = curExternal->symbol->idCode;
13201 }
13202 }
13203 return symbol;
13204 }
13205
13206 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
13207 {
13208 if(!type->isSigned && type->kind != 22 && type->kind != 23)
13209 ListAdd(specs, MkSpecifier(UNSIGNED));
13210 switch(type->kind)
13211 {
13212 case 8:
13213 {
13214 if(type->__anon1._class->__anon1.registered)
13215 {
13216 if(!type->__anon1._class->__anon1.registered->dataType)
13217 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
13218 GetTypeSpecs(type->__anon1._class->__anon1.registered->dataType, specs);
13219 }
13220 break;
13221 }
13222 case 7:
13223 ListAdd(specs, MkSpecifier(DOUBLE));
13224 break;
13225 case 6:
13226 ListAdd(specs, MkSpecifier(FLOAT));
13227 break;
13228 case 1:
13229 ListAdd(specs, MkSpecifier(CHAR));
13230 break;
13231 case 24:
13232 ListAdd(specs, MkSpecifier(_BOOL));
13233 break;
13234 case 2:
13235 ListAdd(specs, MkSpecifier(SHORT));
13236 break;
13237 case 4:
13238 ListAdd(specs, MkSpecifier(INT64));
13239 break;
13240 case 22:
13241 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
13242 break;
13243 case 23:
13244 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
13245 break;
13246 case 3:
13247 default:
13248 ListAdd(specs, MkSpecifier(INT));
13249 break;
13250 }
13251 }
13252
13253 static void PrintArraySize(struct Type * arrayType, char * string)
13254 {
13255 char size[256];
13256
13257 size[0] = '\0';
13258 strcat(size, "[");
13259 if(arrayType->__anon1.__anon4.enumClass)
13260 strcat(size, arrayType->__anon1.__anon4.enumClass->string);
13261 else if(arrayType->__anon1.__anon4.arraySizeExp)
13262 PrintExpression(arrayType->__anon1.__anon4.arraySizeExp, size);
13263 strcat(size, "]");
13264 strcat(string, size);
13265 }
13266
13267 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
13268 {
13269 if(type)
13270 {
13271 if(printConst && type->constant)
13272 strcat(string, "const ");
13273 switch(type->kind)
13274 {
13275 case 8:
13276 {
13277 struct Symbol * c = type->__anon1._class;
13278
13279 if(type->classObjectType == 2)
13280 strcat(string, "typed_object");
13281 else if(type->classObjectType == 3)
13282 strcat(string, "any_object");
13283 else
13284 {
13285 if(c && c->string)
13286 strcat(string, (fullName || !c->__anon1.registered) ? c->string : c->__anon1.registered->name);
13287 }
13288 if(type->byReference)
13289 strcat(string, " &");
13290 break;
13291 }
13292 case 0:
13293 strcat(string, "void");
13294 break;
13295 case 3:
13296 strcat(string, type->isSigned ? "int" : "uint");
13297 break;
13298 case 4:
13299 strcat(string, type->isSigned ? "int64" : "uint64");
13300 break;
13301 case 22:
13302 strcat(string, type->isSigned ? "intptr" : "uintptr");
13303 break;
13304 case 23:
13305 strcat(string, type->isSigned ? "intsize" : "uintsize");
13306 break;
13307 case 1:
13308 strcat(string, type->isSigned ? "char" : "byte");
13309 break;
13310 case 24:
13311 strcat(string, "_Bool");
13312 break;
13313 case 2:
13314 strcat(string, type->isSigned ? "short" : "uint16");
13315 break;
13316 case 6:
13317 strcat(string, "float");
13318 break;
13319 case 7:
13320 strcat(string, "double");
13321 break;
13322 case 9:
13323 if(type->__anon1.__anon1.enumName)
13324 {
13325 strcat(string, "struct ");
13326 strcat(string, type->__anon1.__anon1.enumName);
13327 }
13328 else if(type->typeName)
13329 strcat(string, type->typeName);
13330 else
13331 {
13332 struct Type * member;
13333
13334 strcat(string, "struct { ");
13335 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
13336 {
13337 PrintType(member, string, 1, fullName);
13338 strcat(string, "; ");
13339 }
13340 strcat(string, "}");
13341 }
13342 break;
13343 case 10:
13344 if(type->__anon1.__anon1.enumName)
13345 {
13346 strcat(string, "union ");
13347 strcat(string, type->__anon1.__anon1.enumName);
13348 }
13349 else if(type->typeName)
13350 strcat(string, type->typeName);
13351 else
13352 {
13353 strcat(string, "union ");
13354 strcat(string, "(unnamed)");
13355 }
13356 break;
13357 case 15:
13358 if(type->__anon1.__anon1.enumName)
13359 {
13360 strcat(string, "enum ");
13361 strcat(string, type->__anon1.__anon1.enumName);
13362 }
13363 else if(type->typeName)
13364 strcat(string, type->typeName);
13365 else
13366 strcat(string, "int");
13367 break;
13368 case 14:
13369 strcat(string, "...");
13370 break;
13371 case 19:
13372 strcat(string, "subclass(");
13373 strcat(string, type->__anon1._class ? type->__anon1._class->string : "int");
13374 strcat(string, ")");
13375 break;
13376 case 20:
13377 strcat(string, type->__anon1.templateParameter->identifier->string);
13378 break;
13379 case 21:
13380 strcat(string, "thisclass");
13381 break;
13382 case 17:
13383 strcat(string, "__builtin_va_list");
13384 break;
13385 }
13386 }
13387 }
13388
13389 extern char *  __ecereNameSpace__ecere__sys__RSearchString(const char *  buffer, const char *  subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
13390
13391 static void PrintName(struct Type * type, char * string, unsigned int fullName)
13392 {
13393 if(type->name && type->name[0])
13394 {
13395 if(fullName)
13396 strcat(string, type->name);
13397 else
13398 {
13399 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 1, 0);
13400
13401 if(name)
13402 name += 2;
13403 else
13404 name = type->name;
13405 strcat(string, name);
13406 }
13407 }
13408 }
13409
13410 static void PrintAttribs(struct Type * type, char * string)
13411 {
13412 if(type)
13413 {
13414 if(type->dllExport)
13415 strcat(string, "dllexport ");
13416 if(type->attrStdcall)
13417 strcat(string, "stdcall ");
13418 }
13419 }
13420
13421 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
13422 {
13423 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13424 {
13425 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
13426 PrintAttribs(type, string);
13427 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
13428 strcat(string, " const");
13429 PrePrintType(type->kind == 16 ? type->__anon1.__anon3.method->dataType : type->__anon1.type, string, fullName, type, printConst);
13430 if(type->kind == 13 && (type->__anon1.type->kind == 12 || type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16))
13431 strcat(string, " (");
13432 if(type->kind == 13)
13433 {
13434 if(type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16)
13435 PrintAttribs(type->__anon1.type, string);
13436 }
13437 if(type->kind == 13)
13438 {
13439 if(type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16 || type->__anon1.type->kind == 12)
13440 strcat(string, "*");
13441 else
13442 strcat(string, " *");
13443 }
13444 if(printConst && type->constant && type->kind == 13)
13445 strcat(string, " const");
13446 }
13447 else
13448 PrintTypeSpecs(type, string, fullName, printConst);
13449 }
13450
13451 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
13452 {
13453 if(type->kind == 13 && (type->__anon1.type->kind == 12 || type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16))
13454 strcat(string, ")");
13455 if(type->kind == 12)
13456 PrintArraySize(type, string);
13457 else if(type->kind == 11)
13458 {
13459 struct Type * param;
13460
13461 strcat(string, "(");
13462 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
13463 {
13464 PrintType(param, string, 1, fullName);
13465 if(param->next)
13466 strcat(string, ", ");
13467 }
13468 strcat(string, ")");
13469 }
13470 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13471 PostPrintType(type->kind == 16 ? type->__anon1.__anon3.method->dataType : type->__anon1.type, string, fullName);
13472 }
13473
13474 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
13475 {
13476 PrePrintType(type, string, fullName, (((void *)0)), printConst);
13477 if(type->__anon1.__anon2.thisClass || (printName && type->name && type->name[0]))
13478 strcat(string, " ");
13479 if((type->__anon1.__anon2.thisClass || type->__anon1.__anon2.staticMethod))
13480 {
13481 struct Symbol * _class = type->__anon1.__anon2.thisClass;
13482
13483 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
13484 {
13485 if(type->classObjectType == 1)
13486 strcat(string, "class");
13487 else
13488 strcat(string, type->byReference ? "typed_object&" : "typed_object");
13489 }
13490 else if(_class && _class->string)
13491 {
13492 char * s = _class->string;
13493
13494 if(fullName)
13495 strcat(string, s);
13496 else
13497 {
13498 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 1, 0);
13499
13500 if(name)
13501 name += 2;
13502 else
13503 name = s;
13504 strcat(string, name);
13505 }
13506 }
13507 strcat(string, "::");
13508 }
13509 if(printName && type->name)
13510 PrintName(type, string, fullName);
13511 PostPrintType(type, string, fullName);
13512 if(type->bitFieldCount)
13513 {
13514 char count[100];
13515
13516 sprintf(count, ":%d", type->bitFieldCount);
13517 strcat(string, count);
13518 }
13519 }
13520
13521 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13522 {
13523 _PrintType(type, string, printName, fullName, 1);
13524 }
13525
13526 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13527 {
13528 _PrintType(type, string, printName, fullName, 0);
13529 }
13530
13531 static struct Type * FindMember(struct Type * type, char * string)
13532 {
13533 struct Type * memberType;
13534
13535 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
13536 {
13537 if(!memberType->name)
13538 {
13539 struct Type * subType = FindMember(memberType, string);
13540
13541 if(subType)
13542 return subType;
13543 }
13544 else if(!strcmp(memberType->name, string))
13545 return memberType;
13546 }
13547 return (((void *)0));
13548 }
13549
13550 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
13551 {
13552 struct Type * memberType;
13553
13554 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
13555 {
13556 if(!memberType->name)
13557 {
13558 struct Type * subType = FindMember(memberType, string);
13559
13560 if(subType)
13561 {
13562 *offset += memberType->offset;
13563 return subType;
13564 }
13565 }
13566 else if(!strcmp(memberType->name, string))
13567 {
13568 *offset += memberType->offset;
13569 return memberType;
13570 }
13571 }
13572 return (((void *)0));
13573 }
13574
13575 extern unsigned int parseError;
13576
13577 unsigned int GetParseError()
13578 {
13579 return parseError;
13580 }
13581
13582 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
13583
13584 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
13585
13586 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
13587
13588 struct Expression * ParseExpressionString(char * expression)
13589 {
13590 parseError = 0;
13591 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13592 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count))__extension__ ({
13593 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13594
13595 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13596 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
13597 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13598 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13599
13600 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13601 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13602 echoOn = 0;
13603 parsedExpression = (((void *)0));
13604 resetScanner();
13605 expression_yyparse();
13606 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13607 return parsedExpression;
13608 }
13609
13610 extern char *  QMkString(const char *  source);
13611
13612 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
13613 {
13614 struct Identifier * id = exp->__anon1.__anon1.identifier;
13615 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13616 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13617 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13618 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13619
13620 if(_class && _class->type == 4)
13621 {
13622 struct __ecereNameSpace__ecere__sys__NamedLink64 * value = (((void *)0));
13623 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
13624
13625 if(enumClass)
13626 {
13627 struct __ecereNameSpace__ecere__com__Class * baseClass;
13628
13629 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
13630 {
13631 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
13632
13633 for(value = e->values.first; value; value = value->next)
13634 {
13635 if(!strcmp(value->name, id->string))
13636 break;
13637 }
13638 if(value)
13639 {
13640 char constant[256];
13641
13642 FreeExpContents(exp);
13643 exp->type = 2;
13644 exp->isConstant = 1;
13645 if(!strcmp(baseClass->dataTypeString, "int") || !strcmp(baseClass->dataTypeString, "int64") || !strcmp(baseClass->dataTypeString, "char") || !strcmp(baseClass->dataTypeString, "short"))
13646 sprintf(constant, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), value->data);
13647 else
13648 sprintf(constant, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), value->data);
13649 exp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13650 exp->expType = MkClassType(baseClass->fullName);
13651 break;
13652 }
13653 }
13654 }
13655 if(value)
13656 return 1;
13657 }
13658 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
13659 {
13660 ProcessMethodType(method);
13661 exp->expType = __extension__ ({
13662 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13663
13664 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1->__anon1.__anon3.methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
13665 });
13666 return 1;
13667 }
13668 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
13669 {
13670 if(!prop->dataType)
13671 ProcessPropertyType(prop);
13672 exp->expType = prop->dataType;
13673 if(prop->dataType)
13674 prop->dataType->refCount++;
13675 return 1;
13676 }
13677 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
13678 {
13679 if(!member->dataType)
13680 member->dataType = ProcessTypeString(member->dataTypeString, 0);
13681 exp->expType = member->dataType;
13682 if(member->dataType)
13683 member->dataType->refCount++;
13684 return 1;
13685 }
13686 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
13687 {
13688 if(!classProp->dataType)
13689 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0);
13690 if(classProp->constant)
13691 {
13692 FreeExpContents(exp);
13693 exp->isConstant = 1;
13694 if(classProp->dataType->kind == 13 && classProp->dataType->__anon1.type->kind == 1)
13695 {
13696 exp->type = 3;
13697 exp->__anon1.__anon1.constant = QMkString((char *)classProp->Get(_class));
13698 }
13699 else
13700 {
13701 char constant[256];
13702
13703 exp->type = 2;
13704 sprintf(constant, "%d", (int)classProp->Get(_class));
13705 exp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13706 }
13707 }
13708 else
13709 {
13710 }
13711 exp->expType = classProp->dataType;
13712 if(classProp->dataType)
13713 classProp->dataType->refCount++;
13714 return 1;
13715 }
13716 return 0;
13717 }
13718
13719 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
13720 {
13721 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
13722 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
13723 struct __ecereNameSpace__ecere__com__NameSpace * child;
13724
13725 if(!data)
13726 {
13727 for(child = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(&nameSpace->nameSpaces); child; child = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(((struct __ecereNameSpace__ecere__sys__BTNode *)child)))
13728 {
13729 data = ScanGlobalData(child, name);
13730 if(data)
13731 break;
13732 }
13733 }
13734 return data;
13735 }
13736
13737 extern struct __ecereNameSpace__ecere__com__NameSpace *  globalData;
13738
13739 extern char *  strncpy(char * , const char * , size_t n);
13740
13741 static struct GlobalData * FindGlobalData(char * name)
13742 {
13743 int start = 0, c;
13744 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13745
13746 nameSpace = globalData;
13747 for(c = 0; name[c]; c++)
13748 {
13749 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
13750 {
13751 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
13752 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
13753
13754 strncpy(spaceName, name + start, c - start);
13755 spaceName[c - start] = '\0';
13756 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
13757 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
13758 if(!newSpace)
13759 return (((void *)0));
13760 nameSpace = newSpace;
13761 if(name[c] == ':')
13762 c++;
13763 start = c + 1;
13764 }
13765 }
13766 if(c - start)
13767 {
13768 return ScanGlobalData(nameSpace, name + start);
13769 }
13770 return (((void *)0));
13771 }
13772
13773 static int definedExpStackPos;
13774
13775 static void * definedExpStack[512];
13776
13777 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
13778 {
13779 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
13780
13781 FreeExpContents(checkedExp);
13782 FreeType(checkedExp->expType);
13783 FreeType(checkedExp->destType);
13784 *checkedExp = *newExp;
13785 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13786 checkedExp->prev = prev;
13787 checkedExp->next = next;
13788 }
13789
13790 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
13791
13792 extern int printf(const char * , ...);
13793
13794 void __ecereMethod_Expression_Clear();
13795
13796 void ApplyAnyObjectLogic(struct Expression * e)
13797 {
13798 struct Type * destType = e->destType;
13799
13800 if(destType && (destType->classObjectType == 3))
13801 {
13802 if(e && e->expType)
13803 {
13804 struct Type * type = e->expType;
13805 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
13806
13807 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
13808 {
13809 _class = type->__anon1._class->__anon1.registered;
13810 }
13811 else if(type->kind == 19)
13812 {
13813 _class = FindClass("ecere::com::Class")->__anon1.registered;
13814 }
13815 else
13816 {
13817 char string[1024] = "";
13818 struct Symbol * classSym;
13819
13820 PrintTypeNoConst(type, string, 0, 1);
13821 classSym = FindClass(string);
13822 if(classSym)
13823 _class = classSym->__anon1.registered;
13824 }
13825 if((_class && (_class->type == 4 || _class->type == 3 || _class->type == 2 || _class->type == 1000) && strcmp(_class->fullName, "class") && strcmp(_class->fullName, "uintptr") && strcmp(_class->fullName, "intptr")) || (!e->expType->classObjectType && (((type->kind != 13 && type->kind != 22 && type->kind != 19 && (type->kind != 8 || !type->__anon1._class || !type->__anon1._class->__anon1.registered || type->__anon1._class->__anon1.registered->type == 1))) || destType->byReference)))
13826 {
13827 if(!_class || strcmp(_class->fullName, "char *"))
13828 {
13829 struct Expression * checkedExp = e, * newExp;
13830
13831 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->__anon1.list) || checkedExp->type == 11)
13832 {
13833 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13834 {
13835 if(checkedExp->type == 23)
13836 {
13837 checkedExp = (*((struct Statement *)(*checkedExp->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
13838 }
13839 else
13840 checkedExp = (*checkedExp->__anon1.list).last;
13841 }
13842 else if(checkedExp->type == 11)
13843 checkedExp = checkedExp->__anon1.cast.exp;
13844 }
13845 if(checkedExp && checkedExp->type == 4 && checkedExp->__anon1.op.op == '*' && !checkedExp->__anon1.op.exp1)
13846 {
13847 newExp = checkedExp->__anon1.op.exp2;
13848 checkedExp->__anon1.op.exp2 = (((void *)0));
13849 FreeExpContents(checkedExp);
13850 if(e->expType && e->expType->passAsTemplate)
13851 {
13852 char size[100];
13853
13854 ComputeTypeSize(e->expType);
13855 sprintf(size, "%d", e->expType->size);
13856 newExp = MkExpBrackets(MkListOne(MkExpOp(MkExpCast(MkTypeName(MkListOne(MkSpecifier(CHAR)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp), '+', MkExpCall(MkExpIdentifier(MkIdentifier("__ENDIAN_PAD")), MkListOne(MkExpConstant(size))))));
13857 }
13858 ReplaceExpContents(checkedExp, newExp);
13859 e->byReference = 1;
13860 }
13861 else if(!e->byReference || (_class && _class->type == 5))
13862 {
13863 struct Expression * checkedExp;
13864
13865 {
13866 unsigned int hasAddress = e->type == 0 || (e->type == 8 && e->__anon1.member.memberType == 3) || (e->type == 9 && e->__anon1.member.memberType == 3) || (e->type == 4 && !e->__anon1.op.exp1 && e->__anon1.op.op == '*') || e->type == 6;
13867
13868 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
13869 {
13870 struct Context * context = PushContext();
13871 struct Declarator * decl;
13872 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13873 char typeString[1024];
13874 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13875
13876 typeString[0] = '\0';
13877 *newExp = *e;
13878 newExp->prev = (((void *)0));
13879 newExp->next = (((void *)0));
13880 newExp->expType = (((void *)0));
13881 PrintTypeNoConst(e->expType, typeString, 0, 1);
13882 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13883 newExp->destType = ProcessType(specs, decl);
13884 curContext = context;
13885 if(curCompound)
13886 {
13887 char name[100];
13888 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
13889
13890 e->type = 23;
13891 sprintf(name, "__internalValue%03X", internalValueCounter++);
13892 if(!curCompound->__anon1.compound.declarations)
13893 curCompound->__anon1.compound.declarations = MkList();
13894 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
13895 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
13896 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
13897 e->__anon1.compound = MkCompoundStmt((((void *)0)), stmts);
13898 }
13899 else
13900 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
13901 {
13902 struct Type * type = e->destType;
13903
13904 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13905 CopyTypeInto(e->destType, type);
13906 e->destType->refCount = 1;
13907 e->destType->classObjectType = 0;
13908 FreeType(type);
13909 }
13910 e->__anon1.compound->__anon1.compound.context = context;
13911 PopContext(context);
13912 curContext = context->parent;
13913 }
13914 }
13915 checkedExp = e;
13916 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->__anon1.list) || checkedExp->type == 11)
13917 {
13918 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13919 {
13920 if(checkedExp->type == 23)
13921 {
13922 checkedExp = (*((struct Statement *)(*checkedExp->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
13923 }
13924 else
13925 checkedExp = (*checkedExp->__anon1.list).last;
13926 }
13927 else if(checkedExp->type == 11)
13928 checkedExp = checkedExp->__anon1.cast.exp;
13929 }
13930 {
13931 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13932
13933 *operand = *checkedExp;
13934 __ecereMethod_Expression_Clear(checkedExp);
13935 checkedExp->destType = ProcessTypeString("void *", 0);
13936 checkedExp->expType = checkedExp->destType;
13937 checkedExp->destType->refCount++;
13938 checkedExp->type = 4;
13939 checkedExp->__anon1.op.op = '&';
13940 checkedExp->__anon1.op.exp1 = (((void *)0));
13941 checkedExp->__anon1.op.exp2 = operand;
13942 }
13943 }
13944 }
13945 }
13946 }
13947 }
13948 {
13949 }
13950 if((!destType || destType->kind == 14 || destType->kind == 0) && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && (e->expType->byReference || (e->expType->kind == 8 && e->expType->__anon1._class && e->expType->__anon1._class->__anon1.registered && (e->expType->__anon1._class->__anon1.registered->type == 2 || e->expType->__anon1._class->__anon1.registered->type == 4 || e->expType->__anon1._class->__anon1.registered->type == 3))))
13951 {
13952 if(e->expType->classObjectType && destType && destType->classObjectType)
13953 {
13954 return ;
13955 }
13956 else
13957 {
13958 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13959
13960 *thisExp = *e;
13961 thisExp->prev = (((void *)0));
13962 thisExp->next = (((void *)0));
13963 __ecereMethod_Expression_Clear(e);
13964 e->type = 5;
13965 e->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
13966 if(thisExp->expType->kind == 8 && thisExp->expType->__anon1._class && thisExp->expType->__anon1._class->__anon1.registered && thisExp->expType->__anon1._class->__anon1.registered->type == 5)
13967 ((struct Expression *)(*e->__anon1.list).first)->byReference = 1;
13968 {
13969 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13970 CopyTypeInto(e->expType, thisExp->expType);
13971 e->expType->byReference = 0;
13972 e->expType->refCount = 1;
13973 if(e->expType->kind == 8 && e->expType->__anon1._class && e->expType->__anon1._class->__anon1.registered && (e->expType->__anon1._class->__anon1.registered->type == 2 || e->expType->__anon1._class->__anon1.registered->type == 4 || e->expType->__anon1._class->__anon1.registered->type == 3))
13974 {
13975 e->expType->classObjectType = 0;
13976 }
13977 }
13978 }
13979 }
13980 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
13981 {
13982 if(destType->kind == 14)
13983 {
13984 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unspecified type\n", (((void *)0))));
13985 }
13986 else if(!(destType->truth && e->expType->kind == 8 && e->expType->__anon1._class && e->expType->__anon1._class->__anon1.registered && e->expType->__anon1._class->__anon1.registered->type == 1))
13987 {
13988 unsigned int byReference = e->expType->byReference;
13989 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13990 struct Declarator * decl;
13991 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13992 char typeString[1024];
13993 struct Type * type;
13994 int backupClassObjectType;
13995 unsigned int backupByReference;
13996
13997 if(e->expType->kind == 8 && e->expType->__anon1._class && e->expType->__anon1._class->__anon1.registered && strcmp(e->expType->__anon1._class->__anon1.registered->name, "class"))
13998 type = e->expType;
13999 else
14000 type = destType;
14001 backupClassObjectType = type->classObjectType;
14002 backupByReference = type->byReference;
14003 type->classObjectType = 0;
14004 type->byReference = 0;
14005 typeString[0] = '\0';
14006 PrintType(type, typeString, 0, 1);
14007 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14008 type->classObjectType = backupClassObjectType;
14009 type->byReference = backupByReference;
14010 *thisExp = *e;
14011 thisExp->prev = (((void *)0));
14012 thisExp->next = (((void *)0));
14013 __ecereMethod_Expression_Clear(e);
14014 if((type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered && (type->__anon1._class->__anon1.registered->type == 1000 || type->__anon1._class->__anon1.registered->type == 2 || type->__anon1._class->__anon1.registered->type == 4 || type->__anon1._class->__anon1.registered->type == 3)) || (type->kind != 13 && type->kind != 22 && type->kind != 12 && type->kind != 8) || (!destType->byReference && byReference && (destType->kind != 13 || type->kind != 13)))
14015 {
14016 e->type = 4;
14017 e->__anon1.op.op = '*';
14018 e->__anon1.op.exp1 = (((void *)0));
14019 e->__anon1.op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
14020 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14021 CopyTypeInto(e->expType, type);
14022 e->expType->byReference = 0;
14023 e->expType->refCount = 1;
14024 }
14025 else
14026 {
14027 e->type = 11;
14028 e->__anon1.cast.typeName = MkTypeName(specs, decl);
14029 e->__anon1.cast.exp = thisExp;
14030 e->byReference = 1;
14031 e->expType = type;
14032 type->refCount++;
14033 }
14034 e->destType = destType;
14035 destType->refCount++;
14036 }
14037 }
14038 }
14039
14040 void ApplyLocation(struct Expression * exp, struct Location * loc)
14041 {
14042 exp->loc = *loc;
14043 switch(exp->type)
14044 {
14045 case 4:
14046 if(exp->__anon1.op.exp1)
14047 ApplyLocation(exp->__anon1.op.exp1, loc);
14048 if(exp->__anon1.op.exp2)
14049 ApplyLocation(exp->__anon1.op.exp2, loc);
14050 break;
14051 case 5:
14052 if(exp->__anon1.list)
14053 {
14054 struct Expression * e;
14055
14056 for(e = (*exp->__anon1.list).first; e; e = e->next)
14057 ApplyLocation(e, loc);
14058 }
14059 break;
14060 case 6:
14061 if(exp->__anon1.index.index)
14062 {
14063 struct Expression * e;
14064
14065 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
14066 ApplyLocation(e, loc);
14067 }
14068 if(exp->__anon1.index.exp)
14069 ApplyLocation(exp->__anon1.index.exp, loc);
14070 break;
14071 case 7:
14072 if(exp->__anon1.call.arguments)
14073 {
14074 struct Expression * arg;
14075
14076 for(arg = (*exp->__anon1.call.arguments).first; arg; arg = arg->next)
14077 ApplyLocation(arg, loc);
14078 }
14079 if(exp->__anon1.call.exp)
14080 ApplyLocation(exp->__anon1.call.exp, loc);
14081 break;
14082 case 8:
14083 case 9:
14084 if(exp->__anon1.member.exp)
14085 ApplyLocation(exp->__anon1.member.exp, loc);
14086 break;
14087 case 11:
14088 if(exp->__anon1.cast.exp)
14089 ApplyLocation(exp->__anon1.cast.exp, loc);
14090 break;
14091 case 12:
14092 if(exp->__anon1.cond.exp)
14093 {
14094 struct Expression * e;
14095
14096 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
14097 ApplyLocation(e, loc);
14098 }
14099 if(exp->__anon1.cond.cond)
14100 ApplyLocation(exp->__anon1.cond.cond, loc);
14101 if(exp->__anon1.cond.elseExp)
14102 ApplyLocation(exp->__anon1.cond.elseExp, loc);
14103 break;
14104 case 34:
14105 if(exp->__anon1.vaArg.exp)
14106 ApplyLocation(exp->__anon1.vaArg.exp, loc);
14107 break;
14108 default:
14109 break;
14110 }
14111 }
14112
14113 extern char *  strstr(const char * , const char * );
14114
14115 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
14116
14117 struct __ecereNameSpace__ecere__com__DefinedExpression
14118 {
14119 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
14120 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
14121 const char *  name;
14122 const char *  value;
14123 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
14124 } __attribute__ ((gcc_struct));
14125
14126 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
14127
14128 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
14129
14130 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(const char *  string, int *  numBytes);
14131
14132 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
14133
14134 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
14135
14136 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList *  specifiers, struct Declarator * decl);
14137
14138 static void ProcessStatement(struct Statement * stmt);
14139
14140 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
14141
14142 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
14143
14144 extern char *  __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, const void * object, ...);
14145
14146 extern const char *  sourceFile;
14147
14148 unsigned int __ecereProp_Type_Get_specConst(struct Type * this);
14149
14150 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_Type_specConst;
14151
14152 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
14153
14154 void ProcessExpressionType(struct Expression * exp)
14155 {
14156 unsigned int unresolved = 0;
14157 struct Location oldyylloc = yylloc;
14158 unsigned int notByReference = 0;
14159
14160 if(!exp || exp->expType)
14161 return ;
14162 yylloc = exp->loc;
14163 switch(exp->type)
14164 {
14165 case 0:
14166 {
14167 struct Identifier * id = exp->__anon1.__anon1.identifier;
14168
14169 if(!id || !topContext)
14170 return ;
14171 if(id->_class && id->_class->__anon1.__anon1.name)
14172 {
14173 id->classSym = id->_class->__anon1.__anon1.symbol;
14174 }
14175 if(!strcmp(id->string, "__runtimePlatform"))
14176 {
14177 exp->expType = ProcessTypeString("ecere::com::Platform", 1);
14178 break;
14179 }
14180 else if(strstr(id->string, "__ecereClass") == id->string)
14181 {
14182 exp->expType = ProcessTypeString("ecere::com::Class", 1);
14183 break;
14184 }
14185 else if(id->_class && (id->classSym || (id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))))
14186 {
14187 ReplaceClassMembers(exp, thisClass);
14188 if(exp->type != 0)
14189 {
14190 ProcessExpressionType(exp);
14191 break;
14192 }
14193 if(id->classSym && ResolveIdWithClass(exp, id->classSym->__anon1.registered, 0))
14194 break;
14195 }
14196 else
14197 {
14198 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
14199
14200 if(!symbol)
14201 {
14202 if(exp->destType && CheckExpressionType(exp, exp->destType, 0, 0))
14203 break;
14204 else
14205 {
14206 if(thisClass)
14207 {
14208 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
14209 if(exp->type != 0)
14210 {
14211 ProcessExpressionType(exp);
14212 break;
14213 }
14214 }
14215 else if(currentClass && !id->_class)
14216 {
14217 if(ResolveIdWithClass(exp, currentClass, 1))
14218 break;
14219 }
14220 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
14221 }
14222 }
14223 if(symbol)
14224 {
14225 struct Type * type = symbol->type;
14226 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->__anon1._class) ? type->__anon1._class->__anon1.registered : (((void *)0));
14227
14228 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
14229 {
14230 struct Context * context = SetupTemplatesContext(_class);
14231
14232 type = ReplaceThisClassType(_class);
14233 FinishTemplatesContext(context);
14234 if(type)
14235 type->refCount = 0;
14236 }
14237 FreeSpecifier(id->_class);
14238 id->_class = (((void *)0));
14239 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14240 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
14241 id->classSym = (((void *)0));
14242 exp->expType = type;
14243 if(type)
14244 type->refCount++;
14245 if(type && (type->kind == 15))
14246 exp->isConstant = 1;
14247 if(symbol->isParam || !strcmp(id->string, "this"))
14248 {
14249 if(_class && _class->type == 1 && !type->declaredWithStruct)
14250 exp->byReference = 1;
14251 }
14252 if(symbol->isIterator)
14253 {
14254 if(symbol->isIterator == 3)
14255 {
14256 exp->type = 5;
14257 exp->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->__anon1.__anon1.identifier)));
14258 ((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2->expType = exp->expType;
14259 exp->expType = (((void *)0));
14260 ProcessExpressionType(exp);
14261 }
14262 else if(symbol->isIterator != 4)
14263 {
14264 exp->type = 8;
14265 exp->__anon1.member.exp = MkExpIdentifier(exp->__anon1.__anon1.identifier);
14266 exp->__anon1.member.exp->expType = exp->expType;
14267 exp->__anon1.member.member = MkIdentifier("data");
14268 exp->expType = (((void *)0));
14269 ProcessExpressionType(exp);
14270 }
14271 }
14272 break;
14273 }
14274 else
14275 {
14276 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
14277
14278 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
14279 {
14280 char name[1024];
14281
14282 strcpy(name, thisNameSpace);
14283 strcat(name, "::");
14284 strcat(name, id->string);
14285 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
14286 }
14287 if(!definedExp)
14288 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
14289 if(definedExp)
14290 {
14291 int c;
14292
14293 for(c = 0; c < definedExpStackPos; c++)
14294 if(definedExpStack[c] == definedExp)
14295 break;
14296 if(c == definedExpStackPos && c < sizeof (definedExpStack) / sizeof(void *))
14297 {
14298 struct Location backupYylloc = yylloc;
14299 struct __ecereNameSpace__ecere__com__Instance * backInput = fileInput;
14300
14301 definedExpStack[definedExpStackPos++] = definedExp;
14302 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
14303 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count))__extension__ ({
14304 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
14305
14306 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
14307 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
14308 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
14309 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
14310
14311 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
14312 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
14313 echoOn = 0;
14314 parsedExpression = (((void *)0));
14315 resetScanner();
14316 expression_yyparse();
14317 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
14318 if(backInput)
14319 fileInput = backInput;
14320 yylloc = backupYylloc;
14321 if(parsedExpression)
14322 {
14323 FreeIdentifier(id);
14324 exp->type = 5;
14325 exp->__anon1.list = MkListOne(parsedExpression);
14326 ApplyLocation(parsedExpression, &yylloc);
14327 ProcessExpressionType(exp);
14328 definedExpStackPos--;
14329 return ;
14330 }
14331 definedExpStackPos--;
14332 }
14333 else
14334 {
14335 if(inCompiler)
14336 {
14337 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Recursion in defined expression %s\n", (((void *)0))), id->string);
14338 }
14339 }
14340 }
14341 else
14342 {
14343 struct GlobalData * data = (((void *)0));
14344
14345 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
14346 {
14347 char name[1024];
14348
14349 strcpy(name, thisNameSpace);
14350 strcat(name, "::");
14351 strcat(name, id->string);
14352 data = FindGlobalData(name);
14353 }
14354 if(!data)
14355 data = FindGlobalData(id->string);
14356 if(data)
14357 {
14358 DeclareGlobalData(data);
14359 exp->expType = data->dataType;
14360 if(data->dataType)
14361 data->dataType->refCount++;
14362 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14363 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
14364 FreeSpecifier(id->_class);
14365 id->_class = (((void *)0));
14366 break;
14367 }
14368 else
14369 {
14370 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
14371
14372 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
14373 {
14374 char name[1024];
14375
14376 strcpy(name, thisNameSpace);
14377 strcat(name, "::");
14378 strcat(name, id->string);
14379 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
14380 }
14381 if(!function)
14382 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
14383 if(function)
14384 {
14385 char name[1024];
14386
14387 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14388 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
14389 name[0] = (char)0;
14390 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
14391 strcpy(name, "__ecereFunction_");
14392 FullClassNameCat(name, id->string, 0);
14393 if(DeclareFunction(function, name))
14394 {
14395 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14396 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
14397 }
14398 exp->expType = function->dataType;
14399 if(function->dataType)
14400 function->dataType->refCount++;
14401 FreeSpecifier(id->_class);
14402 id->_class = (((void *)0));
14403 break;
14404 }
14405 }
14406 }
14407 }
14408 }
14409 unresolved = 1;
14410 break;
14411 }
14412 case 1:
14413 {
14414 if(!exp->__anon1.instance->_class)
14415 {
14416 if(exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class)
14417 {
14418 exp->__anon1.instance->_class = MkSpecifierName(exp->destType->__anon1._class->string);
14419 }
14420 }
14421 ProcessInstantiationType(exp->__anon1.instance);
14422 exp->isConstant = exp->__anon1.instance->isConstant;
14423 if(exp->__anon1.instance->_class)
14424 {
14425 exp->expType = MkClassType(exp->__anon1.instance->_class->__anon1.__anon1.name);
14426 }
14427 break;
14428 }
14429 case 2:
14430 {
14431 if(!exp->expType)
14432 {
14433 char * constant = exp->__anon1.__anon1.constant;
14434 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 1, type);
14435
14436 exp->expType = type;
14437 if(constant[0] == '\'')
14438 {
14439 if((int)((unsigned char *)constant)[1] > 127)
14440 {
14441 int nb;
14442 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
14443
14444 if(nb < 2)
14445 ch = constant[1];
14446 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
14447 exp->__anon1.__anon1.constant = PrintUInt(ch);
14448 type->kind = 8;
14449 type->__anon1._class = FindClass("unichar");
14450 type->isSigned = 0;
14451 }
14452 else
14453 {
14454 type->kind = 1;
14455 type->isSigned = 1;
14456 }
14457 }
14458 else
14459 {
14460 char * dot = strchr(constant, '.');
14461 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
14462 char * exponent;
14463
14464 if(isHex)
14465 {
14466 exponent = strchr(constant, 'p');
14467 if(!exponent)
14468 exponent = strchr(constant, 'P');
14469 }
14470 else
14471 {
14472 exponent = strchr(constant, 'e');
14473 if(!exponent)
14474 exponent = strchr(constant, 'E');
14475 }
14476 if(dot || exponent)
14477 {
14478 if(strchr(constant, 'f') || strchr(constant, 'F'))
14479 type->kind = 6;
14480 else
14481 type->kind = 7;
14482 type->isSigned = 1;
14483 }
14484 else
14485 {
14486 unsigned int isSigned = constant[0] == '-';
14487 char * endP = (((void *)0));
14488 long long i64 = strtoll(constant, &endP, 0);
14489 uint64 ui64 = strtoull(constant, &endP, 0);
14490 unsigned int is64Bit = endP && (!strcmp(endP, "LL") || !strcmp(endP, "ll"));
14491
14492 if(isSigned)
14493 {
14494 if(i64 < (((int)0x80000000)))
14495 is64Bit = 1;
14496 }
14497 else
14498 {
14499 if(ui64 > (((int)0x7fffffff)))
14500 {
14501 if(ui64 > (0xffffffff))
14502 {
14503 is64Bit = 1;
14504 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
14505 isSigned = 1;
14506 }
14507 }
14508 else if(constant[0] != '0' || !constant[1])
14509 isSigned = 1;
14510 }
14511 type->kind = is64Bit ? 4 : 3;
14512 type->isSigned = isSigned;
14513 }
14514 }
14515 exp->isConstant = 1;
14516 if(exp->destType && exp->destType->kind == 7)
14517 type->kind = 7;
14518 else if(exp->destType && exp->destType->kind == 6)
14519 type->kind = 6;
14520 else if(exp->destType && exp->destType->kind == 4)
14521 type->kind = 4;
14522 }
14523 break;
14524 }
14525 case 3:
14526 {
14527 exp->isConstant = 1;
14528 exp->expType = __extension__ ({
14529 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14530
14531 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
14532 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14533
14534 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 1, __ecereInstance1->constant = 1, __ecereInstance1->isSigned = 1, __ecereInstance1;
14535 }), __ecereInstance2;
14536 });
14537 break;
14538 }
14539 case 13:
14540 case 26:
14541 ProcessExpressionType(exp->__anon1._new.size);
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._new.typeName->qualifiers, exp->__anon1._new.typeName->declarator), __ecereInstance1;
14546 });
14547 DeclareType(exp->expType->__anon1.type, 0, 0);
14548 break;
14549 case 14:
14550 case 27:
14551 ProcessExpressionType(exp->__anon1._renew.size);
14552 ProcessExpressionType(exp->__anon1._renew.exp);
14553 exp->expType = __extension__ ({
14554 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14555
14556 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = ProcessType(exp->__anon1._renew.typeName->qualifiers, exp->__anon1._renew.typeName->declarator), __ecereInstance1;
14557 });
14558 DeclareType(exp->expType->__anon1.type, 0, 0);
14559 break;
14560 case 4:
14561 {
14562 unsigned int assign = 0, boolResult = 0, boolOps = 0;
14563 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
14564 unsigned int useDestType = 0, useSideType = 0;
14565 struct Location oldyylloc = yylloc;
14566 unsigned int useSideUnit = 0;
14567 struct __ecereNameSpace__ecere__com__Class * destClass = (exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class) ? exp->destType->__anon1._class->__anon1.registered : (((void *)0));
14568 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
14569
14570 switch(exp->__anon1.op.op)
14571 {
14572 case '=':
14573 case MUL_ASSIGN:
14574 case DIV_ASSIGN:
14575 case MOD_ASSIGN:
14576 case ADD_ASSIGN:
14577 case SUB_ASSIGN:
14578 case LEFT_ASSIGN:
14579 case RIGHT_ASSIGN:
14580 case AND_ASSIGN:
14581 case XOR_ASSIGN:
14582 case OR_ASSIGN:
14583 assign = 1;
14584 break;
14585 case '!':
14586 break;
14587 case AND_OP:
14588 case OR_OP:
14589 boolOps = 1;
14590 boolResult = 1;
14591 break;
14592 case EQ_OP:
14593 case '<':
14594 case '>':
14595 case LE_OP:
14596 case GE_OP:
14597 case NE_OP:
14598 boolResult = 1;
14599 useSideType = 1;
14600 break;
14601 case '+':
14602 case '-':
14603 useSideUnit = 1;
14604 useSideType = 1;
14605 useDestType = 1;
14606 break;
14607 case LEFT_OP:
14608 case RIGHT_OP:
14609 useSideType = 1;
14610 useDestType = 1;
14611 break;
14612 case '|':
14613 case '^':
14614 useSideType = 1;
14615 useDestType = 1;
14616 break;
14617 case '/':
14618 case '%':
14619 useSideType = 1;
14620 useDestType = 1;
14621 break;
14622 case '&':
14623 case '*':
14624 if(exp->__anon1.op.exp1)
14625 {
14626 useSideType = 1;
14627 useDestType = 1;
14628 }
14629 break;
14630 }
14631 if(exp->__anon1.op.op == '&')
14632 {
14633 if(!exp->__anon1.op.exp1 && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->type == 0 && exp->__anon1.op.exp2->__anon1.__anon1.identifier)
14634 {
14635 struct Identifier * id = exp->__anon1.op.exp2->__anon1.__anon1.identifier;
14636 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
14637
14638 if(symbol && symbol->isIterator == 2)
14639 {
14640 exp->type = 8;
14641 exp->__anon1.member.exp = exp->__anon1.op.exp2;
14642 exp->__anon1.member.member = MkIdentifier("key");
14643 exp->expType = (((void *)0));
14644 exp->__anon1.op.exp2->expType = symbol->type;
14645 symbol->type->refCount++;
14646 ProcessExpressionType(exp);
14647 FreeType(dummy);
14648 break;
14649 }
14650 }
14651 }
14652 if(exp->__anon1.op.exp1)
14653 {
14654 if(exp->__anon1.op.exp2 && useSideUnit && useDestType && destClass && destClass->type == 3 && destClass->base->type != 3)
14655 useDestType = 0;
14656 if(destClass && useDestType && ((destClass->type == 3 && useSideUnit) || destClass->type == 4 || destClass->type == 2))
14657 {
14658 if(exp->__anon1.op.exp1->destType)
14659 FreeType(exp->__anon1.op.exp1->destType);
14660 exp->__anon1.op.exp1->destType = exp->destType;
14661 exp->__anon1.op.exp1->opDestType = 1;
14662 if(exp->destType)
14663 exp->destType->refCount++;
14664 }
14665 else if(!assign)
14666 {
14667 if(exp->__anon1.op.exp1->destType)
14668 FreeType(exp->__anon1.op.exp1->destType);
14669 exp->__anon1.op.exp1->destType = dummy;
14670 dummy->refCount++;
14671 }
14672 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
14673 exp->__anon1.op.exp1->destType->count++;
14674 ProcessExpressionType(exp->__anon1.op.exp1);
14675 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
14676 exp->__anon1.op.exp1->destType->count--;
14677 exp->__anon1.op.exp1->opDestType = 0;
14678 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)
14679 {
14680 exp->__anon1.op.exp2 = MkExpConstant("1");
14681 exp->__anon1.op.op = exp->__anon1.op.op == INC_OP ? ADD_ASSIGN : SUB_ASSIGN;
14682 assign = 1;
14683 }
14684 if(exp->__anon1.op.exp1->destType == dummy)
14685 {
14686 FreeType(dummy);
14687 exp->__anon1.op.exp1->destType = (((void *)0));
14688 }
14689 type1 = exp->__anon1.op.exp1->expType;
14690 }
14691 if(exp->__anon1.op.exp2)
14692 {
14693 char expString[10240];
14694
14695 expString[0] = '\0';
14696 if(exp->__anon1.op.exp2->type == 1 && !exp->__anon1.op.exp2->__anon1.instance->_class)
14697 {
14698 if(exp->__anon1.op.exp1)
14699 {
14700 exp->__anon1.op.exp2->destType = exp->__anon1.op.exp1->expType;
14701 if(exp->__anon1.op.exp1->expType)
14702 exp->__anon1.op.exp1->expType->refCount++;
14703 }
14704 else
14705 {
14706 exp->__anon1.op.exp2->destType = exp->destType;
14707 if(!exp->__anon1.op.exp1 || exp->__anon1.op.op != '&')
14708 exp->__anon1.op.exp2->opDestType = 1;
14709 if(exp->destType)
14710 exp->destType->refCount++;
14711 }
14712 if(type1)
14713 type1->refCount++;
14714 exp->expType = type1;
14715 }
14716 else if(assign)
14717 {
14718 if(inCompiler)
14719 PrintExpression(exp->__anon1.op.exp2, expString);
14720 if(type1 && type1->kind == 13)
14721 {
14722 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)
14723 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "operator %s illegal on pointer\n", (((void *)0))), exp->__anon1.op.op);
14724 else if(exp->__anon1.op.op == '=')
14725 {
14726 if(exp->__anon1.op.exp2->destType)
14727 FreeType(exp->__anon1.op.exp2->destType);
14728 exp->__anon1.op.exp2->destType = type1;
14729 if(type1)
14730 type1->refCount++;
14731 }
14732 }
14733 else
14734 {
14735 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)
14736 ;
14737 else
14738 {
14739 if(exp->__anon1.op.exp2->destType)
14740 FreeType(exp->__anon1.op.exp2->destType);
14741 exp->__anon1.op.exp2->destType = type1;
14742 if(type1)
14743 type1->refCount++;
14744 }
14745 }
14746 if(type1)
14747 type1->refCount++;
14748 exp->expType = type1;
14749 }
14750 else if(destClass && ((destClass->type == 3 && useDestType && useSideUnit) || (destClass->type == 4 && useDestType)))
14751 {
14752 if(exp->__anon1.op.exp2->destType)
14753 FreeType(exp->__anon1.op.exp2->destType);
14754 exp->__anon1.op.exp2->destType = exp->destType;
14755 if(exp->__anon1.op.op != '&')
14756 exp->__anon1.op.exp2->opDestType = 1;
14757 if(exp->destType)
14758 exp->destType->refCount++;
14759 }
14760 else
14761 {
14762 if(exp->__anon1.op.exp2->destType)
14763 FreeType(exp->__anon1.op.exp2->destType);
14764 exp->__anon1.op.exp2->destType = dummy;
14765 dummy->refCount++;
14766 }
14767 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))
14768 {
14769 FreeType(exp->__anon1.op.exp2->destType);
14770 exp->__anon1.op.exp2->destType = type1;
14771 type1->refCount++;
14772 }
14773 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
14774 exp->__anon1.op.exp2->destType->count++;
14775 if(exp->__anon1.op.op == SIZEOF)
14776 {
14777 struct Expression * e = exp->__anon1.op.exp2;
14778
14779 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
14780 {
14781 if(e->type == 5 || e->type == 32 || e->type == 23)
14782 {
14783 if(e->type == 23)
14784 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
14785 else
14786 e = (*e->__anon1.list).last;
14787 }
14788 }
14789 if(e->type == 11 && e->__anon1.cast.exp)
14790 e->__anon1.cast.exp->needCast = 1;
14791 }
14792 ProcessExpressionType(exp->__anon1.op.exp2);
14793 exp->__anon1.op.exp2->opDestType = 0;
14794 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
14795 exp->__anon1.op.exp2->destType->count--;
14796 if(assign && type1 && type1->kind == 13 && exp->__anon1.op.exp2->expType)
14797 {
14798 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)
14799 {
14800 if(exp->__anon1.op.op != '=' && type1->__anon1.type->kind == 0)
14801 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14802 }
14803 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)))
14804 {
14805 if(exp->__anon1.op.op == ADD_ASSIGN)
14806 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14807 }
14808 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))
14809 {
14810 if(exp->__anon1.op.op == ADD_ASSIGN)
14811 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14812 }
14813 else if(inCompiler)
14814 {
14815 char type1String[1024];
14816 char type2String[1024];
14817
14818 type1String[0] = '\0';
14819 type2String[0] = '\0';
14820 PrintType(exp->__anon1.op.exp2->expType, type1String, 0, 1);
14821 PrintType(type1, type2String, 0, 1);
14822 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14823 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
14824 }
14825 }
14826 if(exp->__anon1.op.exp2->destType == dummy)
14827 {
14828 FreeType(dummy);
14829 exp->__anon1.op.exp2->destType = (((void *)0));
14830 }
14831 if(exp->__anon1.op.op == '-' && !exp->__anon1.op.exp1 && exp->__anon1.op.exp2->expType && !exp->__anon1.op.exp2->expType->isSigned)
14832 {
14833 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14834 type2->refCount = 1;
14835 CopyTypeInto(type2, exp->__anon1.op.exp2->expType);
14836 type2->isSigned = 1;
14837 }
14838 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))
14839 {
14840 type2 = __extension__ ({
14841 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14842
14843 __ecereInstance1->kind = 3, __ecereInstance1;
14844 });
14845 type2->refCount = 1;
14846 type2->isSigned = 1;
14847 }
14848 else
14849 {
14850 type2 = exp->__anon1.op.exp2->expType;
14851 if(type2)
14852 type2->refCount++;
14853 }
14854 }
14855 dummy->kind = 0;
14856 if(exp->__anon1.op.op == SIZEOF)
14857 {
14858 exp->expType = __extension__ ({
14859 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14860
14861 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
14862 });
14863 exp->isConstant = 1;
14864 }
14865 else if(exp->__anon1.op.op == '*' && !exp->__anon1.op.exp1)
14866 {
14867 exp->expType = Dereference(type2);
14868 if(type2 && type2->kind == 8)
14869 notByReference = 1;
14870 }
14871 else if(exp->__anon1.op.op == '&' && !exp->__anon1.op.exp1)
14872 exp->expType = Reference(type2);
14873 else if(!assign)
14874 {
14875 if(boolOps)
14876 {
14877 if(exp->__anon1.op.exp1)
14878 {
14879 if(exp->__anon1.op.exp1->destType)
14880 FreeType(exp->__anon1.op.exp1->destType);
14881 exp->__anon1.op.exp1->destType = MkClassType("bool");
14882 exp->__anon1.op.exp1->destType->truth = 1;
14883 if(!exp->__anon1.op.exp1->expType)
14884 ProcessExpressionType(exp->__anon1.op.exp1);
14885 else
14886 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
14887 FreeType(exp->__anon1.op.exp1->expType);
14888 exp->__anon1.op.exp1->expType = MkClassType("bool");
14889 exp->__anon1.op.exp1->expType->truth = 1;
14890 }
14891 if(exp->__anon1.op.exp2)
14892 {
14893 if(exp->__anon1.op.exp2->destType)
14894 FreeType(exp->__anon1.op.exp2->destType);
14895 exp->__anon1.op.exp2->destType = MkClassType("bool");
14896 exp->__anon1.op.exp2->destType->truth = 1;
14897 if(!exp->__anon1.op.exp2->expType)
14898 ProcessExpressionType(exp->__anon1.op.exp2);
14899 else
14900 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
14901 FreeType(exp->__anon1.op.exp2->expType);
14902 exp->__anon1.op.exp2->expType = MkClassType("bool");
14903 exp->__anon1.op.exp2->expType->truth = 1;
14904 }
14905 }
14906 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")))))
14907 {
14908 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"))))
14909 {
14910 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)))
14911 {
14912 struct Type * intType;
14913
14914 if(!type1->__anon1._class->__anon1.registered->dataType)
14915 type1->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type1->__anon1._class->__anon1.registered->dataTypeString, 0);
14916 if(!type2->__anon1._class->__anon1.registered->dataType)
14917 type2->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type2->__anon1._class->__anon1.registered->dataTypeString, 0);
14918 intType = ProcessTypeString((type1->__anon1._class->__anon1.registered->dataType->kind == 4 || type2->__anon1._class->__anon1.registered->dataType->kind == 4) ? "int64" : "int", 0);
14919 if(exp->__anon1.op.exp1->destType)
14920 FreeType(exp->__anon1.op.exp1->destType);
14921 if(exp->__anon1.op.exp2->destType)
14922 FreeType(exp->__anon1.op.exp2->destType);
14923 exp->__anon1.op.exp1->destType = intType;
14924 exp->__anon1.op.exp2->destType = intType;
14925 intType->refCount++;
14926 }
14927 else
14928 {
14929 if(exp->__anon1.op.exp2->destType)
14930 FreeType(exp->__anon1.op.exp2->destType);
14931 exp->__anon1.op.exp2->destType = type1;
14932 type1->refCount++;
14933 if(exp->__anon1.op.exp1->destType)
14934 FreeType(exp->__anon1.op.exp1->destType);
14935 exp->__anon1.op.exp1->destType = type2;
14936 type2->refCount++;
14937 }
14938 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)
14939 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);
14940 if(type1->kind == 13 && type1->__anon1.type->kind == 20 && type2->kind != 13)
14941 {
14942 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 1);
14943
14944 if(argExp)
14945 {
14946 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14947
14948 exp->__anon1.op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->__anon1.op.exp1)));
14949 ProcessExpressionType(exp->__anon1.op.exp1);
14950 if(type2->kind != 13)
14951 {
14952 ProcessExpressionType(classExp);
14953 exp->__anon1.op.exp2 = MkExpBrackets(MkListOne(MkExpOp(exp->__anon1.op.exp2, '*', MkExpMember(classExp, MkIdentifier("typeSize")))));
14954 if(!exp->__anon1.op.exp2->expType)
14955 {
14956 if(type2)
14957 FreeType(type2);
14958 type2 = exp->__anon1.op.exp2->expType = ProcessTypeString("int", 0);
14959 type2->refCount++;
14960 }
14961 ProcessExpressionType(exp->__anon1.op.exp2);
14962 }
14963 }
14964 }
14965 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)))
14966 {
14967 if(type1->kind != 8 && type1->__anon1.type->kind == 0)
14968 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14969 exp->expType = type1;
14970 if(type1)
14971 type1->refCount++;
14972 }
14973 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)))
14974 {
14975 if(type2->kind != 8 && type2->__anon1.type->kind == 0)
14976 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14977 exp->expType = type2;
14978 if(type2)
14979 type2->refCount++;
14980 }
14981 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))
14982 {
14983 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "different levels of indirection\n", (((void *)0))));
14984 }
14985 else
14986 {
14987 unsigned int success = 0;
14988
14989 if(type1->kind == 13 && type2->kind == 13)
14990 {
14991 if(exp->__anon1.op.op == '+')
14992 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14993 else if(exp->__anon1.op.op == '-')
14994 {
14995 if(MatchTypes(type1->__anon1.type, type2->__anon1.type, (((void *)0)), (((void *)0)), (((void *)0)), 0, 0, 0, 0, 0))
14996 {
14997 exp->expType = __extension__ ({
14998 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14999
15000 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
15001 });
15002 success = 1;
15003 if(type1->__anon1.type->kind == 20)
15004 {
15005 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 1);
15006
15007 if(argExp)
15008 {
15009 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
15010
15011 ProcessExpressionType(classExp);
15012 exp->type = 5;
15013 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"))));
15014 ProcessExpressionType(((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2);
15015 FreeType(dummy);
15016 return ;
15017 }
15018 }
15019 }
15020 }
15021 }
15022 if(!success && exp->__anon1.op.exp1->type == 2)
15023 {
15024 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
15025 {
15026 if(exp->expType)
15027 FreeType(exp->expType);
15028 exp->expType = exp->__anon1.op.exp1->destType;
15029 if(exp->__anon1.op.exp1->destType)
15030 exp->__anon1.op.exp1->destType->refCount++;
15031 success = 1;
15032 }
15033 else if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
15034 {
15035 if(exp->expType)
15036 FreeType(exp->expType);
15037 exp->expType = exp->__anon1.op.exp2->destType;
15038 if(exp->__anon1.op.exp2->destType)
15039 exp->__anon1.op.exp2->destType->refCount++;
15040 success = 1;
15041 }
15042 }
15043 else if(!success)
15044 {
15045 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
15046 {
15047 if(exp->expType)
15048 FreeType(exp->expType);
15049 exp->expType = exp->__anon1.op.exp2->destType;
15050 if(exp->__anon1.op.exp2->destType)
15051 exp->__anon1.op.exp2->destType->refCount++;
15052 success = 1;
15053 }
15054 else if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
15055 {
15056 if(exp->expType)
15057 FreeType(exp->expType);
15058 exp->expType = exp->__anon1.op.exp1->destType;
15059 if(exp->__anon1.op.exp1->destType)
15060 exp->__anon1.op.exp1->destType->refCount++;
15061 success = 1;
15062 }
15063 }
15064 if(!success)
15065 {
15066 char expString1[10240];
15067 char expString2[10240];
15068 char type1[1024];
15069 char type2[1024];
15070
15071 expString1[0] = '\0';
15072 expString2[0] = '\0';
15073 type1[0] = '\0';
15074 type2[0] = '\0';
15075 if(inCompiler)
15076 {
15077 PrintExpression(exp->__anon1.op.exp1, expString1);
15078 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
15079 PrintExpression(exp->__anon1.op.exp2, expString2);
15080 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
15081 PrintType(exp->__anon1.op.exp1->expType, type1, 0, 1);
15082 PrintType(exp->__anon1.op.exp2->expType, type2, 0, 1);
15083 }
15084 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
15085 }
15086 }
15087 }
15088 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)
15089 {
15090 if(exp->__anon1.op.exp1->destType)
15091 FreeType(exp->__anon1.op.exp1->destType);
15092 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
15093 if(type2->__anon1._class->__anon1.registered->dataType)
15094 type2->__anon1._class->__anon1.registered->dataType->refCount++;
15095 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
15096 exp->expType = type2;
15097 if(type2)
15098 type2->refCount++;
15099 }
15100 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)
15101 {
15102 if(exp->__anon1.op.exp2->destType)
15103 FreeType(exp->__anon1.op.exp2->destType);
15104 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
15105 if(type1->__anon1._class->__anon1.registered->dataType)
15106 type1->__anon1._class->__anon1.registered->dataType->refCount++;
15107 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
15108 exp->expType = type1;
15109 if(type1)
15110 type1->refCount++;
15111 }
15112 else if(type1)
15113 {
15114 unsigned int valid = 0;
15115
15116 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3 && type2 && type2->kind != 8)
15117 {
15118 if(exp->__anon1.op.exp2->destType)
15119 FreeType(exp->__anon1.op.exp2->destType);
15120 if(!type1->__anon1._class->__anon1.registered->dataType)
15121 type1->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type1->__anon1._class->__anon1.registered->dataTypeString, 0);
15122 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
15123 exp->__anon1.op.exp2->destType->refCount++;
15124 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
15125 if(type2)
15126 FreeType(type2);
15127 type2 = exp->__anon1.op.exp2->destType;
15128 if(type2)
15129 type2->refCount++;
15130 exp->expType = type2;
15131 type2->refCount++;
15132 }
15133 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3 && type1 && type1->kind != 8)
15134 {
15135 if(exp->__anon1.op.exp1->destType)
15136 FreeType(exp->__anon1.op.exp1->destType);
15137 if(!type2->__anon1._class->__anon1.registered->dataType)
15138 type2->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type2->__anon1._class->__anon1.registered->dataTypeString, 0);
15139 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
15140 exp->__anon1.op.exp1->destType->refCount++;
15141 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
15142 type1 = exp->__anon1.op.exp1->destType;
15143 exp->expType = type1;
15144 type1->refCount++;
15145 }
15146 if(!boolResult || exp->__anon1.op.op == '>' || exp->__anon1.op.op == '<' || exp->__anon1.op.op == GE_OP || exp->__anon1.op.op == LE_OP)
15147 {
15148 unsigned int op1IsEnum = type1 && type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4;
15149 unsigned int op2IsEnum = type2 && type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4;
15150
15151 if(exp->__anon1.op.op == '*' || exp->__anon1.op.op == '/' || exp->__anon1.op.op == '-' || exp->__anon1.op.op == '|' || exp->__anon1.op.op == '^')
15152 {
15153 if(op1IsEnum && exp->__anon1.op.exp2->expType)
15154 {
15155 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0, 0))
15156 {
15157 if(exp->expType)
15158 FreeType(exp->expType);
15159 exp->expType = exp->__anon1.op.exp2->expType;
15160 if(exp->__anon1.op.exp2->expType)
15161 exp->__anon1.op.exp2->expType->refCount++;
15162 valid = 1;
15163 }
15164 }
15165 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
15166 {
15167 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0, 0))
15168 {
15169 if(exp->expType)
15170 FreeType(exp->expType);
15171 exp->expType = exp->__anon1.op.exp1->expType;
15172 if(exp->__anon1.op.exp1->expType)
15173 exp->__anon1.op.exp1->expType->refCount++;
15174 valid = 1;
15175 }
15176 }
15177 }
15178 else
15179 {
15180 if(op1IsEnum && exp->__anon1.op.exp2->expType)
15181 {
15182 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0, 0))
15183 {
15184 if(exp->expType)
15185 FreeType(exp->expType);
15186 exp->expType = exp->__anon1.op.exp1->expType;
15187 if(exp->__anon1.op.exp1->expType)
15188 exp->__anon1.op.exp1->expType->refCount++;
15189 valid = 1;
15190 }
15191 }
15192 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
15193 {
15194 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0, 0))
15195 {
15196 if(exp->expType)
15197 FreeType(exp->expType);
15198 exp->expType = exp->__anon1.op.exp2->expType;
15199 if(exp->__anon1.op.exp2->expType)
15200 exp->__anon1.op.exp2->expType->refCount++;
15201 valid = 1;
15202 }
15203 }
15204 }
15205 }
15206 if(!valid)
15207 {
15208 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))
15209 {
15210 if(exp->__anon1.op.exp1->destType)
15211 FreeType(exp->__anon1.op.exp1->destType);
15212 exp->__anon1.op.exp1->destType = type2;
15213 type2->refCount++;
15214 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
15215 {
15216 if(exp->expType)
15217 FreeType(exp->expType);
15218 exp->expType = exp->__anon1.op.exp1->destType;
15219 if(exp->__anon1.op.exp1->destType)
15220 exp->__anon1.op.exp1->destType->refCount++;
15221 }
15222 }
15223 else
15224 {
15225 if(exp->__anon1.op.exp2->destType)
15226 FreeType(exp->__anon1.op.exp2->destType);
15227 exp->__anon1.op.exp2->destType = type1;
15228 type1->refCount++;
15229 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
15230 {
15231 if(exp->expType)
15232 FreeType(exp->expType);
15233 exp->expType = exp->__anon1.op.exp2->destType;
15234 if(exp->__anon1.op.exp2->destType)
15235 exp->__anon1.op.exp2->destType->refCount++;
15236 }
15237 else if(type1 && type2)
15238 {
15239 char expString1[10240];
15240 char expString2[10240];
15241 char type1String[1024];
15242 char type2String[1024];
15243
15244 expString1[0] = '\0';
15245 expString2[0] = '\0';
15246 type1String[0] = '\0';
15247 type2String[0] = '\0';
15248 if(inCompiler)
15249 {
15250 PrintExpression(exp->__anon1.op.exp1, expString1);
15251 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
15252 PrintExpression(exp->__anon1.op.exp2, expString2);
15253 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
15254 PrintType(exp->__anon1.op.exp1->expType, type1String, 0, 1);
15255 PrintType(exp->__anon1.op.exp2->expType, type2String, 0, 1);
15256 }
15257 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
15258 if(type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4)
15259 {
15260 exp->expType = exp->__anon1.op.exp1->expType;
15261 if(exp->__anon1.op.exp1->expType)
15262 exp->__anon1.op.exp1->expType->refCount++;
15263 }
15264 else if(type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)
15265 {
15266 exp->expType = exp->__anon1.op.exp2->expType;
15267 if(exp->__anon1.op.exp2->expType)
15268 exp->__anon1.op.exp2->expType->refCount++;
15269 }
15270 }
15271 }
15272 }
15273 }
15274 else if(type2)
15275 {
15276 if(type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)
15277 {
15278 struct Type * oldType = exp->__anon1.op.exp1->expType;
15279
15280 exp->__anon1.op.exp1->expType = (((void *)0));
15281 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
15282 FreeType(oldType);
15283 else
15284 exp->__anon1.op.exp1->expType = oldType;
15285 }
15286 if(exp->__anon1.op.exp1->destType)
15287 FreeType(exp->__anon1.op.exp1->destType);
15288 exp->__anon1.op.exp1->destType = type2;
15289 type2->refCount++;
15290 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
15291 {
15292 if(exp->expType)
15293 FreeType(exp->expType);
15294 exp->expType = exp->__anon1.op.exp1->destType;
15295 if(exp->__anon1.op.exp1->destType)
15296 exp->__anon1.op.exp1->destType->refCount++;
15297 }
15298 }
15299 }
15300 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
15301 {
15302 if(type1 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3)
15303 {
15304 if(exp->__anon1.op.exp1->destType)
15305 FreeType(exp->__anon1.op.exp1->destType);
15306 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
15307 if(type2->__anon1._class->__anon1.registered->dataType)
15308 type2->__anon1._class->__anon1.registered->dataType->refCount++;
15309 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
15310 }
15311 if(exp->__anon1.op.op == '!')
15312 {
15313 exp->expType = MkClassType("bool");
15314 exp->expType->truth = 1;
15315 }
15316 else
15317 {
15318 exp->expType = type2;
15319 if(type2)
15320 type2->refCount++;
15321 }
15322 }
15323 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
15324 {
15325 if(type2 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3)
15326 {
15327 if(exp->__anon1.op.exp2->destType)
15328 FreeType(exp->__anon1.op.exp2->destType);
15329 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
15330 if(type1->__anon1._class->__anon1.registered->dataType)
15331 type1->__anon1._class->__anon1.registered->dataType->refCount++;
15332 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
15333 }
15334 exp->expType = type1;
15335 if(type1)
15336 type1->refCount++;
15337 }
15338 }
15339 yylloc = exp->loc;
15340 if(exp->__anon1.op.exp1 && !exp->__anon1.op.exp1->expType)
15341 {
15342 char expString[10000];
15343
15344 expString[0] = '\0';
15345 if(inCompiler)
15346 {
15347 PrintExpression(exp->__anon1.op.exp1, expString);
15348 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15349 }
15350 if(expString[0])
15351 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
15352 }
15353 if(exp->__anon1.op.exp2 && !exp->__anon1.op.exp2->expType)
15354 {
15355 char expString[10240];
15356
15357 expString[0] = '\0';
15358 if(inCompiler)
15359 {
15360 PrintExpression(exp->__anon1.op.exp2, expString);
15361 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15362 }
15363 if(expString[0])
15364 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
15365 }
15366 if(boolResult)
15367 {
15368 FreeType(exp->expType);
15369 exp->expType = MkClassType("bool");
15370 exp->expType->truth = 1;
15371 }
15372 if(exp->__anon1.op.op != SIZEOF)
15373 exp->isConstant = (!exp->__anon1.op.exp1 || exp->__anon1.op.exp1->isConstant) && (!exp->__anon1.op.exp2 || exp->__anon1.op.exp2->isConstant);
15374 if(exp->__anon1.op.op == SIZEOF && exp->__anon1.op.exp2->expType)
15375 {
15376 DeclareType(exp->__anon1.op.exp2->expType, 0, 0);
15377 }
15378 if(exp->__anon1.op.op == DELETE && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->expType && __ecereProp_Type_Get_specConst(exp->__anon1.op.exp2->expType))
15379 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "deleting const qualified object\n", (((void *)0))));
15380 yylloc = oldyylloc;
15381 FreeType(dummy);
15382 if(type2)
15383 FreeType(type2);
15384 break;
15385 }
15386 case 5:
15387 case 32:
15388 {
15389 struct Expression * e;
15390
15391 exp->isConstant = 1;
15392 for(e = (*exp->__anon1.list).first; e; e = e->next)
15393 {
15394 unsigned int inced = 0;
15395
15396 if(!e->next)
15397 {
15398 FreeType(e->destType);
15399 e->opDestType = exp->opDestType;
15400 e->destType = exp->destType;
15401 if(e->destType)
15402 {
15403 exp->destType->refCount++;
15404 e->destType->count++;
15405 inced = 1;
15406 }
15407 }
15408 ProcessExpressionType(e);
15409 if(inced)
15410 exp->destType->count--;
15411 if(!exp->expType && !e->next)
15412 {
15413 exp->expType = e->expType;
15414 if(e->expType)
15415 e->expType->refCount++;
15416 }
15417 if(!e->isConstant)
15418 exp->isConstant = 0;
15419 }
15420 e = (*exp->__anon1.list).first;
15421 if(!e->next && e->type == 8)
15422 {
15423 struct Expression * next = exp->next, * prev = exp->prev;
15424
15425 FreeType(exp->expType);
15426 FreeType(exp->destType);
15427 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
15428 *exp = *e;
15429 exp->prev = prev;
15430 exp->next = next;
15431 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
15432 ProcessExpressionType(exp);
15433 }
15434 break;
15435 }
15436 case 6:
15437 {
15438 struct Expression * e;
15439
15440 exp->isConstant = 1;
15441 ProcessExpressionType(exp->__anon1.index.exp);
15442 if(!exp->__anon1.index.exp->isConstant)
15443 exp->isConstant = 0;
15444 if(exp->__anon1.index.exp->expType)
15445 {
15446 struct Type * source = exp->__anon1.index.exp->expType;
15447
15448 if(source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered)
15449 {
15450 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class->__anon1.registered;
15451 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
15452
15453 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
15454 {
15455 exp->expType = ProcessTypeString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, 0);
15456 if(exp->__anon1.index.index && (*exp->__anon1.index.index).last)
15457 {
15458 struct Type * type = ProcessTypeString(_class->templateArgs[1].__anon1.__anon1.dataTypeString, 0);
15459
15460 if(type->kind == 8)
15461 type->constant = 1;
15462 else if(type->kind == 13)
15463 {
15464 struct Type * t = type;
15465
15466 while(t->kind == 13)
15467 t = t->__anon1.type;
15468 t->constant = 1;
15469 }
15470 ((struct Expression *)(*exp->__anon1.index.index).last)->destType = type;
15471 }
15472 }
15473 }
15474 }
15475 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
15476 {
15477 if(!e->next && exp->__anon1.index.exp->expType && exp->__anon1.index.exp->expType->kind == 12 && exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass)
15478 {
15479 if(e->destType)
15480 FreeType(e->destType);
15481 e->destType = MkClassType(exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass->string);
15482 }
15483 ProcessExpressionType(e);
15484 if(!e->next)
15485 {
15486 }
15487 if(!e->isConstant)
15488 exp->isConstant = 0;
15489 }
15490 if(!exp->expType)
15491 exp->expType = Dereference(exp->__anon1.index.exp->expType);
15492 if(exp->expType)
15493 DeclareType(exp->expType, 0, 0);
15494 break;
15495 }
15496 case 7:
15497 {
15498 struct Expression * e;
15499 struct Type * functionType;
15500 struct Type * methodType = (((void *)0));
15501 char name[1024];
15502
15503 name[0] = '\0';
15504 if(inCompiler)
15505 {
15506 PrintExpression(exp->__anon1.call.exp, name);
15507 if(exp->__anon1.call.exp->expType && !exp->__anon1.call.exp->expType->__anon1.__anon2.returnType)
15508 {
15509 PrintExpression(exp->__anon1.call.exp, name);
15510 }
15511 }
15512 if(exp->__anon1.call.exp->type == 0)
15513 {
15514 struct Expression * idExp = exp->__anon1.call.exp;
15515 struct Identifier * id = idExp->__anon1.__anon1.identifier;
15516
15517 if(!strcmp(id->string, "__builtin_frame_address"))
15518 {
15519 exp->expType = ProcessTypeString("void *", 1);
15520 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
15521 ProcessExpressionType((*exp->__anon1.call.arguments).first);
15522 break;
15523 }
15524 else if(!strcmp(id->string, "__ENDIAN_PAD"))
15525 {
15526 exp->expType = ProcessTypeString("int", 1);
15527 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
15528 ProcessExpressionType((*exp->__anon1.call.arguments).first);
15529 break;
15530 }
15531 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
15532 {
15533 struct Expression * a = (((void *)0));
15534 struct Expression * b = (((void *)0));
15535 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
15536
15537 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->__anon1.call.arguments).count == 2)
15538 {
15539 a = (*exp->__anon1.call.arguments).first;
15540 b = (*exp->__anon1.call.arguments).last;
15541 tempExp1 = a;
15542 tempExp2 = b;
15543 }
15544 else if((*exp->__anon1.call.arguments).count == 1)
15545 {
15546 a = (*exp->__anon1.call.arguments).first;
15547 tempExp1 = a;
15548 }
15549 if(a)
15550 {
15551 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->__anon1.call.arguments));
15552 idExp->__anon1.__anon1.identifier = (((void *)0));
15553 FreeExpContents(exp);
15554 ProcessExpressionType(a);
15555 if(b)
15556 ProcessExpressionType(b);
15557 exp->type = 5;
15558 exp->__anon1.list = MkList();
15559 if(a->expType && (!b || b->expType))
15560 {
15561 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
15562 {
15563 if(inCompiler)
15564 {
15565 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15566 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
15567 struct Declaration * decl;
15568 char temp1[1024], temp2[1024];
15569
15570 GetTypeSpecs(a->expType, specs);
15571 if(a && !a->isConstant && a->type != 0)
15572 {
15573 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
15574 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
15575 tempExp1 = QMkExpId(temp1);
15576 tempExp1->expType = a->expType;
15577 if(a->expType)
15578 a->expType->refCount++;
15579 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp1), '=', a));
15580 }
15581 if(b && !b->isConstant && b->type != 0)
15582 {
15583 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
15584 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
15585 tempExp2 = QMkExpId(temp2);
15586 tempExp2->expType = b->expType;
15587 if(b->expType)
15588 b->expType->refCount++;
15589 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp2), '=', b));
15590 }
15591 decl = MkDeclaration(specs, decls);
15592 if(!curCompound->__anon1.compound.declarations)
15593 curCompound->__anon1.compound.declarations = MkList();
15594 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), decl);
15595 }
15596 }
15597 }
15598 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
15599 {
15600 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
15601
15602 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
15603 exp->expType = a->expType;
15604 if(a->expType)
15605 a->expType->refCount++;
15606 }
15607 else if(!strcmp(id->string, "Abs"))
15608 {
15609 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
15610 exp->expType = a->expType;
15611 if(a->expType)
15612 a->expType->refCount++;
15613 }
15614 else if(!strcmp(id->string, "Sgn"))
15615 {
15616 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"))))));
15617 exp->expType = ProcessTypeString("int", 0);
15618 }
15619 FreeExpression(tempExp1);
15620 if(tempExp2)
15621 FreeExpression(tempExp2);
15622 FreeIdentifier(id);
15623 break;
15624 }
15625 }
15626 }
15627 {
15628 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
15629
15630 if(!exp->__anon1.call.exp->destType)
15631 {
15632 exp->__anon1.call.exp->destType = dummy;
15633 dummy->refCount++;
15634 }
15635 ProcessExpressionType(exp->__anon1.call.exp);
15636 if(exp->__anon1.call.exp->destType == dummy)
15637 {
15638 FreeType(dummy);
15639 exp->__anon1.call.exp->destType = (((void *)0));
15640 }
15641 FreeType(dummy);
15642 }
15643 functionType = exp->__anon1.call.exp->expType;
15644 if(functionType && functionType->kind == 16)
15645 {
15646 methodType = functionType;
15647 functionType = methodType->__anon1.__anon3.method->dataType;
15648 if(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass)
15649 {
15650 char typeString[1024];
15651
15652 typeString[0] = '\0';
15653 {
15654 struct Symbol * back = functionType->__anon1.__anon2.thisClass;
15655
15656 functionType->__anon1.__anon2.thisClass = (((void *)0));
15657 PrintType(functionType, typeString, 1, 1);
15658 functionType->__anon1.__anon2.thisClass = back;
15659 }
15660 if(strstr(typeString, "thisclass"))
15661 {
15662 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15663 struct Declarator * decl;
15664
15665 {
15666 struct Context * context = SetupTemplatesContext(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
15667
15668 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
15669 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))
15670 thisClassParams = 0;
15671 ReplaceThisClassSpecifiers(specs, exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
15672 {
15673 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
15674
15675 thisClass = exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass;
15676 ProcessDeclarator(decl);
15677 thisClass = backupThisClass;
15678 }
15679 thisClassParams = 1;
15680 functionType = ProcessType(specs, decl);
15681 functionType->refCount = 0;
15682 FinishTemplatesContext(context);
15683 }
15684 FreeList(specs, FreeSpecifier);
15685 FreeDeclarator(decl);
15686 }
15687 }
15688 }
15689 if(functionType && functionType->kind == 13 && functionType->__anon1.type && functionType->__anon1.type->kind == 11)
15690 {
15691 struct Type * type = functionType->__anon1.type;
15692
15693 if(!functionType->refCount)
15694 {
15695 functionType->__anon1.type = (((void *)0));
15696 FreeType(functionType);
15697 }
15698 functionType = type;
15699 }
15700 if(functionType && functionType->kind != 11)
15701 {
15702 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "called object %s is not a function\n", (((void *)0))), name);
15703 }
15704 else if(functionType)
15705 {
15706 unsigned int emptyParams = 0, noParams = 0;
15707 struct Expression * e = exp->__anon1.call.arguments ? (*exp->__anon1.call.arguments).first : (((void *)0));
15708 struct Type * type = functionType->__anon1.__anon2.params.first;
15709 struct Expression * memberExp = (exp->__anon1.call.exp->type == 8) ? exp->__anon1.call.exp : (((void *)0));
15710 int extra = 0;
15711 struct Location oldyylloc = yylloc;
15712
15713 if(!type)
15714 emptyParams = 1;
15715 if(functionType->extraParam && e && functionType->__anon1.__anon2.thisClass)
15716 {
15717 e->destType = MkClassType(functionType->__anon1.__anon2.thisClass->string);
15718 e = e->next;
15719 }
15720 if(!functionType->__anon1.__anon2.staticMethod && !functionType->extraParam)
15721 {
15722 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)
15723 {
15724 type = MkClassType(memberExp->__anon1.member.exp->expType->__anon1._class->string);
15725 if(e)
15726 {
15727 e->destType = type;
15728 e = e->next;
15729 type = functionType->__anon1.__anon2.params.first;
15730 }
15731 else
15732 type->refCount = 0;
15733 }
15734 else if(!memberExp && (functionType->__anon1.__anon2.thisClass || (methodType && methodType->__anon1.__anon3.methodClass)))
15735 {
15736 type = MkClassType(functionType->__anon1.__anon2.thisClass ? functionType->__anon1.__anon2.thisClass->string : (methodType ? methodType->__anon1.__anon3.methodClass->fullName : (((void *)0))));
15737 type->byReference = functionType->byReference;
15738 type->typedByReference = functionType->typedByReference;
15739 if(e)
15740 {
15741 if(e->next && type->kind == 8 && (functionType && functionType->__anon1.__anon2.thisClass) && functionType->classObjectType == 2)
15742 e = e->next;
15743 e->destType = type;
15744 e = e->next;
15745 type = functionType->__anon1.__anon2.params.first;
15746 }
15747 else
15748 type->refCount = 0;
15749 }
15750 }
15751 if(type && type->kind == 0)
15752 {
15753 noParams = 1;
15754 if(!type->refCount)
15755 FreeType(type);
15756 type = (((void *)0));
15757 }
15758 for(; e; e = e->next)
15759 {
15760 if(!type && !emptyParams)
15761 {
15762 yylloc = e->loc;
15763 if(methodType && methodType->__anon1.__anon3.methodClass)
15764 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);
15765 else
15766 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);
15767 break;
15768 }
15769 if(methodType && type && type->kind == 20 && type->__anon1.templateParameter->type == 0)
15770 {
15771 struct Type * templatedType = (((void *)0));
15772 struct __ecereNameSpace__ecere__com__Class * _class = methodType->__anon1.__anon3.usedClass;
15773 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15774 int id = 0;
15775
15776 if(_class && _class->templateArgs)
15777 {
15778 struct __ecereNameSpace__ecere__com__Class * sClass;
15779
15780 for(sClass = _class; sClass; sClass = sClass->base)
15781 {
15782 if(sClass->templateClass)
15783 sClass = sClass->templateClass;
15784 id = 0;
15785 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15786 {
15787 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
15788 {
15789 struct __ecereNameSpace__ecere__com__Class * nextClass;
15790
15791 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15792 {
15793 if(nextClass->templateClass)
15794 nextClass = nextClass->templateClass;
15795 id += nextClass->templateParams.count;
15796 }
15797 break;
15798 }
15799 id++;
15800 }
15801 if(curParam)
15802 break;
15803 }
15804 }
15805 if(curParam && _class->templateArgs[id].__anon1.__anon1.dataTypeString)
15806 {
15807 unsigned int constant = type->constant;
15808 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
15809
15810 {
15811 struct Context * context = SetupTemplatesContext(_class);
15812
15813 templatedType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
15814 FinishTemplatesContext(context);
15815 }
15816 if(templatedType->kind == 8 && constant)
15817 templatedType->constant = 1;
15818 else if(templatedType->kind == 13)
15819 {
15820 struct Type * t = templatedType->__anon1.type;
15821
15822 while(t->kind == 13)
15823 t = t->__anon1.type;
15824 if(constant)
15825 t->constant = constant;
15826 }
15827 e->destType = templatedType;
15828 if(templatedType)
15829 {
15830 templatedType->passAsTemplate = 1;
15831 }
15832 }
15833 else
15834 {
15835 e->destType = type;
15836 if(type)
15837 type->refCount++;
15838 }
15839 }
15840 else
15841 {
15842 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
15843 {
15844 e->destType = type->prev;
15845 e->destType->refCount++;
15846 }
15847 else
15848 {
15849 e->destType = type;
15850 if(type)
15851 type->refCount++;
15852 }
15853 }
15854 if(type && type->kind != 14)
15855 {
15856 struct Type * next = type->next;
15857
15858 if(!type->refCount)
15859 FreeType(type);
15860 type = next;
15861 }
15862 }
15863 if(type && type->kind != 14)
15864 {
15865 if(methodType && methodType->__anon1.__anon3.methodClass)
15866 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);
15867 else
15868 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);
15869 }
15870 yylloc = oldyylloc;
15871 if(type && !type->refCount)
15872 FreeType(type);
15873 }
15874 else
15875 {
15876 functionType = __extension__ ({
15877 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15878
15879 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
15880 });
15881 if(exp->__anon1.call.exp->type == 0)
15882 {
15883 char * string = exp->__anon1.call.exp->__anon1.__anon1.identifier->string;
15884
15885 if(inCompiler)
15886 {
15887 struct Symbol * symbol;
15888 struct Location oldyylloc = yylloc;
15889
15890 yylloc = exp->__anon1.call.exp->__anon1.__anon1.identifier->loc;
15891 if(strstr(string, "__builtin_") == string)
15892 {
15893 if(exp->destType)
15894 {
15895 functionType->__anon1.__anon2.returnType = exp->destType;
15896 exp->destType->refCount++;
15897 }
15898 }
15899 else
15900 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s undefined; assuming extern returning int\n", (((void *)0))), string);
15901 symbol = __extension__ ({
15902 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
15903
15904 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 1), __ecereInstance1;
15905 });
15906 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
15907 if(strstr(symbol->string, "::"))
15908 globalContext->hasNameSpace = 1;
15909 yylloc = oldyylloc;
15910 }
15911 }
15912 else if(exp->__anon1.call.exp->type == 8)
15913 {
15914 }
15915 else
15916 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "callable object undefined; extern assuming returning int\n", (((void *)0))));
15917 if(!functionType->__anon1.__anon2.returnType)
15918 {
15919 functionType->__anon1.__anon2.returnType = __extension__ ({
15920 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15921
15922 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15923 });
15924 }
15925 }
15926 if(functionType && functionType->kind == 11)
15927 {
15928 exp->expType = functionType->__anon1.__anon2.returnType;
15929 if(functionType->__anon1.__anon2.returnType)
15930 functionType->__anon1.__anon2.returnType->refCount++;
15931 if(!functionType->refCount)
15932 FreeType(functionType);
15933 }
15934 if(exp->__anon1.call.arguments)
15935 {
15936 for(e = (*exp->__anon1.call.arguments).first; e; e = e->next)
15937 ProcessExpressionType(e);
15938 }
15939 break;
15940 }
15941 case 8:
15942 {
15943 struct Type * type;
15944 struct Location oldyylloc = yylloc;
15945 unsigned int thisPtr;
15946 struct Expression * checkExp = exp->__anon1.member.exp;
15947
15948 while(checkExp)
15949 {
15950 if(checkExp->type == 11)
15951 checkExp = checkExp->__anon1.cast.exp;
15952 else if(checkExp->type == 5)
15953 checkExp = checkExp->__anon1.list ? (*checkExp->__anon1.list).first : (((void *)0));
15954 else
15955 break;
15956 }
15957 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->__anon1.__anon1.identifier->string, "this"));
15958 exp->thisPtr = thisPtr;
15959 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
15960 {
15961 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
15962 }
15963 ProcessExpressionType(exp->__anon1.member.exp);
15964 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)
15965 {
15966 exp->isConstant = 0;
15967 }
15968 else
15969 exp->isConstant = exp->__anon1.member.exp->isConstant;
15970 type = exp->__anon1.member.exp->expType;
15971 yylloc = exp->loc;
15972 if(type && (type->kind == 20))
15973 {
15974 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
15975 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
15976
15977 if(_class)
15978 {
15979 for(param = _class->templateParams.first; param; param = param->next)
15980 {
15981 if(param->type == 1 && exp->__anon1.member.member && exp->__anon1.member.member->string && !strcmp(param->name, exp->__anon1.member.member->string))
15982 break;
15983 }
15984 }
15985 if(param && param->defaultArg.__anon1.__anon2.__anon1.member)
15986 {
15987 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
15988
15989 if(argExp)
15990 {
15991 struct Expression * expMember = exp->__anon1.member.exp;
15992 struct Declarator * decl;
15993 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15994 char thisClassTypeString[1024];
15995
15996 FreeIdentifier(exp->__anon1.member.member);
15997 ProcessExpressionType(argExp);
15998 {
15999 char * colon = strstr(param->defaultArg.__anon1.__anon2.memberString, "::");
16000
16001 if(colon)
16002 {
16003 memcpy(thisClassTypeString, param->defaultArg.__anon1.__anon2.memberString, colon - param->defaultArg.__anon1.__anon2.memberString);
16004 thisClassTypeString[colon - param->defaultArg.__anon1.__anon2.memberString] = '\0';
16005 }
16006 else
16007 strcpy(thisClassTypeString, _class->fullName);
16008 }
16009 decl = SpecDeclFromString(param->defaultArg.__anon1.__anon2.__anon1.member->dataTypeString, specs, (((void *)0)));
16010 exp->expType = ProcessType(specs, decl);
16011 if(exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->templateClass)
16012 {
16013 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
16014 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
16015 int paramCount = 0;
16016 int lastParam = -1;
16017 char templateString[1024];
16018 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
16019
16020 sprintf(templateString, "%s<", expClass->templateClass->fullName);
16021 for(cClass = expClass; cClass; cClass = cClass->base)
16022 {
16023 int p = 0;
16024
16025 for(param = cClass->templateParams.first; param; param = param->next)
16026 {
16027 int id = p;
16028 struct __ecereNameSpace__ecere__com__Class * sClass;
16029 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
16030
16031 for(sClass = cClass->base; sClass; sClass = sClass->base)
16032 id += sClass->templateParams.count;
16033 arg = expClass->templateArgs[id];
16034 for(sClass = _class; sClass; sClass = sClass->base)
16035 {
16036 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
16037 int p = 0;
16038 struct __ecereNameSpace__ecere__com__Class * nextClass;
16039
16040 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
16041 p += nextClass->templateParams.count;
16042 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
16043 {
16044 if(cParam->type == 0 && arg.__anon1.__anon1.dataTypeString && !strcmp(cParam->name, arg.__anon1.__anon1.dataTypeString))
16045 {
16046 if(_class->templateArgs && arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
16047 {
16048 arg.__anon1.__anon1.dataTypeString = _class->templateArgs[p].__anon1.__anon1.dataTypeString;
16049 arg.__anon1.__anon1.dataTypeClass = _class->templateArgs[p].__anon1.__anon1.dataTypeClass;
16050 break;
16051 }
16052 }
16053 }
16054 }
16055 {
16056 char argument[256];
16057
16058 argument[0] = '\0';
16059 switch(param->type)
16060 {
16061 case 2:
16062 {
16063 char expString[1024];
16064 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16065 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
16066 struct Expression * exp;
16067 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
16068
16069 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
16070 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
16071 ProcessExpressionType(exp);
16072 ComputeExpression(exp);
16073 expString[0] = '\0';
16074 PrintExpression(exp, expString);
16075 strcat(argument, expString);
16076 FreeExpression(exp);
16077 break;
16078 }
16079 case 1:
16080 {
16081 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
16082 break;
16083 }
16084 case 0:
16085 {
16086 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
16087 {
16088 if(!strcmp(arg.__anon1.__anon1.dataTypeString, "thisclass"))
16089 strcat(argument, thisClassTypeString);
16090 else
16091 strcat(argument, arg.__anon1.__anon1.dataTypeString);
16092 }
16093 break;
16094 }
16095 }
16096 if(argument[0])
16097 {
16098 if(paramCount)
16099 strcat(templateString, ", ");
16100 if(lastParam != p - 1)
16101 {
16102 strcat(templateString, param->name);
16103 strcat(templateString, " = ");
16104 }
16105 strcat(templateString, argument);
16106 paramCount++;
16107 lastParam = p;
16108 }
16109 p++;
16110 }
16111 }
16112 }
16113 {
16114 int len = strlen(templateString);
16115
16116 if(templateString[len - 1] == '>')
16117 templateString[len++] = ' ';
16118 templateString[len++] = '>';
16119 templateString[len++] = '\0';
16120 }
16121 {
16122 struct Context * context = SetupTemplatesContext(_class);
16123
16124 FreeType(exp->expType);
16125 exp->expType = ProcessTypeString(templateString, 0);
16126 FinishTemplatesContext(context);
16127 }
16128 }
16129 exp->type = 5;
16130 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")))))))));
16131 }
16132 }
16133 else if(type->__anon1.templateParameter && type->__anon1.templateParameter->type == 0 && (type->__anon1.templateParameter->__anon1.dataType || type->__anon1.templateParameter->dataTypeString))
16134 {
16135 type = ProcessTemplateParameterType(type->__anon1.templateParameter);
16136 }
16137 }
16138 if(type && (type->kind == 20))
16139 ;
16140 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)))
16141 {
16142 struct Identifier * id = exp->__anon1.member.member;
16143 int typeKind = type->kind;
16144 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));
16145
16146 if(typeKind == 19 && exp->__anon1.member.exp->type == 24)
16147 {
16148 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
16149 typeKind = 8;
16150 }
16151 if(id)
16152 {
16153 if(typeKind == 3 || typeKind == 15)
16154 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
16155 else if(!_class)
16156 {
16157 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
16158 {
16159 _class = type->__anon1._class->__anon1.registered;
16160 }
16161 else if((type->kind == 12 || type->kind == 13) && type->__anon1.type && type->__anon1.type->kind == 1)
16162 {
16163 _class = FindClass("char *")->__anon1.registered;
16164 }
16165 else if(type->kind == 13)
16166 {
16167 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
16168 FreeType(exp->expType);
16169 exp->expType = ProcessTypeString("uintptr", 0);
16170 exp->byReference = 1;
16171 }
16172 else
16173 {
16174 char string[1024] = "";
16175 struct Symbol * classSym;
16176
16177 PrintTypeNoConst(type, string, 0, 1);
16178 classSym = FindClass(string);
16179 if(classSym)
16180 _class = classSym->__anon1.registered;
16181 }
16182 }
16183 }
16184 if(_class && id)
16185 {
16186 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
16187 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
16188 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
16189 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
16190 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
16191
16192 if(id && id->_class && id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))
16193 exp->__anon1.member.memberType = 1;
16194 if(id && id->_class && type->__anon1._class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->__anon1._class->__anon1.registered, _class))
16195 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->__anon1._class->string);
16196 if(typeKind != 19)
16197 {
16198 if((exp->__anon1.member.memberType == 0 && thisPtr) || exp->__anon1.member.memberType == 3)
16199 {
16200 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
16201 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->__anon1.member.memberType != 3)
16202 {
16203 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
16204 if(prop)
16205 member = (((void *)0));
16206 }
16207 if(!member && !prop)
16208 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
16209 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
16210 exp->__anon1.member.thisPtr = 1;
16211 }
16212 else
16213 {
16214 unsigned int useMemberForNonConst = 0;
16215
16216 if(!id->classSym)
16217 {
16218 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
16219 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);
16220 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
16221 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
16222 }
16223 if((!prop || useMemberForNonConst) && !member)
16224 {
16225 method = useMemberForNonConst ? (((void *)0)) : __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
16226 if(!method)
16227 {
16228 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
16229 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);
16230 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
16231 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
16232 }
16233 }
16234 if(member && prop)
16235 {
16236 if(useMemberForNonConst || (member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class)))
16237 prop = (((void *)0));
16238 else
16239 member = (((void *)0));
16240 }
16241 }
16242 }
16243 if(!prop && !member && !method)
16244 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
16245 if(!prop && !member && !method)
16246 {
16247 if(typeKind == 19)
16248 {
16249 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->__anon1._class->__anon1.registered, exp->__anon1.member.member->string);
16250 if(classProp)
16251 {
16252 exp->__anon1.member.memberType = 5;
16253 exp->expType = ProcessTypeString(classProp->dataTypeString, 0);
16254 }
16255 else
16256 {
16257 char structName[1024];
16258 struct Identifier * id = exp->__anon1.member.member;
16259 struct Expression * classExp = exp->__anon1.member.exp;
16260
16261 type->refCount++;
16262 FreeType(classExp->expType);
16263 classExp->expType = ProcessTypeString("ecere::com::Class", 0);
16264 strcpy(structName, "__ecereClassData_");
16265 FullClassNameCat(structName, type->__anon1._class->string, 0);
16266 exp->type = 9;
16267 exp->__anon1.member.member = id;
16268 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"))))))));
16269 FreeType(type);
16270 ProcessExpressionType(exp);
16271 return ;
16272 }
16273 }
16274 else
16275 {
16276 struct Symbol * classSym = FindClass(id->string);
16277
16278 if(classSym)
16279 {
16280 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->__anon1.registered;
16281
16282 if(convertClass)
16283 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
16284 }
16285 }
16286 }
16287 if(exp->__anon1.member.exp->destType)
16288 FreeType(exp->__anon1.member.exp->destType);
16289 {
16290 if(method && !method->_class->symbol)
16291 method->_class->symbol = FindClass(method->_class->fullName);
16292 if(prop && !prop->_class->symbol)
16293 prop->_class->symbol = FindClass(prop->_class->fullName);
16294 exp->__anon1.member.exp->destType = __extension__ ({
16295 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16296
16297 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 8, __ecereInstance1->__anon1._class = prop ? prop->_class->symbol : method ? method->_class->symbol : _class->symbol, __ecereInstance1;
16298 });
16299 }
16300 if(prop)
16301 {
16302 exp->__anon1.member.memberType = 1;
16303 if(!prop->dataType)
16304 ProcessPropertyType(prop);
16305 exp->expType = prop->dataType;
16306 if(!strcmp(_class->base->fullName, "eda::Row") && !exp->expType->constant && !exp->destType)
16307 {
16308 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16309
16310 CopyTypeInto(type, exp->expType);
16311 type->refCount = 1;
16312 type->constant = 1;
16313 exp->expType = type;
16314 }
16315 else if(prop->dataType)
16316 prop->dataType->refCount++;
16317 }
16318 else if(member)
16319 {
16320 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
16321 {
16322 FreeExpContents(exp);
16323 exp->type = 0;
16324 exp->__anon1.__anon1.identifier = MkIdentifier("class");
16325 ProcessExpressionType(exp);
16326 return ;
16327 }
16328 exp->__anon1.member.memberType = 3;
16329 DeclareStruct(_class->fullName, 0);
16330 if(!member->dataType)
16331 {
16332 struct Context * context = SetupTemplatesContext(_class);
16333
16334 member->dataType = ProcessTypeString(member->dataTypeString, 0);
16335 FinishTemplatesContext(context);
16336 }
16337 exp->expType = member->dataType;
16338 if(member->dataType)
16339 member->dataType->refCount++;
16340 }
16341 else if(revConvert)
16342 {
16343 exp->__anon1.member.memberType = 4;
16344 exp->expType = MkClassType(revConvert->_class->fullName);
16345 }
16346 else if(method)
16347 {
16348 {
16349 exp->__anon1.member.memberType = 2;
16350 }
16351 if(!method->dataType)
16352 ProcessMethodType(method);
16353 exp->expType = __extension__ ({
16354 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16355
16356 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1;
16357 });
16358 exp->expType->__anon1.__anon3.methodClass = (id && id->_class) ? _class : (((void *)0));
16359 exp->expType->__anon1.__anon3.usedClass = _class;
16360 }
16361 else if(!classProp)
16362 {
16363 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
16364 {
16365 FreeExpContents(exp);
16366 exp->type = 0;
16367 exp->__anon1.__anon1.identifier = MkIdentifier("class");
16368 FreeType(exp->expType);
16369 exp->expType = MkClassType("ecere::com::Class");
16370 return ;
16371 }
16372 yylloc = exp->__anon1.member.member->loc;
16373 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
16374 if(inCompiler)
16375 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
16376 }
16377 if(_class && exp->expType)
16378 {
16379 struct __ecereNameSpace__ecere__com__Class * tClass;
16380
16381 tClass = type->__anon1._class && type->__anon1._class->__anon1.registered ? type->__anon1._class->__anon1.registered : _class;
16382 while(tClass && !tClass->templateClass)
16383 tClass = tClass->base;
16384 if(tClass && exp->expType->kind == 20 && exp->expType->__anon1.templateParameter->type == 0)
16385 {
16386 int id = 0;
16387 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
16388 struct __ecereNameSpace__ecere__com__Class * sClass;
16389
16390 for(sClass = tClass; sClass; sClass = sClass->base)
16391 {
16392 id = 0;
16393 if(sClass->templateClass)
16394 sClass = sClass->templateClass;
16395 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
16396 {
16397 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.templateParameter->identifier->string, curParam->name))
16398 {
16399 for(sClass = sClass->base; sClass; sClass = sClass->base)
16400 id += sClass->templateParams.count;
16401 break;
16402 }
16403 id++;
16404 }
16405 if(curParam)
16406 break;
16407 }
16408 if(curParam && tClass->templateArgs[id].__anon1.__anon1.dataTypeString)
16409 {
16410 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
16411 struct Context * context = SetupTemplatesContext(tClass);
16412 unsigned int constant = exp->expType->constant;
16413
16414 FreeType(exp->expType);
16415 exp->expType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
16416 if(exp->expType->kind == 8 && constant)
16417 exp->expType->constant = 1;
16418 else if(exp->expType->kind == 13)
16419 {
16420 struct Type * t = exp->expType->__anon1.type;
16421
16422 while(t->kind == 13)
16423 t = t->__anon1.type;
16424 if(constant)
16425 t->constant = constant;
16426 }
16427 if(exp->expType)
16428 {
16429 if(exp->expType->kind == 21)
16430 {
16431 FreeType(exp->expType);
16432 exp->expType = ReplaceThisClassType(_class);
16433 }
16434 if(tClass->templateClass && (exp->expType->kind != 20 || (!exp->expType->__anon1.templateParameter || (!exp->expType->__anon1.templateParameter->dataTypeString && !exp->expType->__anon1.templateParameter->__anon1.dataType))))
16435 exp->expType->passAsTemplate = 1;
16436 if(!exp->destType)
16437 {
16438 exp->destType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
16439 if(exp->destType->kind == 8 && constant)
16440 exp->destType->constant = 1;
16441 else if(exp->destType->kind == 13)
16442 {
16443 struct Type * t = exp->destType->__anon1.type;
16444
16445 while(t->kind == 13)
16446 t = t->__anon1.type;
16447 if(constant)
16448 t->constant = constant;
16449 }
16450 if(exp->destType->kind == 21)
16451 {
16452 FreeType(exp->destType);
16453 exp->destType = ReplaceThisClassType(_class);
16454 }
16455 }
16456 }
16457 FinishTemplatesContext(context);
16458 }
16459 }
16460 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)
16461 {
16462 int id = 0;
16463 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
16464 struct __ecereNameSpace__ecere__com__Class * sClass;
16465
16466 for(sClass = tClass; sClass; sClass = sClass->base)
16467 {
16468 id = 0;
16469 if(sClass->templateClass)
16470 sClass = sClass->templateClass;
16471 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
16472 {
16473 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.type->__anon1.templateParameter->identifier->string, curParam->name))
16474 {
16475 for(sClass = sClass->base; sClass; sClass = sClass->base)
16476 id += sClass->templateParams.count;
16477 break;
16478 }
16479 id++;
16480 }
16481 if(curParam)
16482 break;
16483 }
16484 if(curParam)
16485 {
16486 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
16487 struct Context * context = SetupTemplatesContext(tClass);
16488 struct Type * basicType;
16489
16490 basicType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
16491 if(basicType)
16492 {
16493 if(basicType->kind == 21)
16494 {
16495 FreeType(basicType);
16496 basicType = ReplaceThisClassType(_class);
16497 }
16498 FreeType(exp->expType);
16499 exp->expType = __extension__ ({
16500 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16501
16502 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = basicType, __ecereInstance1;
16503 });
16504 if(!exp->destType)
16505 {
16506 exp->destType = exp->expType;
16507 exp->destType->refCount++;
16508 }
16509 {
16510 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16511 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16512 struct Declarator * decl;
16513
16514 decl = SpecDeclFromString(arg.__anon1.__anon1.dataTypeString, specs, (((void *)0)));
16515 *newExp = *exp;
16516 if(exp->destType)
16517 exp->destType->refCount++;
16518 if(exp->expType)
16519 exp->expType->refCount++;
16520 exp->type = 11;
16521 exp->__anon1.cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
16522 exp->__anon1.cast.exp = newExp;
16523 }
16524 }
16525 FinishTemplatesContext(context);
16526 }
16527 }
16528 else if(tClass && exp->expType->kind == 8 && exp->expType->__anon1._class && strchr(exp->expType->__anon1._class->string, '<'))
16529 {
16530 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
16531
16532 if(expClass)
16533 {
16534 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
16535 int p = 0;
16536 int paramCount = 0;
16537 int lastParam = -1;
16538 char templateString[1024];
16539 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
16540
16541 sprintf(templateString, "%s<", expClass->templateClass->fullName);
16542 while(cClass != expClass)
16543 {
16544 struct __ecereNameSpace__ecere__com__Class * sClass;
16545
16546 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
16547 ;
16548 cClass = sClass;
16549 for(param = cClass->templateParams.first; param; param = param->next)
16550 {
16551 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
16552 int cp = 0;
16553 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
16554 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
16555
16556 while(cClassCur != tClass && !paramCur)
16557 {
16558 struct __ecereNameSpace__ecere__com__Class * sClassCur;
16559
16560 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
16561 ;
16562 cClassCur = sClassCur;
16563 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
16564 {
16565 if(!strcmp(paramCur->name, param->name))
16566 {
16567 break;
16568 }
16569 cp++;
16570 }
16571 }
16572 if(paramCur && paramCur->type == 0)
16573 arg = tClass->templateArgs[cp];
16574 else
16575 arg = expClass->templateArgs[p];
16576 {
16577 char argument[256];
16578
16579 argument[0] = '\0';
16580 switch(param->type)
16581 {
16582 case 2:
16583 {
16584 char expString[1024];
16585 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16586 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
16587 struct Expression * exp;
16588 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
16589
16590 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
16591 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
16592 ProcessExpressionType(exp);
16593 ComputeExpression(exp);
16594 expString[0] = '\0';
16595 PrintExpression(exp, expString);
16596 strcat(argument, expString);
16597 FreeExpression(exp);
16598 break;
16599 }
16600 case 1:
16601 {
16602 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
16603 break;
16604 }
16605 case 0:
16606 {
16607 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
16608 strcat(argument, arg.__anon1.__anon1.dataTypeString);
16609 break;
16610 }
16611 }
16612 if(argument[0])
16613 {
16614 if(paramCount)
16615 strcat(templateString, ", ");
16616 if(lastParam != p - 1)
16617 {
16618 strcat(templateString, param->name);
16619 strcat(templateString, " = ");
16620 }
16621 strcat(templateString, argument);
16622 paramCount++;
16623 lastParam = p;
16624 }
16625 }
16626 p++;
16627 }
16628 }
16629 {
16630 int len = strlen(templateString);
16631
16632 if(templateString[len - 1] == '>')
16633 templateString[len++] = ' ';
16634 templateString[len++] = '>';
16635 templateString[len++] = '\0';
16636 }
16637 FreeType(exp->expType);
16638 {
16639 struct Context * context = SetupTemplatesContext(tClass);
16640
16641 exp->expType = ProcessTypeString(templateString, 0);
16642 FinishTemplatesContext(context);
16643 }
16644 }
16645 }
16646 }
16647 }
16648 else
16649 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)");
16650 }
16651 else if(type && (type->kind == 9 || type->kind == 10))
16652 {
16653 struct Type * memberType = exp->__anon1.member.member ? FindMember(type, exp->__anon1.member.member->string) : (((void *)0));
16654
16655 if(memberType)
16656 {
16657 exp->expType = memberType;
16658 if(memberType)
16659 memberType->refCount++;
16660 }
16661 }
16662 else
16663 {
16664 char expString[10240];
16665
16666 expString[0] = '\0';
16667 if(inCompiler)
16668 {
16669 PrintExpression(exp, expString);
16670 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16671 }
16672 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "member operator on non-structure type expression %s\n", (((void *)0))), expString);
16673 }
16674 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
16675 {
16676 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
16677 {
16678 struct Identifier * id = exp->__anon1.member.member;
16679 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));
16680
16681 if(_class)
16682 {
16683 FreeType(exp->expType);
16684 exp->expType = ReplaceThisClassType(_class);
16685 }
16686 }
16687 }
16688 yylloc = oldyylloc;
16689 break;
16690 }
16691 case 9:
16692 {
16693 struct Type * destType = exp->destType;
16694
16695 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
16696 {
16697 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
16698 }
16699 exp->__anon1.member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->__anon1.member.exp)));
16700 exp->type = 8;
16701 if(destType)
16702 destType->count++;
16703 ProcessExpressionType(exp);
16704 if(destType)
16705 destType->count--;
16706 break;
16707 }
16708 case 15:
16709 {
16710 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
16711
16712 if(classSym && classSym->__anon1.registered)
16713 {
16714 if(classSym->__anon1.registered->type == 5)
16715 {
16716 char name[1024];
16717
16718 name[0] = '\0';
16719 DeclareStruct(classSym->string, 0);
16720 FreeSpecifier(exp->__anon1._class);
16721 exp->type = 10;
16722 FullClassNameCat(name, classSym->string, 0);
16723 exp->__anon1.typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
16724 }
16725 else
16726 {
16727 if(classSym->__anon1.registered->fixed)
16728 {
16729 FreeSpecifier(exp->__anon1._class);
16730 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
16731 exp->type = 2;
16732 }
16733 else
16734 {
16735 char className[1024];
16736
16737 strcpy(className, "__ecereClass_");
16738 FullClassNameCat(className, classSym->string, 1);
16739 DeclareClass(classSym, className);
16740 FreeExpContents(exp);
16741 exp->type = 9;
16742 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
16743 exp->__anon1.member.member = MkIdentifier("structSize");
16744 }
16745 }
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 break;
16753 }
16754 case 10:
16755 {
16756 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
16757
16758 exp->expType = __extension__ ({
16759 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16760
16761 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
16762 });
16763 exp->isConstant = 1;
16764 DeclareType(type, 0, 0);
16765 FreeType(type);
16766 break;
16767 }
16768 case 11:
16769 {
16770 struct Type * type = ProcessType(exp->__anon1.cast.typeName->qualifiers, exp->__anon1.cast.typeName->declarator);
16771
16772 type->count = 1;
16773 FreeType(exp->__anon1.cast.exp->destType);
16774 exp->__anon1.cast.exp->destType = type;
16775 type->refCount++;
16776 type->casted = 1;
16777 ProcessExpressionType(exp->__anon1.cast.exp);
16778 type->casted = 0;
16779 type->count = 0;
16780 exp->expType = type;
16781 if(!exp->__anon1.cast.exp->needCast && !NeedCast(exp->__anon1.cast.exp->expType, type))
16782 {
16783 void * prev = exp->prev, * next = exp->next;
16784 struct Type * expType = exp->__anon1.cast.exp->destType;
16785 struct Expression * castExp = exp->__anon1.cast.exp;
16786 struct Type * destType = exp->destType;
16787
16788 if(expType)
16789 expType->refCount++;
16790 FreeType(exp->expType);
16791 FreeTypeName(exp->__anon1.cast.typeName);
16792 *exp = *castExp;
16793 FreeType(exp->expType);
16794 FreeType(exp->destType);
16795 exp->expType = expType;
16796 exp->destType = destType;
16797 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
16798 exp->prev = prev;
16799 exp->next = next;
16800 }
16801 else
16802 {
16803 exp->isConstant = exp->__anon1.cast.exp->isConstant;
16804 }
16805 break;
16806 }
16807 case 33:
16808 {
16809 struct Type * type = ProcessType(exp->__anon1.initializer.typeName->qualifiers, exp->__anon1.initializer.typeName->declarator);
16810
16811 exp->expType = type;
16812 break;
16813 }
16814 case 34:
16815 {
16816 struct Type * type = ProcessType(exp->__anon1.vaArg.typeName->qualifiers, exp->__anon1.vaArg.typeName->declarator);
16817
16818 ProcessExpressionType(exp->__anon1.vaArg.exp);
16819 exp->expType = type;
16820 break;
16821 }
16822 case 12:
16823 {
16824 struct Expression * e;
16825
16826 exp->isConstant = 1;
16827 FreeType(exp->__anon1.cond.cond->destType);
16828 exp->__anon1.cond.cond->destType = MkClassType("bool");
16829 exp->__anon1.cond.cond->destType->truth = 1;
16830 ProcessExpressionType(exp->__anon1.cond.cond);
16831 if(!exp->__anon1.cond.cond->isConstant)
16832 exp->isConstant = 0;
16833 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
16834 {
16835 if(!e->next)
16836 {
16837 FreeType(e->destType);
16838 e->destType = exp->destType;
16839 if(e->destType)
16840 e->destType->refCount++;
16841 }
16842 ProcessExpressionType(e);
16843 if(!e->next)
16844 {
16845 exp->expType = e->expType;
16846 if(e->expType)
16847 e->expType->refCount++;
16848 }
16849 if(!e->isConstant)
16850 exp->isConstant = 0;
16851 }
16852 FreeType(exp->__anon1.cond.elseExp->destType);
16853 exp->__anon1.cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
16854 if(exp->__anon1.cond.elseExp->destType)
16855 exp->__anon1.cond.elseExp->destType->refCount++;
16856 ProcessExpressionType(exp->__anon1.cond.elseExp);
16857 if(!exp->__anon1.cond.elseExp->isConstant)
16858 exp->isConstant = 0;
16859 break;
16860 }
16861 case 23:
16862 {
16863 if(exp->__anon1.compound && exp->__anon1.compound->__anon1.compound.statements && (*exp->__anon1.compound->__anon1.compound.statements).last)
16864 {
16865 struct Statement * last = (*exp->__anon1.compound->__anon1.compound.statements).last;
16866
16867 if(last->type == 3 && last->__anon1.expressions && (*last->__anon1.expressions).last)
16868 {
16869 ((struct Expression *)(*last->__anon1.expressions).last)->destType = exp->destType;
16870 if(exp->destType)
16871 exp->destType->refCount++;
16872 }
16873 ProcessStatement(exp->__anon1.compound);
16874 exp->expType = (last->__anon1.expressions && (*last->__anon1.expressions).last) ? ((struct Expression *)(*last->__anon1.expressions).last)->expType : (((void *)0));
16875 if(exp->expType)
16876 exp->expType->refCount++;
16877 }
16878 break;
16879 }
16880 case 24:
16881 {
16882 struct Specifier * spec = (*exp->__anon1._classExp.specifiers).first;
16883
16884 if(spec && spec->type == 1)
16885 {
16886 exp->expType = MkClassType(spec->__anon1.__anon1.name);
16887 exp->expType->kind = 19;
16888 exp->byReference = 1;
16889 }
16890 else
16891 {
16892 exp->expType = MkClassType("ecere::com::Class");
16893 exp->byReference = 1;
16894 }
16895 break;
16896 }
16897 case 25:
16898 {
16899 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
16900
16901 if(_class)
16902 {
16903 struct Identifier * id = exp->__anon1.classData.id;
16904 char structName[1024];
16905 struct Expression * classExp;
16906
16907 strcpy(structName, "__ecereClassData_");
16908 FullClassNameCat(structName, _class->fullName, 0);
16909 exp->type = 9;
16910 exp->__anon1.member.member = id;
16911 if(curCompound && FindSymbol("this", curContext, curCompound->__anon1.compound.context, 0, 0))
16912 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
16913 else
16914 classExp = MkExpIdentifier(MkIdentifier("class"));
16915 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"))))))));
16916 ProcessExpressionType(exp);
16917 return ;
16918 }
16919 break;
16920 }
16921 case 35:
16922 {
16923 struct Type * type = (((void *)0));
16924 const char * typeString = (((void *)0));
16925 char typeStringBuf[1024];
16926
16927 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))
16928 {
16929 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->__anon1._class->__anon1.registered;
16930
16931 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
16932 }
16933 else if(exp->__anon1.list)
16934 {
16935 struct Expression * e;
16936
16937 for(e = (*exp->__anon1.list).first; e; e = e->next)
16938 {
16939 ProcessExpressionType(e);
16940 if(e->expType)
16941 {
16942 if(!type)
16943 {
16944 type = e->expType;
16945 type->refCount++;
16946 }
16947 else
16948 {
16949 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
16950 {
16951 FreeType(type);
16952 type = e->expType;
16953 e->expType = (((void *)0));
16954 e = (*exp->__anon1.list).first;
16955 ProcessExpressionType(e);
16956 if(e->expType)
16957 {
16958 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
16959 {
16960 FreeType(e->expType);
16961 e->expType = (((void *)0));
16962 FreeType(type);
16963 type = (((void *)0));
16964 break;
16965 }
16966 }
16967 }
16968 }
16969 if(e->expType)
16970 {
16971 FreeType(e->expType);
16972 e->expType = (((void *)0));
16973 }
16974 }
16975 }
16976 if(type)
16977 {
16978 typeStringBuf[0] = '\0';
16979 PrintTypeNoConst(type, typeStringBuf, 0, 1);
16980 typeString = typeStringBuf;
16981 FreeType(type);
16982 type = (((void *)0));
16983 }
16984 }
16985 if(typeString)
16986 {
16987 char templateString[1024];
16988 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
16989 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
16990 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16991 struct Expression * expExt;
16992 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16993
16994 sprintf(templateString, "Container<%s>", typeString);
16995 if(exp->__anon1.list)
16996 {
16997 struct Expression * e;
16998
16999 type = ProcessTypeString(typeString, 0);
17000 while((e = (*exp->__anon1.list).first))
17001 {
17002 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->__anon1.list), e);
17003 e->destType = type;
17004 type->refCount++;
17005 ProcessExpressionType(e);
17006 ListAdd(initializers, MkInitializerAssignment(e));
17007 }
17008 FreeType(type);
17009 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
17010 }
17011 DeclareStruct("ecere::com::BuiltInContainer", 0);
17012 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
17013 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17014 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
17015 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17016 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
17017 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17018 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
17019 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17020 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
17021 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
17022
17023 __ecereInstance1->type = 2, __ecereInstance1->__anon1.__anon1.constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, (void *)0), __ecereInstance1;
17024 })));
17025 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17026 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
17027 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
17028 exp->expType = ProcessTypeString(templateString, 0);
17029 exp->type = 5;
17030 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
17031 ProcessExpressionType(expExt);
17032 }
17033 else
17034 {
17035 exp->expType = ProcessTypeString("Container", 0);
17036 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
17037 }
17038 break;
17039 }
17040 }
17041 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
17042 {
17043 FreeType(exp->expType);
17044 exp->expType = ReplaceThisClassType(thisClass);
17045 }
17046 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)
17047 {
17048 struct Symbol * symbol = FindSymbol(exp->expType->__anon1.__anon1.enumName, curContext, globalContext, 1, 0);
17049
17050 if(symbol)
17051 {
17052 if(exp->expType->kind != 15)
17053 {
17054 struct Type * member;
17055 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->__anon1.__anon1.enumName);
17056
17057 FreeType(exp->expType);
17058 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17059 exp->expType->kind = symbol->type->kind;
17060 exp->expType->refCount++;
17061 exp->expType->__anon1.__anon1.enumName = enumName;
17062 exp->expType->__anon1.__anon1.members = symbol->type->__anon1.__anon1.members;
17063 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
17064 member->refCount++;
17065 }
17066 else
17067 {
17068 struct __ecereNameSpace__ecere__sys__NamedLink64 * member;
17069
17070 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
17071 {
17072 struct __ecereNameSpace__ecere__sys__NamedLink64 * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(structSize_NamedLink64), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
17073
17074 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->__anon1.__anon1.members, value);
17075 }
17076 }
17077 }
17078 }
17079 yylloc = exp->loc;
17080 if(exp->destType && (exp->destType->kind == 18))
17081 ;
17082 else if(exp->destType && !exp->destType->keepCast)
17083 {
17084 if(!exp->needTemplateCast && exp->expType && (exp->expType->kind == 20 || exp->expType->passAsTemplate))
17085 exp->needTemplateCast = 1;
17086 if(exp->destType->kind == 0)
17087 ;
17088 else if(!CheckExpressionType(exp, exp->destType, 0, !exp->destType->casted))
17089 {
17090 if(!exp->destType->count || unresolved)
17091 {
17092 if(!exp->expType)
17093 {
17094 yylloc = exp->loc;
17095 if(exp->destType->kind != 14)
17096 {
17097 char type2[1024];
17098
17099 type2[0] = '\0';
17100 if(inCompiler)
17101 {
17102 char expString[10240];
17103
17104 expString[0] = '\0';
17105 PrintType(exp->destType, type2, 0, 1);
17106 if(inCompiler)
17107 {
17108 PrintExpression(exp, expString);
17109 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17110 }
17111 if(unresolved)
17112 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
17113 else if(exp->type != 16)
17114 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
17115 }
17116 }
17117 else
17118 {
17119 char expString[10240];
17120
17121 expString[0] = '\0';
17122 if(inCompiler)
17123 {
17124 PrintExpression(exp, expString);
17125 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17126 }
17127 if(unresolved)
17128 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), expString);
17129 else if(exp->type != 16)
17130 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
17131 }
17132 }
17133 else
17134 {
17135 char type1[1024];
17136 char type2[1024];
17137
17138 type1[0] = '\0';
17139 type2[0] = '\0';
17140 if(inCompiler)
17141 {
17142 PrintType(exp->expType, type1, 0, 1);
17143 PrintType(exp->destType, type2, 0, 1);
17144 }
17145 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)))
17146 ;
17147 else
17148 {
17149 char expString[10240];
17150
17151 expString[0] = '\0';
17152 if(inCompiler)
17153 {
17154 PrintExpression(exp, expString);
17155 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17156 }
17157 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
17158 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
17159 FreeType(exp->expType);
17160 exp->destType->refCount++;
17161 exp->expType = exp->destType;
17162 }
17163 }
17164 }
17165 }
17166 }
17167 else if(unresolved)
17168 {
17169 if(exp->__anon1.__anon1.identifier->_class && exp->__anon1.__anon1.identifier->_class->__anon1.__anon1.name)
17170 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);
17171 else if(exp->__anon1.__anon1.identifier->string && exp->__anon1.__anon1.identifier->string[0])
17172 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), exp->__anon1.__anon1.identifier->string);
17173 }
17174 else if(!exp->expType && exp->type != 16)
17175 {
17176 char expString[10240];
17177
17178 expString[0] = '\0';
17179 if(inCompiler)
17180 {
17181 PrintExpression(exp, expString);
17182 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17183 }
17184 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
17185 }
17186 if(inCompiler)
17187 ApplyAnyObjectLogic(exp);
17188 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)))
17189 {
17190 exp->byReference = 1;
17191 }
17192 yylloc = oldyylloc;
17193 }
17194
17195 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)
17196 {
17197 if(*curMember)
17198 {
17199 *curMember = (*curMember)->next;
17200 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
17201 {
17202 *curMember = subMemberStack[--(*subMemberStackPos)];
17203 *curMember = (*curMember)->next;
17204 }
17205 while((*curMember) && (*curMember)->isProperty)
17206 *curMember = (*curMember)->next;
17207 if(subMemberStackPos)
17208 {
17209 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
17210 {
17211 subMemberStack[(*subMemberStackPos)++] = *curMember;
17212 *curMember = (*curMember)->members.first;
17213 while(*curMember && (*curMember)->isProperty)
17214 *curMember = (*curMember)->next;
17215 }
17216 }
17217 }
17218 while(!*curMember)
17219 {
17220 if(!*curMember)
17221 {
17222 if(subMemberStackPos && *subMemberStackPos)
17223 {
17224 *curMember = subMemberStack[--(*subMemberStackPos)];
17225 *curMember = (*curMember)->next;
17226 }
17227 else
17228 {
17229 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
17230
17231 if(*curClass == _class)
17232 break;
17233 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
17234 ;
17235 *curMember = (*curClass)->membersAndProperties.first;
17236 }
17237 while((*curMember) && (*curMember)->isProperty)
17238 *curMember = (*curMember)->next;
17239 if(subMemberStackPos)
17240 {
17241 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
17242 {
17243 subMemberStack[(*subMemberStackPos)++] = *curMember;
17244 *curMember = (*curMember)->members.first;
17245 while(*curMember && (*curMember)->isProperty)
17246 *curMember = (*curMember)->next;
17247 }
17248 }
17249 }
17250 }
17251 }
17252
17253 static void ProcessInitializer(struct Initializer * init, struct Type * type)
17254 {
17255 switch(init->type)
17256 {
17257 case 0:
17258 if(!init->__anon1.exp || init->__anon1.exp->type != 1 || !init->__anon1.exp->__anon1.instance || init->__anon1.exp->__anon1.instance->_class || !type || type->kind == 8)
17259 {
17260 if(init->__anon1.exp && !init->__anon1.exp->destType)
17261 {
17262 FreeType(init->__anon1.exp->destType);
17263 init->__anon1.exp->destType = type;
17264 if(type)
17265 type->refCount++;
17266 }
17267 if(init->__anon1.exp)
17268 {
17269 ProcessExpressionType(init->__anon1.exp);
17270 init->isConstant = init->__anon1.exp->isConstant;
17271 }
17272 break;
17273 }
17274 else
17275 {
17276 struct Expression * exp = init->__anon1.exp;
17277 struct Instantiation * inst = exp->__anon1.instance;
17278 struct MembersInit * members;
17279
17280 init->type = 1;
17281 init->__anon1.list = MkList();
17282 if(inst->members)
17283 {
17284 for(members = (*inst->members).first; members; members = members->next)
17285 {
17286 if(members->type == 0)
17287 {
17288 struct MemberInit * member;
17289
17290 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
17291 {
17292 ListAdd(init->__anon1.list, member->initializer);
17293 member->initializer = (((void *)0));
17294 }
17295 }
17296 }
17297 }
17298 FreeExpression(exp);
17299 }
17300 case 1:
17301 {
17302 struct Initializer * i;
17303 struct Type * initializerType = (((void *)0));
17304 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
17305 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
17306 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
17307 int subMemberStackPos = 0;
17308
17309 if(type && type->kind == 12)
17310 initializerType = Dereference(type);
17311 else if(type && (type->kind == 9 || type->kind == 10))
17312 initializerType = type->__anon1.__anon1.members.first;
17313 for(i = (*init->__anon1.list).first; i; i = i->next)
17314 {
17315 if(type && type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
17316 {
17317 FindNextDataMember(type->__anon1._class->__anon1.registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
17318 if(curMember)
17319 {
17320 if(!curMember->dataType)
17321 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0);
17322 initializerType = curMember->dataType;
17323 }
17324 }
17325 ProcessInitializer(i, initializerType);
17326 if(initializerType && type && (type->kind == 9 || type->kind == 10))
17327 initializerType = initializerType->next;
17328 if(!i->isConstant)
17329 init->isConstant = 0;
17330 }
17331 if(type && type->kind == 12)
17332 FreeType(initializerType);
17333 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))
17334 {
17335 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Assigning list initializer to non list\n", (((void *)0))));
17336 }
17337 break;
17338 }
17339 }
17340 }
17341
17342 extern struct Symbol * FindType(struct Context * ctx, const char *  name);
17343
17344 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
17345
17346 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
17347 {
17348 switch(spec->type)
17349 {
17350 case 0:
17351 {
17352 if(spec->__anon1.specifier == THISCLASS)
17353 {
17354 if(thisClass)
17355 {
17356 spec->type = 1;
17357 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
17358 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
17359 ProcessSpecifier(spec, declareStruct);
17360 }
17361 }
17362 break;
17363 }
17364 case 1:
17365 {
17366 struct Symbol * symbol = FindType(curContext, spec->__anon1.__anon1.name);
17367
17368 if(symbol)
17369 DeclareType(symbol->type, 1, 1);
17370 else if((symbol = spec->__anon1.__anon1.symbol) && symbol->__anon1.registered && symbol->__anon1.registered->type == 1 && declareStruct)
17371 DeclareStruct(spec->__anon1.__anon1.name, 0);
17372 break;
17373 }
17374 case 2:
17375 {
17376 struct Enumerator * e;
17377
17378 if(spec->__anon1.__anon2.list)
17379 {
17380 for(e = (*spec->__anon1.__anon2.list).first; e; e = e->next)
17381 {
17382 if(e->exp)
17383 ProcessExpressionType(e->exp);
17384 }
17385 }
17386 break;
17387 }
17388 case 3:
17389 case 4:
17390 {
17391 if(spec->__anon1.__anon2.definitions)
17392 {
17393 struct Symbol * symbol = spec->__anon1.__anon2.id ? FindClass(spec->__anon1.__anon2.id->string) : (((void *)0));
17394
17395 ProcessClass(spec->__anon1.__anon2.definitions, symbol);
17396 }
17397 break;
17398 }
17399 }
17400 }
17401
17402 static void ProcessDeclarator(struct Declarator * decl)
17403 {
17404 switch(decl->type)
17405 {
17406 case 1:
17407 if(decl->__anon1.identifier->classSym)
17408 {
17409 FreeSpecifier(decl->__anon1.identifier->_class);
17410 decl->__anon1.identifier->_class = (((void *)0));
17411 }
17412 break;
17413 case 3:
17414 if(decl->__anon1.array.exp)
17415 ProcessExpressionType(decl->__anon1.array.exp);
17416 case 0:
17417 case 2:
17418 case 4:
17419 case 5:
17420 case 6:
17421 case 7:
17422 if(decl->declarator)
17423 ProcessDeclarator(decl->declarator);
17424 if(decl->type == 4)
17425 {
17426 struct Identifier * id = GetDeclId(decl);
17427
17428 if(id && id->_class)
17429 {
17430 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
17431
17432 if(!decl->__anon1.function.parameters)
17433 decl->__anon1.function.parameters = MkList();
17434 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), (((void *)0)), param);
17435 id->_class = (((void *)0));
17436 }
17437 if(decl->__anon1.function.parameters)
17438 {
17439 struct TypeName * param;
17440
17441 for(param = (*decl->__anon1.function.parameters).first; param; param = param->next)
17442 {
17443 if(param->qualifiers && (*param->qualifiers).first)
17444 {
17445 struct Specifier * spec = (*param->qualifiers).first;
17446
17447 if(spec && spec->__anon1.specifier == TYPED_OBJECT)
17448 {
17449 struct Declarator * d = param->declarator;
17450 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);
17451
17452 if(d->type != 5)
17453 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*newParam->qualifiers), (((void *)0)), MkSpecifier(CONST));
17454 FreeList(param->qualifiers, FreeSpecifier);
17455 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
17456 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
17457 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), param, newParam);
17458 param = newParam;
17459 }
17460 else if(spec && spec->__anon1.specifier == ANY_OBJECT)
17461 {
17462 struct Declarator * d = param->declarator;
17463
17464 FreeList(param->qualifiers, FreeSpecifier);
17465 param->qualifiers = MkListOne(MkSpecifier(VOID));
17466 if(d->type != 5)
17467 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*param->qualifiers), (((void *)0)), MkSpecifier(CONST));
17468 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
17469 }
17470 else if(spec->__anon1.specifier == THISCLASS)
17471 {
17472 if(thisClass)
17473 {
17474 spec->type = 1;
17475 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
17476 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
17477 ProcessSpecifier(spec, 0);
17478 }
17479 }
17480 }
17481 if(param->declarator)
17482 ProcessDeclarator(param->declarator);
17483 }
17484 }
17485 }
17486 break;
17487 }
17488 }
17489
17490 extern struct Identifier * CopyIdentifier(struct Identifier * id);
17491
17492 extern void FreeInitDeclarator(struct InitDeclarator * decl);
17493
17494 static void ProcessDeclaration(struct Declaration * decl)
17495 {
17496 yylloc = decl->loc;
17497 switch(decl->type)
17498 {
17499 case 1:
17500 {
17501 unsigned int declareStruct = 0;
17502
17503 if(decl->__anon1.__anon1.declarators)
17504 {
17505 struct InitDeclarator * d;
17506
17507 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
17508 {
17509 struct Type * type, * subType;
17510
17511 ProcessDeclarator(d->declarator);
17512 type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
17513 if(d->initializer)
17514 {
17515 ProcessInitializer(d->initializer, type);
17516 if((*decl->__anon1.__anon1.declarators).count == 1 && d->initializer->type == 0 && d->initializer->__anon1.exp->type == 1)
17517 {
17518 if(type->kind == 8 && type->__anon1._class == d->initializer->__anon1.exp->expType->__anon1._class)
17519 {
17520 struct Instantiation * inst = d->initializer->__anon1.exp->__anon1.instance;
17521
17522 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
17523 d->initializer->__anon1.exp->__anon1.instance = (((void *)0));
17524 if(decl->__anon1.__anon1.specifiers)
17525 FreeList(decl->__anon1.__anon1.specifiers, FreeSpecifier);
17526 FreeList(decl->__anon1.__anon1.declarators, FreeInitDeclarator);
17527 d = (((void *)0));
17528 decl->type = 2;
17529 decl->__anon1.inst = inst;
17530 }
17531 }
17532 }
17533 for(subType = type; subType; )
17534 {
17535 if(subType->kind == 8)
17536 {
17537 declareStruct = 1;
17538 break;
17539 }
17540 else if(subType->kind == 13)
17541 break;
17542 else if(subType->kind == 12)
17543 subType = subType->__anon1.__anon4.arrayType;
17544 else
17545 break;
17546 }
17547 FreeType(type);
17548 if(!d)
17549 break;
17550 }
17551 }
17552 if(decl->__anon1.__anon1.specifiers)
17553 {
17554 struct Specifier * s;
17555
17556 for(s = (*decl->__anon1.__anon1.specifiers).first; s; s = s->next)
17557 {
17558 ProcessSpecifier(s, declareStruct);
17559 }
17560 }
17561 break;
17562 }
17563 case 2:
17564 {
17565 ProcessInstantiationType(decl->__anon1.inst);
17566 break;
17567 }
17568 case 0:
17569 {
17570 struct Specifier * spec;
17571 struct Declarator * d;
17572 unsigned int declareStruct = 0;
17573
17574 if(decl->__anon1.__anon1.declarators)
17575 {
17576 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
17577 {
17578 struct Type * type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
17579 struct Type * subType;
17580
17581 ProcessDeclarator(d);
17582 for(subType = type; subType; )
17583 {
17584 if(subType->kind == 8)
17585 {
17586 declareStruct = 1;
17587 break;
17588 }
17589 else if(subType->kind == 13)
17590 break;
17591 else if(subType->kind == 12)
17592 subType = subType->__anon1.__anon4.arrayType;
17593 else
17594 break;
17595 }
17596 FreeType(type);
17597 }
17598 }
17599 if(decl->__anon1.__anon1.specifiers)
17600 {
17601 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
17602 ProcessSpecifier(spec, declareStruct);
17603 }
17604 break;
17605 }
17606 }
17607 }
17608
17609 static struct FunctionDefinition * curFunction;
17610
17611 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
17612 {
17613 char propName[1024], propNameM[1024];
17614 char getName[1024], setName[1024];
17615 struct __ecereNameSpace__ecere__sys__OldList * args;
17616
17617 DeclareProperty(prop, setName, getName);
17618 strcpy(propName, "__ecereProp_");
17619 FullClassNameCat(propName, prop->_class->fullName, 0);
17620 strcat(propName, "_");
17621 FullClassNameCat(propName, prop->name, 1);
17622 strcpy(propNameM, "__ecerePropM_");
17623 FullClassNameCat(propNameM, prop->_class->fullName, 0);
17624 strcat(propNameM, "_");
17625 FullClassNameCat(propNameM, prop->name, 1);
17626 if(prop->isWatchable)
17627 {
17628 args = MkList();
17629 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17630 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17631 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17632 args = MkList();
17633 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17634 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17635 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17636 }
17637 {
17638 args = MkList();
17639 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17640 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17641 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17642 args = MkList();
17643 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17644 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17645 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17646 }
17647 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
17648 curFunction->propSet->fireWatchersDone = 1;
17649 }
17650
17651 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
17652
17653 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
17654
17655 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
17656
17657 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
17658
17659 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
17660
17661 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
17662
17663 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
17664
17665 extern void FreePropertyWatch(struct PropertyWatch * watcher);
17666
17667 static void ProcessStatement(struct Statement * stmt)
17668 {
17669 yylloc = stmt->loc;
17670 switch(stmt->type)
17671 {
17672 case 0:
17673 ProcessStatement(stmt->__anon1.labeled.stmt);
17674 break;
17675 case 1:
17676 if(stmt->__anon1.caseStmt.exp)
17677 {
17678 FreeType(stmt->__anon1.caseStmt.exp->destType);
17679 stmt->__anon1.caseStmt.exp->destType = curSwitchType;
17680 if(curSwitchType)
17681 curSwitchType->refCount++;
17682 ProcessExpressionType(stmt->__anon1.caseStmt.exp);
17683 ComputeExpression(stmt->__anon1.caseStmt.exp);
17684 }
17685 if(stmt->__anon1.caseStmt.stmt)
17686 ProcessStatement(stmt->__anon1.caseStmt.stmt);
17687 break;
17688 case 2:
17689 {
17690 if(stmt->__anon1.compound.context)
17691 {
17692 struct Declaration * decl;
17693 struct Statement * s;
17694 struct Statement * prevCompound = curCompound;
17695 struct Context * prevContext = curContext;
17696
17697 if(!stmt->__anon1.compound.isSwitch)
17698 curCompound = stmt;
17699 curContext = stmt->__anon1.compound.context;
17700 if(stmt->__anon1.compound.declarations)
17701 {
17702 for(decl = (*stmt->__anon1.compound.declarations).first; decl; decl = decl->next)
17703 ProcessDeclaration(decl);
17704 }
17705 if(stmt->__anon1.compound.statements)
17706 {
17707 for(s = (*stmt->__anon1.compound.statements).first; s; s = s->next)
17708 ProcessStatement(s);
17709 }
17710 curContext = prevContext;
17711 curCompound = prevCompound;
17712 }
17713 break;
17714 }
17715 case 3:
17716 {
17717 struct Expression * exp;
17718
17719 if(stmt->__anon1.expressions)
17720 {
17721 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
17722 ProcessExpressionType(exp);
17723 }
17724 break;
17725 }
17726 case 4:
17727 {
17728 struct Expression * exp;
17729
17730 FreeType(((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType);
17731 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType = MkClassType("bool");
17732 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType->truth = 1;
17733 for(exp = (*stmt->__anon1.ifStmt.exp).first; exp; exp = exp->next)
17734 {
17735 ProcessExpressionType(exp);
17736 }
17737 if(stmt->__anon1.ifStmt.stmt)
17738 ProcessStatement(stmt->__anon1.ifStmt.stmt);
17739 if(stmt->__anon1.ifStmt.elseStmt)
17740 ProcessStatement(stmt->__anon1.ifStmt.elseStmt);
17741 break;
17742 }
17743 case 5:
17744 {
17745 struct Type * oldSwitchType = curSwitchType;
17746
17747 if(stmt->__anon1.switchStmt.exp)
17748 {
17749 struct Expression * exp;
17750
17751 for(exp = (*stmt->__anon1.switchStmt.exp).first; exp; exp = exp->next)
17752 {
17753 if(!exp->next)
17754 {
17755 ProcessExpressionType(exp);
17756 }
17757 if(!exp->next)
17758 curSwitchType = exp->expType;
17759 }
17760 }
17761 ProcessStatement(stmt->__anon1.switchStmt.stmt);
17762 curSwitchType = oldSwitchType;
17763 break;
17764 }
17765 case 6:
17766 {
17767 if(stmt->__anon1.whileStmt.exp)
17768 {
17769 struct Expression * exp;
17770
17771 FreeType(((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType);
17772 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType = MkClassType("bool");
17773 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType->truth = 1;
17774 for(exp = (*stmt->__anon1.whileStmt.exp).first; exp; exp = exp->next)
17775 {
17776 ProcessExpressionType(exp);
17777 }
17778 }
17779 if(stmt->__anon1.whileStmt.stmt)
17780 ProcessStatement(stmt->__anon1.whileStmt.stmt);
17781 break;
17782 }
17783 case 7:
17784 {
17785 if(stmt->__anon1.doWhile.exp)
17786 {
17787 struct Expression * exp;
17788
17789 if((*stmt->__anon1.doWhile.exp).last)
17790 {
17791 FreeType(((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType);
17792 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType = MkClassType("bool");
17793 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType->truth = 1;
17794 }
17795 for(exp = (*stmt->__anon1.doWhile.exp).first; exp; exp = exp->next)
17796 {
17797 ProcessExpressionType(exp);
17798 }
17799 }
17800 if(stmt->__anon1.doWhile.stmt)
17801 ProcessStatement(stmt->__anon1.doWhile.stmt);
17802 break;
17803 }
17804 case 8:
17805 {
17806 struct Expression * exp;
17807
17808 if(stmt->__anon1.forStmt.init)
17809 ProcessStatement(stmt->__anon1.forStmt.init);
17810 if(stmt->__anon1.forStmt.check && stmt->__anon1.forStmt.check->__anon1.expressions)
17811 {
17812 FreeType(((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType);
17813 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType = MkClassType("bool");
17814 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType->truth = 1;
17815 }
17816 if(stmt->__anon1.forStmt.check)
17817 ProcessStatement(stmt->__anon1.forStmt.check);
17818 if(stmt->__anon1.forStmt.increment)
17819 {
17820 for(exp = (*stmt->__anon1.forStmt.increment).first; exp; exp = exp->next)
17821 ProcessExpressionType(exp);
17822 }
17823 if(stmt->__anon1.forStmt.stmt)
17824 ProcessStatement(stmt->__anon1.forStmt.stmt);
17825 break;
17826 }
17827 case 18:
17828 {
17829 struct Identifier * id = stmt->__anon1.forEachStmt.id;
17830 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->__anon1.forEachStmt.exp;
17831 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->__anon1.forEachStmt.filter;
17832 struct Statement * block = stmt->__anon1.forEachStmt.stmt;
17833 char iteratorType[1024];
17834 struct Type * source;
17835 struct Expression * e;
17836 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));
17837 struct Expression * arrayExp;
17838 const char * typeString = (((void *)0));
17839 int builtinCount = 0;
17840
17841 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
17842 {
17843 if(!e->next)
17844 {
17845 FreeType(e->destType);
17846 e->destType = ProcessTypeString("Container", 0);
17847 }
17848 if(!isBuiltin || e->next)
17849 ProcessExpressionType(e);
17850 }
17851 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
17852 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)))
17853 {
17854 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->__anon1._class->__anon1.registered : (((void *)0));
17855 struct Symbol * symbol;
17856 struct Expression * expIt = (((void *)0));
17857 unsigned int isMap = 0, isArray = 0, isLinkList = 0, isList = 0, isCustomAVLTree = 0;
17858 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
17859 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
17860 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
17861
17862 stmt->type = 2;
17863 stmt->__anon1.compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
17864 stmt->__anon1.compound.context->parent = curContext;
17865 curContext = stmt->__anon1.compound.context;
17866 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, customAVLTreeClass))
17867 {
17868 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
17869
17870 isCustomAVLTree = 1;
17871 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, mapClass))
17872 isMap = 1;
17873 }
17874 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, arrayClass))
17875 isArray = 1;
17876 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, linkListClass))
17877 {
17878 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
17879
17880 isLinkList = 1;
17881 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, listClass);
17882 }
17883 if(isArray)
17884 {
17885 struct Declarator * decl;
17886 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17887
17888 decl = SpecDeclFromString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
17889 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17890 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
17891 }
17892 else if(isBuiltin)
17893 {
17894 struct Type * type = (((void *)0));
17895 char typeStringBuf[1024];
17896
17897 arrayExp = (((struct Expression *)(*exp).last)->type == 35) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->__anon1.cast.exp;
17898 if(((struct Expression *)(*exp).last)->type == 11)
17899 {
17900 struct TypeName * typeName = ((struct Expression *)(*exp).last)->__anon1.cast.typeName;
17901
17902 if(typeName)
17903 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
17904 }
17905 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)
17906 {
17907 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->__anon1._class->__anon1.registered;
17908
17909 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
17910 }
17911 else if(arrayExp->__anon1.list)
17912 {
17913 struct Expression * e;
17914
17915 for(e = (*arrayExp->__anon1.list).first; e; e = e->next)
17916 {
17917 ProcessExpressionType(e);
17918 if(e->expType)
17919 {
17920 if(!type)
17921 {
17922 type = e->expType;
17923 type->refCount++;
17924 }
17925 else
17926 {
17927 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
17928 {
17929 FreeType(type);
17930 type = e->expType;
17931 e->expType = (((void *)0));
17932 e = (*arrayExp->__anon1.list).first;
17933 ProcessExpressionType(e);
17934 if(e->expType)
17935 {
17936 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
17937 {
17938 FreeType(e->expType);
17939 e->expType = (((void *)0));
17940 FreeType(type);
17941 type = (((void *)0));
17942 break;
17943 }
17944 }
17945 }
17946 }
17947 if(e->expType)
17948 {
17949 FreeType(e->expType);
17950 e->expType = (((void *)0));
17951 }
17952 }
17953 }
17954 if(type)
17955 {
17956 typeStringBuf[0] = '\0';
17957 PrintType(type, typeStringBuf, 0, 1);
17958 typeString = typeStringBuf;
17959 FreeType(type);
17960 }
17961 }
17962 if(typeString)
17963 {
17964 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
17965 struct Declarator * decl;
17966 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17967
17968 if(arrayExp->__anon1.list)
17969 {
17970 struct Expression * e;
17971
17972 builtinCount = (*arrayExp->__anon1.list).count;
17973 type = ProcessTypeString(typeString, 0);
17974 while((e = (*arrayExp->__anon1.list).first))
17975 {
17976 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->__anon1.list), e);
17977 e->destType = type;
17978 type->refCount++;
17979 ProcessExpressionType(e);
17980 ListAdd(initializers, MkInitializerAssignment(e));
17981 }
17982 FreeType(type);
17983 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->__anon1.list), arrayExp->__anon1.list = 0);
17984 }
17985 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
17986 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
17987 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
17988 FreeList(exp, FreeExpression);
17989 }
17990 else
17991 {
17992 arrayExp->expType = ProcessTypeString("Container", 0);
17993 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
17994 }
17995 }
17996 else if(isLinkList && !isList)
17997 {
17998 struct Declarator * decl;
17999 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18000
18001 decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, MkDeclaratorIdentifier(id));
18002 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
18003 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
18004 }
18005 else if(_class->templateArgs)
18006 {
18007 if(isMap)
18008 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].__anon1.__anon1.dataTypeString, _class->templateArgs[6].__anon1.__anon1.dataTypeString);
18009 else
18010 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].__anon1.__anon1.dataTypeString, _class->templateArgs[1].__anon1.__anon1.dataTypeString);
18011 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)))))))));
18012 }
18013 symbol = FindSymbol(id->string, curContext, curContext, 0, 0);
18014 if(block)
18015 {
18016 switch(block->type)
18017 {
18018 case 2:
18019 if(block->__anon1.compound.context)
18020 block->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18021 break;
18022 case 4:
18023 if(block->__anon1.ifStmt.stmt && block->__anon1.ifStmt.stmt->type == 2 && block->__anon1.ifStmt.stmt->__anon1.compound.context)
18024 block->__anon1.ifStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18025 if(block->__anon1.ifStmt.elseStmt && block->__anon1.ifStmt.elseStmt->type == 2 && block->__anon1.ifStmt.elseStmt->__anon1.compound.context)
18026 block->__anon1.ifStmt.elseStmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18027 break;
18028 case 5:
18029 if(block->__anon1.switchStmt.stmt && block->__anon1.switchStmt.stmt->type == 2 && block->__anon1.switchStmt.stmt->__anon1.compound.context)
18030 block->__anon1.switchStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18031 break;
18032 case 6:
18033 if(block->__anon1.whileStmt.stmt && block->__anon1.whileStmt.stmt->type == 2 && block->__anon1.whileStmt.stmt->__anon1.compound.context)
18034 block->__anon1.whileStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18035 break;
18036 case 7:
18037 if(block->__anon1.doWhile.stmt && block->__anon1.doWhile.stmt->type == 2 && block->__anon1.doWhile.stmt->__anon1.compound.context)
18038 block->__anon1.doWhile.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18039 break;
18040 case 8:
18041 if(block->__anon1.forStmt.stmt && block->__anon1.forStmt.stmt->type == 2 && block->__anon1.forStmt.stmt->__anon1.compound.context)
18042 block->__anon1.forStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18043 break;
18044 case 18:
18045 if(block->__anon1.forEachStmt.stmt && block->__anon1.forEachStmt.stmt->type == 2 && block->__anon1.forEachStmt.stmt->__anon1.compound.context)
18046 block->__anon1.forEachStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
18047 break;
18048 }
18049 }
18050 if(filter)
18051 {
18052 block = MkIfStmt(filter, block, (((void *)0)));
18053 }
18054 if(isArray)
18055 {
18056 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));
18057 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
18058 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
18059 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
18060 }
18061 else if(isBuiltin)
18062 {
18063 char count[128];
18064
18065 sprintf(count, "%d", builtinCount);
18066 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));
18067 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
18068 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
18069 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
18070 }
18071 else if(isLinkList && !isList)
18072 {
18073 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].__anon1.__anon1.dataTypeString);
18074 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
18075
18076 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].__anon1.__anon1.dataTypeString && !strcmp(_class->templateArgs[5].__anon1.__anon1.dataTypeString, "LT::link"))
18077 {
18078 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));
18079 }
18080 else
18081 {
18082 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18083 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, (((void *)0)));
18084
18085 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));
18086 }
18087 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
18088 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
18089 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
18090 }
18091 else
18092 {
18093 stmt->__anon1.compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
18094 }
18095 ProcessExpressionType(expIt);
18096 if((*stmt->__anon1.compound.declarations).first)
18097 ProcessDeclaration((*stmt->__anon1.compound.declarations).first);
18098 if(symbol)
18099 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
18100 ProcessStatement(stmt);
18101 curContext = stmt->__anon1.compound.context->parent;
18102 break;
18103 }
18104 else
18105 {
18106 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Expression is not a container\n", (((void *)0))));
18107 }
18108 break;
18109 }
18110 case 9:
18111 break;
18112 case 10:
18113 break;
18114 case 11:
18115 break;
18116 case 12:
18117 {
18118 struct Expression * exp;
18119
18120 if(stmt->__anon1.expressions)
18121 {
18122 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
18123 {
18124 if(!exp->next)
18125 {
18126 if(curFunction && !curFunction->type)
18127 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
18128 FreeType(exp->destType);
18129 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->__anon1.__anon2.returnType : (((void *)0));
18130 if(exp->destType)
18131 exp->destType->refCount++;
18132 }
18133 ProcessExpressionType(exp);
18134 }
18135 }
18136 break;
18137 }
18138 case 14:
18139 {
18140 ProcessDeclaration(stmt->__anon1.decl);
18141 break;
18142 }
18143 case 13:
18144 {
18145 struct AsmField * field;
18146
18147 if(stmt->__anon1.asmStmt.inputFields)
18148 {
18149 for(field = (*stmt->__anon1.asmStmt.inputFields).first; field; field = field->next)
18150 if(field->expression)
18151 ProcessExpressionType(field->expression);
18152 }
18153 if(stmt->__anon1.asmStmt.outputFields)
18154 {
18155 for(field = (*stmt->__anon1.asmStmt.outputFields).first; field; field = field->next)
18156 if(field->expression)
18157 ProcessExpressionType(field->expression);
18158 }
18159 if(stmt->__anon1.asmStmt.clobberedFields)
18160 {
18161 for(field = (*stmt->__anon1.asmStmt.clobberedFields).first; field; field = field->next)
18162 {
18163 if(field->expression)
18164 ProcessExpressionType(field->expression);
18165 }
18166 }
18167 break;
18168 }
18169 case 17:
18170 {
18171 struct PropertyWatch * propWatch;
18172 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
18173 struct Expression * object = stmt->__anon1._watch.object;
18174 struct Expression * watcher = stmt->__anon1._watch.watcher;
18175
18176 if(watcher)
18177 ProcessExpressionType(watcher);
18178 if(object)
18179 ProcessExpressionType(object);
18180 if(inCompiler)
18181 {
18182 if(watcher || thisClass)
18183 {
18184 struct External * external = curExternal;
18185 struct Context * context = curContext;
18186
18187 stmt->type = 3;
18188 stmt->__anon1.expressions = MkList();
18189 curExternal = external->prev;
18190 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
18191 {
18192 struct ClassFunction * func;
18193 char watcherName[1024];
18194 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;
18195 struct External * createdExternal;
18196 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
18197
18198 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
18199 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
18200 if(propWatch->deleteWatch)
18201 strcat(watcherName, "_delete");
18202 else
18203 {
18204 struct Identifier * propID;
18205
18206 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
18207 {
18208 strcat(watcherName, "_");
18209 strcat(watcherName, propID->string);
18210 }
18211 }
18212 if(object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class && object->expType->__anon1._class->__anon1.registered)
18213 {
18214 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)));
18215 ProcessClassFunctionBody(func, propWatch->compound);
18216 propWatch->compound = (((void *)0));
18217 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 1);
18218 createdExternal->symbol->idCode = external->symbol->idCode;
18219 curExternal = createdExternal;
18220 ProcessFunction(createdExternal->__anon1.function);
18221 {
18222 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->__anon1.function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->__anon1.function->declarator), (((void *)0)))));
18223
18224 externalDecl->__anon1.declaration = decl;
18225 if(decl->symbol && !decl->symbol->__anon2.__anon1.pointerExternal)
18226 decl->symbol->__anon2.__anon1.pointerExternal = externalDecl;
18227 }
18228 if(propWatch->deleteWatch)
18229 {
18230 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
18231
18232 ListAdd(args, CopyExpression(object));
18233 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18234 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
18235 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
18236 }
18237 else
18238 {
18239 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->__anon1._class->__anon1.registered;
18240 struct Identifier * propID;
18241
18242 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
18243 {
18244 char propName[1024];
18245 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
18246
18247 if(prop)
18248 {
18249 char getName[1024], setName[1024];
18250 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
18251
18252 DeclareProperty(prop, setName, getName);
18253 strcpy(propName, "__ecereProp_");
18254 FullClassNameCat(propName, prop->_class->fullName, 0);
18255 strcat(propName, "_");
18256 FullClassNameCat(propName, prop->name, 1);
18257 ListAdd(args, CopyExpression(object));
18258 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
18259 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18260 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
18261 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
18262 }
18263 else
18264 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
18265 }
18266 }
18267 }
18268 else
18269 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid watched object\n", (((void *)0))));
18270 }
18271 curExternal = external;
18272 curContext = context;
18273 if(watcher)
18274 FreeExpression(watcher);
18275 if(object)
18276 FreeExpression(object);
18277 FreeList(watches, FreePropertyWatch);
18278 }
18279 else
18280 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a _class\n", (((void *)0))));
18281 }
18282 else
18283 {
18284 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
18285 {
18286 ProcessStatement(propWatch->compound);
18287 }
18288 }
18289 break;
18290 }
18291 case 15:
18292 {
18293 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
18294 struct Expression * object = stmt->__anon1._watch.object;
18295 struct __ecereNameSpace__ecere__com__Class * _class;
18296
18297 if(object)
18298 ProcessExpressionType(object);
18299 if(inCompiler)
18300 {
18301 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0))) : thisClass;
18302 if(_class)
18303 {
18304 struct Identifier * propID;
18305
18306 stmt->type = 3;
18307 stmt->__anon1.expressions = MkList();
18308 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
18309 {
18310 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
18311 }
18312 else if(!watches)
18313 {
18314 }
18315 if(watches)
18316 {
18317 for(propID = (*watches).first; propID; propID = propID->next)
18318 {
18319 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
18320
18321 if(prop)
18322 {
18323 CreateFireWatcher(prop, object, stmt);
18324 }
18325 else
18326 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
18327 }
18328 }
18329 else
18330 {
18331 struct __ecereNameSpace__ecere__com__Property * prop;
18332 struct __ecereNameSpace__ecere__com__Class * base;
18333
18334 for(base = _class; base; base = base->base)
18335 {
18336 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
18337 {
18338 if(prop->isProperty && prop->isWatchable)
18339 {
18340 CreateFireWatcher(prop, object, stmt);
18341 }
18342 }
18343 }
18344 }
18345 if(object)
18346 FreeExpression(object);
18347 FreeList(watches, FreeIdentifier);
18348 }
18349 else
18350 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
18351 }
18352 break;
18353 }
18354 case 16:
18355 {
18356 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
18357 struct Expression * object = stmt->__anon1._watch.object;
18358 struct Expression * watcher = stmt->__anon1._watch.watcher;
18359 struct __ecereNameSpace__ecere__com__Class * _class;
18360
18361 if(object)
18362 ProcessExpressionType(object);
18363 if(watcher)
18364 ProcessExpressionType(watcher);
18365 if(inCompiler)
18366 {
18367 _class = (object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0));
18368 if(watcher || thisClass)
18369 {
18370 if(_class)
18371 {
18372 struct Identifier * propID;
18373
18374 stmt->type = 3;
18375 stmt->__anon1.expressions = MkList();
18376 if(!watches)
18377 {
18378 struct __ecereNameSpace__ecere__sys__OldList * args;
18379
18380 args = MkList();
18381 ListAdd(args, CopyExpression(object));
18382 ListAdd(args, MkExpConstant("0"));
18383 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18384 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
18385 }
18386 else
18387 {
18388 for(propID = (*watches).first; propID; propID = propID->next)
18389 {
18390 char propName[1024];
18391 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
18392
18393 if(prop)
18394 {
18395 char getName[1024], setName[1024];
18396 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
18397
18398 DeclareProperty(prop, setName, getName);
18399 strcpy(propName, "__ecereProp_");
18400 FullClassNameCat(propName, prop->_class->fullName, 0);
18401 strcat(propName, "_");
18402 FullClassNameCat(propName, prop->name, 1);
18403 ListAdd(args, CopyExpression(object));
18404 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
18405 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18406 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
18407 }
18408 else
18409 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
18410 }
18411 }
18412 if(object)
18413 FreeExpression(object);
18414 if(watcher)
18415 FreeExpression(watcher);
18416 FreeList(watches, FreeIdentifier);
18417 }
18418 else
18419 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
18420 }
18421 else
18422 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
18423 }
18424 break;
18425 }
18426 }
18427 }
18428
18429 extern struct Expression * QBrackets(struct Expression * exp);
18430
18431 extern struct TypeName * QMkType(const char *  spec, struct Declarator * decl);
18432
18433 extern struct Declarator * QMkPtrDecl(const char *  id);
18434
18435 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
18436
18437 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
18438
18439 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
18440
18441 static void ProcessFunction(struct FunctionDefinition * function)
18442 {
18443 struct Identifier * id = GetDeclId(function->declarator);
18444 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
18445 struct Type * type = symbol ? symbol->type : (((void *)0));
18446 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
18447 struct Context * oldTopContext = topContext;
18448
18449 yylloc = function->loc;
18450 if(type && type->__anon1.__anon2.thisClass)
18451 {
18452 struct Symbol * classSym = type->__anon1.__anon2.thisClass;
18453 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1.__anon2.thisClass->__anon1.registered;
18454 char className[1024];
18455 char structName[1024];
18456 struct Declarator * funcDecl;
18457 struct Symbol * thisSymbol;
18458 unsigned int typedObject = 0;
18459
18460 if(_class && !_class->base)
18461 {
18462 _class = currentClass;
18463 if(_class && !_class->symbol)
18464 _class->symbol = FindClass(_class->fullName);
18465 classSym = _class ? _class->symbol : (((void *)0));
18466 typedObject = 1;
18467 }
18468 thisClass = _class;
18469 if(inCompiler && _class)
18470 {
18471 if(type->kind == 11)
18472 {
18473 if(symbol->type->__anon1.__anon2.params.count == 1 && ((struct Type *)symbol->type->__anon1.__anon2.params.first)->kind == 0)
18474 {
18475 struct Type * param = symbol->type->__anon1.__anon2.params.first;
18476
18477 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->__anon1.__anon2.params, param);
18478 FreeType(param);
18479 }
18480 if(type->classObjectType != 1)
18481 {
18482 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->__anon1.__anon2.params, (((void *)0)), MkClassType(_class->fullName));
18483 symbol->type->__anon1.__anon2.staticMethod = 1;
18484 symbol->type->__anon1.__anon2.thisClass = (((void *)0));
18485 symbol->type->extraParam = 0;
18486 }
18487 }
18488 strcpy(className, "__ecereClass_");
18489 FullClassNameCat(className, _class->fullName, 1);
18490 structName[0] = (char)0;
18491 FullClassNameCat(structName, _class->fullName, 0);
18492 funcDecl = GetFuncDecl(function->declarator);
18493 if(funcDecl)
18494 {
18495 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
18496 {
18497 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
18498
18499 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
18500 {
18501 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
18502 FreeTypeName(param);
18503 }
18504 }
18505 if(!function->propertyNoThis)
18506 {
18507 struct TypeName * thisParam = (((void *)0));
18508
18509 if(type->classObjectType != 1)
18510 {
18511 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18512 if(!funcDecl->__anon1.function.parameters)
18513 funcDecl->__anon1.function.parameters = MkList();
18514 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18515 }
18516 if(typedObject)
18517 {
18518 if(type->classObjectType != 1)
18519 {
18520 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
18521 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
18522 }
18523 thisParam = __extension__ ({
18524 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
18525
18526 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
18527 });
18528 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18529 }
18530 }
18531 }
18532 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
18533 {
18534 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
18535
18536 funcDecl = GetFuncDecl(initDecl->declarator);
18537 if(funcDecl)
18538 {
18539 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
18540 {
18541 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
18542
18543 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
18544 {
18545 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
18546 FreeTypeName(param);
18547 }
18548 }
18549 if(type->classObjectType != 1)
18550 {
18551 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->__anon2.__anon2.externalSet)
18552 {
18553 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18554
18555 if(!funcDecl->__anon1.function.parameters)
18556 funcDecl->__anon1.function.parameters = MkList();
18557 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18558 }
18559 }
18560 }
18561 }
18562 }
18563 if(function->body)
18564 {
18565 if(type->classObjectType != 1)
18566 {
18567 thisSymbol = __extension__ ({
18568 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18569
18570 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
18571 });
18572 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18573 if(typedObject && thisSymbol->type)
18574 {
18575 thisSymbol->type->classObjectType = 2;
18576 thisSymbol->type->byReference = type->byReference;
18577 thisSymbol->type->typedByReference = type->byReference;
18578 }
18579 }
18580 }
18581 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
18582 {
18583 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
18584
18585 {
18586 struct __ecereNameSpace__ecere__com__Class * base;
18587
18588 for(base = _class; base && base->type != 1000; base = base->next)
18589 {
18590 for(member = base->membersAndProperties.first; member; member = member->next)
18591 if(!member->isProperty)
18592 break;
18593 if(member)
18594 break;
18595 }
18596 }
18597 for(member = _class->membersAndProperties.first; member; member = member->next)
18598 if(!member->isProperty)
18599 break;
18600 if(member)
18601 {
18602 char pointerName[1024];
18603 struct Declaration * decl;
18604 struct Initializer * initializer;
18605 struct Expression * exp, * bytePtr;
18606
18607 strcpy(pointerName, "__ecerePointer_");
18608 FullClassNameCat(pointerName, _class->fullName, 0);
18609 {
18610 char className[1024];
18611
18612 strcpy(className, "__ecereClass_");
18613 FullClassNameCat(className, classSym->string, 1);
18614 DeclareClass(classSym, className);
18615 }
18616 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
18617 if(_class->fixed)
18618 {
18619 char string[256];
18620
18621 sprintf(string, "%d", _class->offset);
18622 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
18623 }
18624 else
18625 {
18626 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
18627 }
18628 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
18629 exp->expType = __extension__ ({
18630 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18631
18632 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
18633 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18634
18635 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
18636 }), __ecereInstance2;
18637 });
18638 if(function->body)
18639 {
18640 yylloc = function->body->loc;
18641 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
18642 {
18643 struct Context * prevContext = curContext;
18644 struct __ecereNameSpace__ecere__sys__OldList * list;
18645
18646 curContext = function->body->__anon1.compound.context;
18647 decl = MkDeclaration((list = MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0))))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
18648 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*list), (((void *)0)), MkSpecifierExtended(MkExtDeclAttrib(MkAttrib(ATTRIB, MkListOne(MkAttribute(__ecereNameSpace__ecere__sys__CopyString("unused"), (((void *)0))))))));
18649 curContext = prevContext;
18650 }
18651 decl->symbol = (((void *)0));
18652 if(!function->body->__anon1.compound.declarations)
18653 function->body->__anon1.compound.declarations = MkList();
18654 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->__anon1.compound.declarations), (((void *)0)), decl);
18655 }
18656 }
18657 }
18658 }
18659 else
18660 thisClass = (((void *)0));
18661 if(id)
18662 {
18663 FreeSpecifier(id->_class);
18664 id->_class = (((void *)0));
18665 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
18666 {
18667 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
18668
18669 id = GetDeclId(initDecl->declarator);
18670 FreeSpecifier(id->_class);
18671 id->_class = (((void *)0));
18672 }
18673 }
18674 if(function->body)
18675 topContext = function->body->__anon1.compound.context;
18676 {
18677 struct FunctionDefinition * oldFunction = curFunction;
18678
18679 curFunction = function;
18680 if(function->body)
18681 ProcessStatement(function->body);
18682 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
18683 {
18684 struct Statement * prevCompound = curCompound;
18685 struct Context * prevContext = curContext;
18686 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
18687
18688 if(!function->body->__anon1.compound.statements)
18689 function->body->__anon1.compound.statements = MkList();
18690 ListAdd(function->body->__anon1.compound.statements, fireWatchers);
18691 curCompound = function->body;
18692 curContext = function->body->__anon1.compound.context;
18693 ProcessStatement(fireWatchers);
18694 curContext = prevContext;
18695 curCompound = prevCompound;
18696 }
18697 curFunction = oldFunction;
18698 }
18699 if(function->declarator)
18700 {
18701 ProcessDeclarator(function->declarator);
18702 }
18703 topContext = oldTopContext;
18704 thisClass = oldThisClass;
18705 }
18706
18707 extern void FreeSymbol(struct Symbol * symbol);
18708
18709 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
18710
18711 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
18712 {
18713 struct ClassDef * def;
18714 struct External * external = curExternal;
18715 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->__anon1.registered : (((void *)0));
18716
18717 for(def = definitions->first; def; def = def->next)
18718 {
18719 if(def->type == 0)
18720 {
18721 if(def->__anon1.function->declarator)
18722 curExternal = def->__anon1.function->declarator->symbol->__anon2.__anon1.pointerExternal;
18723 else
18724 curExternal = external;
18725 ProcessFunction((struct FunctionDefinition *)def->__anon1.function);
18726 }
18727 else if(def->type == 2)
18728 {
18729 if(def->__anon1.decl->type == 2)
18730 {
18731 thisClass = regClass;
18732 ProcessInstantiationType(def->__anon1.decl->__anon1.inst);
18733 thisClass = (((void *)0));
18734 }
18735 else
18736 {
18737 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
18738
18739 if(regClass)
18740 thisClass = regClass;
18741 ProcessDeclaration(def->__anon1.decl);
18742 thisClass = backThisClass;
18743 }
18744 }
18745 else if(def->type == 1 && def->__anon1.defProperties)
18746 {
18747 struct MemberInit * defProperty;
18748 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);
18749
18750 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18751 for(defProperty = (*def->__anon1.defProperties).first; defProperty; defProperty = defProperty->next)
18752 {
18753 thisClass = regClass;
18754 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
18755 thisClass = (((void *)0));
18756 }
18757 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18758 FreeSymbol(thisSymbol);
18759 }
18760 else if(def->type == 3 && def->__anon1.propertyDef)
18761 {
18762 struct PropertyDef * prop = def->__anon1.propertyDef;
18763
18764 thisClass = regClass;
18765 if(prop->setStmt)
18766 {
18767 if(regClass)
18768 {
18769 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18770
18771 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18772 }
18773 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalSet : (((void *)0));
18774 ProcessStatement(prop->setStmt);
18775 }
18776 if(prop->getStmt)
18777 {
18778 if(regClass)
18779 {
18780 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18781
18782 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18783 }
18784 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalGet : (((void *)0));
18785 ProcessStatement(prop->getStmt);
18786 }
18787 if(prop->issetStmt)
18788 {
18789 if(regClass)
18790 {
18791 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18792
18793 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18794 }
18795 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalIsSet : (((void *)0));
18796 ProcessStatement(prop->issetStmt);
18797 }
18798 thisClass = (((void *)0));
18799 }
18800 else if(def->type == 4 && def->__anon1.propertyWatch)
18801 {
18802 struct PropertyWatch * propertyWatch = def->__anon1.propertyWatch;
18803
18804 thisClass = regClass;
18805 if(propertyWatch->compound)
18806 {
18807 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);
18808
18809 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18810 curExternal = (((void *)0));
18811 ProcessStatement(propertyWatch->compound);
18812 }
18813 thisClass = (((void *)0));
18814 }
18815 }
18816 }
18817
18818 void DeclareFunctionUtil(const char * s)
18819 {
18820 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
18821
18822 if(function)
18823 {
18824 char name[1024];
18825
18826 name[0] = (char)0;
18827 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
18828 strcpy(name, "__ecereFunction_");
18829 FullClassNameCat(name, s, 0);
18830 DeclareFunction(function, name);
18831 }
18832 }
18833
18834 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
18835
18836 void ComputeDataTypes()
18837 {
18838 struct External * external;
18839 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
18840 struct External * after = (((void *)0));
18841
18842 currentClass = (((void *)0));
18843 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
18844 for(external = (*ast).first; external; external = external->next)
18845 {
18846 if(external->type == 1)
18847 {
18848 struct Declaration * decl = external->__anon1.declaration;
18849
18850 if(decl)
18851 {
18852 struct __ecereNameSpace__ecere__sys__OldList * decls = decl->__anon1.__anon1.declarators;
18853
18854 if(decls)
18855 {
18856 struct InitDeclarator * initDecl = (*decls).first;
18857
18858 if(initDecl)
18859 {
18860 struct Declarator * declarator = initDecl->declarator;
18861
18862 if(declarator && declarator->type == 1)
18863 {
18864 struct Identifier * id = declarator->__anon1.identifier;
18865
18866 if(id && id->string)
18867 {
18868 if(!strcmp(id->string, "uintptr_t") || !strcmp(id->string, "intptr_t") || !strcmp(id->string, "size_t") || !strcmp(id->string, "ssize_t"))
18869 {
18870 external->symbol->id = -1001, external->symbol->idCode = -1001;
18871 after = external;
18872 }
18873 }
18874 }
18875 }
18876 }
18877 }
18878 }
18879 }
18880 {
18881 struct External * e = MkExternalDeclaration(MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Instance"), (((void *)0)))), (((void *)0))));
18882
18883 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, e);
18884 after = e;
18885 }
18886 temp->symbol = __extension__ ({
18887 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18888
18889 __ecereInstance1->id = -1000, __ecereInstance1->idCode = -1000, __ecereInstance1;
18890 });
18891 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
18892 curExternal = temp;
18893 DeclareFunctionUtil("eSystem_New");
18894 DeclareFunctionUtil("eSystem_New0");
18895 DeclareFunctionUtil("eSystem_Renew");
18896 DeclareFunctionUtil("eSystem_Renew0");
18897 DeclareFunctionUtil("eSystem_Delete");
18898 DeclareFunctionUtil("eClass_GetProperty");
18899 DeclareFunctionUtil("eClass_SetProperty");
18900 DeclareFunctionUtil("eInstance_FireSelfWatchers");
18901 DeclareFunctionUtil("eInstance_SetMethod");
18902 DeclareFunctionUtil("eInstance_IncRef");
18903 DeclareFunctionUtil("eInstance_StopWatching");
18904 DeclareFunctionUtil("eInstance_Watch");
18905 DeclareFunctionUtil("eInstance_FireWatchers");
18906 DeclareStruct("ecere::com::Class", 0);
18907 DeclareStruct("ecere::com::Instance", 0);
18908 DeclareStruct("ecere::com::Property", 0);
18909 DeclareStruct("ecere::com::DataMember", 0);
18910 DeclareStruct("ecere::com::Method", 0);
18911 DeclareStruct("ecere::com::SerialBuffer", 0);
18912 DeclareStruct("ecere::com::ClassTemplateArgument", 0);
18913 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
18914 for(external = (*ast).first; external; external = external->next)
18915 {
18916 afterExternal = curExternal = external;
18917 if(external->type == 0)
18918 {
18919 currentClass = external->__anon1.function->_class;
18920 ProcessFunction(external->__anon1.function);
18921 }
18922 else if(external->type == 1)
18923 {
18924 currentClass = (((void *)0));
18925 if(external->__anon1.declaration)
18926 ProcessDeclaration(external->__anon1.declaration);
18927 }
18928 else if(external->type == 2)
18929 {
18930 struct ClassDefinition * _class = external->__anon1._class;
18931
18932 currentClass = external->symbol->__anon1.registered;
18933 if(_class->definitions)
18934 {
18935 ProcessClass(_class->definitions, _class->symbol);
18936 }
18937 if(inCompiler)
18938 {
18939 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
18940 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor((void *)external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
18941 }
18942 }
18943 else if(external->type == 4)
18944 {
18945 thisNameSpace = external->__anon1.id->string;
18946 }
18947 }
18948 currentClass = (((void *)0));
18949 thisNameSpace = (((void *)0));
18950 curExternal = (((void *)0));
18951 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor((void *)temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
18952 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor((void *)temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
18953 }
18954
18955 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);
18956
18957 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);
18958
18959 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
18960
18961 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
18962 {
18963 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
18964
18965 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
18966 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
18967 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
18968 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
18969 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
18970 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
18971 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
18972 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
18973 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
18974 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
18975 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
18976 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
18977 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
18978 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
18979 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
18980 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
18981 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
18982 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
18983 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt", "bool GetOpInt(Operand op2, int * value2)", GetOpInt, module, 1);
18984 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
18985 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt", "bool GetOpUInt(Operand op2, uint * value2)", GetOpUInt, module, 1);
18986 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
18987 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt64", "bool GetOpInt64(Operand op2, int64 * value2)", GetOpInt64, module, 1);
18988 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
18989 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt64", "bool GetOpUInt64(Operand op2, uint64 * value2)", GetOpUInt64, module, 1);
18990 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
18991 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntPtr", "bool GetOpIntPtr(Operand op2, intptr * value2)", GetOpIntPtr, module, 1);
18992 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
18993 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntPtr", "bool GetOpUIntPtr(Operand op2, uintptr * value2)", GetOpUIntPtr, module, 1);
18994 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
18995 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntSize", "bool GetOpIntSize(Operand op2, intsize * value2)", GetOpIntSize, module, 1);
18996 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
18997 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntSize", "bool GetOpUIntSize(Operand op2, uintsize * value2)", GetOpUIntSize, module, 1);
18998 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
18999 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpShort", "bool GetOpShort(Operand op2, short * value2)", GetOpShort, module, 1);
19000 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
19001 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUShort", "bool GetOpUShort(Operand op2, uint16 * value2)", GetOpUShort, module, 1);
19002 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
19003 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpChar", "bool GetOpChar(Operand op2, char * value2)", GetOpChar, module, 1);
19004 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
19005 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUChar", "bool GetOpUChar(Operand op2, byte * value2)", GetOpUChar, module, 1);
19006 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
19007 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpFloat", "bool GetOpFloat(Operand op2, float * value2)", GetOpFloat, module, 1);
19008 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
19009 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpDouble", "bool GetOpDouble(Operand op2, double * value2)", GetOpDouble, module, 1);
19010 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
19011 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
19012 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
19013 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
19014 __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);
19015 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(const char * name, bool skipNoHead)", DeclareStruct, module, 2);
19016 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
19017 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
19018 __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);
19019 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
19020 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
19021 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
19022 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
19023 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
19024 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
19025 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, const char * name)", DeclareMethod, module, 1);
19026 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
19027 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
19028 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
19029 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
19030 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
19031 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
19032 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
19033 __ecereClass_Conversion = class;
19034 __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);
19035 __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);
19036 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
19037 __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);
19038 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla, bool warnConst)", MatchTypeExpression, module, 2);
19039 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
19040 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("UnescapeString", "int UnescapeString(char * d, char * s, int len)", UnescapeString, module, 1);
19041 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("OffsetEscapedString", "char * OffsetEscapedString(char * s, int len, int offset)", OffsetEscapedString, module, 1);
19042 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
19043 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
19044 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
19045 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
19046 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
19047 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
19048 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(const char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
19049 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
19050 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
19051 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
19052 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetParseError", "bool GetParseError(void)", GetParseError, module, 1);
19053 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
19054 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
19055 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
19056 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyLocation", "void ApplyLocation(Expression exp, Location loc)", ApplyLocation, module, 1);
19057 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
19058 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(const String s)", DeclareFunctionUtil, module, 1);
19059 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
19060 }
19061
19062 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
19063 {
19064
19065 }
19066