compiler/libec; ide/debugger: 64 bit fixes; ecere/com: Added strtoul() and strtoull()
[sdk] / compiler / bootstrap / libec / bootstrap / pass15.c
1 /* Code generated from eC source file: pass15.ec */
2 #if defined(__GNUC__)
3 typedef long long int64;
4 typedef unsigned long long uint64;
5 #ifndef _WIN32
6 #define __declspec(x)
7 #endif
8 #elif defined(__TINYC__)
9 #include <stdarg.h>
10 #define __builtin_va_list va_list
11 #define __builtin_va_start va_start
12 #define __builtin_va_end va_end
13 #ifdef _WIN32
14 #define strcasecmp stricmp
15 #define strncasecmp strnicmp
16 #define __declspec(x) __attribute__((x))
17 #else
18 #define __declspec(x)
19 #endif
20 typedef long long int64;
21 typedef unsigned long long uint64;
22 #else
23 typedef __int64 int64;
24 typedef unsigned __int64 uint64;
25 #endif
26 #ifdef __BIG_ENDIAN__
27 #define __ENDIAN_PAD(x) (8 - (x))
28 #else
29 #define __ENDIAN_PAD(x) 0
30 #endif
31 #include <stdint.h>
32 #include <sys/types.h>
33
34 #if /*defined(_W64) || */(defined(__WORDSIZE) && __WORDSIZE == 8) || defined(__x86_64__)
35 #define _64BIT 1
36 #else
37 #define _64BIT 0
38 #endif
39
40 #define arch_PointerSize                  sizeof(void *)
41 #define structSize_Instance               (_64BIT ? 24 : 12)
42 #define structSize_Module                 (_64BIT ? 560 : 300)
43 #define structSize_NamedLink              (_64BIT ? 32 : 16)
44
45 extern void *  __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
46
47 extern void *  __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
48
49 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew(void *  memory, unsigned int size);
50
51 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew0(void *  memory, unsigned int size);
52
53 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BTNode;
54
55 struct __ecereNameSpace__ecere__sys__BTNode;
56
57 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BinaryTree;
58
59 struct __ecereNameSpace__ecere__sys__BinaryTree
60 {
61 struct __ecereNameSpace__ecere__sys__BTNode * root;
62 int count;
63 int (*  CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
64 void (*  FreeKey)(void *  key);
65 } __attribute__ ((gcc_struct));
66
67 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldList;
68
69 struct __ecereNameSpace__ecere__sys__OldList
70 {
71 void *  first;
72 void *  last;
73 int count;
74 unsigned int offset;
75 unsigned int circ;
76 } __attribute__ ((gcc_struct));
77
78 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Method;
79
80 struct __ecereNameSpace__ecere__com__Method
81 {
82 char *  name;
83 struct __ecereNameSpace__ecere__com__Method * parent;
84 struct __ecereNameSpace__ecere__com__Method * left;
85 struct __ecereNameSpace__ecere__com__Method * right;
86 int depth;
87 int (*  function)();
88 int vid;
89 int type;
90 struct __ecereNameSpace__ecere__com__Class * _class;
91 void *  symbol;
92 char *  dataTypeString;
93 struct Type * dataType;
94 int memberAccess;
95 } __attribute__ ((gcc_struct));
96
97 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Property;
98
99 struct __ecereNameSpace__ecere__com__Property
100 {
101 struct __ecereNameSpace__ecere__com__Property * prev;
102 struct __ecereNameSpace__ecere__com__Property * next;
103 char *  name;
104 unsigned int isProperty;
105 int memberAccess;
106 int id;
107 struct __ecereNameSpace__ecere__com__Class * _class;
108 char *  dataTypeString;
109 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
110 struct Type * dataType;
111 void (*  Set)(void * , int);
112 int (*  Get)(void * );
113 unsigned int (*  IsSet)(void * );
114 void *  data;
115 void *  symbol;
116 int vid;
117 unsigned int conversion;
118 unsigned int watcherOffset;
119 char *  category;
120 unsigned int compiled;
121 unsigned int selfWatchable;
122 unsigned int isWatchable;
123 } __attribute__ ((gcc_struct));
124
125 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_CodePosition;
126
127 struct CodePosition
128 {
129 int line;
130 int charPos;
131 int pos;
132 int included;
133 } __attribute__ ((gcc_struct));
134
135 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Location;
136
137 struct Location
138 {
139 struct CodePosition start;
140 struct CodePosition end;
141 } __attribute__ ((gcc_struct));
142
143 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attrib;
144
145 struct Attrib;
146
147 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ExtDecl;
148
149 struct ExtDecl
150 {
151 struct Location loc;
152 int type;
153 union
154 {
155 char * s;
156 struct Attrib * attr;
157 } __attribute__ ((gcc_struct));
158 } __attribute__ ((gcc_struct));
159
160 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDefinition;
161
162 struct ClassDefinition
163 {
164 struct ClassDefinition * prev;
165 struct ClassDefinition * next;
166 struct Location loc;
167 struct Specifier * _class;
168 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
169 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
170 struct Symbol * symbol;
171 struct Location blockStart;
172 struct Location nameLoc;
173 int endid;
174 int declMode;
175 unsigned int deleteWatchable;
176 } __attribute__ ((gcc_struct));
177
178 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
179
180 struct Context
181 {
182 struct Context * parent;
183 struct __ecereNameSpace__ecere__sys__BinaryTree types;
184 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
185 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
186 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
187 int nextID;
188 int simpleID;
189 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
190 struct ClassDefinition * classDef;
191 unsigned int templateTypesOnly;
192 unsigned int hasNameSpace;
193 } __attribute__ ((gcc_struct));
194
195 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
196
197 struct Instantiation
198 {
199 struct Instantiation * prev;
200 struct Instantiation * next;
201 struct Location loc;
202 struct Specifier * _class;
203 struct Expression * exp;
204 struct __ecereNameSpace__ecere__sys__OldList *  members;
205 struct Symbol * symbol;
206 unsigned int fullSet;
207 unsigned int isConstant;
208 unsigned char *  data;
209 struct Location nameLoc;
210 struct Location insideLoc;
211 unsigned int built;
212 } __attribute__ ((gcc_struct));
213
214 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declaration;
215
216 struct Declaration
217 {
218 struct Declaration * prev;
219 struct Declaration * next;
220 struct Location loc;
221 int type;
222 union
223 {
224 struct
225 {
226 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
227 struct __ecereNameSpace__ecere__sys__OldList *  declarators;
228 } __attribute__ ((gcc_struct));
229 struct Instantiation * inst;
230 struct
231 {
232 struct Identifier * id;
233 struct Expression * exp;
234 } __attribute__ ((gcc_struct));
235 } __attribute__ ((gcc_struct));
236 struct Specifier * extStorage;
237 struct Symbol * symbol;
238 int declMode;
239 } __attribute__ ((gcc_struct));
240
241 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Statement;
242
243 struct Statement
244 {
245 struct Statement * prev;
246 struct Statement * next;
247 struct Location loc;
248 int type;
249 union
250 {
251 struct __ecereNameSpace__ecere__sys__OldList *  expressions;
252 struct
253 {
254 struct Identifier * id;
255 struct Statement * stmt;
256 } __attribute__ ((gcc_struct)) labeled;
257 struct
258 {
259 struct Expression * exp;
260 struct Statement * stmt;
261 } __attribute__ ((gcc_struct)) caseStmt;
262 struct
263 {
264 struct __ecereNameSpace__ecere__sys__OldList * declarations;
265 struct __ecereNameSpace__ecere__sys__OldList * statements;
266 struct Context * context;
267 unsigned int isSwitch;
268 } __attribute__ ((gcc_struct)) compound;
269 struct
270 {
271 struct __ecereNameSpace__ecere__sys__OldList * exp;
272 struct Statement * stmt;
273 struct Statement * elseStmt;
274 } __attribute__ ((gcc_struct)) ifStmt;
275 struct
276 {
277 struct __ecereNameSpace__ecere__sys__OldList * exp;
278 struct Statement * stmt;
279 } __attribute__ ((gcc_struct)) switchStmt;
280 struct
281 {
282 struct __ecereNameSpace__ecere__sys__OldList * exp;
283 struct Statement * stmt;
284 } __attribute__ ((gcc_struct)) whileStmt;
285 struct
286 {
287 struct __ecereNameSpace__ecere__sys__OldList * exp;
288 struct Statement * stmt;
289 } __attribute__ ((gcc_struct)) doWhile;
290 struct
291 {
292 struct Statement * init;
293 struct Statement * check;
294 struct __ecereNameSpace__ecere__sys__OldList * increment;
295 struct Statement * stmt;
296 } __attribute__ ((gcc_struct)) forStmt;
297 struct
298 {
299 struct Identifier * id;
300 } __attribute__ ((gcc_struct)) gotoStmt;
301 struct
302 {
303 struct Specifier * spec;
304 char * statements;
305 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
306 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
307 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
308 } __attribute__ ((gcc_struct)) asmStmt;
309 struct
310 {
311 struct Expression * watcher;
312 struct Expression * object;
313 struct __ecereNameSpace__ecere__sys__OldList * watches;
314 } __attribute__ ((gcc_struct)) _watch;
315 struct
316 {
317 struct Identifier * id;
318 struct __ecereNameSpace__ecere__sys__OldList * exp;
319 struct __ecereNameSpace__ecere__sys__OldList * filter;
320 struct Statement * stmt;
321 } __attribute__ ((gcc_struct)) forEachStmt;
322 struct Declaration * decl;
323 } __attribute__ ((gcc_struct));
324 } __attribute__ ((gcc_struct));
325
326 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
327
328 struct TypeName
329 {
330 struct TypeName * prev;
331 struct TypeName * next;
332 struct Location loc;
333 struct __ecereNameSpace__ecere__sys__OldList *  qualifiers;
334 struct Declarator * declarator;
335 int classObjectType;
336 struct Expression * bitCount;
337 } __attribute__ ((gcc_struct));
338
339 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Initializer;
340
341 struct Initializer
342 {
343 struct Initializer * prev;
344 struct Initializer * next;
345 struct Location loc;
346 int type;
347 union
348 {
349 struct Expression * exp;
350 struct __ecereNameSpace__ecere__sys__OldList *  list;
351 } __attribute__ ((gcc_struct));
352 unsigned int isConstant;
353 } __attribute__ ((gcc_struct));
354
355 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
356
357 struct __ecereNameSpace__ecere__com__DataValue
358 {
359 union
360 {
361 char c;
362 unsigned char uc;
363 short s;
364 unsigned short us;
365 int i;
366 unsigned int ui;
367 void *  p;
368 float f;
369 double d;
370 long long i64;
371 uint64 ui64;
372 } __attribute__ ((gcc_struct));
373 } __attribute__ ((gcc_struct));
374
375 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
376
377 struct Expression
378 {
379 struct Expression * prev;
380 struct Expression * next;
381 struct Location loc;
382 int type;
383 union
384 {
385 struct
386 {
387 char *  constant;
388 struct Identifier * identifier;
389 } __attribute__ ((gcc_struct));
390 struct Statement * compound;
391 struct Instantiation * instance;
392 char *  string;
393 struct __ecereNameSpace__ecere__sys__OldList *  list;
394 struct
395 {
396 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
397 struct Declarator * decl;
398 } __attribute__ ((gcc_struct)) _classExp;
399 struct
400 {
401 struct Identifier * id;
402 } __attribute__ ((gcc_struct)) classData;
403 struct
404 {
405 struct Expression * exp;
406 struct __ecereNameSpace__ecere__sys__OldList * arguments;
407 struct Location argLoc;
408 } __attribute__ ((gcc_struct)) call;
409 struct
410 {
411 struct Expression * exp;
412 struct __ecereNameSpace__ecere__sys__OldList * index;
413 } __attribute__ ((gcc_struct)) index;
414 struct
415 {
416 struct Expression * exp;
417 struct Identifier * member;
418 int memberType;
419 unsigned int thisPtr;
420 } __attribute__ ((gcc_struct)) member;
421 struct
422 {
423 int op;
424 struct Expression * exp1;
425 struct Expression * exp2;
426 } __attribute__ ((gcc_struct)) op;
427 struct TypeName * typeName;
428 struct Specifier * _class;
429 struct
430 {
431 struct TypeName * typeName;
432 struct Expression * exp;
433 } __attribute__ ((gcc_struct)) cast;
434 struct
435 {
436 struct Expression * cond;
437 struct __ecereNameSpace__ecere__sys__OldList * exp;
438 struct Expression * elseExp;
439 } __attribute__ ((gcc_struct)) cond;
440 struct
441 {
442 struct TypeName * typeName;
443 struct Expression * size;
444 } __attribute__ ((gcc_struct)) _new;
445 struct
446 {
447 struct TypeName * typeName;
448 struct Expression * size;
449 struct Expression * exp;
450 } __attribute__ ((gcc_struct)) _renew;
451 struct
452 {
453 char * table;
454 struct Identifier * id;
455 } __attribute__ ((gcc_struct)) db;
456 struct
457 {
458 struct Expression * ds;
459 struct Expression * name;
460 } __attribute__ ((gcc_struct)) dbopen;
461 struct
462 {
463 struct TypeName * typeName;
464 struct Initializer * initializer;
465 } __attribute__ ((gcc_struct)) initializer;
466 struct
467 {
468 struct Expression * exp;
469 struct TypeName * typeName;
470 } __attribute__ ((gcc_struct)) vaArg;
471 } __attribute__ ((gcc_struct));
472 unsigned int debugValue;
473 struct __ecereNameSpace__ecere__com__DataValue val;
474 uint64 address;
475 unsigned int hasAddress;
476 struct Type * expType;
477 struct Type * destType;
478 unsigned int usage;
479 int tempCount;
480 unsigned int byReference;
481 unsigned int isConstant;
482 unsigned int addedThis;
483 unsigned int needCast;
484 unsigned int thisPtr;
485 } __attribute__ ((gcc_struct));
486
487 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
488
489 struct TemplateDatatype
490 {
491 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
492 struct Declarator * decl;
493 } __attribute__ ((gcc_struct));
494
495 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
496
497 struct TemplateArgument;
498
499 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
500
501 struct TemplateParameter
502 {
503 struct TemplateParameter * prev;
504 struct TemplateParameter * next;
505 struct Location loc;
506 int type;
507 struct Identifier * identifier;
508 union
509 {
510 struct TemplateDatatype * dataType;
511 int memberType;
512 } __attribute__ ((gcc_struct));
513 struct TemplateArgument * defaultArgument;
514 char *  dataTypeString;
515 struct Type * baseType;
516 } __attribute__ ((gcc_struct));
517
518 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
519
520 struct Specifier
521 {
522 struct Specifier * prev;
523 struct Specifier * next;
524 struct Location loc;
525 int type;
526 union
527 {
528 int specifier;
529 struct
530 {
531 struct ExtDecl * extDecl;
532 char *  name;
533 struct Symbol * symbol;
534 struct __ecereNameSpace__ecere__sys__OldList *  templateArgs;
535 } __attribute__ ((gcc_struct));
536 struct
537 {
538 struct Identifier * id;
539 struct __ecereNameSpace__ecere__sys__OldList *  list;
540 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
541 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
542 unsigned int addNameSpace;
543 struct Context * ctx;
544 struct ExtDecl * extDeclStruct;
545 } __attribute__ ((gcc_struct));
546 struct Expression * expression;
547 struct Specifier * _class;
548 struct TemplateParameter * templateParameter;
549 } __attribute__ ((gcc_struct));
550 } __attribute__ ((gcc_struct));
551
552 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
553
554 struct Identifier
555 {
556 struct Identifier * prev;
557 struct Identifier * next;
558 struct Location loc;
559 struct Symbol * classSym;
560 struct Specifier * _class;
561 char *  string;
562 struct Identifier * badID;
563 } __attribute__ ((gcc_struct));
564
565 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Pointer;
566
567 struct Pointer;
568
569 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
570
571 struct Declarator
572 {
573 struct Declarator * prev;
574 struct Declarator * next;
575 struct Location loc;
576 int type;
577 struct Symbol * symbol;
578 struct Declarator * declarator;
579 union
580 {
581 struct Identifier * identifier;
582 struct
583 {
584 struct Expression * exp;
585 struct Expression * posExp;
586 struct Attrib * attrib;
587 } __attribute__ ((gcc_struct)) structDecl;
588 struct
589 {
590 struct Expression * exp;
591 struct Specifier * enumClass;
592 } __attribute__ ((gcc_struct)) array;
593 struct
594 {
595 struct __ecereNameSpace__ecere__sys__OldList * parameters;
596 } __attribute__ ((gcc_struct)) function;
597 struct
598 {
599 struct Pointer * pointer;
600 } __attribute__ ((gcc_struct)) pointer;
601 struct
602 {
603 struct ExtDecl * extended;
604 } __attribute__ ((gcc_struct)) extended;
605 } __attribute__ ((gcc_struct));
606 } __attribute__ ((gcc_struct));
607
608 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
609
610 struct FunctionDefinition
611 {
612 struct FunctionDefinition * prev;
613 struct FunctionDefinition * next;
614 struct Location loc;
615 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
616 struct Declarator * declarator;
617 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
618 struct Statement * body;
619 struct __ecereNameSpace__ecere__com__Class * _class;
620 struct __ecereNameSpace__ecere__sys__OldList attached;
621 int declMode;
622 struct Type * type;
623 struct Symbol * propSet;
624 int tempCount;
625 unsigned int propertyNoThis;
626 } __attribute__ ((gcc_struct));
627
628 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
629
630 struct DBTableDef;
631
632 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
633
634 struct External
635 {
636 struct External * prev;
637 struct External * next;
638 struct Location loc;
639 int type;
640 struct Symbol * symbol;
641 union
642 {
643 struct FunctionDefinition * function;
644 struct ClassDefinition * _class;
645 struct Declaration * declaration;
646 char *  importString;
647 struct Identifier * id;
648 struct DBTableDef * table;
649 } __attribute__ ((gcc_struct));
650 int importType;
651 } __attribute__ ((gcc_struct));
652
653 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
654
655 struct ModuleImport
656 {
657 struct ModuleImport * prev;
658 struct ModuleImport * next;
659 char *  name;
660 struct __ecereNameSpace__ecere__sys__OldList classes;
661 struct __ecereNameSpace__ecere__sys__OldList functions;
662 int importType;
663 int importAccess;
664 } __attribute__ ((gcc_struct));
665
666 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
667
668 struct ClassImport
669 {
670 struct ClassImport * prev;
671 struct ClassImport * next;
672 char *  name;
673 struct __ecereNameSpace__ecere__sys__OldList methods;
674 struct __ecereNameSpace__ecere__sys__OldList properties;
675 unsigned int itself;
676 unsigned int isRemote;
677 } __attribute__ ((gcc_struct));
678
679 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
680
681 struct Symbol
682 {
683 char *  string;
684 struct Symbol * parent;
685 struct Symbol * left;
686 struct Symbol * right;
687 int depth;
688 struct Type * type;
689 union
690 {
691 struct __ecereNameSpace__ecere__com__Method * method;
692 struct __ecereNameSpace__ecere__com__Property * _property;
693 struct __ecereNameSpace__ecere__com__Class * registered;
694 } __attribute__ ((gcc_struct));
695 int id;
696 int idCode;
697 union
698 {
699 struct
700 {
701 struct External * pointerExternal;
702 struct External * structExternal;
703 } __attribute__ ((gcc_struct));
704 struct
705 {
706 struct External * externalGet;
707 struct External * externalSet;
708 struct External * externalPtr;
709 struct External * externalIsSet;
710 } __attribute__ ((gcc_struct));
711 struct
712 {
713 struct External * methodExternal;
714 struct External * methodCodeExternal;
715 } __attribute__ ((gcc_struct));
716 } __attribute__ ((gcc_struct));
717 unsigned int imported;
718 unsigned int declaredStructSym;
719 struct __ecereNameSpace__ecere__com__Class * _class;
720 unsigned int declaredStruct;
721 unsigned int needConstructor;
722 unsigned int needDestructor;
723 char *  constructorName;
724 char *  structName;
725 char *  className;
726 char *  destructorName;
727 struct ModuleImport * module;
728 struct ClassImport * _import;
729 struct Location nameLoc;
730 unsigned int isParam;
731 unsigned int isRemote;
732 unsigned int isStruct;
733 unsigned int fireWatchersDone;
734 int declaring;
735 unsigned int classData;
736 unsigned int isStatic;
737 char *  shortName;
738 struct __ecereNameSpace__ecere__sys__OldList *  templateParams;
739 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
740 struct Context * ctx;
741 int isIterator;
742 struct Expression * propCategory;
743 } __attribute__ ((gcc_struct));
744
745 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
746
747 struct Type
748 {
749 struct Type * prev;
750 struct Type * next;
751 int refCount;
752 union
753 {
754 struct Symbol * _class;
755 struct
756 {
757 struct __ecereNameSpace__ecere__sys__OldList members;
758 char *  enumName;
759 } __attribute__ ((gcc_struct));
760 struct
761 {
762 struct Type * returnType;
763 struct __ecereNameSpace__ecere__sys__OldList params;
764 struct Symbol * thisClass;
765 unsigned int staticMethod;
766 struct TemplateParameter * thisClassTemplate;
767 } __attribute__ ((gcc_struct));
768 struct
769 {
770 struct __ecereNameSpace__ecere__com__Method * method;
771 struct __ecereNameSpace__ecere__com__Class * methodClass;
772 struct __ecereNameSpace__ecere__com__Class * usedClass;
773 } __attribute__ ((gcc_struct));
774 struct
775 {
776 struct Type * arrayType;
777 int arraySize;
778 struct Expression * arraySizeExp;
779 unsigned int freeExp;
780 struct Symbol * enumClass;
781 } __attribute__ ((gcc_struct));
782 struct Type * type;
783 struct TemplateParameter * templateParameter;
784 } __attribute__ ((gcc_struct));
785 int kind;
786 unsigned int size;
787 char *  name;
788 char *  typeName;
789 int classObjectType;
790 int alignment;
791 unsigned int offset;
792 int bitFieldCount;
793 int count;
794 unsigned int isSigned : 1;
795 unsigned int constant : 1;
796 unsigned int truth : 1;
797 unsigned int byReference : 1;
798 unsigned int extraParam : 1;
799 unsigned int directClassAccess : 1;
800 unsigned int computing : 1;
801 unsigned int keepCast : 1;
802 unsigned int passAsTemplate : 1;
803 unsigned int dllExport : 1;
804 unsigned int attrStdcall : 1;
805 unsigned int declaredWithStruct : 1;
806 unsigned int typedByReference : 1;
807 } __attribute__ ((gcc_struct));
808
809 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
810
811 struct __ecereNameSpace__ecere__com__Class
812 {
813 struct __ecereNameSpace__ecere__com__Class * prev;
814 struct __ecereNameSpace__ecere__com__Class * next;
815 char *  name;
816 int offset;
817 int structSize;
818 int (* *  _vTbl)();
819 int vTblSize;
820 int (*  Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
821 void (*  Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
822 int offsetClass;
823 int sizeClass;
824 struct __ecereNameSpace__ecere__com__Class * base;
825 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
826 struct __ecereNameSpace__ecere__sys__BinaryTree members;
827 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
828 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
829 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
830 struct __ecereNameSpace__ecere__sys__OldList derivatives;
831 int memberID;
832 int startMemberID;
833 int type;
834 struct __ecereNameSpace__ecere__com__Instance * module;
835 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
836 char *  dataTypeString;
837 struct Type * dataType;
838 int typeSize;
839 int defaultAlignment;
840 void (*  Initialize)();
841 int memberOffset;
842 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
843 char *  designerClass;
844 unsigned int noExpansion;
845 char *  defaultProperty;
846 unsigned int comRedefinition;
847 int count;
848 unsigned int isRemote;
849 unsigned int internalDecl;
850 void *  data;
851 unsigned int computeSize;
852 int structAlignment;
853 int destructionWatchOffset;
854 unsigned int fixed;
855 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
856 int inheritanceAccess;
857 char *  fullName;
858 void *  symbol;
859 struct __ecereNameSpace__ecere__sys__OldList conversions;
860 struct __ecereNameSpace__ecere__sys__OldList templateParams;
861 struct __ecereNameSpace__ecere__com__ClassTemplateArgument *  templateArgs;
862 struct __ecereNameSpace__ecere__com__Class * templateClass;
863 struct __ecereNameSpace__ecere__sys__OldList templatized;
864 int numParams;
865 unsigned int isInstanceClass;
866 unsigned int byValueSystemClass;
867 } __attribute__ ((gcc_struct));
868
869 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char *  name);
870
871 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
872
873 struct __ecereNameSpace__ecere__com__Instance
874 {
875 int (* *  _vTbl)();
876 struct __ecereNameSpace__ecere__com__Class * _class;
877 int _refCount;
878 } __attribute__ ((gcc_struct));
879
880 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
881
882 struct __ecereNameSpace__ecere__com__DataMember
883 {
884 struct __ecereNameSpace__ecere__com__DataMember * prev;
885 struct __ecereNameSpace__ecere__com__DataMember * next;
886 char *  name;
887 unsigned int isProperty;
888 int memberAccess;
889 int id;
890 struct __ecereNameSpace__ecere__com__Class * _class;
891 char *  dataTypeString;
892 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
893 struct Type * dataType;
894 int type;
895 int offset;
896 int memberID;
897 struct __ecereNameSpace__ecere__sys__OldList members;
898 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
899 int memberOffset;
900 int structAlignment;
901 } __attribute__ ((gcc_struct));
902
903 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
904
905 struct __ecereNameSpace__ecere__com__SerialBuffer
906 {
907 unsigned char *  _buffer;
908 unsigned int count;
909 unsigned int _size;
910 unsigned int pos;
911 } __attribute__ ((gcc_struct));
912
913 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
914
915 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
916 {
917 union
918 {
919 struct
920 {
921 char *  dataTypeString;
922 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
923 } __attribute__ ((gcc_struct));
924 struct __ecereNameSpace__ecere__com__DataValue expression;
925 struct
926 {
927 char *  memberString;
928 union
929 {
930 struct __ecereNameSpace__ecere__com__DataMember * member;
931 struct __ecereNameSpace__ecere__com__Property * prop;
932 struct __ecereNameSpace__ecere__com__Method * method;
933 } __attribute__ ((gcc_struct));
934 } __attribute__ ((gcc_struct));
935 } __attribute__ ((gcc_struct));
936 } __attribute__ ((gcc_struct));
937
938 void exit(int status);
939
940 void * calloc(size_t nmemb, size_t size);
941
942 void free(void * ptr);
943
944 void * malloc(size_t size);
945
946 void * realloc(void * ptr, size_t size);
947
948 long int strtol(const char * nptr, char ** endptr, int base);
949
950 long long int strtoll(const char * nptr, char ** endptr, int base);
951
952 unsigned long long int strtoull(const char * nptr, char ** endptr, int base);
953
954 enum yytokentype
955 {
956 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
957 };
958
959 typedef union YYSTYPE
960 {
961 int specifierType;
962 int i;
963 int declMode;
964 struct Identifier * id;
965 struct Expression * exp;
966 struct Specifier * specifier;
967 struct __ecereNameSpace__ecere__sys__OldList * list;
968 struct Enumerator * enumerator;
969 struct Declarator * declarator;
970 struct Pointer * pointer;
971 struct Initializer * initializer;
972 struct InitDeclarator * initDeclarator;
973 struct TypeName * typeName;
974 struct Declaration * declaration;
975 struct Statement * stmt;
976 struct FunctionDefinition * function;
977 struct External * external;
978 struct Context * context;
979 struct AsmField * asmField;
980 struct Attrib * attrib;
981 struct ExtDecl * extDecl;
982 struct Attribute * attribute;
983 struct Instantiation * instance;
984 struct MembersInit * membersInit;
985 struct MemberInit * memberInit;
986 struct ClassFunction * classFunction;
987 struct ClassDefinition * _class;
988 struct ClassDef * classDef;
989 struct PropertyDef * prop;
990 char * string;
991 struct Symbol * symbol;
992 struct PropertyWatch * propertyWatch;
993 struct TemplateParameter * templateParameter;
994 struct TemplateArgument * templateArgument;
995 struct TemplateDatatype * templateDatatype;
996 struct DBTableEntry * dbtableEntry;
997 struct DBIndexItem * dbindexItem;
998 struct DBTableDef * dbtableDef;
999 } __attribute__ ((gcc_struct)) YYSTYPE;
1000
1001 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
1002
1003 struct Enumerator
1004 {
1005 struct Enumerator * prev;
1006 struct Enumerator * next;
1007 struct Location loc;
1008 struct Identifier * id;
1009 struct Expression * exp;
1010 } __attribute__ ((gcc_struct));
1011
1012 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
1013
1014 struct InitDeclarator
1015 {
1016 struct InitDeclarator * prev;
1017 struct InitDeclarator * next;
1018 struct Location loc;
1019 struct Declarator * declarator;
1020 struct Initializer * initializer;
1021 } __attribute__ ((gcc_struct));
1022
1023 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
1024
1025 struct AsmField
1026 {
1027 struct AsmField * prev;
1028 struct AsmField * next;
1029 struct Location loc;
1030 char *  command;
1031 struct Expression * expression;
1032 } __attribute__ ((gcc_struct));
1033
1034 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attribute;
1035
1036 struct Attribute;
1037
1038 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
1039
1040 struct ClassFunction
1041 {
1042 struct ClassFunction * prev;
1043 struct ClassFunction * next;
1044 struct Location loc;
1045 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1046 struct Declarator * declarator;
1047 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
1048 struct Statement * body;
1049 struct __ecereNameSpace__ecere__com__Class * _class;
1050 struct __ecereNameSpace__ecere__sys__OldList attached;
1051 int declMode;
1052 struct Type * type;
1053 struct Symbol * propSet;
1054 unsigned int isVirtual;
1055 unsigned int isConstructor;
1056 unsigned int isDestructor;
1057 unsigned int dontMangle;
1058 int id;
1059 int idCode;
1060 } __attribute__ ((gcc_struct));
1061
1062 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
1063
1064 struct MembersInit
1065 {
1066 struct MembersInit * prev;
1067 struct MembersInit * next;
1068 struct Location loc;
1069 int type;
1070 union
1071 {
1072 struct __ecereNameSpace__ecere__sys__OldList *  dataMembers;
1073 struct ClassFunction * function;
1074 } __attribute__ ((gcc_struct));
1075 } __attribute__ ((gcc_struct));
1076
1077 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
1078
1079 struct MemberInit
1080 {
1081 struct MemberInit * prev;
1082 struct MemberInit * next;
1083 struct Location loc;
1084 struct Location realLoc;
1085 struct __ecereNameSpace__ecere__sys__OldList *  identifiers;
1086 struct Initializer * initializer;
1087 unsigned int used;
1088 unsigned int variable;
1089 unsigned int takeOutExp;
1090 } __attribute__ ((gcc_struct));
1091
1092 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1093
1094 struct PropertyDef
1095 {
1096 struct PropertyDef * prev;
1097 struct PropertyDef * next;
1098 struct Location loc;
1099 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1100 struct Declarator * declarator;
1101 struct Identifier * id;
1102 struct Statement * getStmt;
1103 struct Statement * setStmt;
1104 struct Statement * issetStmt;
1105 struct Symbol * symbol;
1106 unsigned int conversion;
1107 unsigned int isWatchable;
1108 struct Expression * category;
1109 } __attribute__ ((gcc_struct));
1110
1111 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1112
1113 struct PropertyWatch
1114 {
1115 struct PropertyWatch * prev;
1116 struct PropertyWatch * next;
1117 struct Location loc;
1118 struct Statement * compound;
1119 struct __ecereNameSpace__ecere__sys__OldList *  properties;
1120 unsigned int deleteWatch;
1121 } __attribute__ ((gcc_struct));
1122
1123 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1124
1125 struct ClassDef
1126 {
1127 struct ClassDef * prev;
1128 struct ClassDef * next;
1129 struct Location loc;
1130 int type;
1131 union
1132 {
1133 struct Declaration * decl;
1134 struct ClassFunction * function;
1135 struct __ecereNameSpace__ecere__sys__OldList *  defProperties;
1136 struct PropertyDef * propertyDef;
1137 struct PropertyWatch * propertyWatch;
1138 char *  designer;
1139 struct Identifier * defaultProperty;
1140 struct
1141 {
1142 struct Identifier * id;
1143 struct Initializer * initializer;
1144 } __attribute__ ((gcc_struct));
1145 } __attribute__ ((gcc_struct));
1146 int memberAccess;
1147 void *  object;
1148 } __attribute__ ((gcc_struct));
1149
1150 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1151
1152 struct DBTableEntry;
1153
1154 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1155
1156 struct DBIndexItem;
1157
1158 extern YYSTYPE yylval;
1159
1160 extern struct Location yylloc;
1161
1162 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1163
1164 extern int returnCode;
1165
1166 extern struct Expression * parsedExpression;
1167
1168 extern unsigned int yydebug;
1169
1170 void SetYydebug(unsigned int b)
1171 {
1172 yydebug = b;
1173 }
1174
1175 extern unsigned int echoOn;
1176
1177 void resetScanner();
1178
1179 int propWatcherID;
1180
1181 int expression_yyparse();
1182
1183 static struct Statement * curCompound;
1184
1185 struct External * curExternal, * afterExternal;
1186
1187 static struct Type * curSwitchType;
1188
1189 static struct __ecereNameSpace__ecere__com__Class * currentClass;
1190
1191 struct __ecereNameSpace__ecere__com__Class * thisClass;
1192
1193 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
1194 {
1195 thisClass = c;
1196 }
1197
1198 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
1199 {
1200 return thisClass;
1201 }
1202
1203 static char * thisNameSpace;
1204
1205 struct __ecereNameSpace__ecere__com__Class * containerClass;
1206
1207 unsigned int thisClassParams = 0x1;
1208
1209 unsigned int internalValueCounter;
1210
1211 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
1212
1213 extern size_t strlen(const char * );
1214
1215 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
1216
1217 extern void *  __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1218
1219 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
1220
1221 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
1222
1223 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
1224
1225 void PrintExpression(struct Expression * exp, char * string)
1226 {
1227 {
1228 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
1229 int count;
1230
1231 if(exp)
1232 OutputExpression(exp, f);
1233 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
1234 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
1235
1236 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
1237 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
1238 count = strlen(string);
1239 count += ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__extension__ ({
1240 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
1241
1242 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
1243 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Read])(f, string + count, 1, 1023);
1244 string[count] = '\0';
1245 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
1246 }
1247 }
1248
1249 extern struct Type * ProcessTypeString(char *  string, unsigned int staticMethod);
1250
1251 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1252
1253 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1254 {
1255 if(param && param->type == 0 && (param->dataType || param->dataTypeString))
1256 {
1257 if(!param->baseType)
1258 {
1259 if(param->dataTypeString)
1260 param->baseType = ProcessTypeString(param->dataTypeString, 0x0);
1261 else
1262 param->baseType = ProcessType(param->dataType->specifiers, param->dataType->decl);
1263 }
1264 return param->baseType;
1265 }
1266 return (((void *)0));
1267 }
1268
1269 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1270 {
1271 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1272 return 0x1;
1273 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0x0)
1274 {
1275 return 0x0;
1276 }
1277 if(type1->kind == type2->kind)
1278 {
1279 switch(type1->kind)
1280 {
1281 case 24:
1282 case 1:
1283 case 2:
1284 case 3:
1285 case 4:
1286 case 22:
1287 case 23:
1288 if(type1->passAsTemplate && !type2->passAsTemplate)
1289 return 0x1;
1290 return type1->isSigned != type2->isSigned;
1291 case 8:
1292 return type1->_class != type2->_class;
1293 case 13:
1294 return NeedCast(type1->type, type2->type);
1295 default:
1296 return 0x1;
1297 }
1298 }
1299 return 0x1;
1300 }
1301
1302 extern int strcmp(const char * , const char * );
1303
1304 extern struct Context * curContext;
1305
1306 extern struct Context * topContext;
1307
1308 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
1309
1310 extern struct __ecereNameSpace__ecere__com__Property * __ecereNameSpace__ecere__com__eClass_FindProperty(struct __ecereNameSpace__ecere__com__Class * _class, char *  name, struct __ecereNameSpace__ecere__com__Instance * module);
1311
1312 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1313
1314 extern struct __ecereNameSpace__ecere__com__Method * __ecereNameSpace__ecere__com__eClass_FindMethod(struct __ecereNameSpace__ecere__com__Class * _class, char *  name, struct __ecereNameSpace__ecere__com__Instance * module);
1315
1316 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_FindDataMember(struct __ecereNameSpace__ecere__com__Class * _class, char *  name, struct __ecereNameSpace__ecere__com__Instance * module, struct __ecereNameSpace__ecere__com__DataMember **  subMemberStack, int *  subMemberStackPos);
1317
1318 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassProperty;
1319
1320 struct __ecereNameSpace__ecere__com__ClassProperty
1321 {
1322 char *  name;
1323 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1324 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1325 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1326 int depth;
1327 void (*  Set)(struct __ecereNameSpace__ecere__com__Class *, long long);
1328 long long (*  Get)(struct __ecereNameSpace__ecere__com__Class *);
1329 char *  dataTypeString;
1330 struct Type * dataType;
1331 unsigned int constant;
1332 } __attribute__ ((gcc_struct));
1333
1334 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, char *  name);
1335
1336 extern struct Expression * QMkExpId(char *  id);
1337
1338 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateParameter;
1339
1340 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
1341 {
1342 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
1343 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
1344 char *  name;
1345 int type;
1346 union
1347 {
1348 char *  dataTypeString;
1349 int memberType;
1350 } __attribute__ ((gcc_struct));
1351 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
1352 void *  param;
1353 } __attribute__ ((gcc_struct));
1354
1355 extern struct Expression * GetTemplateArgExpByName(char *  paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
1356
1357 extern struct __ecereNameSpace__ecere__sys__OldList *  MkList(void);
1358
1359 extern void FreeIdentifier(struct Identifier * id);
1360
1361 void ProcessExpressionType(struct Expression * exp);
1362
1363 extern struct Declarator * SpecDeclFromString(char *  string, struct __ecereNameSpace__ecere__sys__OldList *  specs, struct Declarator * baseDecl);
1364
1365 extern struct __ecereNameSpace__ecere__sys__OldList *  MkListOne(void *  item);
1366
1367 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1368
1369 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1370
1371 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1372
1373 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1374
1375 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1376
1377 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char *  key);
1378
1379 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
1380 {
1381 if(exp->type == 0 && exp->identifier)
1382 {
1383 struct Identifier * id = exp->identifier;
1384 struct Context * ctx;
1385 struct Symbol * symbol = (((void *)0));
1386
1387 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
1388 {
1389 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
1390 {
1391 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
1392 if(symbol)
1393 break;
1394 }
1395 }
1396 if(!symbol && ((!id->_class || (id->_class->name && !strcmp(id->_class->name, "property"))) || (id->classSym && __ecereNameSpace__ecere__com__eClass_IsDerived(_class, id->classSym->registered))))
1397 {
1398 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
1399 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
1400 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
1401 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
1402
1403 if(!prop)
1404 {
1405 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
1406 }
1407 if(!prop && !method)
1408 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
1409 if(!prop && !method && !member)
1410 {
1411 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
1412 }
1413 if(prop || method || member || classProp)
1414 {
1415 exp->type = 8;
1416 exp->member.member = id;
1417 exp->member.memberType = 0;
1418 exp->member.exp = QMkExpId("this");
1419 exp->addedThis = 0x1;
1420 }
1421 else if(_class && _class->templateParams.first)
1422 {
1423 struct __ecereNameSpace__ecere__com__Class * sClass;
1424
1425 for(sClass = _class; sClass; sClass = sClass->base)
1426 {
1427 if(sClass->templateParams.first)
1428 {
1429 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
1430
1431 for(param = sClass->templateParams.first; param; param = param->next)
1432 {
1433 if(param->type == 2 && !strcmp(param->name, id->string))
1434 {
1435 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
1436
1437 if(argExp)
1438 {
1439 struct Declarator * decl;
1440 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1441
1442 FreeIdentifier(exp->member.member);
1443 ProcessExpressionType(argExp);
1444 decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
1445 exp->expType = ProcessType(specs, decl);
1446 exp->type = 5;
1447 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
1448 }
1449 }
1450 }
1451 }
1452 }
1453 }
1454 }
1455 }
1456 }
1457
1458 extern int sprintf(char * , char * , ...);
1459
1460 extern int __ecereNameSpace__ecere__com__GetRuntimePlatform(void);
1461
1462 extern char *  __ecereNameSpace__ecere__sys__CopyString(char *  string);
1463
1464 char * PrintInt(long long result)
1465 {
1466 char temp[100];
1467
1468 if(result > (((long long)0x7fffffffffffffffLL)))
1469 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1470 else
1471 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1472 return __ecereNameSpace__ecere__sys__CopyString(temp);
1473 }
1474
1475 char * PrintUInt(uint64 result)
1476 {
1477 char temp[100];
1478
1479 if(result > (0xffffffff))
1480 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1481 else if(result > (((int)0x7fffffff)))
1482 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1483 else
1484 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1485 return __ecereNameSpace__ecere__sys__CopyString(temp);
1486 }
1487
1488 char * PrintInt64(long long result)
1489 {
1490 char temp[100];
1491
1492 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1493 return __ecereNameSpace__ecere__sys__CopyString(temp);
1494 }
1495
1496 char * PrintUInt64(uint64 result)
1497 {
1498 char temp[100];
1499
1500 if(result > (((long long)0x7fffffffffffffffLL)))
1501 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1502 else
1503 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1504 return __ecereNameSpace__ecere__sys__CopyString(temp);
1505 }
1506
1507 char * PrintHexUInt(uint64 result)
1508 {
1509 char temp[100];
1510
1511 if(result > (0xffffffff))
1512 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1513 else
1514 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1515 return __ecereNameSpace__ecere__sys__CopyString(temp);
1516 }
1517
1518 char * PrintHexUInt64(uint64 result)
1519 {
1520 char temp[100];
1521
1522 if(result > (0xffffffff))
1523 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1524 else
1525 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1526 return __ecereNameSpace__ecere__sys__CopyString(temp);
1527 }
1528
1529 char * PrintShort(short result)
1530 {
1531 char temp[100];
1532
1533 sprintf(temp, "%d", (unsigned short)result);
1534 return __ecereNameSpace__ecere__sys__CopyString(temp);
1535 }
1536
1537 char * PrintUShort(unsigned short result)
1538 {
1539 char temp[100];
1540
1541 if(result > (unsigned short)32767)
1542 sprintf(temp, "0x%X", (int)result);
1543 else
1544 sprintf(temp, "%d", (int)result);
1545 return __ecereNameSpace__ecere__sys__CopyString(temp);
1546 }
1547
1548 extern int isprint(int c);
1549
1550 char * PrintChar(char result)
1551 {
1552 char temp[100];
1553
1554 if(result > (char)0 && isprint(result))
1555 sprintf(temp, "'%c'", result);
1556 else if(result < (char)0)
1557 sprintf(temp, "%d", (int)result);
1558 else
1559 sprintf(temp, "0x%X", (unsigned char)result);
1560 return __ecereNameSpace__ecere__sys__CopyString(temp);
1561 }
1562
1563 char * PrintUChar(unsigned char result)
1564 {
1565 char temp[100];
1566
1567 sprintf(temp, "0x%X", result);
1568 return __ecereNameSpace__ecere__sys__CopyString(temp);
1569 }
1570
1571 char * PrintFloat(float result)
1572 {
1573 char temp[350];
1574
1575 sprintf(temp, "%.16ff", result);
1576 return __ecereNameSpace__ecere__sys__CopyString(temp);
1577 }
1578
1579 char * PrintDouble(double result)
1580 {
1581 char temp[350];
1582
1583 sprintf(temp, "%.16f", result);
1584 return __ecereNameSpace__ecere__sys__CopyString(temp);
1585 }
1586
1587 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1588
1589 struct OpTable
1590 {
1591 unsigned int (*  Add)(struct Expression *, struct Operand *, struct Operand *);
1592 unsigned int (*  Sub)(struct Expression *, struct Operand *, struct Operand *);
1593 unsigned int (*  Mul)(struct Expression *, struct Operand *, struct Operand *);
1594 unsigned int (*  Div)(struct Expression *, struct Operand *, struct Operand *);
1595 unsigned int (*  Mod)(struct Expression *, struct Operand *, struct Operand *);
1596 unsigned int (*  Neg)(struct Expression *, struct Operand *);
1597 unsigned int (*  Inc)(struct Expression *, struct Operand *);
1598 unsigned int (*  Dec)(struct Expression *, struct Operand *);
1599 unsigned int (*  Asign)(struct Expression *, struct Operand *, struct Operand *);
1600 unsigned int (*  AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1601 unsigned int (*  SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1602 unsigned int (*  MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1603 unsigned int (*  DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1604 unsigned int (*  ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1605 unsigned int (*  BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1606 unsigned int (*  BitOr)(struct Expression *, struct Operand *, struct Operand *);
1607 unsigned int (*  BitXor)(struct Expression *, struct Operand *, struct Operand *);
1608 unsigned int (*  LShift)(struct Expression *, struct Operand *, struct Operand *);
1609 unsigned int (*  RShift)(struct Expression *, struct Operand *, struct Operand *);
1610 unsigned int (*  BitNot)(struct Expression *, struct Operand *);
1611 unsigned int (*  AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1612 unsigned int (*  OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1613 unsigned int (*  XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1614 unsigned int (*  LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1615 unsigned int (*  RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1616 unsigned int (*  Not)(struct Expression *, struct Operand *);
1617 unsigned int (*  Equ)(struct Expression *, struct Operand *, struct Operand *);
1618 unsigned int (*  Nqu)(struct Expression *, struct Operand *, struct Operand *);
1619 unsigned int (*  And)(struct Expression *, struct Operand *, struct Operand *);
1620 unsigned int (*  Or)(struct Expression *, struct Operand *, struct Operand *);
1621 unsigned int (*  Grt)(struct Expression *, struct Operand *, struct Operand *);
1622 unsigned int (*  Sma)(struct Expression *, struct Operand *, struct Operand *);
1623 unsigned int (*  GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1624 unsigned int (*  SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1625 unsigned int (*  Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1626 } __attribute__ ((gcc_struct));
1627
1628 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1629
1630 struct Operand
1631 {
1632 int kind;
1633 struct Type * type;
1634 unsigned int ptrSize;
1635 union
1636 {
1637 char c;
1638 unsigned char uc;
1639 short s;
1640 unsigned short us;
1641 int i;
1642 unsigned int ui;
1643 float f;
1644 double d;
1645 long long i64;
1646 uint64 ui64;
1647 } __attribute__ ((gcc_struct));
1648 struct OpTable ops;
1649 } __attribute__ ((gcc_struct));
1650
1651 struct Operand GetOperand(struct Expression * exp);
1652
1653 unsigned int GetInt(struct Expression * exp, int * value2)
1654 {
1655 struct Operand op2 = GetOperand(exp);
1656
1657 if(op2.kind == 3 && op2.type->isSigned)
1658 *value2 = op2.i;
1659 else if(op2.kind == 3)
1660 *value2 = (int)op2.ui;
1661 else if(op2.kind == 4 && op2.type->isSigned)
1662 *value2 = (int)op2.i64;
1663 else if(op2.kind == 4)
1664 *value2 = (int)op2.ui64;
1665 else if(op2.kind == 23 && op2.type->isSigned)
1666 *value2 = (int)op2.i64;
1667 else if(op2.kind == 23)
1668 *value2 = (int)op2.ui64;
1669 else if(op2.kind == 22 && op2.type->isSigned)
1670 *value2 = (int)op2.i64;
1671 else if(op2.kind == 22)
1672 *value2 = (int)op2.ui64;
1673 else if(op2.kind == 2 && op2.type->isSigned)
1674 *value2 = (int)op2.s;
1675 else if(op2.kind == 2)
1676 *value2 = (int)op2.us;
1677 else if(op2.kind == 1 && op2.type->isSigned)
1678 *value2 = (int)op2.c;
1679 else if(op2.kind == 24 || op2.kind == 1)
1680 *value2 = (int)op2.uc;
1681 else if(op2.kind == 6)
1682 *value2 = (int)op2.f;
1683 else if(op2.kind == 7)
1684 *value2 = (int)op2.d;
1685 else if(op2.kind == 13)
1686 *value2 = (int)op2.ui64;
1687 else
1688 return 0x0;
1689 return 0x1;
1690 }
1691
1692 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1693 {
1694 struct Operand op2 = GetOperand(exp);
1695
1696 if(op2.kind == 3 && op2.type->isSigned)
1697 *value2 = (unsigned int)op2.i;
1698 else if(op2.kind == 3)
1699 *value2 = op2.ui;
1700 else if(op2.kind == 4 && op2.type->isSigned)
1701 *value2 = (unsigned int)op2.i64;
1702 else if(op2.kind == 4)
1703 *value2 = (unsigned int)op2.ui64;
1704 else if(op2.kind == 23 && op2.type->isSigned)
1705 *value2 = (unsigned int)op2.i64;
1706 else if(op2.kind == 23)
1707 *value2 = (unsigned int)op2.ui64;
1708 else if(op2.kind == 22 && op2.type->isSigned)
1709 *value2 = (unsigned int)op2.i64;
1710 else if(op2.kind == 22)
1711 *value2 = (unsigned int)op2.ui64;
1712 else if(op2.kind == 2 && op2.type->isSigned)
1713 *value2 = (unsigned int)op2.s;
1714 else if(op2.kind == 2)
1715 *value2 = (unsigned int)op2.us;
1716 else if(op2.kind == 1 && op2.type->isSigned)
1717 *value2 = (unsigned int)op2.c;
1718 else if(op2.kind == 24 || op2.kind == 1)
1719 *value2 = (unsigned int)op2.uc;
1720 else if(op2.kind == 6)
1721 *value2 = (unsigned int)op2.f;
1722 else if(op2.kind == 7)
1723 *value2 = (unsigned int)op2.d;
1724 else if(op2.kind == 13)
1725 *value2 = (unsigned int)op2.ui64;
1726 else
1727 return 0x0;
1728 return 0x1;
1729 }
1730
1731 unsigned int GetInt64(struct Expression * exp, long long * value2)
1732 {
1733 struct Operand op2 = GetOperand(exp);
1734
1735 if(op2.kind == 3 && op2.type->isSigned)
1736 *value2 = (long long)op2.i;
1737 else if(op2.kind == 3)
1738 *value2 = (long long)op2.ui;
1739 else if(op2.kind == 4 && op2.type->isSigned)
1740 *value2 = op2.i64;
1741 else if(op2.kind == 4)
1742 *value2 = (long long)op2.ui64;
1743 else if(op2.kind == 23 && op2.type->isSigned)
1744 *value2 = op2.i64;
1745 else if(op2.kind == 23)
1746 *value2 = (long long)op2.ui64;
1747 else if(op2.kind == 22 && op2.type->isSigned)
1748 *value2 = op2.i64;
1749 else if(op2.kind == 22)
1750 *value2 = (long long)op2.ui64;
1751 else if(op2.kind == 2 && op2.type->isSigned)
1752 *value2 = (long long)op2.s;
1753 else if(op2.kind == 2)
1754 *value2 = (long long)op2.us;
1755 else if(op2.kind == 1 && op2.type->isSigned)
1756 *value2 = (long long)op2.c;
1757 else if(op2.kind == 24 || op2.kind == 1)
1758 *value2 = (long long)op2.uc;
1759 else if(op2.kind == 6)
1760 *value2 = (long long)op2.f;
1761 else if(op2.kind == 7)
1762 *value2 = (long long)op2.d;
1763 else if(op2.kind == 13)
1764 *value2 = (long long)op2.ui64;
1765 else
1766 return 0x0;
1767 return 0x1;
1768 }
1769
1770 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1771 {
1772 struct Operand op2 = GetOperand(exp);
1773
1774 if(op2.kind == 3 && op2.type->isSigned)
1775 *value2 = (uint64)op2.i;
1776 else if(op2.kind == 3)
1777 *value2 = (uint64)op2.ui;
1778 else if(op2.kind == 4 && op2.type->isSigned)
1779 *value2 = (uint64)op2.i64;
1780 else if(op2.kind == 4)
1781 *value2 = op2.ui64;
1782 else if(op2.kind == 23 && op2.type->isSigned)
1783 *value2 = (uint64)op2.i64;
1784 else if(op2.kind == 23)
1785 *value2 = op2.ui64;
1786 else if(op2.kind == 22 && op2.type->isSigned)
1787 *value2 = (uint64)op2.i64;
1788 else if(op2.kind == 22)
1789 *value2 = op2.ui64;
1790 else if(op2.kind == 2 && op2.type->isSigned)
1791 *value2 = (uint64)op2.s;
1792 else if(op2.kind == 2)
1793 *value2 = (uint64)op2.us;
1794 else if(op2.kind == 1 && op2.type->isSigned)
1795 *value2 = (uint64)op2.c;
1796 else if(op2.kind == 24 || op2.kind == 1)
1797 *value2 = (uint64)op2.uc;
1798 else if(op2.kind == 6)
1799 *value2 = (uint64)op2.f;
1800 else if(op2.kind == 7)
1801 *value2 = (uint64)op2.d;
1802 else if(op2.kind == 13)
1803 *value2 = op2.ui64;
1804 else
1805 return 0x0;
1806 return 0x1;
1807 }
1808
1809 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
1810 {
1811 struct Operand op2 = GetOperand(exp);
1812
1813 if(op2.kind == 3 && op2.type->isSigned)
1814 *value2 = (intptr_t)op2.i;
1815 else if(op2.kind == 3)
1816 *value2 = (intptr_t)op2.ui;
1817 else if(op2.kind == 4 && op2.type->isSigned)
1818 *value2 = (intptr_t)op2.i64;
1819 else if(op2.kind == 4)
1820 *value2 = (intptr_t)op2.ui64;
1821 else if(op2.kind == 23 && op2.type->isSigned)
1822 *value2 = (intptr_t)op2.i64;
1823 else if(op2.kind == 23)
1824 *value2 = (intptr_t)op2.ui64;
1825 else if(op2.kind == 22 && op2.type->isSigned)
1826 *value2 = (intptr_t)op2.i64;
1827 else if(op2.kind == 22)
1828 *value2 = (intptr_t)op2.ui64;
1829 else if(op2.kind == 2 && op2.type->isSigned)
1830 *value2 = (intptr_t)op2.s;
1831 else if(op2.kind == 2)
1832 *value2 = (intptr_t)op2.us;
1833 else if(op2.kind == 1 && op2.type->isSigned)
1834 *value2 = (intptr_t)op2.c;
1835 else if(op2.kind == 24 || op2.kind == 1)
1836 *value2 = (intptr_t)op2.uc;
1837 else if(op2.kind == 6)
1838 *value2 = (intptr_t)op2.f;
1839 else if(op2.kind == 7)
1840 *value2 = (intptr_t)op2.d;
1841 else if(op2.kind == 13)
1842 *value2 = (intptr_t)op2.ui64;
1843 else
1844 return 0x0;
1845 return 0x1;
1846 }
1847
1848 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
1849 {
1850 struct Operand op2 = GetOperand(exp);
1851
1852 if(op2.kind == 3 && op2.type->isSigned)
1853 *value2 = (uintptr_t)op2.i;
1854 else if(op2.kind == 3)
1855 *value2 = (uintptr_t)op2.ui;
1856 else if(op2.kind == 4 && op2.type->isSigned)
1857 *value2 = (uintptr_t)op2.i64;
1858 else if(op2.kind == 4)
1859 *value2 = (uintptr_t)op2.ui64;
1860 else if(op2.kind == 23 && op2.type->isSigned)
1861 *value2 = (uintptr_t)op2.i64;
1862 else if(op2.kind == 23)
1863 *value2 = (uintptr_t)op2.ui64;
1864 else if(op2.kind == 22 && op2.type->isSigned)
1865 *value2 = (uintptr_t)op2.i64;
1866 else if(op2.kind == 22)
1867 *value2 = (uintptr_t)op2.ui64;
1868 else if(op2.kind == 2 && op2.type->isSigned)
1869 *value2 = (uintptr_t)op2.s;
1870 else if(op2.kind == 2)
1871 *value2 = (uintptr_t)op2.us;
1872 else if(op2.kind == 1 && op2.type->isSigned)
1873 *value2 = (uintptr_t)op2.c;
1874 else if(op2.kind == 24 || op2.kind == 1)
1875 *value2 = (uintptr_t)op2.uc;
1876 else if(op2.kind == 6)
1877 *value2 = (uintptr_t)op2.f;
1878 else if(op2.kind == 7)
1879 *value2 = (uintptr_t)op2.d;
1880 else if(op2.kind == 13)
1881 *value2 = (uintptr_t)op2.ui64;
1882 else
1883 return 0x0;
1884 return 0x1;
1885 }
1886
1887 unsigned int GetIntSize(struct Expression * exp, ssize_t * value2)
1888 {
1889 struct Operand op2 = GetOperand(exp);
1890
1891 if(op2.kind == 3 && op2.type->isSigned)
1892 *value2 = (ssize_t)op2.i;
1893 else if(op2.kind == 3)
1894 *value2 = (ssize_t)op2.ui;
1895 else if(op2.kind == 4 && op2.type->isSigned)
1896 *value2 = (ssize_t)op2.i64;
1897 else if(op2.kind == 4)
1898 *value2 = (ssize_t)op2.ui64;
1899 else if(op2.kind == 23 && op2.type->isSigned)
1900 *value2 = (ssize_t)op2.i64;
1901 else if(op2.kind == 23)
1902 *value2 = (ssize_t)op2.ui64;
1903 else if(op2.kind == 22 && op2.type->isSigned)
1904 *value2 = (ssize_t)op2.i64;
1905 else if(op2.kind == 22)
1906 *value2 = (ssize_t)op2.ui64;
1907 else if(op2.kind == 2 && op2.type->isSigned)
1908 *value2 = (ssize_t)op2.s;
1909 else if(op2.kind == 2)
1910 *value2 = (ssize_t)op2.us;
1911 else if(op2.kind == 1 && op2.type->isSigned)
1912 *value2 = (ssize_t)op2.c;
1913 else if(op2.kind == 24 || op2.kind == 1)
1914 *value2 = (ssize_t)op2.uc;
1915 else if(op2.kind == 6)
1916 *value2 = (ssize_t)op2.f;
1917 else if(op2.kind == 7)
1918 *value2 = (ssize_t)op2.d;
1919 else if(op2.kind == 13)
1920 *value2 = (ssize_t)op2.ui64;
1921 else
1922 return 0x0;
1923 return 0x1;
1924 }
1925
1926 unsigned int GetUIntSize(struct Expression * exp, size_t * value2)
1927 {
1928 struct Operand op2 = GetOperand(exp);
1929
1930 if(op2.kind == 3 && op2.type->isSigned)
1931 *value2 = (size_t)op2.i;
1932 else if(op2.kind == 3)
1933 *value2 = (size_t)op2.ui;
1934 else if(op2.kind == 4 && op2.type->isSigned)
1935 *value2 = (size_t)op2.i64;
1936 else if(op2.kind == 4)
1937 *value2 = (size_t)op2.ui64;
1938 else if(op2.kind == 23 && op2.type->isSigned)
1939 *value2 = (size_t)op2.i64;
1940 else if(op2.kind == 23)
1941 *value2 = (size_t)op2.ui64;
1942 else if(op2.kind == 22 && op2.type->isSigned)
1943 *value2 = (size_t)op2.i64;
1944 else if(op2.kind == 22)
1945 *value2 = (size_t)op2.ui64;
1946 else if(op2.kind == 2 && op2.type->isSigned)
1947 *value2 = (size_t)op2.s;
1948 else if(op2.kind == 2)
1949 *value2 = (size_t)op2.us;
1950 else if(op2.kind == 1 && op2.type->isSigned)
1951 *value2 = (size_t)op2.c;
1952 else if(op2.kind == 24 || op2.kind == 1)
1953 *value2 = (size_t)op2.uc;
1954 else if(op2.kind == 6)
1955 *value2 = (size_t)op2.f;
1956 else if(op2.kind == 7)
1957 *value2 = (size_t)op2.d;
1958 else if(op2.kind == 13)
1959 *value2 = (size_t)op2.ui64;
1960 else
1961 return 0x0;
1962 return 0x1;
1963 }
1964
1965 unsigned int GetShort(struct Expression * exp, short * value2)
1966 {
1967 struct Operand op2 = GetOperand(exp);
1968
1969 if(op2.kind == 3 && op2.type->isSigned)
1970 *value2 = (short)op2.i;
1971 else if(op2.kind == 3)
1972 *value2 = (short)op2.ui;
1973 else if(op2.kind == 4 && op2.type->isSigned)
1974 *value2 = (short)op2.i64;
1975 else if(op2.kind == 4)
1976 *value2 = (short)op2.ui64;
1977 else if(op2.kind == 23 && op2.type->isSigned)
1978 *value2 = (short)op2.i64;
1979 else if(op2.kind == 23)
1980 *value2 = (short)op2.ui64;
1981 else if(op2.kind == 22 && op2.type->isSigned)
1982 *value2 = (short)op2.i64;
1983 else if(op2.kind == 22)
1984 *value2 = (short)op2.ui64;
1985 else if(op2.kind == 2 && op2.type->isSigned)
1986 *value2 = op2.s;
1987 else if(op2.kind == 2)
1988 *value2 = (short)op2.us;
1989 else if(op2.kind == 1 && op2.type->isSigned)
1990 *value2 = (short)op2.c;
1991 else if(op2.kind == 24 || op2.kind == 1)
1992 *value2 = (short)op2.uc;
1993 else if(op2.kind == 6)
1994 *value2 = (short)op2.f;
1995 else if(op2.kind == 7)
1996 *value2 = (short)op2.d;
1997 else if(op2.kind == 13)
1998 *value2 = (short)op2.ui64;
1999 else
2000 return 0x0;
2001 return 0x1;
2002 }
2003
2004 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
2005 {
2006 struct Operand op2 = GetOperand(exp);
2007
2008 if(op2.kind == 3 && op2.type->isSigned)
2009 *value2 = (unsigned short)op2.i;
2010 else if(op2.kind == 3)
2011 *value2 = (unsigned short)op2.ui;
2012 else if(op2.kind == 4 && op2.type->isSigned)
2013 *value2 = (unsigned short)op2.i64;
2014 else if(op2.kind == 4)
2015 *value2 = (unsigned short)op2.ui64;
2016 else if(op2.kind == 23 && op2.type->isSigned)
2017 *value2 = (unsigned short)op2.i64;
2018 else if(op2.kind == 23)
2019 *value2 = (unsigned short)op2.ui64;
2020 else if(op2.kind == 22 && op2.type->isSigned)
2021 *value2 = (unsigned short)op2.i64;
2022 else if(op2.kind == 22)
2023 *value2 = (unsigned short)op2.ui64;
2024 else if(op2.kind == 2 && op2.type->isSigned)
2025 *value2 = (unsigned short)op2.s;
2026 else if(op2.kind == 2)
2027 *value2 = op2.us;
2028 else if(op2.kind == 1 && op2.type->isSigned)
2029 *value2 = (unsigned short)op2.c;
2030 else if(op2.kind == 24 || op2.kind == 1)
2031 *value2 = (unsigned short)op2.uc;
2032 else if(op2.kind == 6)
2033 *value2 = (unsigned short)op2.f;
2034 else if(op2.kind == 7)
2035 *value2 = (unsigned short)op2.d;
2036 else if(op2.kind == 13)
2037 *value2 = (unsigned short)op2.ui64;
2038 else
2039 return 0x0;
2040 return 0x1;
2041 }
2042
2043 unsigned int GetChar(struct Expression * exp, char * value2)
2044 {
2045 struct Operand op2 = GetOperand(exp);
2046
2047 if(op2.kind == 3 && op2.type->isSigned)
2048 *value2 = (char)op2.i;
2049 else if(op2.kind == 3)
2050 *value2 = (char)op2.ui;
2051 else if(op2.kind == 4 && op2.type->isSigned)
2052 *value2 = (char)op2.i64;
2053 else if(op2.kind == 4)
2054 *value2 = (char)op2.ui64;
2055 else if(op2.kind == 23 && op2.type->isSigned)
2056 *value2 = (char)op2.i64;
2057 else if(op2.kind == 23)
2058 *value2 = (char)op2.ui64;
2059 else if(op2.kind == 22 && op2.type->isSigned)
2060 *value2 = (char)op2.i64;
2061 else if(op2.kind == 22)
2062 *value2 = (char)op2.ui64;
2063 else if(op2.kind == 2 && op2.type->isSigned)
2064 *value2 = (char)op2.s;
2065 else if(op2.kind == 2)
2066 *value2 = (char)op2.us;
2067 else if(op2.kind == 1 && op2.type->isSigned)
2068 *value2 = op2.c;
2069 else if(op2.kind == 24 || op2.kind == 1)
2070 *value2 = (char)op2.uc;
2071 else if(op2.kind == 6)
2072 *value2 = (char)op2.f;
2073 else if(op2.kind == 7)
2074 *value2 = (char)op2.d;
2075 else if(op2.kind == 13)
2076 *value2 = (char)op2.ui64;
2077 else
2078 return 0x0;
2079 return 0x1;
2080 }
2081
2082 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
2083 {
2084 struct Operand op2 = GetOperand(exp);
2085
2086 if(op2.kind == 3 && op2.type->isSigned)
2087 *value2 = (unsigned char)op2.i;
2088 else if(op2.kind == 3)
2089 *value2 = (unsigned char)op2.ui;
2090 else if(op2.kind == 4 && op2.type->isSigned)
2091 *value2 = (unsigned char)op2.i64;
2092 else if(op2.kind == 4)
2093 *value2 = (unsigned char)op2.ui64;
2094 else if(op2.kind == 23 && op2.type->isSigned)
2095 *value2 = (unsigned char)op2.i64;
2096 else if(op2.kind == 23)
2097 *value2 = (unsigned char)op2.ui64;
2098 else if(op2.kind == 22 && op2.type->isSigned)
2099 *value2 = (unsigned char)op2.i64;
2100 else if(op2.kind == 22)
2101 *value2 = (unsigned char)op2.ui64;
2102 else if(op2.kind == 2 && op2.type->isSigned)
2103 *value2 = (unsigned char)op2.s;
2104 else if(op2.kind == 2)
2105 *value2 = (unsigned char)op2.us;
2106 else if(op2.kind == 1 && op2.type->isSigned)
2107 *value2 = (unsigned char)op2.c;
2108 else if(op2.kind == 24 || op2.kind == 1)
2109 *value2 = op2.uc;
2110 else if(op2.kind == 6)
2111 *value2 = (unsigned char)op2.f;
2112 else if(op2.kind == 7)
2113 *value2 = (unsigned char)op2.d;
2114 else if(op2.kind == 13)
2115 *value2 = (unsigned char)op2.ui64;
2116 else
2117 return 0x0;
2118 return 0x1;
2119 }
2120
2121 unsigned int GetFloat(struct Expression * exp, float * value2)
2122 {
2123 struct Operand op2 = GetOperand(exp);
2124
2125 if(op2.kind == 3 && op2.type->isSigned)
2126 *value2 = (float)(float)op2.i;
2127 else if(op2.kind == 3)
2128 *value2 = (float)(float)op2.ui;
2129 else if(op2.kind == 4 && op2.type->isSigned)
2130 *value2 = (float)(float)op2.i64;
2131 else if(op2.kind == 4)
2132 *value2 = (float)(float)op2.ui64;
2133 else if(op2.kind == 23 && op2.type->isSigned)
2134 *value2 = (float)(float)op2.i64;
2135 else if(op2.kind == 23)
2136 *value2 = (float)(float)op2.ui64;
2137 else if(op2.kind == 22 && op2.type->isSigned)
2138 *value2 = (float)(float)op2.i64;
2139 else if(op2.kind == 22)
2140 *value2 = (float)(float)op2.ui64;
2141 else if(op2.kind == 2 && op2.type->isSigned)
2142 *value2 = (float)(float)op2.s;
2143 else if(op2.kind == 2)
2144 *value2 = (float)(float)op2.us;
2145 else if(op2.kind == 1 && op2.type->isSigned)
2146 *value2 = (float)(float)op2.c;
2147 else if(op2.kind == 24 || op2.kind == 1)
2148 *value2 = (float)(float)op2.uc;
2149 else if(op2.kind == 6)
2150 *value2 = (float)op2.f;
2151 else if(op2.kind == 7)
2152 *value2 = (float)op2.d;
2153 else if(op2.kind == 13)
2154 *value2 = (float)(float)op2.ui64;
2155 else
2156 return 0x0;
2157 return 0x1;
2158 }
2159
2160 unsigned int GetDouble(struct Expression * exp, double * value2)
2161 {
2162 struct Operand op2 = GetOperand(exp);
2163
2164 if(op2.kind == 3 && op2.type->isSigned)
2165 *value2 = (double)(double)op2.i;
2166 else if(op2.kind == 3)
2167 *value2 = (double)(double)op2.ui;
2168 else if(op2.kind == 4 && op2.type->isSigned)
2169 *value2 = (double)(double)op2.i64;
2170 else if(op2.kind == 4)
2171 *value2 = (double)(double)op2.ui64;
2172 else if(op2.kind == 23 && op2.type->isSigned)
2173 *value2 = (double)(double)op2.i64;
2174 else if(op2.kind == 23)
2175 *value2 = (double)(double)op2.ui64;
2176 else if(op2.kind == 22 && op2.type->isSigned)
2177 *value2 = (double)(double)op2.i64;
2178 else if(op2.kind == 22)
2179 *value2 = (double)(double)op2.ui64;
2180 else if(op2.kind == 2 && op2.type->isSigned)
2181 *value2 = (double)(double)op2.s;
2182 else if(op2.kind == 2)
2183 *value2 = (double)(double)op2.us;
2184 else if(op2.kind == 1 && op2.type->isSigned)
2185 *value2 = (double)(double)op2.c;
2186 else if(op2.kind == 24 || op2.kind == 1)
2187 *value2 = (double)(double)op2.uc;
2188 else if(op2.kind == 6)
2189 *value2 = (double)op2.f;
2190 else if(op2.kind == 7)
2191 *value2 = (double)op2.d;
2192 else if(op2.kind == 13)
2193 *value2 = (double)(double)op2.ui64;
2194 else
2195 return 0x0;
2196 return 0x1;
2197 }
2198
2199 void ComputeExpression(struct Expression * exp);
2200
2201 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2202
2203 extern int targetBits;
2204
2205 int ComputeTypeSize(struct Type * type);
2206
2207 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2208
2209 struct __ecereNameSpace__ecere__com__BitMember
2210 {
2211 struct __ecereNameSpace__ecere__com__BitMember * prev;
2212 struct __ecereNameSpace__ecere__com__BitMember * next;
2213 char *  name;
2214 unsigned int isProperty;
2215 int memberAccess;
2216 int id;
2217 struct __ecereNameSpace__ecere__com__Class * _class;
2218 char *  dataTypeString;
2219 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2220 struct Type * dataType;
2221 int type;
2222 int size;
2223 int pos;
2224 uint64 mask;
2225 } __attribute__ ((gcc_struct));
2226
2227 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2228
2229 struct __ecereNameSpace__ecere__sys__OldLink
2230 {
2231 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2232 struct __ecereNameSpace__ecere__sys__OldLink * next;
2233 void *  data;
2234 } __attribute__ ((gcc_struct));
2235
2236 void FinishTemplatesContext(struct Context * context);
2237
2238 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2239 {
2240 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2241 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2242
2243 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))
2244 {
2245 int c;
2246 int unionMemberOffset = 0;
2247 int bitFields = 0;
2248
2249 if(member)
2250 {
2251 member->memberOffset = 0;
2252 if(targetBits < sizeof(void *) * 8)
2253 member->structAlignment = 0;
2254 }
2255 else if(targetBits < sizeof(void *) * 8)
2256 _class->structAlignment = 0;
2257 if(!member && ((_class->type == 0 || _class->type == 5) || (_class->type == 1 && _class->memberOffset && _class->memberOffset > _class->base->structSize)))
2258 _class->memberOffset = (_class->base && _class->type == 1) ? _class->base->structSize : 0;
2259 if(!member && _class->destructionWatchOffset)
2260 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2261 {
2262 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2263
2264 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2265 {
2266 if(!dataMember->isProperty)
2267 {
2268 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2269 {
2270 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
2271 }
2272 }
2273 }
2274 }
2275 {
2276 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2277
2278 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2279 {
2280 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2281 {
2282 if(!isMember && _class->type == 2 && dataMember->dataType)
2283 {
2284 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2285 uint64 mask = 0;
2286 int d;
2287
2288 ComputeTypeSize(dataMember->dataType);
2289 if(bitMember->pos == -1)
2290 bitMember->pos = _class->memberOffset;
2291 if(!bitMember->size)
2292 bitMember->size = dataMember->dataType->size * 8;
2293 _class->memberOffset = bitMember->pos + bitMember->size;
2294 for(d = 0; d < bitMember->size; d++)
2295 {
2296 if(d)
2297 mask <<= 1;
2298 mask |= 1;
2299 }
2300 bitMember->mask = mask << bitMember->pos;
2301 }
2302 else if(dataMember->type == 0 && dataMember->dataType)
2303 {
2304 int size;
2305 int alignment = 0;
2306
2307 if(dataMember->dataType->kind != 8 || ((!dataMember->dataType->_class || !dataMember->dataType->_class->registered || dataMember->dataType->_class->registered != _class || _class->type != 1)))
2308 ComputeTypeSize(dataMember->dataType);
2309 if(dataMember->dataType->bitFieldCount)
2310 {
2311 bitFields += dataMember->dataType->bitFieldCount;
2312 size = 0;
2313 }
2314 else
2315 {
2316 if(bitFields)
2317 {
2318 int size = (bitFields + 7) / 8;
2319
2320 if(isMember)
2321 {
2322 int __simpleStruct0;
2323
2324 if(alignment)
2325 {
2326 int __simpleStruct0;
2327
2328 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2329 if(member->memberOffset % alignment)
2330 member->memberOffset += alignment - (member->memberOffset % alignment);
2331 }
2332 dataMember->offset = member->memberOffset;
2333 if(member->type == 1)
2334 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2335 else
2336 {
2337 member->memberOffset += size;
2338 }
2339 }
2340 else
2341 {
2342 if(alignment)
2343 {
2344 int __simpleStruct0;
2345
2346 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2347 if(_class->memberOffset % alignment)
2348 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2349 }
2350 dataMember->offset = _class->memberOffset;
2351 _class->memberOffset += size;
2352 }
2353 bitFields = 0;
2354 }
2355 size = dataMember->dataType->size;
2356 alignment = dataMember->dataType->alignment;
2357 }
2358 if(isMember)
2359 {
2360 int __simpleStruct0;
2361
2362 if(alignment)
2363 {
2364 int __simpleStruct0;
2365
2366 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2367 if(member->memberOffset % alignment)
2368 member->memberOffset += alignment - (member->memberOffset % alignment);
2369 }
2370 dataMember->offset = member->memberOffset;
2371 if(member->type == 1)
2372 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2373 else
2374 {
2375 member->memberOffset += size;
2376 }
2377 }
2378 else
2379 {
2380 if(alignment)
2381 {
2382 int __simpleStruct0;
2383
2384 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2385 if(_class->memberOffset % alignment)
2386 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2387 }
2388 dataMember->offset = _class->memberOffset;
2389 _class->memberOffset += size;
2390 }
2391 }
2392 else
2393 {
2394 int alignment;
2395
2396 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 0x1);
2397 alignment = dataMember->structAlignment;
2398 if(isMember)
2399 {
2400 int __simpleStruct0;
2401
2402 if(alignment)
2403 {
2404 int __simpleStruct0;
2405
2406 if(member->memberOffset % alignment)
2407 member->memberOffset += alignment - (member->memberOffset % alignment);
2408 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2409 }
2410 dataMember->offset = member->memberOffset;
2411 if(member->type == 1)
2412 unionMemberOffset = (__simpleStruct0 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2413 else
2414 member->memberOffset += dataMember->memberOffset;
2415 }
2416 else
2417 {
2418 if(alignment)
2419 {
2420 int __simpleStruct0;
2421
2422 if(_class->memberOffset % alignment)
2423 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2424 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2425 }
2426 dataMember->offset = _class->memberOffset;
2427 _class->memberOffset += dataMember->memberOffset;
2428 }
2429 }
2430 }
2431 }
2432 if(bitFields)
2433 {
2434 int alignment = 0;
2435 int size = (bitFields + 7) / 8;
2436
2437 if(isMember)
2438 {
2439 int __simpleStruct0;
2440
2441 if(alignment)
2442 {
2443 int __simpleStruct0;
2444
2445 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2446 if(member->memberOffset % alignment)
2447 member->memberOffset += alignment - (member->memberOffset % alignment);
2448 }
2449 if(member->type == 1)
2450 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2451 else
2452 {
2453 member->memberOffset += size;
2454 }
2455 }
2456 else
2457 {
2458 if(alignment)
2459 {
2460 int __simpleStruct0;
2461
2462 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2463 if(_class->memberOffset % alignment)
2464 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2465 }
2466 _class->memberOffset += size;
2467 }
2468 bitFields = 0;
2469 }
2470 }
2471 if(member && member->type == 1)
2472 {
2473 member->memberOffset = unionMemberOffset;
2474 }
2475 if(!isMember)
2476 {
2477 if(_class->type != 2)
2478 {
2479 int extra = 0;
2480
2481 if(_class->structAlignment)
2482 {
2483 if(_class->memberOffset % _class->structAlignment)
2484 extra += _class->structAlignment - (_class->memberOffset % _class->structAlignment);
2485 }
2486 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset + extra;
2487 if(!member)
2488 {
2489 struct __ecereNameSpace__ecere__com__Property * prop;
2490
2491 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2492 {
2493 if(prop->isProperty && prop->isWatchable)
2494 {
2495 prop->watcherOffset = _class->structSize;
2496 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2497 }
2498 }
2499 }
2500 {
2501 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2502
2503 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2504 {
2505 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2506
2507 if(deriv->computeSize)
2508 {
2509 deriv->offset = _class->structSize;
2510 deriv->memberOffset = 0;
2511 deriv->structSize = deriv->offset;
2512 ComputeClassMembers(deriv, 0x0);
2513 }
2514 }
2515 }
2516 }
2517 }
2518 }
2519 if(context)
2520 FinishTemplatesContext(context);
2521 }
2522
2523 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2524
2525 struct __ecereNameSpace__ecere__com__NameSpace
2526 {
2527 char *  name;
2528 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
2529 struct __ecereNameSpace__ecere__com__NameSpace *  left;
2530 struct __ecereNameSpace__ecere__com__NameSpace *  right;
2531 int depth;
2532 struct __ecereNameSpace__ecere__com__NameSpace *  parent;
2533 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2534 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2535 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2536 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2537 } __attribute__ ((gcc_struct));
2538
2539 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2540
2541 struct __ecereNameSpace__ecere__com__Module
2542 {
2543 struct __ecereNameSpace__ecere__com__Instance * application;
2544 struct __ecereNameSpace__ecere__sys__OldList classes;
2545 struct __ecereNameSpace__ecere__sys__OldList defines;
2546 struct __ecereNameSpace__ecere__sys__OldList functions;
2547 struct __ecereNameSpace__ecere__sys__OldList modules;
2548 struct __ecereNameSpace__ecere__com__Instance * prev;
2549 struct __ecereNameSpace__ecere__com__Instance * next;
2550 char *  name;
2551 void *  library;
2552 void *  Unload;
2553 int importType;
2554 int origImportType;
2555 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2556 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2557 } __attribute__ ((gcc_struct));
2558
2559 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2560 {
2561 struct __ecereNameSpace__ecere__com__Class * _class;
2562 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2563
2564 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
2565 ComputeModuleClasses(subModule->data);
2566 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->classes.first; _class; _class = _class->next)
2567 ComputeClassMembers(_class, 0x0);
2568 }
2569
2570 extern unsigned int inCompiler;
2571
2572 extern void Compiler_Error(char *  format, ...);
2573
2574 extern char *  __ecereNameSpace__ecere__GetTranslatedString(struct __ecereNameSpace__ecere__com__Instance * module, char *  string, char *  stringAndContext);
2575
2576 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
2577
2578 int ComputeTypeSize(struct Type * type)
2579 {
2580 unsigned int size = type ? type->size : 0;
2581
2582 if(!size && type && !type->computing)
2583 {
2584 type->computing = 0x1;
2585 switch(type->kind)
2586 {
2587 case 24:
2588 type->alignment = size = sizeof(char);
2589 break;
2590 case 1:
2591 type->alignment = size = sizeof(char);
2592 break;
2593 case 3:
2594 type->alignment = size = sizeof(int);
2595 break;
2596 case 4:
2597 type->alignment = size = sizeof(long long);
2598 break;
2599 case 22:
2600 type->alignment = size = targetBits / 8;
2601 break;
2602 case 23:
2603 type->alignment = size = targetBits / 8;
2604 break;
2605 case 5:
2606 type->alignment = size = sizeof(long);
2607 break;
2608 case 2:
2609 type->alignment = size = sizeof(short);
2610 break;
2611 case 6:
2612 type->alignment = size = sizeof(float);
2613 break;
2614 case 7:
2615 type->alignment = size = sizeof(double);
2616 break;
2617 case 8:
2618 {
2619 struct __ecereNameSpace__ecere__com__Class * _class = type->_class ? type->_class->registered : (((void *)0));
2620
2621 if(_class && _class->type == 1)
2622 {
2623 ComputeClassMembers(_class, 0x0);
2624 type->alignment = _class->structAlignment;
2625 size = _class->structSize;
2626 if(type->alignment && size % type->alignment)
2627 size += type->alignment - (size % type->alignment);
2628 }
2629 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2630 {
2631 if(!_class->dataType)
2632 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2633 size = type->alignment = ComputeTypeSize(_class->dataType);
2634 }
2635 else
2636 size = type->alignment = targetBits / 8;
2637 break;
2638 }
2639 case 13:
2640 case 19:
2641 size = type->alignment = targetBits / 8;
2642 break;
2643 case 12:
2644 if(type->arraySizeExp)
2645 {
2646 ProcessExpressionType(type->arraySizeExp);
2647 ComputeExpression(type->arraySizeExp);
2648 if(!type->arraySizeExp->isConstant || (type->arraySizeExp->expType->kind != 3 && type->arraySizeExp->expType->kind != 15 && (type->arraySizeExp->expType->kind != 8 || !type->arraySizeExp->expType->_class->registered || type->arraySizeExp->expType->_class->registered->type != 4)))
2649 {
2650 struct Location oldLoc = yylloc;
2651 char expression[10240];
2652
2653 expression[0] = '\0';
2654 type->arraySizeExp->expType = (((void *)0));
2655 yylloc = type->arraySizeExp->loc;
2656 if(inCompiler)
2657 PrintExpression(type->arraySizeExp, expression);
2658 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Array size not constant int (%s)\n", (((void *)0))), expression);
2659 yylloc = oldLoc;
2660 }
2661 GetInt(type->arraySizeExp, &type->arraySize);
2662 }
2663 else if(type->enumClass)
2664 {
2665 if(type->enumClass && type->enumClass->registered && type->enumClass->registered->type == 4)
2666 {
2667 type->arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->enumClass->registered, "enumSize");
2668 }
2669 else
2670 type->arraySize = 0;
2671 }
2672 else
2673 {
2674 type->arraySize = 0;
2675 }
2676 size = ComputeTypeSize(type->type) * type->arraySize;
2677 if(type->type)
2678 type->alignment = type->type->alignment;
2679 break;
2680 case 9:
2681 {
2682 struct Type * member;
2683
2684 for(member = type->members.first; member; member = member->next)
2685 {
2686 int __simpleStruct0, __simpleStruct1;
2687 unsigned int addSize = ComputeTypeSize(member);
2688
2689 member->offset = size;
2690 if(member->alignment && size % member->alignment)
2691 member->offset += member->alignment - (size % member->alignment);
2692 size = member->offset;
2693 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2694 size += addSize;
2695 }
2696 if(type->alignment && size % type->alignment)
2697 size += type->alignment - (size % type->alignment);
2698 break;
2699 }
2700 case 10:
2701 {
2702 struct Type * member;
2703
2704 for(member = type->members.first; member; member = member->next)
2705 {
2706 int __simpleStruct0, __simpleStruct1;
2707 unsigned int addSize = ComputeTypeSize(member);
2708
2709 member->offset = size;
2710 if(member->alignment && size % member->alignment)
2711 member->offset += member->alignment - (size % member->alignment);
2712 size = member->offset;
2713 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2714 size = ((size > addSize) ? size : addSize);
2715 }
2716 if(type->alignment && size % type->alignment)
2717 size += type->alignment - (size % type->alignment);
2718 break;
2719 }
2720 case 20:
2721 {
2722 struct TemplateParameter * param = type->templateParameter;
2723 struct Type * baseType = ProcessTemplateParameterType(param);
2724
2725 if(baseType)
2726 {
2727 size = ComputeTypeSize(baseType);
2728 type->alignment = baseType->alignment;
2729 }
2730 else
2731 type->alignment = size = sizeof(uint64);
2732 break;
2733 }
2734 case 15:
2735 {
2736 type->alignment = size = sizeof(enum
2737 {
2738 test
2739 });
2740 break;
2741 }
2742 case 21:
2743 {
2744 type->alignment = size = targetBits / 8;
2745 break;
2746 }
2747 }
2748 type->size = size;
2749 type->computing = 0x0;
2750 }
2751 return size;
2752 }
2753
2754 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2755
2756 extern struct Identifier * MkIdentifier(char *  string);
2757
2758 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void *  item);
2759
2760 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2761
2762 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2763
2764 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2765
2766 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2767
2768 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2769
2770 extern void FreeType(struct Type * type);
2771
2772 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2773
2774 extern struct Specifier * MkSpecifier(int specifier);
2775
2776 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2777
2778 extern struct Expression * MkExpConstant(char *  string);
2779
2780 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)
2781 {
2782 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2783 unsigned int totalSize = 0;
2784 unsigned int maxSize = 0;
2785 int alignment, size;
2786 struct __ecereNameSpace__ecere__com__DataMember * member;
2787 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2788
2789 if(addedPadding)
2790 *addedPadding = 0x0;
2791 if(!isMember && _class->base)
2792 {
2793 maxSize = _class->structSize;
2794 {
2795 if(_class->type == 1 || _class->type == 5)
2796 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass, (((void *)0)));
2797 else
2798 {
2799 unsigned int baseSize = _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2800
2801 if(maxSize > baseSize)
2802 maxSize -= baseSize;
2803 else
2804 maxSize = 0;
2805 }
2806 }
2807 }
2808 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2809 {
2810 if(!member->isProperty)
2811 {
2812 switch(member->type)
2813 {
2814 case 0:
2815 {
2816 if(member->dataTypeString)
2817 {
2818 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2819 struct Declarator * decl;
2820
2821 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2822 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2823 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2824 if(!member->dataType)
2825 member->dataType = ProcessType(specs, decl);
2826 ReplaceThisClassSpecifiers(specs, topClass);
2827 {
2828 struct Type * type = ProcessType(specs, decl);
2829
2830 DeclareType(member->dataType, 0x0, 0x0);
2831 FreeType(type);
2832 }
2833 ComputeTypeSize(member->dataType);
2834 size = member->dataType->size;
2835 alignment = member->dataType->alignment;
2836 if(alignment)
2837 {
2838 if(totalSize % alignment)
2839 totalSize += alignment - (totalSize % alignment);
2840 }
2841 totalSize += size;
2842 }
2843 break;
2844 }
2845 case 1:
2846 case 2:
2847 {
2848 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
2849
2850 size = 0;
2851 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass, (((void *)0)));
2852 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
2853 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, (((void *)0)), (((void *)0)))));
2854 alignment = member->structAlignment;
2855 if(alignment)
2856 {
2857 if(totalSize % alignment)
2858 totalSize += alignment - (totalSize % alignment);
2859 }
2860 totalSize += size;
2861 break;
2862 }
2863 }
2864 }
2865 }
2866 if(retSize)
2867 {
2868 unsigned int __simpleStruct0;
2869
2870 if(topMember && topMember->type == 1)
2871 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
2872 else
2873 *retSize += totalSize;
2874 }
2875 else if(totalSize < maxSize && _class->type != 1000)
2876 {
2877 int autoPadding = 0;
2878
2879 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
2880 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
2881 if(totalSize + autoPadding < maxSize)
2882 {
2883 char sizeString[50];
2884
2885 sprintf(sizeString, "%d", maxSize - totalSize);
2886 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
2887 if(addedPadding)
2888 *addedPadding = 0x1;
2889 }
2890 }
2891 if(context)
2892 FinishTemplatesContext(context);
2893 return topMember ? topMember->memberID : _class->memberID;
2894 }
2895
2896 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2897 {
2898 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2899 unsigned int totalSize = 0;
2900 struct __ecereNameSpace__ecere__com__DataMember * member;
2901 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2902
2903 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
2904 DeclareMembers(_class->base, 0x0);
2905 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2906 {
2907 if(!member->isProperty)
2908 {
2909 switch(member->type)
2910 {
2911 case 0:
2912 {
2913 if(!member->dataType && member->dataTypeString)
2914 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
2915 if(member->dataType)
2916 DeclareType(member->dataType, 0x0, 0x0);
2917 break;
2918 }
2919 case 1:
2920 case 2:
2921 {
2922 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
2923 break;
2924 }
2925 }
2926 }
2927 }
2928 if(context)
2929 FinishTemplatesContext(context);
2930 return topMember ? topMember->memberID : _class->memberID;
2931 }
2932
2933 extern struct Symbol * FindClass(char *  name);
2934
2935 extern char *  strchr(const char * , int);
2936
2937 extern void FullClassNameCat(char *  output, char *  className, unsigned int includeTemplateParams);
2938
2939 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (*  FreeFunction)(void * ));
2940
2941 extern void FreeClassDef(struct ClassDef * def);
2942
2943 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
2944
2945 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
2946
2947 extern char *  strcpy(char * , const char * );
2948
2949 extern void MangleClassName(char *  className);
2950
2951 extern void DeclareClass(struct Symbol * classSym, char *  className);
2952
2953 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item, void *  prevItem);
2954
2955 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void *  prevItem, void *  item);
2956
2957 void DeclareStruct(char * name, unsigned int skipNoHead)
2958 {
2959 struct External * external = (((void *)0));
2960 struct Symbol * classSym = FindClass(name);
2961
2962 if(!inCompiler || !classSym)
2963 return ;
2964 if(classSym->registered && (classSym->registered->type == 2 || classSym->registered->type == 3 || classSym->registered->type == 4))
2965 return ;
2966 if(classSym->registered && classSym->imported && !classSym->declaredStructSym)
2967 {
2968 struct Declaration * decl;
2969 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
2970 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
2971 char structName[1024];
2972
2973 external = (classSym->registered && classSym->registered->type == 1) ? classSym->pointerExternal : classSym->structExternal;
2974 classSym->declaring++;
2975 if(strchr(classSym->string, '<'))
2976 {
2977 if(classSym->registered->templateClass)
2978 {
2979 DeclareStruct(classSym->registered->templateClass->fullName, skipNoHead);
2980 classSym->declaring--;
2981 }
2982 return ;
2983 }
2984 DeclareMembers(classSym->registered, 0x0);
2985 structName[0] = (char)0;
2986 FullClassNameCat(structName, name, 0x0);
2987 if(!skipNoHead)
2988 {
2989 unsigned int addedPadding = 0x0;
2990
2991 classSym->declaredStructSym = 0x1;
2992 declarations = MkList();
2993 AddMembers(declarations, classSym->registered, 0x0, (((void *)0)), classSym->registered, &addedPadding);
2994 if(!(*declarations).count || ((*declarations).count == 1 && addedPadding))
2995 {
2996 FreeList(declarations, FreeClassDef);
2997 declarations = (((void *)0));
2998 }
2999 }
3000 if(skipNoHead || declarations)
3001 {
3002 if(external && external->declaration)
3003 {
3004 ((struct Specifier *)(*external->declaration->specifiers).first)->definitions = declarations;
3005 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3006 {
3007 if(classSym->structExternal)
3008 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3009 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3010 classSym->id = curExternal->symbol->idCode;
3011 classSym->idCode = curExternal->symbol->idCode;
3012 }
3013 }
3014 else
3015 {
3016 if(!external)
3017 external = MkExternalDeclaration((((void *)0)));
3018 specifiers = MkList();
3019 declarators = MkList();
3020 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
3021 external->declaration = decl = MkDeclaration(specifiers, declarators);
3022 if(decl->symbol && !decl->symbol->pointerExternal)
3023 decl->symbol->pointerExternal = external;
3024 if(classSym->registered && classSym->registered->type == 1)
3025 {
3026 char className[1024];
3027
3028 strcpy(className, "__ecereClass_");
3029 FullClassNameCat(className, classSym->string, 0x1);
3030 MangleClassName(className);
3031 DeclareClass(classSym, className);
3032 external->symbol = classSym;
3033 classSym->pointerExternal = external;
3034 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3035 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3036 }
3037 else
3038 {
3039 char className[1024];
3040
3041 strcpy(className, "__ecereClass_");
3042 FullClassNameCat(className, classSym->string, 0x1);
3043 MangleClassName(className);
3044 classSym->structExternal = external;
3045 DeclareClass(classSym, className);
3046 external->symbol = classSym;
3047 }
3048 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
3049 }
3050 }
3051 classSym->declaring--;
3052 }
3053 else if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3054 {
3055 classSym->declaring++;
3056 {
3057 if(classSym->registered)
3058 DeclareMembers(classSym->registered, 0x0);
3059 }
3060 if(classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 5))
3061 {
3062 if(classSym->structExternal)
3063 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3064 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3065 classSym->id = curExternal->symbol->idCode;
3066 classSym->idCode = curExternal->symbol->idCode;
3067 }
3068 classSym->declaring--;
3069 }
3070 }
3071
3072 extern char *  strcat(char * , const char * );
3073
3074 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
3075
3076 extern struct ModuleImport * mainModule;
3077
3078 extern struct Specifier * MkSpecifierName(char *  name);
3079
3080 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
3081
3082 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
3083
3084 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
3085
3086 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
3087
3088 extern void FreeDeclarator(struct Declarator * decl);
3089
3090 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
3091
3092 struct PropertyImport
3093 {
3094 struct PropertyImport * prev;
3095 struct PropertyImport * next;
3096 char *  name;
3097 unsigned int isVirtual;
3098 unsigned int hasSet;
3099 unsigned int hasGet;
3100 } __attribute__ ((gcc_struct));
3101
3102 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
3103
3104 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
3105 {
3106 struct Symbol * symbol = prop->symbol;
3107 char propName[1024];
3108
3109 strcpy(setName, "__ecereProp_");
3110 FullClassNameCat(setName, prop->_class->fullName, 0x0);
3111 strcat(setName, "_Set_");
3112 FullClassNameCat(setName, prop->name, 0x1);
3113 strcpy(getName, "__ecereProp_");
3114 FullClassNameCat(getName, prop->_class->fullName, 0x0);
3115 strcat(getName, "_Get_");
3116 FullClassNameCat(getName, prop->name, 0x1);
3117 strcpy(propName, "__ecereProp_");
3118 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3119 strcat(propName, "_");
3120 FullClassNameCat(propName, prop->name, 0x1);
3121 MangleClassName(getName);
3122 MangleClassName(setName);
3123 MangleClassName(propName);
3124 if(prop->_class->type == 1)
3125 DeclareStruct(prop->_class->fullName, 0x0);
3126 if(!symbol || curExternal->symbol->idCode < symbol->id)
3127 {
3128 unsigned int imported = 0x0;
3129 unsigned int dllImport = 0x0;
3130
3131 if(!symbol || symbol->_import)
3132 {
3133 if(!symbol)
3134 {
3135 struct Symbol * classSym;
3136
3137 if(!prop->_class->symbol)
3138 prop->_class->symbol = FindClass(prop->_class->fullName);
3139 classSym = prop->_class->symbol;
3140 if(classSym && !classSym->_import)
3141 {
3142 struct ModuleImport * module;
3143
3144 if(prop->_class->module)
3145 module = FindModule(prop->_class->module);
3146 else
3147 module = mainModule;
3148 classSym->_import = __extension__ ({
3149 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
3150
3151 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
3152 });
3153 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3154 }
3155 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3156 symbol->_import = (struct ClassImport *)__extension__ ({
3157 struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
3158
3159 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0x0, __ecereInstance1->hasSet = prop->Set ? 0x1 : 0x0, __ecereInstance1->hasGet = prop->Get ? 0x1 : 0x0, __ecereInstance1;
3160 });
3161 if(classSym)
3162 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3163 }
3164 imported = 0x1;
3165 if(prop->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)prop->_class->module + structSize_Instance)))->importType != 1)
3166 dllImport = 0x1;
3167 }
3168 if(!symbol->type)
3169 {
3170 struct Context * context = SetupTemplatesContext(prop->_class);
3171
3172 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
3173 FinishTemplatesContext(context);
3174 }
3175 if(prop->Get)
3176 {
3177 if(!symbol->externalGet || symbol->externalGet->type == 0)
3178 {
3179 struct Declaration * decl;
3180 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3181 struct Declarator * d;
3182 struct __ecereNameSpace__ecere__sys__OldList * params;
3183 struct Specifier * spec;
3184 struct External * external;
3185 struct Declarator * typeDecl;
3186 unsigned int simple = 0x0;
3187
3188 specifiers = MkList();
3189 declarators = MkList();
3190 params = MkList();
3191 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3192 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3193 if(dllImport)
3194 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3195 {
3196 struct Context * context = SetupTemplatesContext(prop->_class);
3197
3198 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3199 FinishTemplatesContext(context);
3200 }
3201 for(spec = (*specifiers).first; spec; spec = spec->next)
3202 {
3203 if(spec->type == 1)
3204 {
3205 if((!typeDecl || typeDecl->type == 1))
3206 {
3207 struct Symbol * classSym = spec->symbol;
3208
3209 symbol->_class = classSym->registered;
3210 if(classSym->registered && classSym->registered->type == 1)
3211 {
3212 DeclareStruct(spec->name, 0x0);
3213 simple = 0x1;
3214 }
3215 }
3216 }
3217 }
3218 if(!simple)
3219 d = PlugDeclarator(typeDecl, d);
3220 else
3221 {
3222 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3223 specifiers = MkList();
3224 }
3225 d = MkDeclaratorFunction(d, params);
3226 if(dllImport)
3227 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3228 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3229 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3230 if(simple)
3231 ListAdd(specifiers, MkSpecifier(VOID));
3232 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3233 decl = MkDeclaration(specifiers, declarators);
3234 external = MkExternalDeclaration(decl);
3235 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3236 external->symbol = symbol;
3237 symbol->externalGet = external;
3238 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3239 if(typeDecl)
3240 FreeDeclarator(typeDecl);
3241 }
3242 else
3243 {
3244 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
3245 }
3246 }
3247 if(prop->Set)
3248 {
3249 if(!symbol->externalSet || symbol->externalSet->type == 0)
3250 {
3251 struct Declaration * decl;
3252 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3253 struct Declarator * d;
3254 struct __ecereNameSpace__ecere__sys__OldList * params;
3255 struct Specifier * spec;
3256 struct External * external;
3257 struct Declarator * typeDecl;
3258
3259 declarators = MkList();
3260 params = MkList();
3261 if(!prop->conversion || prop->_class->type == 1)
3262 {
3263 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3264 }
3265 specifiers = MkList();
3266 {
3267 struct Context * context = SetupTemplatesContext(prop->_class);
3268
3269 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3270 FinishTemplatesContext(context);
3271 }
3272 ListAdd(params, MkTypeName(specifiers, d));
3273 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3274 if(dllImport)
3275 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3276 d = MkDeclaratorFunction(d, params);
3277 for(spec = (*specifiers).first; spec; spec = spec->next)
3278 {
3279 if(spec->type == 1)
3280 {
3281 if((!typeDecl || typeDecl->type == 1))
3282 {
3283 struct Symbol * classSym = spec->symbol;
3284
3285 symbol->_class = classSym->registered;
3286 if(classSym->registered && classSym->registered->type == 1)
3287 DeclareStruct(spec->name, 0x0);
3288 }
3289 }
3290 }
3291 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3292 specifiers = MkList();
3293 if(dllImport)
3294 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3295 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3296 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3297 if(!prop->conversion || prop->_class->type == 1)
3298 ListAdd(specifiers, MkSpecifier(VOID));
3299 else
3300 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3301 decl = MkDeclaration(specifiers, declarators);
3302 external = MkExternalDeclaration(decl);
3303 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3304 external->symbol = symbol;
3305 symbol->externalSet = external;
3306 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3307 }
3308 else
3309 {
3310 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3311 }
3312 }
3313 if(!symbol->externalPtr)
3314 {
3315 struct Declaration * decl;
3316 struct External * external;
3317 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3318
3319 if(imported)
3320 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3321 else
3322 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3323 ListAdd(specifiers, MkSpecifierName("Property"));
3324 {
3325 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3326
3327 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3328 if(!imported)
3329 {
3330 strcpy(propName, "__ecerePropM_");
3331 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3332 strcat(propName, "_");
3333 FullClassNameCat(propName, prop->name, 0x1);
3334 MangleClassName(propName);
3335 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3336 }
3337 decl = MkDeclaration(specifiers, list);
3338 }
3339 external = MkExternalDeclaration(decl);
3340 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3341 external->symbol = symbol;
3342 symbol->externalPtr = external;
3343 }
3344 else
3345 {
3346 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3347 }
3348 symbol->id = curExternal->symbol->idCode;
3349 }
3350 }
3351
3352 struct Type * Dereference(struct Type * source)
3353 {
3354 struct Type * type = (((void *)0));
3355
3356 if(source)
3357 {
3358 if(source->kind == 13 || source->kind == 12)
3359 {
3360 type = source->type;
3361 source->type->refCount++;
3362 }
3363 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3364 {
3365 type = __extension__ ({
3366 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3367
3368 __ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
3369 });
3370 }
3371 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3372 {
3373 type = source;
3374 source->refCount++;
3375 }
3376 else
3377 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot dereference type\n", (((void *)0))));
3378 }
3379 return type;
3380 }
3381
3382 static struct Type * Reference(struct Type * source)
3383 {
3384 struct Type * type = (((void *)0));
3385
3386 if(source)
3387 {
3388 type = __extension__ ({
3389 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3390
3391 __ecereInstance1->kind = 13, __ecereInstance1->type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
3392 });
3393 source->refCount++;
3394 }
3395 return type;
3396 }
3397
3398 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);
3399
3400 extern void *  memcpy(void * , const void * , size_t size);
3401
3402 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3403
3404 extern void FreeExpression(struct Expression * exp);
3405
3406 extern void __ecereNameSpace__ecere__sys__ChangeCh(char *  string, char ch1, char ch2);
3407
3408 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);
3409
3410 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3411
3412 extern struct Type * MkClassType(char *  name);
3413
3414 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_AddDataMember(struct __ecereNameSpace__ecere__com__Class * _class, char *  name, char *  type, unsigned int size, unsigned int alignment, int declMode);
3415
3416 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)
3417 {
3418 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3419 unsigned int found = 0x0;
3420 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3421 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3422 unsigned int freeType = 0x0;
3423
3424 yylloc = member->loc;
3425 if(!ident)
3426 {
3427 if(curMember)
3428 {
3429 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3430 if(*curMember)
3431 {
3432 found = 0x1;
3433 dataMember = *curMember;
3434 }
3435 }
3436 }
3437 else
3438 {
3439 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3440 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3441 int _subMemberStackPos = 0;
3442
3443 if(!thisMember)
3444 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3445 if(thisMember)
3446 {
3447 dataMember = thisMember;
3448 if(curMember && thisMember->memberAccess == 1)
3449 {
3450 *curMember = thisMember;
3451 *curClass = thisMember->_class;
3452 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
3453 *subMemberStackPos = _subMemberStackPos;
3454 }
3455 found = 0x1;
3456 }
3457 else
3458 {
3459 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3460 if(method && method->type == 1)
3461 found = 0x1;
3462 else
3463 method = (((void *)0));
3464 }
3465 }
3466 if(found)
3467 {
3468 struct Type * type = (((void *)0));
3469
3470 if(dataMember)
3471 {
3472 if(!dataMember->dataType && dataMember->dataTypeString)
3473 {
3474 struct Context * context = SetupTemplatesContext(_class);
3475
3476 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3477 FinishTemplatesContext(context);
3478 }
3479 type = dataMember->dataType;
3480 }
3481 else if(method)
3482 {
3483 if(!method->dataType)
3484 ProcessMethodType(method);
3485 type = method->dataType;
3486 }
3487 if(ident && ident->next)
3488 {
3489 for(ident = ident->next; ident && type; ident = ident->next)
3490 {
3491 if(type->kind == 8)
3492 {
3493 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3494 if(!dataMember)
3495 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3496 if(dataMember)
3497 type = dataMember->dataType;
3498 }
3499 else if(type->kind == 9 || type->kind == 10)
3500 {
3501 struct Type * memberType;
3502
3503 for(memberType = type->members.first; memberType; memberType = memberType->next)
3504 {
3505 if(!strcmp(memberType->name, ident->string))
3506 {
3507 type = memberType;
3508 break;
3509 }
3510 }
3511 }
3512 }
3513 }
3514 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3515 {
3516 int id = 0;
3517 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3518 struct __ecereNameSpace__ecere__com__Class * sClass;
3519
3520 for(sClass = _class; sClass; sClass = sClass->base)
3521 {
3522 id = 0;
3523 if(sClass->templateClass)
3524 sClass = sClass->templateClass;
3525 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3526 {
3527 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3528 {
3529 for(sClass = sClass->base; sClass; sClass = sClass->base)
3530 {
3531 if(sClass->templateClass)
3532 sClass = sClass->templateClass;
3533 id += sClass->templateParams.count;
3534 }
3535 break;
3536 }
3537 id++;
3538 }
3539 if(curParam)
3540 break;
3541 }
3542 if(curParam)
3543 {
3544 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3545
3546 if(arg.dataTypeString)
3547 {
3548 type = ProcessTypeString(arg.dataTypeString, 0x0);
3549 freeType = 0x1;
3550 if(type && _class->templateClass)
3551 type->passAsTemplate = 0x1;
3552 if(type)
3553 {
3554 }
3555 }
3556 }
3557 }
3558 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3559 {
3560 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3561 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3562 int c;
3563 int paramCount = 0;
3564 int lastParam = -1;
3565 char templateString[1024];
3566 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3567
3568 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3569 for(cClass = expClass; cClass; cClass = cClass->base)
3570 {
3571 int p = 0;
3572
3573 if(cClass->templateClass)
3574 cClass = cClass->templateClass;
3575 for(param = cClass->templateParams.first; param; param = param->next)
3576 {
3577 int id = p;
3578 struct __ecereNameSpace__ecere__com__Class * sClass;
3579 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3580
3581 for(sClass = cClass->base; sClass; sClass = sClass->base)
3582 {
3583 if(sClass->templateClass)
3584 sClass = sClass->templateClass;
3585 id += sClass->templateParams.count;
3586 }
3587 arg = expClass->templateArgs[id];
3588 for(sClass = _class; sClass; sClass = sClass->base)
3589 {
3590 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3591 int p = 0;
3592 struct __ecereNameSpace__ecere__com__Class * nextClass;
3593
3594 if(sClass->templateClass)
3595 sClass = sClass->templateClass;
3596 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3597 {
3598 if(nextClass->templateClass)
3599 nextClass = nextClass->templateClass;
3600 p += nextClass->templateParams.count;
3601 }
3602 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3603 {
3604 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3605 {
3606 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3607 {
3608 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3609 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3610 break;
3611 }
3612 }
3613 }
3614 }
3615 {
3616 char argument[256];
3617
3618 argument[0] = '\0';
3619 switch(param->type)
3620 {
3621 case 2:
3622 {
3623 char expString[1024];
3624 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3625 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3626 struct Expression * exp;
3627 char * string = PrintHexUInt64(arg.expression.ui64);
3628
3629 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3630 ProcessExpressionType(exp);
3631 ComputeExpression(exp);
3632 expString[0] = '\0';
3633 PrintExpression(exp, expString);
3634 strcat(argument, expString);
3635 FreeExpression(exp);
3636 break;
3637 }
3638 case 1:
3639 {
3640 strcat(argument, arg.member->name);
3641 break;
3642 }
3643 case 0:
3644 {
3645 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3646 strcat(argument, arg.dataTypeString);
3647 break;
3648 }
3649 }
3650 if(argument[0])
3651 {
3652 if(paramCount)
3653 strcat(templateString, ", ");
3654 if(lastParam != p - 1)
3655 {
3656 strcat(templateString, param->name);
3657 strcat(templateString, " = ");
3658 }
3659 strcat(templateString, argument);
3660 paramCount++;
3661 lastParam = p;
3662 }
3663 p++;
3664 }
3665 }
3666 }
3667 {
3668 int len = strlen(templateString);
3669
3670 if(templateString[len - 1] == '<')
3671 len--;
3672 else
3673 {
3674 if(templateString[len - 1] == '>')
3675 templateString[len++] = ' ';
3676 templateString[len++] = '>';
3677 }
3678 templateString[len++] = '\0';
3679 }
3680 {
3681 struct Context * context = SetupTemplatesContext(_class);
3682
3683 if(freeType)
3684 FreeType(type);
3685 type = ProcessTypeString(templateString, 0x0);
3686 freeType = 0x1;
3687 FinishTemplatesContext(context);
3688 }
3689 }
3690 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3691 {
3692 ProcessExpressionType(member->initializer->exp);
3693 if(!member->initializer->exp->expType)
3694 {
3695 if(inCompiler)
3696 {
3697 char expString[10240];
3698
3699 expString[0] = '\0';
3700 PrintExpression(member->initializer->exp, expString);
3701 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3702 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3703 }
3704 }
3705 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0))
3706 {
3707 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible instance method %s\n", (((void *)0))), ident->string);
3708 }
3709 }
3710 else if(member->initializer)
3711 {
3712 ProcessInitializer(member->initializer, type);
3713 }
3714 if(freeType)
3715 FreeType(type);
3716 }
3717 else
3718 {
3719 if(_class && _class->type == 3)
3720 {
3721 if(member->initializer)
3722 {
3723 struct Type * type = MkClassType(_class->fullName);
3724
3725 ProcessInitializer(member->initializer, type);
3726 FreeType(type);
3727 }
3728 }
3729 else
3730 {
3731 if(member->initializer)
3732 {
3733 ProcessInitializer(member->initializer, (((void *)0)));
3734 }
3735 if(ident)
3736 {
3737 if(method)
3738 {
3739 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3740 }
3741 else if(_class)
3742 {
3743 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3744 if(inCompiler)
3745 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3746 }
3747 }
3748 else if(_class)
3749 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3750 }
3751 }
3752 }
3753
3754 extern struct Identifier * GetDeclId(struct Declarator * decl);
3755
3756 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);
3757
3758 extern void FreeSpecifier(struct Specifier * spec);
3759
3760 static void ProcessFunction(struct FunctionDefinition * function);
3761
3762 extern struct __ecereNameSpace__ecere__sys__OldList *  CopyList(struct __ecereNameSpace__ecere__sys__OldList *  source, void *  (*  CopyFunction)(void * ));
3763
3764 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3765
3766 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3767
3768 extern void FreeClassFunction(struct ClassFunction * func);
3769
3770 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3771
3772 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3773
3774 void ProcessInstantiationType(struct Instantiation * inst)
3775 {
3776 yylloc = inst->loc;
3777 if(inst->_class)
3778 {
3779 struct MembersInit * members;
3780 struct Symbol * classSym;
3781 struct __ecereNameSpace__ecere__com__Class * _class;
3782
3783 classSym = inst->_class->symbol;
3784 _class = classSym ? classSym->registered : (((void *)0));
3785 if(!_class || _class->type != 5)
3786 DeclareStruct(inst->_class->name, 0x0);
3787 afterExternal = afterExternal ? afterExternal : curExternal;
3788 if(inst->exp)
3789 ProcessExpressionType(inst->exp);
3790 inst->isConstant = 0x1;
3791 if(inst->members)
3792 {
3793 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3794 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3795 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3796 int subMemberStackPos = 0;
3797
3798 for(members = (*inst->members).first; members; members = members->next)
3799 {
3800 switch(members->type)
3801 {
3802 case 1:
3803 {
3804 char name[1024];
3805 static unsigned int instMethodID = 0;
3806 struct External * external = curExternal;
3807 struct Context * context = curContext;
3808 struct Declarator * declarator = members->function->declarator;
3809 struct Identifier * nameID = GetDeclId(declarator);
3810 char * unmangled = nameID ? nameID->string : (((void *)0));
3811 struct Expression * exp;
3812 struct External * createdExternal = (((void *)0));
3813
3814 if(inCompiler)
3815 {
3816 char number[16];
3817
3818 strcpy(name, "__ecereInstMeth_");
3819 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
3820 strcat(name, "_");
3821 strcat(name, nameID->string);
3822 strcat(name, "_");
3823 sprintf(number, "_%08d", instMethodID++);
3824 strcat(name, number);
3825 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
3826 }
3827 if(declarator)
3828 {
3829 struct Symbol * symbol = declarator->symbol;
3830 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
3831
3832 if(method && method->type == 1)
3833 {
3834 symbol->method = method;
3835 ProcessMethodType(method);
3836 if(!symbol->type->thisClass)
3837 {
3838 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
3839 {
3840 if(!currentClass->symbol)
3841 currentClass->symbol = FindClass(currentClass->fullName);
3842 symbol->type->thisClass = currentClass->symbol;
3843 }
3844 else
3845 {
3846 if(!_class->symbol)
3847 _class->symbol = FindClass(_class->fullName);
3848 symbol->type->thisClass = _class->symbol;
3849 }
3850 }
3851 DeclareType(symbol->type, 0x1, 0x1);
3852 }
3853 else if(classSym)
3854 {
3855 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
3856 }
3857 }
3858 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
3859 if(nameID)
3860 {
3861 FreeSpecifier(nameID->_class);
3862 nameID->_class = (((void *)0));
3863 }
3864 if(inCompiler)
3865 {
3866 struct Type * type = declarator->symbol->type;
3867 struct External * oldExternal = curExternal;
3868
3869 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
3870 {
3871 struct External * externalDecl;
3872
3873 externalDecl = MkExternalDeclaration((((void *)0)));
3874 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
3875 if(createdExternal->function)
3876 {
3877 ProcessFunction(createdExternal->function);
3878 {
3879 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
3880
3881 externalDecl->declaration = decl;
3882 if(decl->symbol && !decl->symbol->pointerExternal)
3883 decl->symbol->pointerExternal = externalDecl;
3884 declarator->symbol->pointerExternal = externalDecl;
3885 }
3886 }
3887 }
3888 }
3889 else if(declarator)
3890 {
3891 curExternal = declarator->symbol->pointerExternal;
3892 ProcessFunction((struct FunctionDefinition *)members->function);
3893 }
3894 curExternal = external;
3895 curContext = context;
3896 if(inCompiler)
3897 {
3898 FreeClassFunction(members->function);
3899 exp = QMkExpId(name);
3900 members->type = 0;
3901 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
3902 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
3903 }
3904 break;
3905 }
3906 case 0:
3907 {
3908 if(members->dataMembers && classSym)
3909 {
3910 struct MemberInit * member;
3911 struct Location oldyyloc = yylloc;
3912
3913 for(member = (*members->dataMembers).first; member; member = member->next)
3914 {
3915 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
3916 if(member->initializer && !member->initializer->isConstant)
3917 inst->isConstant = 0x0;
3918 }
3919 yylloc = oldyyloc;
3920 }
3921 break;
3922 }
3923 }
3924 }
3925 }
3926 }
3927 }
3928
3929 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
3930 {
3931 if(inCompiler)
3932 {
3933 if(type->kind == 11)
3934 {
3935 struct Type * param;
3936
3937 if(declareParams)
3938 {
3939 for(param = type->params.first; param; param = param->next)
3940 DeclareType(param, declarePointers, 0x1);
3941 }
3942 DeclareType(type->returnType, declarePointers, 0x1);
3943 }
3944 else if(type->kind == 13 && declarePointers)
3945 DeclareType(type->type, declarePointers, 0x0);
3946 else if(type->kind == 8)
3947 {
3948 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
3949 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
3950 }
3951 else if(type->kind == 9 || type->kind == 10)
3952 {
3953 struct Type * member;
3954
3955 for(member = type->members.first; member; member = member->next)
3956 DeclareType(member, 0x0, 0x0);
3957 }
3958 else if(type->kind == 12)
3959 DeclareType(type->arrayType, declarePointers, 0x0);
3960 }
3961 }
3962
3963 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
3964
3965 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
3966 {
3967 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
3968 int id = 0;
3969 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3970 struct __ecereNameSpace__ecere__com__Class * sClass;
3971
3972 for(sClass = _class; sClass; sClass = sClass->base)
3973 {
3974 id = 0;
3975 if(sClass->templateClass)
3976 sClass = sClass->templateClass;
3977 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3978 {
3979 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
3980 {
3981 for(sClass = sClass->base; sClass; sClass = sClass->base)
3982 {
3983 if(sClass->templateClass)
3984 sClass = sClass->templateClass;
3985 id += sClass->templateParams.count;
3986 }
3987 break;
3988 }
3989 id++;
3990 }
3991 if(curParam)
3992 break;
3993 }
3994 if(curParam)
3995 {
3996 arg = &_class->templateArgs[id];
3997 if(arg && param->type == 0)
3998 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
3999 }
4000 return arg;
4001 }
4002
4003 extern struct Context * PushContext(void);
4004
4005 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
4006
4007 struct TemplatedType
4008 {
4009 uintptr_t key;
4010 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4011 struct __ecereNameSpace__ecere__sys__BTNode * left;
4012 struct __ecereNameSpace__ecere__sys__BTNode * right;
4013 int depth;
4014 struct TemplateParameter * param;
4015 } __attribute__ ((gcc_struct));
4016
4017 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
4018
4019 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
4020 {
4021 struct Context * context = PushContext();
4022
4023 context->templateTypesOnly = 0x1;
4024 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
4025 {
4026 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
4027
4028 for(; param; param = param->next)
4029 {
4030 if(param->type == 0 && param->identifier)
4031 {
4032 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
4033
4034 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4035 }
4036 }
4037 }
4038 else if(_class)
4039 {
4040 struct __ecereNameSpace__ecere__com__Class * sClass;
4041
4042 for(sClass = _class; sClass; sClass = sClass->base)
4043 {
4044 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
4045
4046 for(p = sClass->templateParams.first; p; p = p->next)
4047 {
4048 if(p->type == 0)
4049 {
4050 struct TemplateParameter * param = p->param;
4051 struct TemplatedType * type;
4052
4053 if(!param)
4054 {
4055 p->param = param = __extension__ ({
4056 struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
4057
4058 __ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->dataTypeString, __ecereInstance1;
4059 });
4060 }
4061 type = __extension__ ({
4062 struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
4063
4064 __ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
4065 });
4066 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4067 }
4068 }
4069 }
4070 }
4071 return context;
4072 }
4073
4074 extern void PopContext(struct Context * ctx);
4075
4076 extern void FreeContext(struct Context * context);
4077
4078 void FinishTemplatesContext(struct Context * context)
4079 {
4080 PopContext(context);
4081 FreeContext(context);
4082 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
4083 }
4084
4085 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
4086 {
4087 if(!method->dataType)
4088 {
4089 struct Context * context = SetupTemplatesContext(method->_class);
4090
4091 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4092 FinishTemplatesContext(context);
4093 if(method->type != 1 && method->dataType)
4094 {
4095 if(!method->dataType->thisClass && !method->dataType->staticMethod)
4096 {
4097 if(!method->_class->symbol)
4098 method->_class->symbol = FindClass(method->_class->fullName);
4099 method->dataType->thisClass = method->_class->symbol;
4100 }
4101 }
4102 }
4103 }
4104
4105 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
4106 {
4107 if(!prop->dataType)
4108 {
4109 struct Context * context = SetupTemplatesContext(prop->_class);
4110
4111 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
4112 FinishTemplatesContext(context);
4113 }
4114 }
4115
4116 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4117
4118 extern void FreeTypeName(struct TypeName * typeName);
4119
4120 static void ProcessDeclarator(struct Declarator * decl);
4121
4122 extern struct __ecereNameSpace__ecere__sys__OldList *  excludedSymbols;
4123
4124 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4125
4126 struct MethodImport
4127 {
4128 struct MethodImport * prev;
4129 struct MethodImport * next;
4130 char *  name;
4131 unsigned int isVirtual;
4132 } __attribute__ ((gcc_struct));
4133
4134 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
4135
4136 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
4137 {
4138 struct Symbol * symbol = method->symbol;
4139
4140 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4141 {
4142 unsigned int imported = 0x0;
4143 unsigned int dllImport = 0x0;
4144
4145 if(!method->dataType)
4146 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4147 if(!symbol || symbol->_import || method->type == 1)
4148 {
4149 if(!symbol || method->type == 1)
4150 {
4151 struct Symbol * classSym;
4152
4153 if(!method->_class->symbol)
4154 method->_class->symbol = FindClass(method->_class->fullName);
4155 classSym = method->_class->symbol;
4156 if(!classSym->_import)
4157 {
4158 struct ModuleImport * module;
4159
4160 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->name)
4161 module = FindModule(method->_class->module);
4162 else
4163 module = mainModule;
4164 classSym->_import = __extension__ ({
4165 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
4166
4167 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
4168 });
4169 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4170 }
4171 if(!symbol)
4172 {
4173 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4174 }
4175 if(!symbol->_import)
4176 {
4177 symbol->_import = (struct ClassImport *)__extension__ ({
4178 struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
4179
4180 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
4181 });
4182 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4183 }
4184 if(!symbol)
4185 {
4186 symbol->type = method->dataType;
4187 if(symbol->type)
4188 symbol->type->refCount++;
4189 }
4190 }
4191 if(!method->dataType->dllExport)
4192 {
4193 imported = 0x1;
4194 if(method->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->importType != 1)
4195 dllImport = 0x1;
4196 }
4197 }
4198 if(method->type != 1 && method->dataType)
4199 DeclareType(method->dataType, 0x1, 0x1);
4200 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4201 {
4202 struct Declaration * decl;
4203 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4204 struct Declarator * d;
4205 struct Declarator * funcDecl;
4206 struct External * external;
4207
4208 specifiers = MkList();
4209 declarators = MkList();
4210 if(dllImport)
4211 ListAdd(specifiers, MkSpecifier(EXTERN));
4212 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4213 ListAdd(specifiers, MkSpecifier(STATIC));
4214 if(method->type == 1)
4215 {
4216 ListAdd(specifiers, MkSpecifier(INT));
4217 d = MkDeclaratorIdentifier(MkIdentifier(name));
4218 }
4219 else
4220 {
4221 d = MkDeclaratorIdentifier(MkIdentifier(name));
4222 if(dllImport)
4223 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4224 {
4225 struct Context * context = SetupTemplatesContext(method->_class);
4226
4227 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4228 FinishTemplatesContext(context);
4229 }
4230 funcDecl = GetFuncDecl(d);
4231 if(dllImport)
4232 {
4233 struct Specifier * spec, * next;
4234
4235 for(spec = (*specifiers).first; spec; spec = next)
4236 {
4237 next = spec->next;
4238 if(spec->type == 5)
4239 {
4240 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4241 FreeSpecifier(spec);
4242 }
4243 }
4244 }
4245 if(method->dataType && !method->dataType->staticMethod)
4246 {
4247 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
4248 {
4249 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
4250 struct TypeName * thisParam = MkTypeName(MkListOne(MkSpecifierName(method->dataType->thisClass ? method->dataType->thisClass->string : method->_class->fullName)), (_class && _class->type == 1000) ? MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("this"))) : MkDeclaratorIdentifier(MkIdentifier("this")));
4251 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
4252 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4253
4254 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
4255 {
4256 struct TypeName * param = (*funcDecl->function.parameters).first;
4257
4258 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
4259 FreeTypeName(param);
4260 }
4261 if(!funcDecl->function.parameters)
4262 funcDecl->function.parameters = MkList();
4263 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
4264 }
4265 }
4266 }
4267 ProcessDeclarator(d);
4268 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4269 decl = MkDeclaration(specifiers, declarators);
4270 ReplaceThisClassSpecifiers(specifiers, method->_class);
4271 if(symbol->pointerExternal)
4272 {
4273 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4274
4275 {
4276 *functionSymbol = *symbol;
4277 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4278 if(functionSymbol->type)
4279 functionSymbol->type->refCount++;
4280 }
4281 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4282 symbol->pointerExternal->symbol = functionSymbol;
4283 }
4284 external = MkExternalDeclaration(decl);
4285 if(curExternal)
4286 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4287 external->symbol = symbol;
4288 symbol->pointerExternal = external;
4289 }
4290 else if(ast)
4291 {
4292 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4293 }
4294 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4295 }
4296 }
4297
4298 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4299 {
4300 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4301 {
4302 unsigned int first = 0x1;
4303 int p = 0;
4304 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4305 int lastParam = -1;
4306 char className[1024];
4307
4308 strcpy(className, _class->fullName);
4309 for(param = _class->templateParams.first; param; param = param->next)
4310 {
4311 {
4312 if(first)
4313 strcat(className, "<");
4314 if(!first)
4315 strcat(className, ", ");
4316 if(lastParam + 1 != p)
4317 {
4318 strcat(className, param->name);
4319 strcat(className, " = ");
4320 }
4321 strcat(className, param->name);
4322 first = 0x0;
4323 lastParam = p;
4324 }
4325 p++;
4326 }
4327 if(!first)
4328 {
4329 int len = strlen(className);
4330
4331 if(className[len - 1] == '>')
4332 className[len++] = ' ';
4333 className[len++] = '>';
4334 className[len++] = '\0';
4335 }
4336 return __ecereNameSpace__ecere__sys__CopyString(className);
4337 }
4338 else
4339 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4340 }
4341
4342 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4343 {
4344 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4345 {
4346 unsigned int first = 0x1;
4347 int p = 0;
4348 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4349 int lastParam = -1;
4350 char className[1024];
4351
4352 strcpy(className, _class->fullName);
4353 for(param = _class->templateParams.first; param; param = param->next)
4354 {
4355 {
4356 if(first)
4357 strcat(className, "<");
4358 if(!first)
4359 strcat(className, ", ");
4360 if(lastParam + 1 != p)
4361 {
4362 strcat(className, param->name);
4363 strcat(className, " = ");
4364 }
4365 strcat(className, param->name);
4366 first = 0x0;
4367 lastParam = p;
4368 }
4369 p++;
4370 }
4371 if(!first)
4372 {
4373 int len = strlen(className);
4374
4375 if(className[len - 1] == '>')
4376 className[len++] = ' ';
4377 className[len++] = '>';
4378 className[len++] = '\0';
4379 }
4380 return MkClassType(className);
4381 }
4382 else
4383 {
4384 return MkClassType(_class->fullName);
4385 }
4386 }
4387
4388 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4389 {
4390 if(specs != (((void *)0)) && _class)
4391 {
4392 struct Specifier * spec;
4393
4394 for(spec = specs->first; spec; spec = spec->next)
4395 {
4396 if(spec->type == 0 && spec->specifier == THISCLASS)
4397 {
4398 spec->type = 1;
4399 spec->name = ReplaceThisClass(_class);
4400 spec->symbol = FindClass(spec->name);
4401 }
4402 }
4403 }
4404 }
4405
4406 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4407
4408 struct __ecereNameSpace__ecere__com__GlobalFunction
4409 {
4410 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4411 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4412 char *  name;
4413 int (*  function)();
4414 struct __ecereNameSpace__ecere__com__Instance * module;
4415 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
4416 char *  dataTypeString;
4417 struct Type * dataType;
4418 void *  symbol;
4419 } __attribute__ ((gcc_struct));
4420
4421 extern struct Context * globalContext;
4422
4423 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4424
4425 struct FunctionImport
4426 {
4427 struct FunctionImport * prev;
4428 struct FunctionImport * next;
4429 char *  name;
4430 } __attribute__ ((gcc_struct));
4431
4432 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4433 {
4434 struct Symbol * symbol = function->symbol;
4435
4436 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4437 {
4438 unsigned int imported = 0x0;
4439 unsigned int dllImport = 0x0;
4440
4441 if(!function->dataType)
4442 {
4443 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4444 if(!function->dataType->thisClass)
4445 function->dataType->staticMethod = 0x1;
4446 }
4447 if(inCompiler)
4448 {
4449 if(!symbol)
4450 {
4451 struct ModuleImport * module = FindModule(function->module);
4452
4453 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4454 if(module->name)
4455 {
4456 if(!function->dataType->dllExport)
4457 {
4458 symbol->_import = (struct ClassImport *)__extension__ ({
4459 struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
4460
4461 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
4462 });
4463 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4464 }
4465 }
4466 {
4467 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4468 if(!symbol->type->thisClass)
4469 symbol->type->staticMethod = 0x1;
4470 }
4471 }
4472 imported = symbol->_import ? 0x1 : 0x0;
4473 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1)
4474 dllImport = 0x1;
4475 }
4476 DeclareType(function->dataType, 0x1, 0x1);
4477 if(inCompiler)
4478 {
4479 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4480 {
4481 struct Declaration * decl;
4482 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4483 struct Declarator * d;
4484 struct Declarator * funcDecl;
4485 struct External * external;
4486
4487 specifiers = MkList();
4488 declarators = MkList();
4489 ListAdd(specifiers, MkSpecifier(EXTERN));
4490 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4491 if(dllImport)
4492 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4493 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4494 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType == 1)
4495 {
4496 struct Specifier * spec;
4497
4498 for(spec = (*specifiers).first; spec; spec = spec->next)
4499 if(spec->type == 5 && spec->extDecl && spec->extDecl->type == 0 && !strcmp(spec->extDecl->s, "dllexport"))
4500 {
4501 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4502 FreeSpecifier(spec);
4503 break;
4504 }
4505 }
4506 funcDecl = GetFuncDecl(d);
4507 if(funcDecl && !funcDecl->function.parameters)
4508 {
4509 funcDecl->function.parameters = MkList();
4510 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4511 }
4512 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4513 {
4514 struct Context * oldCtx = curContext;
4515
4516 curContext = globalContext;
4517 decl = MkDeclaration(specifiers, declarators);
4518 curContext = oldCtx;
4519 }
4520 if(symbol->pointerExternal)
4521 {
4522 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4523
4524 {
4525 *functionSymbol = *symbol;
4526 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4527 if(functionSymbol->type)
4528 functionSymbol->type->refCount++;
4529 }
4530 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4531 symbol->pointerExternal->symbol = functionSymbol;
4532 }
4533 external = MkExternalDeclaration(decl);
4534 if(curExternal)
4535 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4536 external->symbol = symbol;
4537 symbol->pointerExternal = external;
4538 }
4539 else
4540 {
4541 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4542 }
4543 if(curExternal)
4544 symbol->id = curExternal->symbol->idCode;
4545 }
4546 }
4547 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1) ? 0x1 : 0x0;
4548 }
4549
4550 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4551
4552 struct GlobalData
4553 {
4554 uintptr_t key;
4555 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4556 struct __ecereNameSpace__ecere__sys__BTNode * left;
4557 struct __ecereNameSpace__ecere__sys__BTNode * right;
4558 int depth;
4559 struct __ecereNameSpace__ecere__com__Instance * module;
4560 char *  dataTypeString;
4561 struct Type * dataType;
4562 void *  symbol;
4563 char *  fullName;
4564 } __attribute__ ((gcc_struct));
4565
4566 void DeclareGlobalData(struct GlobalData * data)
4567 {
4568 struct Symbol * symbol = data->symbol;
4569
4570 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4571 {
4572 if(inCompiler)
4573 {
4574 if(!symbol)
4575 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4576 }
4577 if(!data->dataType)
4578 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4579 DeclareType(data->dataType, 0x1, 0x1);
4580 if(inCompiler)
4581 {
4582 if(!symbol->pointerExternal)
4583 {
4584 struct Declaration * decl;
4585 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4586 struct Declarator * d;
4587 struct External * external;
4588
4589 specifiers = MkList();
4590 declarators = MkList();
4591 ListAdd(specifiers, MkSpecifier(EXTERN));
4592 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4593 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4594 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4595 decl = MkDeclaration(specifiers, declarators);
4596 external = MkExternalDeclaration(decl);
4597 if(curExternal)
4598 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4599 external->symbol = symbol;
4600 symbol->pointerExternal = external;
4601 }
4602 else
4603 {
4604 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4605 }
4606 if(curExternal)
4607 symbol->id = curExternal->symbol->idCode;
4608 }
4609 }
4610 }
4611
4612 struct Conversion
4613 {
4614 struct Conversion * prev, * next;
4615 struct __ecereNameSpace__ecere__com__Property * convert;
4616 unsigned int isGet;
4617 struct Type * resultType;
4618 } __attribute__ ((gcc_struct));
4619
4620 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4621
4622 extern void Compiler_Warning(char *  format, ...);
4623
4624 void PrintType(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
4625
4626 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)
4627 {
4628 if(source && dest)
4629 {
4630 if(source->kind == 20 && dest->kind != 20)
4631 {
4632 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4633
4634 if(type)
4635 source = type;
4636 }
4637 if(dest->kind == 20 && source->kind != 20)
4638 {
4639 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4640
4641 if(type)
4642 dest = type;
4643 }
4644 if(dest->classObjectType == 2)
4645 {
4646 if(source->classObjectType != 3)
4647 return 0x1;
4648 else
4649 {
4650 if((dest->_class && strcmp(dest->_class->string, "class")) || (source->_class && strcmp(source->_class->string, "class")))
4651 {
4652 return 0x1;
4653 }
4654 }
4655 }
4656 else
4657 {
4658 if(source->classObjectType == 3)
4659 return 0x1;
4660 if(dest->classObjectType == 3 && source->classObjectType != 2)
4661 return 0x1;
4662 }
4663 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4664 {
4665 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4666 return 0x1;
4667 }
4668 if(dest->kind == 14 && source->kind != 0)
4669 return 0x1;
4670 if(dest->kind == 13 && dest->type->kind == 0 && ((source->kind == 8 && (!source->_class || !source->_class->registered || source->_class->registered->type == 1 || source->_class->registered->type == 0 || source->_class->registered->type == 5 || source->_class->registered->type == 1000)) || source->kind == 19 || source->kind == 13 || source->kind == 12 || source->kind == 11 || source->kind == 21))
4671 return 0x1;
4672 if(!isConversionExploration && source->kind == 13 && source->type->kind == 0 && ((dest->kind == 8 && (!dest->_class || !dest->_class->registered || dest->_class->registered->type == 1 || dest->_class->registered->type == 0 || dest->_class->registered->type == 5 || dest->_class->registered->type == 1000)) || dest->kind == 19 || dest->kind == 13 || dest->kind == 12 || dest->kind == 11 || dest->kind == 21))
4673 return 0x1;
4674 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4675 {
4676 if(source->_class->registered && source->_class->registered->type == 3)
4677 {
4678 if(conversions != (((void *)0)))
4679 {
4680 if(source->_class->registered == dest->_class->registered)
4681 return 0x1;
4682 }
4683 else
4684 {
4685 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4686
4687 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4688 ;
4689 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4690 ;
4691 if(sourceBase == destBase)
4692 return 0x1;
4693 }
4694 }
4695 else if(source->_class && dest->_class && (dest->classObjectType == source->classObjectType || !dest->classObjectType) && (enumBaseType || (!source->_class->registered || source->_class->registered->type != 4) || (!dest->_class->registered || dest->_class->registered->type != 4)) && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, dest->_class->registered))
4696 return 0x1;
4697 else
4698 {
4699 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4 && ((source->_class && source->_class->registered && source->_class->registered->type != 4) || source->kind == 8))
4700 {
4701 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4702 {
4703 return 0x1;
4704 }
4705 }
4706 }
4707 }
4708 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
4709 return 0x1;
4710 if(doConversion)
4711 {
4712 if(source->kind == 8)
4713 {
4714 struct __ecereNameSpace__ecere__com__Class * _class;
4715
4716 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4717 {
4718 struct __ecereNameSpace__ecere__com__Property * convert;
4719
4720 for(convert = _class->conversions.first; convert; convert = convert->next)
4721 {
4722 if(convert->memberAccess == 1 || _class->module == privateModule)
4723 {
4724 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4725
4726 if(!convert->dataType)
4727 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4728 if(MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x0, 0x1, 0x0, 0x1))
4729 {
4730 if(!conversions && !convert->Get)
4731 return 0x1;
4732 else if(conversions != (((void *)0)))
4733 {
4734 if(_class->type == 3 && convert->dataType->kind == 8 && convert->dataType->_class && convert->dataType->_class->registered && _class->base == convert->dataType->_class->registered->base && (dest->kind != 8 || dest->_class->registered != _class->base))
4735 return 0x1;
4736 else
4737 {
4738 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4739
4740 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4741 return 0x1;
4742 }
4743 }
4744 }
4745 }
4746 }
4747 }
4748 }
4749 if(dest->kind == 8)
4750 {
4751 struct __ecereNameSpace__ecere__com__Class * _class;
4752
4753 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4754 {
4755 struct __ecereNameSpace__ecere__com__Property * convert;
4756
4757 for(convert = _class->conversions.first; convert; convert = convert->next)
4758 {
4759 if(convert->memberAccess == 1 || _class->module == privateModule)
4760 {
4761 if(!convert->dataType)
4762 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4763 if(convert->dataType != dest && MatchTypes(source, convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1))
4764 {
4765 if(!conversions && !convert->Set)
4766 return 0x1;
4767 else if(conversions != (((void *)0)))
4768 {
4769 if(_class->type == 3 && convert->dataType->kind == 8 && convert->dataType->_class && convert->dataType->_class->registered && _class->base == convert->dataType->_class->registered->base && (source->kind != 8 || source->_class->registered != _class->base))
4770 return 0x1;
4771 else
4772 {
4773 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4774
4775 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4776 return 0x1;
4777 }
4778 }
4779 }
4780 }
4781 }
4782 }
4783 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
4784 {
4785 if(!dest->_class->registered->dataType)
4786 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
4787 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
4788 {
4789 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4790 {
4791 return 0x1;
4792 }
4793 }
4794 }
4795 }
4796 if(source->kind == 8)
4797 {
4798 struct __ecereNameSpace__ecere__com__Class * _class;
4799
4800 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4801 {
4802 struct __ecereNameSpace__ecere__com__Property * convert;
4803
4804 for(convert = _class->conversions.first; convert; convert = convert->next)
4805 {
4806 if(convert->memberAccess == 1 || _class->module == privateModule)
4807 {
4808 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4809
4810 if(!convert->dataType)
4811 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4812 if(convert->dataType != source && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x1))
4813 {
4814 if(!conversions && !convert->Get)
4815 return 0x1;
4816 else if(conversions != (((void *)0)))
4817 {
4818 if(_class->type == 3 && convert->dataType->kind == 8 && convert->dataType->_class && convert->dataType->_class->registered && _class->base == convert->dataType->_class->registered->base && (dest->kind != 8 || dest->_class->registered != _class->base))
4819 return 0x1;
4820 else
4821 {
4822 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4823
4824 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4825 return 0x1;
4826 }
4827 }
4828 }
4829 }
4830 }
4831 }
4832 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
4833 {
4834 if(!source->_class->registered->dataType)
4835 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
4836 if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4837 {
4838 return 0x1;
4839 }
4840 }
4841 }
4842 }
4843 if(source->kind == 8 || source->kind == 19)
4844 ;
4845 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
4846 return 0x1;
4847 else if(dest->kind == 7 && source->kind == 6)
4848 return 0x1;
4849 else if(dest->kind == 2 && (source->kind == 1 || source->kind == 24))
4850 return 0x1;
4851 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 23))
4852 return 0x1;
4853 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 22 || source->kind == 23))
4854 return 0x1;
4855 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 23 || source->kind == 4))
4856 return 0x1;
4857 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 4 || source->kind == 22))
4858 return 0x1;
4859 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))
4860 return 0x1;
4861 else if(dest->kind == 15 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 5 || source->kind == 4 || source->kind == 22 || source->kind == 23))
4862 return 0x1;
4863 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && ((source->kind == 11 || (source->kind == 13 && source->type->kind == 11) || source->kind == 16)))
4864 {
4865 struct Type * paramSource, * paramDest;
4866
4867 if(dest->kind == 16)
4868 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
4869 if(source->kind == 16)
4870 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
4871 if(dest->kind == 13 && dest->type->kind == 11)
4872 dest = dest->type;
4873 if(source->kind == 13 && source->type->kind == 11)
4874 source = source->type;
4875 if(dest->kind == 16)
4876 dest = dest->method->dataType;
4877 if(source->kind == 16)
4878 source = source->method->dataType;
4879 paramSource = source->params.first;
4880 if(paramSource && paramSource->kind == 0)
4881 paramSource = (((void *)0));
4882 paramDest = dest->params.first;
4883 if(paramDest && paramDest->kind == 0)
4884 paramDest = (((void *)0));
4885 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
4886 {
4887 if(!paramDest || (!(paramDest->kind == 13 && paramDest->type && paramDest->type->kind == 0) && (paramDest->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, paramDest->_class->registered))))
4888 {
4889 if(paramDest && paramDest->kind == 8)
4890 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), paramDest->_class->string);
4891 else
4892 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class should not take an object\n", (((void *)0))));
4893 return 0x0;
4894 }
4895 paramDest = paramDest->next;
4896 }
4897 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
4898 {
4899 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
4900 {
4901 if(dest->thisClass)
4902 {
4903 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
4904 {
4905 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4906 return 0x0;
4907 }
4908 }
4909 else
4910 {
4911 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
4912 {
4913 if(owningClassDest)
4914 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
4915 else
4916 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "overriding class expected to be derived from method class\n", (((void *)0))));
4917 return 0x0;
4918 }
4919 }
4920 paramSource = paramSource->next;
4921 }
4922 else
4923 {
4924 if(dest->thisClass)
4925 {
4926 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
4927 {
4928 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4929 return 0x0;
4930 }
4931 }
4932 else
4933 {
4934 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
4935 {
4936 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), source->thisClass->registered->fullName);
4937 return 0x0;
4938 }
4939 }
4940 }
4941 }
4942 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4943 {
4944 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible return type for function\n", (((void *)0))));
4945 return 0x0;
4946 }
4947 for(; paramDest; paramDest = paramDest->next)
4948 {
4949 if(!paramSource)
4950 {
4951 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "not enough parameters\n", (((void *)0))));
4952 return 0x0;
4953 }
4954 {
4955 struct Type * paramDestType = paramDest;
4956 struct Type * paramSourceType = paramSource;
4957 struct Type * type = paramDestType;
4958
4959 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
4960 {
4961 int id = 0;
4962 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4963 struct __ecereNameSpace__ecere__com__Class * sClass;
4964
4965 for(sClass = owningClassSource; sClass; sClass = sClass->base)
4966 {
4967 id = 0;
4968 if(sClass->templateClass)
4969 sClass = sClass->templateClass;
4970 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4971 {
4972 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
4973 {
4974 for(sClass = sClass->base; sClass; sClass = sClass->base)
4975 {
4976 if(sClass->templateClass)
4977 sClass = sClass->templateClass;
4978 id += sClass->templateParams.count;
4979 }
4980 break;
4981 }
4982 id++;
4983 }
4984 if(curParam)
4985 break;
4986 }
4987 if(curParam)
4988 {
4989 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
4990
4991 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
4992 }
4993 }
4994 if(!MatchTypes(paramDestType, paramSourceType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0) && (!acceptReversedParams || !MatchTypes(paramSourceType, paramDestType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0)))
4995 {
4996 char type[1024];
4997
4998 type[0] = (char)0;
4999 PrintType(paramDest, type, 0x0, 0x1);
5000 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
5001 if(paramDestType != paramDest)
5002 FreeType(paramDestType);
5003 return 0x0;
5004 }
5005 if(paramDestType != paramDest)
5006 FreeType(paramDestType);
5007 }
5008 paramSource = paramSource->next;
5009 }
5010 if(paramSource)
5011 {
5012 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many parameters\n", (((void *)0))));
5013 return 0x0;
5014 }
5015 return 0x1;
5016 }
5017 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
5018 {
5019 return 0x1;
5020 }
5021 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
5022 {
5023 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5024 return 0x1;
5025 }
5026 }
5027 return 0x0;
5028 }
5029
5030 static void FreeConvert(struct Conversion * convert)
5031 {
5032 if(convert->resultType)
5033 FreeType(convert->resultType);
5034 }
5035
5036 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
5037
5038 struct __ecereNameSpace__ecere__com__BTNamedLink
5039 {
5040 char *  name;
5041 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
5042 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
5043 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
5044 int depth;
5045 void *  data;
5046 } __attribute__ ((gcc_struct));
5047
5048 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
5049
5050 struct __ecereNameSpace__ecere__com__EnumClassData
5051 {
5052 struct __ecereNameSpace__ecere__sys__OldList values;
5053 int largest;
5054 } __attribute__ ((gcc_struct));
5055
5056 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
5057
5058 struct __ecereNameSpace__ecere__sys__NamedLink
5059 {
5060 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
5061 struct __ecereNameSpace__ecere__sys__NamedLink * next;
5062 char *  name;
5063 void *  data;
5064 } __attribute__ ((gcc_struct));
5065
5066 extern void FreeExpContents(struct Expression * exp);
5067
5068 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
5069
5070 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
5071
5072 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
5073
5074 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
5075
5076 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (*  freeFn)(void * ));
5077
5078 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5079 {
5080 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
5081
5082 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)))
5083 {
5084 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
5085
5086 if(_class->type == 4)
5087 {
5088 struct __ecereNameSpace__ecere__sys__OldList converts = 
5089 {
5090 0, 0, 0, 0, 0
5091 };
5092 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5093
5094 type->kind = 8;
5095 if(!_class->symbol)
5096 _class->symbol = FindClass(_class->fullName);
5097 type->_class = _class->symbol;
5098 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0))
5099 {
5100 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5101 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5102
5103 if(enumClass)
5104 {
5105 struct __ecereNameSpace__ecere__com__Class * baseClass;
5106
5107 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
5108 {
5109 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
5110
5111 for(value = e->values.first; value; value = value->next)
5112 {
5113 if(!strcmp(value->name, string))
5114 break;
5115 }
5116 if(value)
5117 {
5118 FreeExpContents(sourceExp);
5119 FreeType(sourceExp->expType);
5120 sourceExp->isConstant = 0x1;
5121 sourceExp->expType = MkClassType(baseClass->fullName);
5122 {
5123 char constant[256];
5124
5125 sourceExp->type = 2;
5126 if(!strcmp(baseClass->dataTypeString, "int"))
5127 sprintf(constant, "%d", (int)value->data);
5128 else
5129 sprintf(constant, "0x%X", (int)value->data);
5130 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5131 }
5132 while(converts.first)
5133 {
5134 struct Conversion * convert = converts.first;
5135
5136 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
5137 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5138 }
5139 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5140 return 0x1;
5141 }
5142 }
5143 }
5144 }
5145 if(converts.first)
5146 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
5147 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5148 }
5149 }
5150 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)))
5151 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5152 return 0x1;
5153 return 0x0;
5154 }
5155
5156 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5157
5158 struct __ecereNameSpace__ecere__com__SubModule
5159 {
5160 struct __ecereNameSpace__ecere__com__SubModule * prev;
5161 struct __ecereNameSpace__ecere__com__SubModule * next;
5162 struct __ecereNameSpace__ecere__com__Instance * module;
5163 int importMode;
5164 } __attribute__ ((gcc_struct));
5165
5166 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5167 {
5168 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5169
5170 if(searchFor == searchIn)
5171 return 0x1;
5172 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
5173 {
5174 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->application)
5175 {
5176 if(ModuleVisibility(subModule->module, searchFor))
5177 return 0x1;
5178 }
5179 }
5180 return 0x0;
5181 }
5182
5183 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5184
5185 struct __ecereNameSpace__ecere__com__Application
5186 {
5187 int argc;
5188 char * *  argv;
5189 int exitCode;
5190 unsigned int isGUIApp;
5191 struct __ecereNameSpace__ecere__sys__OldList allModules;
5192 char *  parsedCommand;
5193 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5194 } __attribute__ ((gcc_struct));
5195
5196 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5197 {
5198 struct __ecereNameSpace__ecere__com__Instance * module;
5199
5200 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))
5201 return 0x1;
5202 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))
5203 return 0x1;
5204 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))
5205 return 0x1;
5206 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)
5207 {
5208 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5209 return 0x1;
5210 }
5211 return 0x0;
5212 }
5213
5214 extern unsigned long strtoul(const char *  nptr, char * *  endptr, int base);
5215
5216 void ReadString(char *  output, char *  string);
5217
5218 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5219
5220 extern struct TypeName * QMkClass(char *  spec, struct Declarator * decl);
5221
5222 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5223
5224 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
5225 {
5226 struct Type * source = sourceExp->expType;
5227 struct Type * realDest = dest;
5228 struct Type * backupSourceExpType = (((void *)0));
5229
5230 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
5231 return 0x1;
5232 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5233 {
5234 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
5235 {
5236 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5237
5238 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5239 ;
5240 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5241 ;
5242 if(sourceBase == destBase)
5243 return 0x1;
5244 }
5245 }
5246 if(source)
5247 {
5248 struct __ecereNameSpace__ecere__sys__OldList * specs;
5249 unsigned int flag = 0x0;
5250 long long value = (((int)0x7fffffff));
5251
5252 source->refCount++;
5253 dest->refCount++;
5254 if(sourceExp->type == 2)
5255 {
5256 if(source->isSigned)
5257 value = strtoll(sourceExp->constant, (((void *)0)), 0);
5258 else
5259 value = strtoull(sourceExp->constant, (((void *)0)), 0);
5260 }
5261 else if(sourceExp->type == 4 && sourceExp->op.op == '-' && !sourceExp->op.exp1 && sourceExp->op.exp2 && sourceExp->op.exp2->type == 2)
5262 {
5263 if(source->isSigned)
5264 value = -strtoll(sourceExp->op.exp2->constant, (((void *)0)), 0);
5265 else
5266 value = -strtoull(sourceExp->op.exp2->constant, (((void *)0)), 0);
5267 }
5268 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
5269 {
5270 FreeType(source);
5271 source = __extension__ ({
5272 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5273
5274 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0x0, __ecereInstance1->refCount = 1, __ecereInstance1;
5275 });
5276 }
5277 if(dest->kind == 8)
5278 {
5279 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5280
5281 if(_class && _class->type == 3)
5282 {
5283 if(source->kind != 8)
5284 {
5285 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5286 struct Type * tempDest, * tempSource;
5287
5288 for(; _class->base->type != 1000; _class = _class->base)
5289 ;
5290 tempSource = dest;
5291 tempDest = tempType;
5292 tempType->kind = 8;
5293 if(!_class->symbol)
5294 _class->symbol = FindClass(_class->fullName);
5295 tempType->_class = _class->symbol;
5296 tempType->truth = dest->truth;
5297 if(tempType->_class)
5298 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5299 backupSourceExpType = sourceExp->expType;
5300 sourceExp->expType = dest;
5301 dest->refCount++;
5302 flag = 0x1;
5303 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5304 }
5305 }
5306 if(_class && _class->type == 2 && source->kind != 8)
5307 {
5308 if(!dest->_class->registered->dataType)
5309 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5310 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5311 {
5312 FreeType(source);
5313 FreeType(sourceExp->expType);
5314 source = sourceExp->expType = MkClassType(dest->_class->string);
5315 source->refCount++;
5316 }
5317 }
5318 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5319 {
5320 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5321 struct Declarator * decl;
5322 char string[1024];
5323
5324 ReadString(string, sourceExp->string);
5325 decl = SpecDeclFromString(string, specs, (((void *)0)));
5326 FreeExpContents(sourceExp);
5327 FreeType(sourceExp->expType);
5328 sourceExp->type = 26;
5329 sourceExp->_classExp.specifiers = specs;
5330 sourceExp->_classExp.decl = decl;
5331 sourceExp->expType = dest;
5332 dest->refCount++;
5333 FreeType(source);
5334 FreeType(dest);
5335 if(backupSourceExpType)
5336 FreeType(backupSourceExpType);
5337 return 0x1;
5338 }
5339 }
5340 else if(source->kind == 8)
5341 {
5342 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5343
5344 if(_class && (_class->type == 3 || !strcmp(_class->fullName, "bool") || _class->type == 2))
5345 {
5346 if(dest->kind != 8)
5347 {
5348 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5349 struct Type * tempDest, * tempSource;
5350
5351 if(!source->_class->registered->dataType)
5352 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5353 for(; _class->base->type != 1000; _class = _class->base)
5354 ;
5355 tempDest = source;
5356 tempSource = tempType;
5357 tempType->kind = 8;
5358 tempType->_class = FindClass(_class->fullName);
5359 tempType->truth = source->truth;
5360 tempType->classObjectType = source->classObjectType;
5361 if(tempType->_class)
5362 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5363 if(conversions->last)
5364 {
5365 ((struct Conversion *)conversions->last)->resultType = dest;
5366 dest->refCount++;
5367 }
5368 FreeType(sourceExp->expType);
5369 sourceExp->expType = MkClassType(_class->fullName);
5370 sourceExp->expType->truth = source->truth;
5371 sourceExp->expType->classObjectType = source->classObjectType;
5372 if(!sourceExp->destType)
5373 {
5374 FreeType(sourceExp->destType);
5375 sourceExp->destType = sourceExp->expType;
5376 if(sourceExp->expType)
5377 sourceExp->expType->refCount++;
5378 }
5379 if(!_class->dataType)
5380 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5381 FreeType(dest);
5382 dest = MkClassType(source->_class->string);
5383 dest->truth = source->truth;
5384 dest->classObjectType = source->classObjectType;
5385 FreeType(source);
5386 source = _class->dataType;
5387 source->refCount++;
5388 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5389 }
5390 }
5391 }
5392 if(!flag)
5393 {
5394 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5395 {
5396 FreeType(source);
5397 FreeType(dest);
5398 return 0x1;
5399 }
5400 }
5401 if(dest->kind == 8)
5402 {
5403 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5404
5405 if(_class && !dest->truth && (_class->type == 3 || !strcmp(_class->fullName, "bool") || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5406 {
5407 if(_class->type == 0 || _class->type == 5)
5408 {
5409 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5410
5411 *newExp = *sourceExp;
5412 if(sourceExp->destType)
5413 sourceExp->destType->refCount++;
5414 if(sourceExp->expType)
5415 sourceExp->expType->refCount++;
5416 sourceExp->type = 11;
5417 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5418 sourceExp->cast.exp = newExp;
5419 FreeType(sourceExp->expType);
5420 sourceExp->expType = (((void *)0));
5421 ProcessExpressionType(sourceExp);
5422 if(!inCompiler)
5423 {
5424 FreeType(sourceExp->expType);
5425 sourceExp->expType = dest;
5426 }
5427 FreeType(source);
5428 if(inCompiler)
5429 FreeType(dest);
5430 if(backupSourceExpType)
5431 FreeType(backupSourceExpType);
5432 return 0x1;
5433 }
5434 if(!_class->dataType)
5435 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5436 FreeType(dest);
5437 dest = _class->dataType;
5438 dest->refCount++;
5439 }
5440 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))
5441 {
5442 specs = MkListOne(MkSpecifier(DOUBLE));
5443 }
5444 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))
5445 {
5446 specs = MkListOne(MkSpecifier(FLOAT));
5447 }
5448 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))
5449 {
5450 specs = MkList();
5451 if(!dest->isSigned)
5452 ListAdd(specs, MkSpecifier(UNSIGNED));
5453 ListAdd(specs, MkSpecifier(INT64));
5454 }
5455 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
5456 {
5457 specs = MkList();
5458 if(!dest->isSigned)
5459 ListAdd(specs, MkSpecifier(UNSIGNED));
5460 ListAdd(specs, MkSpecifier(INT));
5461 }
5462 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5463 {
5464 specs = MkList();
5465 if(!dest->isSigned)
5466 ListAdd(specs, MkSpecifier(UNSIGNED));
5467 ListAdd(specs, MkSpecifier(SHORT));
5468 }
5469 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 24 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5470 {
5471 specs = MkList();
5472 if(!dest->isSigned)
5473 ListAdd(specs, MkSpecifier(UNSIGNED));
5474 ListAdd(specs, MkSpecifier(CHAR));
5475 }
5476 else
5477 {
5478 FreeType(source);
5479 FreeType(dest);
5480 if(backupSourceExpType)
5481 {
5482 if(sourceExp->expType)
5483 FreeType(sourceExp->expType);
5484 sourceExp->expType = backupSourceExpType;
5485 }
5486 return 0x0;
5487 }
5488 }
5489 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))
5490 {
5491 specs = MkListOne(MkSpecifier(DOUBLE));
5492 }
5493 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))
5494 {
5495 specs = MkListOne(MkSpecifier(FLOAT));
5496 }
5497 else if(dest->kind == 24 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (value == 1 || value == 0))
5498 {
5499 specs = MkList();
5500 ListAdd(specs, MkSpecifier(BOOL));
5501 }
5502 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)))
5503 {
5504 specs = MkList();
5505 if(!dest->isSigned)
5506 ListAdd(specs, MkSpecifier(UNSIGNED));
5507 ListAdd(specs, MkSpecifier(CHAR));
5508 }
5509 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)))))
5510 {
5511 specs = MkList();
5512 if(!dest->isSigned)
5513 ListAdd(specs, MkSpecifier(UNSIGNED));
5514 ListAdd(specs, MkSpecifier(SHORT));
5515 }
5516 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3))
5517 {
5518 specs = MkList();
5519 if(!dest->isSigned)
5520 ListAdd(specs, MkSpecifier(UNSIGNED));
5521 ListAdd(specs, MkSpecifier(INT));
5522 }
5523 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5524 {
5525 specs = MkList();
5526 if(!dest->isSigned)
5527 ListAdd(specs, MkSpecifier(UNSIGNED));
5528 ListAdd(specs, MkSpecifier(INT64));
5529 }
5530 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
5531 {
5532 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5533 }
5534 else
5535 {
5536 FreeType(source);
5537 FreeType(dest);
5538 if(backupSourceExpType)
5539 {
5540 if(sourceExp->expType)
5541 FreeType(sourceExp->expType);
5542 sourceExp->expType = backupSourceExpType;
5543 }
5544 return 0x0;
5545 }
5546 if(!flag)
5547 {
5548 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5549
5550 *newExp = *sourceExp;
5551 newExp->prev = (((void *)0));
5552 newExp->next = (((void *)0));
5553 if(sourceExp->destType)
5554 sourceExp->destType->refCount++;
5555 if(sourceExp->expType)
5556 sourceExp->expType->refCount++;
5557 sourceExp->type = 11;
5558 if(realDest->kind == 8)
5559 {
5560 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5561 FreeList(specs, FreeSpecifier);
5562 }
5563 else
5564 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5565 if(newExp->type == 4)
5566 {
5567 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5568 }
5569 else
5570 sourceExp->cast.exp = newExp;
5571 FreeType(sourceExp->expType);
5572 sourceExp->expType = (((void *)0));
5573 ProcessExpressionType(sourceExp);
5574 }
5575 else
5576 FreeList(specs, FreeSpecifier);
5577 FreeType(dest);
5578 FreeType(source);
5579 if(backupSourceExpType)
5580 FreeType(backupSourceExpType);
5581 return 0x1;
5582 }
5583 else
5584 {
5585 while((sourceExp->type == 5 || sourceExp->type == 34) && sourceExp->list)
5586 sourceExp = (*sourceExp->list).last;
5587 if(sourceExp->type == 0)
5588 {
5589 struct Identifier * id = sourceExp->identifier;
5590
5591 if(dest->kind == 8)
5592 {
5593 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5594 {
5595 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5596 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5597
5598 if(enumClass)
5599 {
5600 for(; _class && _class->type == 4; _class = _class->base)
5601 {
5602 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5603 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5604
5605 for(value = e->values.first; value; value = value->next)
5606 {
5607 if(!strcmp(value->name, id->string))
5608 break;
5609 }
5610 if(value)
5611 {
5612 FreeExpContents(sourceExp);
5613 FreeType(sourceExp->expType);
5614 sourceExp->isConstant = 0x1;
5615 sourceExp->expType = MkClassType(_class->fullName);
5616 {
5617 char constant[256];
5618
5619 sourceExp->type = 2;
5620 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5621 sprintf(constant, "%d", (int)value->data);
5622 else
5623 sprintf(constant, "0x%X", (int)value->data);
5624 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5625 }
5626 return 0x1;
5627 }
5628 }
5629 }
5630 }
5631 }
5632 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5633 return 0x1;
5634 }
5635 }
5636 return 0x0;
5637 }
5638
5639 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5640 {
5641 int value2 = op2->i;
5642
5643 exp->type = 2;
5644 exp->string = PrintInt(op1->i + value2);
5645 if(!exp->expType)
5646 {
5647 exp->expType = op1->type;
5648 if(op1->type)
5649 op1->type->refCount++;
5650 }
5651 return 0x1;
5652 }
5653
5654 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5655 {
5656 unsigned int value2 = op2->ui;
5657
5658 exp->type = 2;
5659 exp->string = PrintUInt(op1->ui + value2);
5660 if(!exp->expType)
5661 {
5662 exp->expType = op1->type;
5663 if(op1->type)
5664 op1->type->refCount++;
5665 }
5666 return 0x1;
5667 }
5668
5669 static unsigned int Int64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5670 {
5671 int value2 = op2->i;
5672
5673 exp->type = 2;
5674 exp->string = PrintInt64(op1->i + value2);
5675 if(!exp->expType)
5676 {
5677 exp->expType = op1->type;
5678 if(op1->type)
5679 op1->type->refCount++;
5680 }
5681 return 0x1;
5682 }
5683
5684 static unsigned int UInt64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5685 {
5686 unsigned int value2 = op2->ui;
5687
5688 exp->type = 2;
5689 exp->string = PrintUInt64(op1->ui + value2);
5690 if(!exp->expType)
5691 {
5692 exp->expType = op1->type;
5693 if(op1->type)
5694 op1->type->refCount++;
5695 }
5696 return 0x1;
5697 }
5698
5699 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5700 {
5701 short value2 = op2->s;
5702
5703 exp->type = 2;
5704 exp->string = PrintShort(op1->s + value2);
5705 if(!exp->expType)
5706 {
5707 exp->expType = op1->type;
5708 if(op1->type)
5709 op1->type->refCount++;
5710 }
5711 return 0x1;
5712 }
5713
5714 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5715 {
5716 unsigned short value2 = op2->us;
5717
5718 exp->type = 2;
5719 exp->string = PrintUShort(op1->us + value2);
5720 if(!exp->expType)
5721 {
5722 exp->expType = op1->type;
5723 if(op1->type)
5724 op1->type->refCount++;
5725 }
5726 return 0x1;
5727 }
5728
5729 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5730 {
5731 char value2 = op2->c;
5732
5733 exp->type = 2;
5734 exp->string = PrintChar(op1->c + value2);
5735 if(!exp->expType)
5736 {
5737 exp->expType = op1->type;
5738 if(op1->type)
5739 op1->type->refCount++;
5740 }
5741 return 0x1;
5742 }
5743
5744 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5745 {
5746 unsigned char value2 = op2->uc;
5747
5748 exp->type = 2;
5749 exp->string = PrintUChar(op1->uc + value2);
5750 if(!exp->expType)
5751 {
5752 exp->expType = op1->type;
5753 if(op1->type)
5754 op1->type->refCount++;
5755 }
5756 return 0x1;
5757 }
5758
5759 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5760 {
5761 float value2 = op2->f;
5762
5763 exp->type = 2;
5764 exp->string = PrintFloat(op1->f + value2);
5765 if(!exp->expType)
5766 {
5767 exp->expType = op1->type;
5768 if(op1->type)
5769 op1->type->refCount++;
5770 }
5771 return 0x1;
5772 }
5773
5774 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5775 {
5776 double value2 = op2->d;
5777
5778 exp->type = 2;
5779 exp->string = PrintDouble(op1->d + value2);
5780 if(!exp->expType)
5781 {
5782 exp->expType = op1->type;
5783 if(op1->type)
5784 op1->type->refCount++;
5785 }
5786 return 0x1;
5787 }
5788
5789 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5790 {
5791 int value2 = op2->i;
5792
5793 exp->type = 2;
5794 exp->string = PrintInt(op1->i - value2);
5795 if(!exp->expType)
5796 {
5797 exp->expType = op1->type;
5798 if(op1->type)
5799 op1->type->refCount++;
5800 }
5801 return 0x1;
5802 }
5803
5804 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5805 {
5806 unsigned int value2 = op2->ui;
5807
5808 exp->type = 2;
5809 exp->string = PrintUInt(op1->ui - value2);
5810 if(!exp->expType)
5811 {
5812 exp->expType = op1->type;
5813 if(op1->type)
5814 op1->type->refCount++;
5815 }
5816 return 0x1;
5817 }
5818
5819 static unsigned int Int64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5820 {
5821 int value2 = op2->i;
5822
5823 exp->type = 2;
5824 exp->string = PrintInt64(op1->i - value2);
5825 if(!exp->expType)
5826 {
5827 exp->expType = op1->type;
5828 if(op1->type)
5829 op1->type->refCount++;
5830 }
5831 return 0x1;
5832 }
5833
5834 static unsigned int UInt64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5835 {
5836 unsigned int value2 = op2->ui;
5837
5838 exp->type = 2;
5839 exp->string = PrintUInt64(op1->ui - value2);
5840 if(!exp->expType)
5841 {
5842 exp->expType = op1->type;
5843 if(op1->type)
5844 op1->type->refCount++;
5845 }
5846 return 0x1;
5847 }
5848
5849 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5850 {
5851 short value2 = op2->s;
5852
5853 exp->type = 2;
5854 exp->string = PrintShort(op1->s - value2);
5855 if(!exp->expType)
5856 {
5857 exp->expType = op1->type;
5858 if(op1->type)
5859 op1->type->refCount++;
5860 }
5861 return 0x1;
5862 }
5863
5864 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5865 {
5866 unsigned short value2 = op2->us;
5867
5868 exp->type = 2;
5869 exp->string = PrintUShort(op1->us - value2);
5870 if(!exp->expType)
5871 {
5872 exp->expType = op1->type;
5873 if(op1->type)
5874 op1->type->refCount++;
5875 }
5876 return 0x1;
5877 }
5878
5879 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5880 {
5881 char value2 = op2->c;
5882
5883 exp->type = 2;
5884 exp->string = PrintChar(op1->c - value2);
5885 if(!exp->expType)
5886 {
5887 exp->expType = op1->type;
5888 if(op1->type)
5889 op1->type->refCount++;
5890 }
5891 return 0x1;
5892 }
5893
5894 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5895 {
5896 unsigned char value2 = op2->uc;
5897
5898 exp->type = 2;
5899 exp->string = PrintUChar(op1->uc - value2);
5900 if(!exp->expType)
5901 {
5902 exp->expType = op1->type;
5903 if(op1->type)
5904 op1->type->refCount++;
5905 }
5906 return 0x1;
5907 }
5908
5909 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5910 {
5911 float value2 = op2->f;
5912
5913 exp->type = 2;
5914 exp->string = PrintFloat(op1->f - value2);
5915 if(!exp->expType)
5916 {
5917 exp->expType = op1->type;
5918 if(op1->type)
5919 op1->type->refCount++;
5920 }
5921 return 0x1;
5922 }
5923
5924 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5925 {
5926 double value2 = op2->d;
5927
5928 exp->type = 2;
5929 exp->string = PrintDouble(op1->d - value2);
5930 if(!exp->expType)
5931 {
5932 exp->expType = op1->type;
5933 if(op1->type)
5934 op1->type->refCount++;
5935 }
5936 return 0x1;
5937 }
5938
5939 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5940 {
5941 int value2 = op2->i;
5942
5943 exp->type = 2;
5944 exp->string = PrintInt(op1->i * value2);
5945 if(!exp->expType)
5946 {
5947 exp->expType = op1->type;
5948 if(op1->type)
5949 op1->type->refCount++;
5950 }
5951 return 0x1;
5952 }
5953
5954 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5955 {
5956 unsigned int value2 = op2->ui;
5957
5958 exp->type = 2;
5959 exp->string = PrintUInt(op1->ui * value2);
5960 if(!exp->expType)
5961 {
5962 exp->expType = op1->type;
5963 if(op1->type)
5964 op1->type->refCount++;
5965 }
5966 return 0x1;
5967 }
5968
5969 static unsigned int Int64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5970 {
5971 int value2 = op2->i;
5972
5973 exp->type = 2;
5974 exp->string = PrintInt64(op1->i * value2);
5975 if(!exp->expType)
5976 {
5977 exp->expType = op1->type;
5978 if(op1->type)
5979 op1->type->refCount++;
5980 }
5981 return 0x1;
5982 }
5983
5984 static unsigned int UInt64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5985 {
5986 unsigned int value2 = op2->ui;
5987
5988 exp->type = 2;
5989 exp->string = PrintUInt64(op1->ui * value2);
5990 if(!exp->expType)
5991 {
5992 exp->expType = op1->type;
5993 if(op1->type)
5994 op1->type->refCount++;
5995 }
5996 return 0x1;
5997 }
5998
5999 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6000 {
6001 short value2 = op2->s;
6002
6003 exp->type = 2;
6004 exp->string = PrintShort(op1->s * value2);
6005 if(!exp->expType)
6006 {
6007 exp->expType = op1->type;
6008 if(op1->type)
6009 op1->type->refCount++;
6010 }
6011 return 0x1;
6012 }
6013
6014 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6015 {
6016 unsigned short value2 = op2->us;
6017
6018 exp->type = 2;
6019 exp->string = PrintUShort(op1->us * value2);
6020 if(!exp->expType)
6021 {
6022 exp->expType = op1->type;
6023 if(op1->type)
6024 op1->type->refCount++;
6025 }
6026 return 0x1;
6027 }
6028
6029 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6030 {
6031 char value2 = op2->c;
6032
6033 exp->type = 2;
6034 exp->string = PrintChar(op1->c * value2);
6035 if(!exp->expType)
6036 {
6037 exp->expType = op1->type;
6038 if(op1->type)
6039 op1->type->refCount++;
6040 }
6041 return 0x1;
6042 }
6043
6044 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6045 {
6046 unsigned char value2 = op2->uc;
6047
6048 exp->type = 2;
6049 exp->string = PrintUChar(op1->uc * value2);
6050 if(!exp->expType)
6051 {
6052 exp->expType = op1->type;
6053 if(op1->type)
6054 op1->type->refCount++;
6055 }
6056 return 0x1;
6057 }
6058
6059 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6060 {
6061 float value2 = op2->f;
6062
6063 exp->type = 2;
6064 exp->string = PrintFloat(op1->f * value2);
6065 if(!exp->expType)
6066 {
6067 exp->expType = op1->type;
6068 if(op1->type)
6069 op1->type->refCount++;
6070 }
6071 return 0x1;
6072 }
6073
6074 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6075 {
6076 double value2 = op2->d;
6077
6078 exp->type = 2;
6079 exp->string = PrintDouble(op1->d * value2);
6080 if(!exp->expType)
6081 {
6082 exp->expType = op1->type;
6083 if(op1->type)
6084 op1->type->refCount++;
6085 }
6086 return 0x1;
6087 }
6088
6089 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6090 {
6091 int value2 = op2->i;
6092
6093 exp->type = 2;
6094 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
6095 if(!exp->expType)
6096 {
6097 exp->expType = op1->type;
6098 if(op1->type)
6099 op1->type->refCount++;
6100 }
6101 return 0x1;
6102 }
6103
6104 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6105 {
6106 unsigned int value2 = op2->ui;
6107
6108 exp->type = 2;
6109 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
6110 if(!exp->expType)
6111 {
6112 exp->expType = op1->type;
6113 if(op1->type)
6114 op1->type->refCount++;
6115 }
6116 return 0x1;
6117 }
6118
6119 static unsigned int Int64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6120 {
6121 int value2 = op2->i;
6122
6123 exp->type = 2;
6124 exp->string = PrintInt64(value2 ? (op1->i / value2) : 0);
6125 if(!exp->expType)
6126 {
6127 exp->expType = op1->type;
6128 if(op1->type)
6129 op1->type->refCount++;
6130 }
6131 return 0x1;
6132 }
6133
6134 static unsigned int UInt64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6135 {
6136 unsigned int value2 = op2->ui;
6137
6138 exp->type = 2;
6139 exp->string = PrintUInt64(value2 ? (op1->ui / value2) : 0);
6140 if(!exp->expType)
6141 {
6142 exp->expType = op1->type;
6143 if(op1->type)
6144 op1->type->refCount++;
6145 }
6146 return 0x1;
6147 }
6148
6149 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6150 {
6151 short value2 = op2->s;
6152
6153 exp->type = 2;
6154 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
6155 if(!exp->expType)
6156 {
6157 exp->expType = op1->type;
6158 if(op1->type)
6159 op1->type->refCount++;
6160 }
6161 return 0x1;
6162 }
6163
6164 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6165 {
6166 unsigned short value2 = op2->us;
6167
6168 exp->type = 2;
6169 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
6170 if(!exp->expType)
6171 {
6172 exp->expType = op1->type;
6173 if(op1->type)
6174 op1->type->refCount++;
6175 }
6176 return 0x1;
6177 }
6178
6179 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6180 {
6181 char value2 = op2->c;
6182
6183 exp->type = 2;
6184 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
6185 if(!exp->expType)
6186 {
6187 exp->expType = op1->type;
6188 if(op1->type)
6189 op1->type->refCount++;
6190 }
6191 return 0x1;
6192 }
6193
6194 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6195 {
6196 unsigned char value2 = op2->uc;
6197
6198 exp->type = 2;
6199 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
6200 if(!exp->expType)
6201 {
6202 exp->expType = op1->type;
6203 if(op1->type)
6204 op1->type->refCount++;
6205 }
6206 return 0x1;
6207 }
6208
6209 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6210 {
6211 float value2 = op2->f;
6212
6213 exp->type = 2;
6214 exp->string = PrintFloat(value2 ? (op1->f / value2) : 0);
6215 if(!exp->expType)
6216 {
6217 exp->expType = op1->type;
6218 if(op1->type)
6219 op1->type->refCount++;
6220 }
6221 return 0x1;
6222 }
6223
6224 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6225 {
6226 double value2 = op2->d;
6227
6228 exp->type = 2;
6229 exp->string = PrintDouble(value2 ? (op1->d / value2) : 0);
6230 if(!exp->expType)
6231 {
6232 exp->expType = op1->type;
6233 if(op1->type)
6234 op1->type->refCount++;
6235 }
6236 return 0x1;
6237 }
6238
6239 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6240 {
6241 int value2 = op2->i;
6242
6243 exp->type = 2;
6244 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
6245 if(!exp->expType)
6246 {
6247 exp->expType = op1->type;
6248 if(op1->type)
6249 op1->type->refCount++;
6250 }
6251 return 0x1;
6252 }
6253
6254 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6255 {
6256 unsigned int value2 = op2->ui;
6257
6258 exp->type = 2;
6259 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
6260 if(!exp->expType)
6261 {
6262 exp->expType = op1->type;
6263 if(op1->type)
6264 op1->type->refCount++;
6265 }
6266 return 0x1;
6267 }
6268
6269 static unsigned int Int64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6270 {
6271 int value2 = op2->i;
6272
6273 exp->type = 2;
6274 exp->string = PrintInt64(value2 ? (op1->i % value2) : 0);
6275 if(!exp->expType)
6276 {
6277 exp->expType = op1->type;
6278 if(op1->type)
6279 op1->type->refCount++;
6280 }
6281 return 0x1;
6282 }
6283
6284 static unsigned int UInt64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6285 {
6286 unsigned int value2 = op2->ui;
6287
6288 exp->type = 2;
6289 exp->string = PrintUInt64(value2 ? (op1->ui % value2) : 0);
6290 if(!exp->expType)
6291 {
6292 exp->expType = op1->type;
6293 if(op1->type)
6294 op1->type->refCount++;
6295 }
6296 return 0x1;
6297 }
6298
6299 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6300 {
6301 short value2 = op2->s;
6302
6303 exp->type = 2;
6304 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
6305 if(!exp->expType)
6306 {
6307 exp->expType = op1->type;
6308 if(op1->type)
6309 op1->type->refCount++;
6310 }
6311 return 0x1;
6312 }
6313
6314 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6315 {
6316 unsigned short value2 = op2->us;
6317
6318 exp->type = 2;
6319 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
6320 if(!exp->expType)
6321 {
6322 exp->expType = op1->type;
6323 if(op1->type)
6324 op1->type->refCount++;
6325 }
6326 return 0x1;
6327 }
6328
6329 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6330 {
6331 char value2 = op2->c;
6332
6333 exp->type = 2;
6334 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
6335 if(!exp->expType)
6336 {
6337 exp->expType = op1->type;
6338 if(op1->type)
6339 op1->type->refCount++;
6340 }
6341 return 0x1;
6342 }
6343
6344 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6345 {
6346 unsigned char value2 = op2->uc;
6347
6348 exp->type = 2;
6349 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
6350 if(!exp->expType)
6351 {
6352 exp->expType = op1->type;
6353 if(op1->type)
6354 op1->type->refCount++;
6355 }
6356 return 0x1;
6357 }
6358
6359 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6360 {
6361 exp->type = 2;
6362 exp->string = PrintInt((-op1->i));
6363 if(!exp->expType)
6364 {
6365 exp->expType = op1->type;
6366 if(op1->type)
6367 op1->type->refCount++;
6368 }
6369 return 0x1;
6370 }
6371
6372 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6373 {
6374 exp->type = 2;
6375 exp->string = PrintUInt((unsigned int)(-op1->ui));
6376 if(!exp->expType)
6377 {
6378 exp->expType = op1->type;
6379 if(op1->type)
6380 op1->type->refCount++;
6381 }
6382 return 0x1;
6383 }
6384
6385 static unsigned int Int64Neg(struct Expression * exp, struct Operand * op1)
6386 {
6387 exp->type = 2;
6388 exp->string = PrintInt64((-op1->i));
6389 if(!exp->expType)
6390 {
6391 exp->expType = op1->type;
6392 if(op1->type)
6393 op1->type->refCount++;
6394 }
6395 return 0x1;
6396 }
6397
6398 static unsigned int UInt64Neg(struct Expression * exp, struct Operand * op1)
6399 {
6400 exp->type = 2;
6401 exp->string = PrintUInt64((unsigned int)(-op1->ui));
6402 if(!exp->expType)
6403 {
6404 exp->expType = op1->type;
6405 if(op1->type)
6406 op1->type->refCount++;
6407 }
6408 return 0x1;
6409 }
6410
6411 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6412 {
6413 exp->type = 2;
6414 exp->string = PrintShort((-op1->s));
6415 if(!exp->expType)
6416 {
6417 exp->expType = op1->type;
6418 if(op1->type)
6419 op1->type->refCount++;
6420 }
6421 return 0x1;
6422 }
6423
6424 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6425 {
6426 exp->type = 2;
6427 exp->string = PrintUShort((unsigned short)(-op1->us));
6428 if(!exp->expType)
6429 {
6430 exp->expType = op1->type;
6431 if(op1->type)
6432 op1->type->refCount++;
6433 }
6434 return 0x1;
6435 }
6436
6437 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6438 {
6439 exp->type = 2;
6440 exp->string = PrintChar((-op1->c));
6441 if(!exp->expType)
6442 {
6443 exp->expType = op1->type;
6444 if(op1->type)
6445 op1->type->refCount++;
6446 }
6447 return 0x1;
6448 }
6449
6450 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6451 {
6452 exp->type = 2;
6453 exp->string = PrintUChar((unsigned char)(-op1->uc));
6454 if(!exp->expType)
6455 {
6456 exp->expType = op1->type;
6457 if(op1->type)
6458 op1->type->refCount++;
6459 }
6460 return 0x1;
6461 }
6462
6463 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6464 {
6465 exp->type = 2;
6466 exp->string = PrintFloat((float)(-op1->f));
6467 if(!exp->expType)
6468 {
6469 exp->expType = op1->type;
6470 if(op1->type)
6471 op1->type->refCount++;
6472 }
6473 return 0x1;
6474 }
6475
6476 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6477 {
6478 exp->type = 2;
6479 exp->string = PrintDouble((double)(-op1->d));
6480 if(!exp->expType)
6481 {
6482 exp->expType = op1->type;
6483 if(op1->type)
6484 op1->type->refCount++;
6485 }
6486 return 0x1;
6487 }
6488
6489 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6490 {
6491 exp->type = 2;
6492 exp->string = PrintInt((++op1->i));
6493 if(!exp->expType)
6494 {
6495 exp->expType = op1->type;
6496 if(op1->type)
6497 op1->type->refCount++;
6498 }
6499 return 0x1;
6500 }
6501
6502 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6503 {
6504 exp->type = 2;
6505 exp->string = PrintUInt((++op1->ui));
6506 if(!exp->expType)
6507 {
6508 exp->expType = op1->type;
6509 if(op1->type)
6510 op1->type->refCount++;
6511 }
6512 return 0x1;
6513 }
6514
6515 static unsigned int Int64Inc(struct Expression * exp, struct Operand * op1)
6516 {
6517 exp->type = 2;
6518 exp->string = PrintInt64((++op1->i));
6519 if(!exp->expType)
6520 {
6521 exp->expType = op1->type;
6522 if(op1->type)
6523 op1->type->refCount++;
6524 }
6525 return 0x1;
6526 }
6527
6528 static unsigned int UInt64Inc(struct Expression * exp, struct Operand * op1)
6529 {
6530 exp->type = 2;
6531 exp->string = PrintUInt64((++op1->ui));
6532 if(!exp->expType)
6533 {
6534 exp->expType = op1->type;
6535 if(op1->type)
6536 op1->type->refCount++;
6537 }
6538 return 0x1;
6539 }
6540
6541 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6542 {
6543 exp->type = 2;
6544 exp->string = PrintShort((++op1->s));
6545 if(!exp->expType)
6546 {
6547 exp->expType = op1->type;
6548 if(op1->type)
6549 op1->type->refCount++;
6550 }
6551 return 0x1;
6552 }
6553
6554 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6555 {
6556 exp->type = 2;
6557 exp->string = PrintUShort((++op1->us));
6558 if(!exp->expType)
6559 {
6560 exp->expType = op1->type;
6561 if(op1->type)
6562 op1->type->refCount++;
6563 }
6564 return 0x1;
6565 }
6566
6567 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6568 {
6569 exp->type = 2;
6570 exp->string = PrintChar((++op1->c));
6571 if(!exp->expType)
6572 {
6573 exp->expType = op1->type;
6574 if(op1->type)
6575 op1->type->refCount++;
6576 }
6577 return 0x1;
6578 }
6579
6580 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6581 {
6582 exp->type = 2;
6583 exp->string = PrintUChar((++op1->uc));
6584 if(!exp->expType)
6585 {
6586 exp->expType = op1->type;
6587 if(op1->type)
6588 op1->type->refCount++;
6589 }
6590 return 0x1;
6591 }
6592
6593 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6594 {
6595 exp->type = 2;
6596 exp->string = PrintFloat((float)(++op1->f));
6597 if(!exp->expType)
6598 {
6599 exp->expType = op1->type;
6600 if(op1->type)
6601 op1->type->refCount++;
6602 }
6603 return 0x1;
6604 }
6605
6606 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6607 {
6608 exp->type = 2;
6609 exp->string = PrintDouble((double)(++op1->d));
6610 if(!exp->expType)
6611 {
6612 exp->expType = op1->type;
6613 if(op1->type)
6614 op1->type->refCount++;
6615 }
6616 return 0x1;
6617 }
6618
6619 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6620 {
6621 exp->type = 2;
6622 exp->string = PrintInt((--op1->i));
6623 if(!exp->expType)
6624 {
6625 exp->expType = op1->type;
6626 if(op1->type)
6627 op1->type->refCount++;
6628 }
6629 return 0x1;
6630 }
6631
6632 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6633 {
6634 exp->type = 2;
6635 exp->string = PrintUInt((--op1->ui));
6636 if(!exp->expType)
6637 {
6638 exp->expType = op1->type;
6639 if(op1->type)
6640 op1->type->refCount++;
6641 }
6642 return 0x1;
6643 }
6644
6645 static unsigned int Int64Dec(struct Expression * exp, struct Operand * op1)
6646 {
6647 exp->type = 2;
6648 exp->string = PrintInt64((--op1->i));
6649 if(!exp->expType)
6650 {
6651 exp->expType = op1->type;
6652 if(op1->type)
6653 op1->type->refCount++;
6654 }
6655 return 0x1;
6656 }
6657
6658 static unsigned int UInt64Dec(struct Expression * exp, struct Operand * op1)
6659 {
6660 exp->type = 2;
6661 exp->string = PrintUInt64((--op1->ui));
6662 if(!exp->expType)
6663 {
6664 exp->expType = op1->type;
6665 if(op1->type)
6666 op1->type->refCount++;
6667 }
6668 return 0x1;
6669 }
6670
6671 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6672 {
6673 exp->type = 2;
6674 exp->string = PrintShort((--op1->s));
6675 if(!exp->expType)
6676 {
6677 exp->expType = op1->type;
6678 if(op1->type)
6679 op1->type->refCount++;
6680 }
6681 return 0x1;
6682 }
6683
6684 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6685 {
6686 exp->type = 2;
6687 exp->string = PrintUShort((--op1->us));
6688 if(!exp->expType)
6689 {
6690 exp->expType = op1->type;
6691 if(op1->type)
6692 op1->type->refCount++;
6693 }
6694 return 0x1;
6695 }
6696
6697 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6698 {
6699 exp->type = 2;
6700 exp->string = PrintChar((--op1->c));
6701 if(!exp->expType)
6702 {
6703 exp->expType = op1->type;
6704 if(op1->type)
6705 op1->type->refCount++;
6706 }
6707 return 0x1;
6708 }
6709
6710 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6711 {
6712 exp->type = 2;
6713 exp->string = PrintUChar((--op1->uc));
6714 if(!exp->expType)
6715 {
6716 exp->expType = op1->type;
6717 if(op1->type)
6718 op1->type->refCount++;
6719 }
6720 return 0x1;
6721 }
6722
6723 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6724 {
6725 exp->type = 2;
6726 exp->string = PrintFloat((float)(--op1->f));
6727 if(!exp->expType)
6728 {
6729 exp->expType = op1->type;
6730 if(op1->type)
6731 op1->type->refCount++;
6732 }
6733 return 0x1;
6734 }
6735
6736 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6737 {
6738 exp->type = 2;
6739 exp->string = PrintDouble((double)(--op1->d));
6740 if(!exp->expType)
6741 {
6742 exp->expType = op1->type;
6743 if(op1->type)
6744 op1->type->refCount++;
6745 }
6746 return 0x1;
6747 }
6748
6749 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6750 {
6751 int value2 = op2->i;
6752
6753 exp->type = 2;
6754 exp->string = PrintInt(op1->i = value2);
6755 if(!exp->expType)
6756 {
6757 exp->expType = op1->type;
6758 if(op1->type)
6759 op1->type->refCount++;
6760 }
6761 return 0x1;
6762 }
6763
6764 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6765 {
6766 unsigned int value2 = op2->ui;
6767
6768 exp->type = 2;
6769 exp->string = PrintUInt(op1->ui = value2);
6770 if(!exp->expType)
6771 {
6772 exp->expType = op1->type;
6773 if(op1->type)
6774 op1->type->refCount++;
6775 }
6776 return 0x1;
6777 }
6778
6779 static unsigned int Int64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6780 {
6781 int value2 = op2->i;
6782
6783 exp->type = 2;
6784 exp->string = PrintInt64(op1->i = value2);
6785 if(!exp->expType)
6786 {
6787 exp->expType = op1->type;
6788 if(op1->type)
6789 op1->type->refCount++;
6790 }
6791 return 0x1;
6792 }
6793
6794 static unsigned int UInt64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6795 {
6796 unsigned int value2 = op2->ui;
6797
6798 exp->type = 2;
6799 exp->string = PrintUInt64(op1->ui = value2);
6800 if(!exp->expType)
6801 {
6802 exp->expType = op1->type;
6803 if(op1->type)
6804 op1->type->refCount++;
6805 }
6806 return 0x1;
6807 }
6808
6809 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6810 {
6811 short value2 = op2->s;
6812
6813 exp->type = 2;
6814 exp->string = PrintShort(op1->s = value2);
6815 if(!exp->expType)
6816 {
6817 exp->expType = op1->type;
6818 if(op1->type)
6819 op1->type->refCount++;
6820 }
6821 return 0x1;
6822 }
6823
6824 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6825 {
6826 unsigned short value2 = op2->us;
6827
6828 exp->type = 2;
6829 exp->string = PrintUShort(op1->us = value2);
6830 if(!exp->expType)
6831 {
6832 exp->expType = op1->type;
6833 if(op1->type)
6834 op1->type->refCount++;
6835 }
6836 return 0x1;
6837 }
6838
6839 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6840 {
6841 char value2 = op2->c;
6842
6843 exp->type = 2;
6844 exp->string = PrintChar(op1->c = value2);
6845 if(!exp->expType)
6846 {
6847 exp->expType = op1->type;
6848 if(op1->type)
6849 op1->type->refCount++;
6850 }
6851 return 0x1;
6852 }
6853
6854 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6855 {
6856 unsigned char value2 = op2->uc;
6857
6858 exp->type = 2;
6859 exp->string = PrintUChar(op1->uc = value2);
6860 if(!exp->expType)
6861 {
6862 exp->expType = op1->type;
6863 if(op1->type)
6864 op1->type->refCount++;
6865 }
6866 return 0x1;
6867 }
6868
6869 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6870 {
6871 float value2 = op2->f;
6872
6873 exp->type = 2;
6874 exp->string = PrintFloat(op1->f = value2);
6875 if(!exp->expType)
6876 {
6877 exp->expType = op1->type;
6878 if(op1->type)
6879 op1->type->refCount++;
6880 }
6881 return 0x1;
6882 }
6883
6884 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6885 {
6886 double value2 = op2->d;
6887
6888 exp->type = 2;
6889 exp->string = PrintDouble(op1->d = value2);
6890 if(!exp->expType)
6891 {
6892 exp->expType = op1->type;
6893 if(op1->type)
6894 op1->type->refCount++;
6895 }
6896 return 0x1;
6897 }
6898
6899 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6900 {
6901 int value2 = op2->i;
6902
6903 exp->type = 2;
6904 exp->string = PrintInt(op1->i += value2);
6905 if(!exp->expType)
6906 {
6907 exp->expType = op1->type;
6908 if(op1->type)
6909 op1->type->refCount++;
6910 }
6911 return 0x1;
6912 }
6913
6914 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6915 {
6916 unsigned int value2 = op2->ui;
6917
6918 exp->type = 2;
6919 exp->string = PrintUInt(op1->ui += value2);
6920 if(!exp->expType)
6921 {
6922 exp->expType = op1->type;
6923 if(op1->type)
6924 op1->type->refCount++;
6925 }
6926 return 0x1;
6927 }
6928
6929 static unsigned int Int64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6930 {
6931 int value2 = op2->i;
6932
6933 exp->type = 2;
6934 exp->string = PrintInt64(op1->i += value2);
6935 if(!exp->expType)
6936 {
6937 exp->expType = op1->type;
6938 if(op1->type)
6939 op1->type->refCount++;
6940 }
6941 return 0x1;
6942 }
6943
6944 static unsigned int UInt64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6945 {
6946 unsigned int value2 = op2->ui;
6947
6948 exp->type = 2;
6949 exp->string = PrintUInt64(op1->ui += value2);
6950 if(!exp->expType)
6951 {
6952 exp->expType = op1->type;
6953 if(op1->type)
6954 op1->type->refCount++;
6955 }
6956 return 0x1;
6957 }
6958
6959 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6960 {
6961 short value2 = op2->s;
6962
6963 exp->type = 2;
6964 exp->string = PrintShort(op1->s += value2);
6965 if(!exp->expType)
6966 {
6967 exp->expType = op1->type;
6968 if(op1->type)
6969 op1->type->refCount++;
6970 }
6971 return 0x1;
6972 }
6973
6974 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6975 {
6976 unsigned short value2 = op2->us;
6977
6978 exp->type = 2;
6979 exp->string = PrintUShort(op1->us += value2);
6980 if(!exp->expType)
6981 {
6982 exp->expType = op1->type;
6983 if(op1->type)
6984 op1->type->refCount++;
6985 }
6986 return 0x1;
6987 }
6988
6989 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6990 {
6991 char value2 = op2->c;
6992
6993 exp->type = 2;
6994 exp->string = PrintChar(op1->c += value2);
6995 if(!exp->expType)
6996 {
6997 exp->expType = op1->type;
6998 if(op1->type)
6999 op1->type->refCount++;
7000 }
7001 return 0x1;
7002 }
7003
7004 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7005 {
7006 unsigned char value2 = op2->uc;
7007
7008 exp->type = 2;
7009 exp->string = PrintUChar(op1->uc += value2);
7010 if(!exp->expType)
7011 {
7012 exp->expType = op1->type;
7013 if(op1->type)
7014 op1->type->refCount++;
7015 }
7016 return 0x1;
7017 }
7018
7019 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7020 {
7021 float value2 = op2->f;
7022
7023 exp->type = 2;
7024 exp->string = PrintFloat(op1->f += value2);
7025 if(!exp->expType)
7026 {
7027 exp->expType = op1->type;
7028 if(op1->type)
7029 op1->type->refCount++;
7030 }
7031 return 0x1;
7032 }
7033
7034 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7035 {
7036 double value2 = op2->d;
7037
7038 exp->type = 2;
7039 exp->string = PrintDouble(op1->d += value2);
7040 if(!exp->expType)
7041 {
7042 exp->expType = op1->type;
7043 if(op1->type)
7044 op1->type->refCount++;
7045 }
7046 return 0x1;
7047 }
7048
7049 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7050 {
7051 int value2 = op2->i;
7052
7053 exp->type = 2;
7054 exp->string = PrintInt(op1->i -= value2);
7055 if(!exp->expType)
7056 {
7057 exp->expType = op1->type;
7058 if(op1->type)
7059 op1->type->refCount++;
7060 }
7061 return 0x1;
7062 }
7063
7064 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7065 {
7066 unsigned int value2 = op2->ui;
7067
7068 exp->type = 2;
7069 exp->string = PrintUInt(op1->ui -= value2);
7070 if(!exp->expType)
7071 {
7072 exp->expType = op1->type;
7073 if(op1->type)
7074 op1->type->refCount++;
7075 }
7076 return 0x1;
7077 }
7078
7079 static unsigned int Int64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7080 {
7081 int value2 = op2->i;
7082
7083 exp->type = 2;
7084 exp->string = PrintInt64(op1->i -= value2);
7085 if(!exp->expType)
7086 {
7087 exp->expType = op1->type;
7088 if(op1->type)
7089 op1->type->refCount++;
7090 }
7091 return 0x1;
7092 }
7093
7094 static unsigned int UInt64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7095 {
7096 unsigned int value2 = op2->ui;
7097
7098 exp->type = 2;
7099 exp->string = PrintUInt64(op1->ui -= value2);
7100 if(!exp->expType)
7101 {
7102 exp->expType = op1->type;
7103 if(op1->type)
7104 op1->type->refCount++;
7105 }
7106 return 0x1;
7107 }
7108
7109 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7110 {
7111 short value2 = op2->s;
7112
7113 exp->type = 2;
7114 exp->string = PrintShort(op1->s -= value2);
7115 if(!exp->expType)
7116 {
7117 exp->expType = op1->type;
7118 if(op1->type)
7119 op1->type->refCount++;
7120 }
7121 return 0x1;
7122 }
7123
7124 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7125 {
7126 unsigned short value2 = op2->us;
7127
7128 exp->type = 2;
7129 exp->string = PrintUShort(op1->us -= value2);
7130 if(!exp->expType)
7131 {
7132 exp->expType = op1->type;
7133 if(op1->type)
7134 op1->type->refCount++;
7135 }
7136 return 0x1;
7137 }
7138
7139 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7140 {
7141 char value2 = op2->c;
7142
7143 exp->type = 2;
7144 exp->string = PrintChar(op1->c -= value2);
7145 if(!exp->expType)
7146 {
7147 exp->expType = op1->type;
7148 if(op1->type)
7149 op1->type->refCount++;
7150 }
7151 return 0x1;
7152 }
7153
7154 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7155 {
7156 unsigned char value2 = op2->uc;
7157
7158 exp->type = 2;
7159 exp->string = PrintUChar(op1->uc -= value2);
7160 if(!exp->expType)
7161 {
7162 exp->expType = op1->type;
7163 if(op1->type)
7164 op1->type->refCount++;
7165 }
7166 return 0x1;
7167 }
7168
7169 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7170 {
7171 float value2 = op2->f;
7172
7173 exp->type = 2;
7174 exp->string = PrintFloat(op1->f -= value2);
7175 if(!exp->expType)
7176 {
7177 exp->expType = op1->type;
7178 if(op1->type)
7179 op1->type->refCount++;
7180 }
7181 return 0x1;
7182 }
7183
7184 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7185 {
7186 double value2 = op2->d;
7187
7188 exp->type = 2;
7189 exp->string = PrintDouble(op1->d -= value2);
7190 if(!exp->expType)
7191 {
7192 exp->expType = op1->type;
7193 if(op1->type)
7194 op1->type->refCount++;
7195 }
7196 return 0x1;
7197 }
7198
7199 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7200 {
7201 int value2 = op2->i;
7202
7203 exp->type = 2;
7204 exp->string = PrintInt(op1->i *= value2);
7205 if(!exp->expType)
7206 {
7207 exp->expType = op1->type;
7208 if(op1->type)
7209 op1->type->refCount++;
7210 }
7211 return 0x1;
7212 }
7213
7214 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7215 {
7216 unsigned int value2 = op2->ui;
7217
7218 exp->type = 2;
7219 exp->string = PrintUInt(op1->ui *= value2);
7220 if(!exp->expType)
7221 {
7222 exp->expType = op1->type;
7223 if(op1->type)
7224 op1->type->refCount++;
7225 }
7226 return 0x1;
7227 }
7228
7229 static unsigned int Int64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7230 {
7231 int value2 = op2->i;
7232
7233 exp->type = 2;
7234 exp->string = PrintInt64(op1->i *= value2);
7235 if(!exp->expType)
7236 {
7237 exp->expType = op1->type;
7238 if(op1->type)
7239 op1->type->refCount++;
7240 }
7241 return 0x1;
7242 }
7243
7244 static unsigned int UInt64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7245 {
7246 unsigned int value2 = op2->ui;
7247
7248 exp->type = 2;
7249 exp->string = PrintUInt64(op1->ui *= value2);
7250 if(!exp->expType)
7251 {
7252 exp->expType = op1->type;
7253 if(op1->type)
7254 op1->type->refCount++;
7255 }
7256 return 0x1;
7257 }
7258
7259 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7260 {
7261 short value2 = op2->s;
7262
7263 exp->type = 2;
7264 exp->string = PrintShort(op1->s *= value2);
7265 if(!exp->expType)
7266 {
7267 exp->expType = op1->type;
7268 if(op1->type)
7269 op1->type->refCount++;
7270 }
7271 return 0x1;
7272 }
7273
7274 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7275 {
7276 unsigned short value2 = op2->us;
7277
7278 exp->type = 2;
7279 exp->string = PrintUShort(op1->us *= value2);
7280 if(!exp->expType)
7281 {
7282 exp->expType = op1->type;
7283 if(op1->type)
7284 op1->type->refCount++;
7285 }
7286 return 0x1;
7287 }
7288
7289 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7290 {
7291 char value2 = op2->c;
7292
7293 exp->type = 2;
7294 exp->string = PrintChar(op1->c *= value2);
7295 if(!exp->expType)
7296 {
7297 exp->expType = op1->type;
7298 if(op1->type)
7299 op1->type->refCount++;
7300 }
7301 return 0x1;
7302 }
7303
7304 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7305 {
7306 unsigned char value2 = op2->uc;
7307
7308 exp->type = 2;
7309 exp->string = PrintUChar(op1->uc *= value2);
7310 if(!exp->expType)
7311 {
7312 exp->expType = op1->type;
7313 if(op1->type)
7314 op1->type->refCount++;
7315 }
7316 return 0x1;
7317 }
7318
7319 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7320 {
7321 float value2 = op2->f;
7322
7323 exp->type = 2;
7324 exp->string = PrintFloat(op1->f *= value2);
7325 if(!exp->expType)
7326 {
7327 exp->expType = op1->type;
7328 if(op1->type)
7329 op1->type->refCount++;
7330 }
7331 return 0x1;
7332 }
7333
7334 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7335 {
7336 double value2 = op2->d;
7337
7338 exp->type = 2;
7339 exp->string = PrintDouble(op1->d *= value2);
7340 if(!exp->expType)
7341 {
7342 exp->expType = op1->type;
7343 if(op1->type)
7344 op1->type->refCount++;
7345 }
7346 return 0x1;
7347 }
7348
7349 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7350 {
7351 int value2 = op2->i;
7352
7353 exp->type = 2;
7354 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
7355 if(!exp->expType)
7356 {
7357 exp->expType = op1->type;
7358 if(op1->type)
7359 op1->type->refCount++;
7360 }
7361 return 0x1;
7362 }
7363
7364 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7365 {
7366 unsigned int value2 = op2->ui;
7367
7368 exp->type = 2;
7369 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
7370 if(!exp->expType)
7371 {
7372 exp->expType = op1->type;
7373 if(op1->type)
7374 op1->type->refCount++;
7375 }
7376 return 0x1;
7377 }
7378
7379 static unsigned int Int64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7380 {
7381 int value2 = op2->i;
7382
7383 exp->type = 2;
7384 exp->string = PrintInt64(value2 ? (op1->i /= value2) : 0);
7385 if(!exp->expType)
7386 {
7387 exp->expType = op1->type;
7388 if(op1->type)
7389 op1->type->refCount++;
7390 }
7391 return 0x1;
7392 }
7393
7394 static unsigned int UInt64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7395 {
7396 unsigned int value2 = op2->ui;
7397
7398 exp->type = 2;
7399 exp->string = PrintUInt64(value2 ? (op1->ui /= value2) : 0);
7400 if(!exp->expType)
7401 {
7402 exp->expType = op1->type;
7403 if(op1->type)
7404 op1->type->refCount++;
7405 }
7406 return 0x1;
7407 }
7408
7409 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7410 {
7411 short value2 = op2->s;
7412
7413 exp->type = 2;
7414 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
7415 if(!exp->expType)
7416 {
7417 exp->expType = op1->type;
7418 if(op1->type)
7419 op1->type->refCount++;
7420 }
7421 return 0x1;
7422 }
7423
7424 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7425 {
7426 unsigned short value2 = op2->us;
7427
7428 exp->type = 2;
7429 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
7430 if(!exp->expType)
7431 {
7432 exp->expType = op1->type;
7433 if(op1->type)
7434 op1->type->refCount++;
7435 }
7436 return 0x1;
7437 }
7438
7439 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7440 {
7441 char value2 = op2->c;
7442
7443 exp->type = 2;
7444 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
7445 if(!exp->expType)
7446 {
7447 exp->expType = op1->type;
7448 if(op1->type)
7449 op1->type->refCount++;
7450 }
7451 return 0x1;
7452 }
7453
7454 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7455 {
7456 unsigned char value2 = op2->uc;
7457
7458 exp->type = 2;
7459 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
7460 if(!exp->expType)
7461 {
7462 exp->expType = op1->type;
7463 if(op1->type)
7464 op1->type->refCount++;
7465 }
7466 return 0x1;
7467 }
7468
7469 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7470 {
7471 float value2 = op2->f;
7472
7473 exp->type = 2;
7474 exp->string = PrintFloat(value2 ? (op1->f /= value2) : 0);
7475 if(!exp->expType)
7476 {
7477 exp->expType = op1->type;
7478 if(op1->type)
7479 op1->type->refCount++;
7480 }
7481 return 0x1;
7482 }
7483
7484 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7485 {
7486 double value2 = op2->d;
7487
7488 exp->type = 2;
7489 exp->string = PrintDouble(value2 ? (op1->d /= value2) : 0);
7490 if(!exp->expType)
7491 {
7492 exp->expType = op1->type;
7493 if(op1->type)
7494 op1->type->refCount++;
7495 }
7496 return 0x1;
7497 }
7498
7499 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7500 {
7501 int value2 = op2->i;
7502
7503 exp->type = 2;
7504 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
7505 if(!exp->expType)
7506 {
7507 exp->expType = op1->type;
7508 if(op1->type)
7509 op1->type->refCount++;
7510 }
7511 return 0x1;
7512 }
7513
7514 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7515 {
7516 unsigned int value2 = op2->ui;
7517
7518 exp->type = 2;
7519 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
7520 if(!exp->expType)
7521 {
7522 exp->expType = op1->type;
7523 if(op1->type)
7524 op1->type->refCount++;
7525 }
7526 return 0x1;
7527 }
7528
7529 static unsigned int Int64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7530 {
7531 int value2 = op2->i;
7532
7533 exp->type = 2;
7534 exp->string = PrintInt64(value2 ? (op1->i %= value2) : 0);
7535 if(!exp->expType)
7536 {
7537 exp->expType = op1->type;
7538 if(op1->type)
7539 op1->type->refCount++;
7540 }
7541 return 0x1;
7542 }
7543
7544 static unsigned int UInt64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7545 {
7546 unsigned int value2 = op2->ui;
7547
7548 exp->type = 2;
7549 exp->string = PrintUInt64(value2 ? (op1->ui %= value2) : 0);
7550 if(!exp->expType)
7551 {
7552 exp->expType = op1->type;
7553 if(op1->type)
7554 op1->type->refCount++;
7555 }
7556 return 0x1;
7557 }
7558
7559 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7560 {
7561 short value2 = op2->s;
7562
7563 exp->type = 2;
7564 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
7565 if(!exp->expType)
7566 {
7567 exp->expType = op1->type;
7568 if(op1->type)
7569 op1->type->refCount++;
7570 }
7571 return 0x1;
7572 }
7573
7574 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7575 {
7576 unsigned short value2 = op2->us;
7577
7578 exp->type = 2;
7579 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
7580 if(!exp->expType)
7581 {
7582 exp->expType = op1->type;
7583 if(op1->type)
7584 op1->type->refCount++;
7585 }
7586 return 0x1;
7587 }
7588
7589 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7590 {
7591 char value2 = op2->c;
7592
7593 exp->type = 2;
7594 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
7595 if(!exp->expType)
7596 {
7597 exp->expType = op1->type;
7598 if(op1->type)
7599 op1->type->refCount++;
7600 }
7601 return 0x1;
7602 }
7603
7604 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7605 {
7606 unsigned char value2 = op2->uc;
7607
7608 exp->type = 2;
7609 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
7610 if(!exp->expType)
7611 {
7612 exp->expType = op1->type;
7613 if(op1->type)
7614 op1->type->refCount++;
7615 }
7616 return 0x1;
7617 }
7618
7619 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7620 {
7621 int value2 = op2->i;
7622
7623 exp->type = 2;
7624 exp->string = PrintInt(op1->i & value2);
7625 if(!exp->expType)
7626 {
7627 exp->expType = op1->type;
7628 if(op1->type)
7629 op1->type->refCount++;
7630 }
7631 return 0x1;
7632 }
7633
7634 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7635 {
7636 unsigned int value2 = op2->ui;
7637
7638 exp->type = 2;
7639 exp->string = PrintUInt(op1->ui & value2);
7640 if(!exp->expType)
7641 {
7642 exp->expType = op1->type;
7643 if(op1->type)
7644 op1->type->refCount++;
7645 }
7646 return 0x1;
7647 }
7648
7649 static unsigned int Int64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7650 {
7651 int value2 = op2->i;
7652
7653 exp->type = 2;
7654 exp->string = PrintInt64(op1->i & value2);
7655 if(!exp->expType)
7656 {
7657 exp->expType = op1->type;
7658 if(op1->type)
7659 op1->type->refCount++;
7660 }
7661 return 0x1;
7662 }
7663
7664 static unsigned int UInt64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7665 {
7666 unsigned int value2 = op2->ui;
7667
7668 exp->type = 2;
7669 exp->string = PrintUInt64(op1->ui & value2);
7670 if(!exp->expType)
7671 {
7672 exp->expType = op1->type;
7673 if(op1->type)
7674 op1->type->refCount++;
7675 }
7676 return 0x1;
7677 }
7678
7679 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7680 {
7681 short value2 = op2->s;
7682
7683 exp->type = 2;
7684 exp->string = PrintShort(op1->s & value2);
7685 if(!exp->expType)
7686 {
7687 exp->expType = op1->type;
7688 if(op1->type)
7689 op1->type->refCount++;
7690 }
7691 return 0x1;
7692 }
7693
7694 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7695 {
7696 unsigned short value2 = op2->us;
7697
7698 exp->type = 2;
7699 exp->string = PrintUShort(op1->us & value2);
7700 if(!exp->expType)
7701 {
7702 exp->expType = op1->type;
7703 if(op1->type)
7704 op1->type->refCount++;
7705 }
7706 return 0x1;
7707 }
7708
7709 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7710 {
7711 char value2 = op2->c;
7712
7713 exp->type = 2;
7714 exp->string = PrintChar(op1->c & value2);
7715 if(!exp->expType)
7716 {
7717 exp->expType = op1->type;
7718 if(op1->type)
7719 op1->type->refCount++;
7720 }
7721 return 0x1;
7722 }
7723
7724 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7725 {
7726 unsigned char value2 = op2->uc;
7727
7728 exp->type = 2;
7729 exp->string = PrintUChar(op1->uc & value2);
7730 if(!exp->expType)
7731 {
7732 exp->expType = op1->type;
7733 if(op1->type)
7734 op1->type->refCount++;
7735 }
7736 return 0x1;
7737 }
7738
7739 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7740 {
7741 int value2 = op2->i;
7742
7743 exp->type = 2;
7744 exp->string = PrintInt(op1->i | value2);
7745 if(!exp->expType)
7746 {
7747 exp->expType = op1->type;
7748 if(op1->type)
7749 op1->type->refCount++;
7750 }
7751 return 0x1;
7752 }
7753
7754 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7755 {
7756 unsigned int value2 = op2->ui;
7757
7758 exp->type = 2;
7759 exp->string = PrintUInt(op1->ui | value2);
7760 if(!exp->expType)
7761 {
7762 exp->expType = op1->type;
7763 if(op1->type)
7764 op1->type->refCount++;
7765 }
7766 return 0x1;
7767 }
7768
7769 static unsigned int Int64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7770 {
7771 int value2 = op2->i;
7772
7773 exp->type = 2;
7774 exp->string = PrintInt64(op1->i | value2);
7775 if(!exp->expType)
7776 {
7777 exp->expType = op1->type;
7778 if(op1->type)
7779 op1->type->refCount++;
7780 }
7781 return 0x1;
7782 }
7783
7784 static unsigned int UInt64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7785 {
7786 unsigned int value2 = op2->ui;
7787
7788 exp->type = 2;
7789 exp->string = PrintUInt64(op1->ui | value2);
7790 if(!exp->expType)
7791 {
7792 exp->expType = op1->type;
7793 if(op1->type)
7794 op1->type->refCount++;
7795 }
7796 return 0x1;
7797 }
7798
7799 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7800 {
7801 short value2 = op2->s;
7802
7803 exp->type = 2;
7804 exp->string = PrintShort(op1->s | value2);
7805 if(!exp->expType)
7806 {
7807 exp->expType = op1->type;
7808 if(op1->type)
7809 op1->type->refCount++;
7810 }
7811 return 0x1;
7812 }
7813
7814 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7815 {
7816 unsigned short value2 = op2->us;
7817
7818 exp->type = 2;
7819 exp->string = PrintUShort(op1->us | value2);
7820 if(!exp->expType)
7821 {
7822 exp->expType = op1->type;
7823 if(op1->type)
7824 op1->type->refCount++;
7825 }
7826 return 0x1;
7827 }
7828
7829 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7830 {
7831 char value2 = op2->c;
7832
7833 exp->type = 2;
7834 exp->string = PrintChar(op1->c | value2);
7835 if(!exp->expType)
7836 {
7837 exp->expType = op1->type;
7838 if(op1->type)
7839 op1->type->refCount++;
7840 }
7841 return 0x1;
7842 }
7843
7844 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7845 {
7846 unsigned char value2 = op2->uc;
7847
7848 exp->type = 2;
7849 exp->string = PrintUChar(op1->uc | value2);
7850 if(!exp->expType)
7851 {
7852 exp->expType = op1->type;
7853 if(op1->type)
7854 op1->type->refCount++;
7855 }
7856 return 0x1;
7857 }
7858
7859 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7860 {
7861 int value2 = op2->i;
7862
7863 exp->type = 2;
7864 exp->string = PrintInt(op1->i ^ value2);
7865 if(!exp->expType)
7866 {
7867 exp->expType = op1->type;
7868 if(op1->type)
7869 op1->type->refCount++;
7870 }
7871 return 0x1;
7872 }
7873
7874 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7875 {
7876 unsigned int value2 = op2->ui;
7877
7878 exp->type = 2;
7879 exp->string = PrintUInt(op1->ui ^ value2);
7880 if(!exp->expType)
7881 {
7882 exp->expType = op1->type;
7883 if(op1->type)
7884 op1->type->refCount++;
7885 }
7886 return 0x1;
7887 }
7888
7889 static unsigned int Int64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7890 {
7891 int value2 = op2->i;
7892
7893 exp->type = 2;
7894 exp->string = PrintInt64(op1->i ^ value2);
7895 if(!exp->expType)
7896 {
7897 exp->expType = op1->type;
7898 if(op1->type)
7899 op1->type->refCount++;
7900 }
7901 return 0x1;
7902 }
7903
7904 static unsigned int UInt64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7905 {
7906 unsigned int value2 = op2->ui;
7907
7908 exp->type = 2;
7909 exp->string = PrintUInt64(op1->ui ^ value2);
7910 if(!exp->expType)
7911 {
7912 exp->expType = op1->type;
7913 if(op1->type)
7914 op1->type->refCount++;
7915 }
7916 return 0x1;
7917 }
7918
7919 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7920 {
7921 short value2 = op2->s;
7922
7923 exp->type = 2;
7924 exp->string = PrintShort(op1->s ^ value2);
7925 if(!exp->expType)
7926 {
7927 exp->expType = op1->type;
7928 if(op1->type)
7929 op1->type->refCount++;
7930 }
7931 return 0x1;
7932 }
7933
7934 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7935 {
7936 unsigned short value2 = op2->us;
7937
7938 exp->type = 2;
7939 exp->string = PrintUShort(op1->us ^ value2);
7940 if(!exp->expType)
7941 {
7942 exp->expType = op1->type;
7943 if(op1->type)
7944 op1->type->refCount++;
7945 }
7946 return 0x1;
7947 }
7948
7949 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7950 {
7951 char value2 = op2->c;
7952
7953 exp->type = 2;
7954 exp->string = PrintChar(op1->c ^ value2);
7955 if(!exp->expType)
7956 {
7957 exp->expType = op1->type;
7958 if(op1->type)
7959 op1->type->refCount++;
7960 }
7961 return 0x1;
7962 }
7963
7964 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7965 {
7966 unsigned char value2 = op2->uc;
7967
7968 exp->type = 2;
7969 exp->string = PrintUChar(op1->uc ^ value2);
7970 if(!exp->expType)
7971 {
7972 exp->expType = op1->type;
7973 if(op1->type)
7974 op1->type->refCount++;
7975 }
7976 return 0x1;
7977 }
7978
7979 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7980 {
7981 int value2 = op2->i;
7982
7983 exp->type = 2;
7984 exp->string = PrintInt(op1->i << value2);
7985 if(!exp->expType)
7986 {
7987 exp->expType = op1->type;
7988 if(op1->type)
7989 op1->type->refCount++;
7990 }
7991 return 0x1;
7992 }
7993
7994 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7995 {
7996 unsigned int value2 = op2->ui;
7997
7998 exp->type = 2;
7999 exp->string = PrintUInt(op1->ui << value2);
8000 if(!exp->expType)
8001 {
8002 exp->expType = op1->type;
8003 if(op1->type)
8004 op1->type->refCount++;
8005 }
8006 return 0x1;
8007 }
8008
8009 static unsigned int Int64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8010 {
8011 int value2 = op2->i;
8012
8013 exp->type = 2;
8014 exp->string = PrintInt64(op1->i << value2);
8015 if(!exp->expType)
8016 {
8017 exp->expType = op1->type;
8018 if(op1->type)
8019 op1->type->refCount++;
8020 }
8021 return 0x1;
8022 }
8023
8024 static unsigned int UInt64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8025 {
8026 unsigned int value2 = op2->ui;
8027
8028 exp->type = 2;
8029 exp->string = PrintUInt64(op1->ui << value2);
8030 if(!exp->expType)
8031 {
8032 exp->expType = op1->type;
8033 if(op1->type)
8034 op1->type->refCount++;
8035 }
8036 return 0x1;
8037 }
8038
8039 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8040 {
8041 short value2 = op2->s;
8042
8043 exp->type = 2;
8044 exp->string = PrintShort(op1->s << value2);
8045 if(!exp->expType)
8046 {
8047 exp->expType = op1->type;
8048 if(op1->type)
8049 op1->type->refCount++;
8050 }
8051 return 0x1;
8052 }
8053
8054 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8055 {
8056 unsigned short value2 = op2->us;
8057
8058 exp->type = 2;
8059 exp->string = PrintUShort(op1->us << value2);
8060 if(!exp->expType)
8061 {
8062 exp->expType = op1->type;
8063 if(op1->type)
8064 op1->type->refCount++;
8065 }
8066 return 0x1;
8067 }
8068
8069 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8070 {
8071 char value2 = op2->c;
8072
8073 exp->type = 2;
8074 exp->string = PrintChar(op1->c << value2);
8075 if(!exp->expType)
8076 {
8077 exp->expType = op1->type;
8078 if(op1->type)
8079 op1->type->refCount++;
8080 }
8081 return 0x1;
8082 }
8083
8084 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8085 {
8086 unsigned char value2 = op2->uc;
8087
8088 exp->type = 2;
8089 exp->string = PrintUChar(op1->uc << value2);
8090 if(!exp->expType)
8091 {
8092 exp->expType = op1->type;
8093 if(op1->type)
8094 op1->type->refCount++;
8095 }
8096 return 0x1;
8097 }
8098
8099 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8100 {
8101 int value2 = op2->i;
8102
8103 exp->type = 2;
8104 exp->string = PrintInt(op1->i >> value2);
8105 if(!exp->expType)
8106 {
8107 exp->expType = op1->type;
8108 if(op1->type)
8109 op1->type->refCount++;
8110 }
8111 return 0x1;
8112 }
8113
8114 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8115 {
8116 unsigned int value2 = op2->ui;
8117
8118 exp->type = 2;
8119 exp->string = PrintUInt(op1->ui >> value2);
8120 if(!exp->expType)
8121 {
8122 exp->expType = op1->type;
8123 if(op1->type)
8124 op1->type->refCount++;
8125 }
8126 return 0x1;
8127 }
8128
8129 static unsigned int Int64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8130 {
8131 int value2 = op2->i;
8132
8133 exp->type = 2;
8134 exp->string = PrintInt64(op1->i >> value2);
8135 if(!exp->expType)
8136 {
8137 exp->expType = op1->type;
8138 if(op1->type)
8139 op1->type->refCount++;
8140 }
8141 return 0x1;
8142 }
8143
8144 static unsigned int UInt64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8145 {
8146 unsigned int value2 = op2->ui;
8147
8148 exp->type = 2;
8149 exp->string = PrintUInt64(op1->ui >> value2);
8150 if(!exp->expType)
8151 {
8152 exp->expType = op1->type;
8153 if(op1->type)
8154 op1->type->refCount++;
8155 }
8156 return 0x1;
8157 }
8158
8159 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8160 {
8161 short value2 = op2->s;
8162
8163 exp->type = 2;
8164 exp->string = PrintShort(op1->s >> value2);
8165 if(!exp->expType)
8166 {
8167 exp->expType = op1->type;
8168 if(op1->type)
8169 op1->type->refCount++;
8170 }
8171 return 0x1;
8172 }
8173
8174 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8175 {
8176 unsigned short value2 = op2->us;
8177
8178 exp->type = 2;
8179 exp->string = PrintUShort(op1->us >> value2);
8180 if(!exp->expType)
8181 {
8182 exp->expType = op1->type;
8183 if(op1->type)
8184 op1->type->refCount++;
8185 }
8186 return 0x1;
8187 }
8188
8189 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8190 {
8191 char value2 = op2->c;
8192
8193 exp->type = 2;
8194 exp->string = PrintChar(op1->c >> value2);
8195 if(!exp->expType)
8196 {
8197 exp->expType = op1->type;
8198 if(op1->type)
8199 op1->type->refCount++;
8200 }
8201 return 0x1;
8202 }
8203
8204 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8205 {
8206 unsigned char value2 = op2->uc;
8207
8208 exp->type = 2;
8209 exp->string = PrintUChar(op1->uc >> value2);
8210 if(!exp->expType)
8211 {
8212 exp->expType = op1->type;
8213 if(op1->type)
8214 op1->type->refCount++;
8215 }
8216 return 0x1;
8217 }
8218
8219 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
8220 {
8221 exp->type = 2;
8222 exp->string = PrintInt((~op1->i));
8223 if(!exp->expType)
8224 {
8225 exp->expType = op1->type;
8226 if(op1->type)
8227 op1->type->refCount++;
8228 }
8229 return 0x1;
8230 }
8231
8232 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
8233 {
8234 exp->type = 2;
8235 exp->string = PrintUInt((unsigned int)(~op1->ui));
8236 if(!exp->expType)
8237 {
8238 exp->expType = op1->type;
8239 if(op1->type)
8240 op1->type->refCount++;
8241 }
8242 return 0x1;
8243 }
8244
8245 static unsigned int Int64BitNot(struct Expression * exp, struct Operand * op1)
8246 {
8247 exp->type = 2;
8248 exp->string = PrintInt64((~op1->i));
8249 if(!exp->expType)
8250 {
8251 exp->expType = op1->type;
8252 if(op1->type)
8253 op1->type->refCount++;
8254 }
8255 return 0x1;
8256 }
8257
8258 static unsigned int UInt64BitNot(struct Expression * exp, struct Operand * op1)
8259 {
8260 exp->type = 2;
8261 exp->string = PrintUInt64((unsigned int)(~op1->ui));
8262 if(!exp->expType)
8263 {
8264 exp->expType = op1->type;
8265 if(op1->type)
8266 op1->type->refCount++;
8267 }
8268 return 0x1;
8269 }
8270
8271 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
8272 {
8273 exp->type = 2;
8274 exp->string = PrintShort((short)(~op1->s));
8275 if(!exp->expType)
8276 {
8277 exp->expType = op1->type;
8278 if(op1->type)
8279 op1->type->refCount++;
8280 }
8281 return 0x1;
8282 }
8283
8284 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
8285 {
8286 exp->type = 2;
8287 exp->string = PrintUShort((unsigned short)(~op1->us));
8288 if(!exp->expType)
8289 {
8290 exp->expType = op1->type;
8291 if(op1->type)
8292 op1->type->refCount++;
8293 }
8294 return 0x1;
8295 }
8296
8297 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
8298 {
8299 exp->type = 2;
8300 exp->string = PrintChar((char)(~op1->c));
8301 if(!exp->expType)
8302 {
8303 exp->expType = op1->type;
8304 if(op1->type)
8305 op1->type->refCount++;
8306 }
8307 return 0x1;
8308 }
8309
8310 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
8311 {
8312 exp->type = 2;
8313 exp->string = PrintUChar((unsigned char)(~op1->uc));
8314 if(!exp->expType)
8315 {
8316 exp->expType = op1->type;
8317 if(op1->type)
8318 op1->type->refCount++;
8319 }
8320 return 0x1;
8321 }
8322
8323 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8324 {
8325 int value2 = op2->i;
8326
8327 exp->type = 2;
8328 exp->string = PrintInt(op1->i &= value2);
8329 if(!exp->expType)
8330 {
8331 exp->expType = op1->type;
8332 if(op1->type)
8333 op1->type->refCount++;
8334 }
8335 return 0x1;
8336 }
8337
8338 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8339 {
8340 unsigned int value2 = op2->ui;
8341
8342 exp->type = 2;
8343 exp->string = PrintUInt(op1->ui &= value2);
8344 if(!exp->expType)
8345 {
8346 exp->expType = op1->type;
8347 if(op1->type)
8348 op1->type->refCount++;
8349 }
8350 return 0x1;
8351 }
8352
8353 static unsigned int Int64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8354 {
8355 int value2 = op2->i;
8356
8357 exp->type = 2;
8358 exp->string = PrintInt64(op1->i &= value2);
8359 if(!exp->expType)
8360 {
8361 exp->expType = op1->type;
8362 if(op1->type)
8363 op1->type->refCount++;
8364 }
8365 return 0x1;
8366 }
8367
8368 static unsigned int UInt64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8369 {
8370 unsigned int value2 = op2->ui;
8371
8372 exp->type = 2;
8373 exp->string = PrintUInt64(op1->ui &= value2);
8374 if(!exp->expType)
8375 {
8376 exp->expType = op1->type;
8377 if(op1->type)
8378 op1->type->refCount++;
8379 }
8380 return 0x1;
8381 }
8382
8383 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8384 {
8385 short value2 = op2->s;
8386
8387 exp->type = 2;
8388 exp->string = PrintShort(op1->s &= value2);
8389 if(!exp->expType)
8390 {
8391 exp->expType = op1->type;
8392 if(op1->type)
8393 op1->type->refCount++;
8394 }
8395 return 0x1;
8396 }
8397
8398 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8399 {
8400 unsigned short value2 = op2->us;
8401
8402 exp->type = 2;
8403 exp->string = PrintUShort(op1->us &= value2);
8404 if(!exp->expType)
8405 {
8406 exp->expType = op1->type;
8407 if(op1->type)
8408 op1->type->refCount++;
8409 }
8410 return 0x1;
8411 }
8412
8413 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8414 {
8415 char value2 = op2->c;
8416
8417 exp->type = 2;
8418 exp->string = PrintChar(op1->c &= value2);
8419 if(!exp->expType)
8420 {
8421 exp->expType = op1->type;
8422 if(op1->type)
8423 op1->type->refCount++;
8424 }
8425 return 0x1;
8426 }
8427
8428 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8429 {
8430 unsigned char value2 = op2->uc;
8431
8432 exp->type = 2;
8433 exp->string = PrintUChar(op1->uc &= value2);
8434 if(!exp->expType)
8435 {
8436 exp->expType = op1->type;
8437 if(op1->type)
8438 op1->type->refCount++;
8439 }
8440 return 0x1;
8441 }
8442
8443 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8444 {
8445 int value2 = op2->i;
8446
8447 exp->type = 2;
8448 exp->string = PrintInt(op1->i |= value2);
8449 if(!exp->expType)
8450 {
8451 exp->expType = op1->type;
8452 if(op1->type)
8453 op1->type->refCount++;
8454 }
8455 return 0x1;
8456 }
8457
8458 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8459 {
8460 unsigned int value2 = op2->ui;
8461
8462 exp->type = 2;
8463 exp->string = PrintUInt(op1->ui |= value2);
8464 if(!exp->expType)
8465 {
8466 exp->expType = op1->type;
8467 if(op1->type)
8468 op1->type->refCount++;
8469 }
8470 return 0x1;
8471 }
8472
8473 static unsigned int Int64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8474 {
8475 int value2 = op2->i;
8476
8477 exp->type = 2;
8478 exp->string = PrintInt64(op1->i |= value2);
8479 if(!exp->expType)
8480 {
8481 exp->expType = op1->type;
8482 if(op1->type)
8483 op1->type->refCount++;
8484 }
8485 return 0x1;
8486 }
8487
8488 static unsigned int UInt64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8489 {
8490 unsigned int value2 = op2->ui;
8491
8492 exp->type = 2;
8493 exp->string = PrintUInt64(op1->ui |= value2);
8494 if(!exp->expType)
8495 {
8496 exp->expType = op1->type;
8497 if(op1->type)
8498 op1->type->refCount++;
8499 }
8500 return 0x1;
8501 }
8502
8503 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8504 {
8505 short value2 = op2->s;
8506
8507 exp->type = 2;
8508 exp->string = PrintShort(op1->s |= value2);
8509 if(!exp->expType)
8510 {
8511 exp->expType = op1->type;
8512 if(op1->type)
8513 op1->type->refCount++;
8514 }
8515 return 0x1;
8516 }
8517
8518 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8519 {
8520 unsigned short value2 = op2->us;
8521
8522 exp->type = 2;
8523 exp->string = PrintUShort(op1->us |= value2);
8524 if(!exp->expType)
8525 {
8526 exp->expType = op1->type;
8527 if(op1->type)
8528 op1->type->refCount++;
8529 }
8530 return 0x1;
8531 }
8532
8533 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8534 {
8535 char value2 = op2->c;
8536
8537 exp->type = 2;
8538 exp->string = PrintChar(op1->c |= value2);
8539 if(!exp->expType)
8540 {
8541 exp->expType = op1->type;
8542 if(op1->type)
8543 op1->type->refCount++;
8544 }
8545 return 0x1;
8546 }
8547
8548 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8549 {
8550 unsigned char value2 = op2->uc;
8551
8552 exp->type = 2;
8553 exp->string = PrintUChar(op1->uc |= value2);
8554 if(!exp->expType)
8555 {
8556 exp->expType = op1->type;
8557 if(op1->type)
8558 op1->type->refCount++;
8559 }
8560 return 0x1;
8561 }
8562
8563 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8564 {
8565 int value2 = op2->i;
8566
8567 exp->type = 2;
8568 exp->string = PrintInt(op1->i ^= value2);
8569 if(!exp->expType)
8570 {
8571 exp->expType = op1->type;
8572 if(op1->type)
8573 op1->type->refCount++;
8574 }
8575 return 0x1;
8576 }
8577
8578 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8579 {
8580 unsigned int value2 = op2->ui;
8581
8582 exp->type = 2;
8583 exp->string = PrintUInt(op1->ui ^= value2);
8584 if(!exp->expType)
8585 {
8586 exp->expType = op1->type;
8587 if(op1->type)
8588 op1->type->refCount++;
8589 }
8590 return 0x1;
8591 }
8592
8593 static unsigned int Int64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8594 {
8595 int value2 = op2->i;
8596
8597 exp->type = 2;
8598 exp->string = PrintInt64(op1->i ^= value2);
8599 if(!exp->expType)
8600 {
8601 exp->expType = op1->type;
8602 if(op1->type)
8603 op1->type->refCount++;
8604 }
8605 return 0x1;
8606 }
8607
8608 static unsigned int UInt64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8609 {
8610 unsigned int value2 = op2->ui;
8611
8612 exp->type = 2;
8613 exp->string = PrintUInt64(op1->ui ^= value2);
8614 if(!exp->expType)
8615 {
8616 exp->expType = op1->type;
8617 if(op1->type)
8618 op1->type->refCount++;
8619 }
8620 return 0x1;
8621 }
8622
8623 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8624 {
8625 short value2 = op2->s;
8626
8627 exp->type = 2;
8628 exp->string = PrintShort(op1->s ^= value2);
8629 if(!exp->expType)
8630 {
8631 exp->expType = op1->type;
8632 if(op1->type)
8633 op1->type->refCount++;
8634 }
8635 return 0x1;
8636 }
8637
8638 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8639 {
8640 unsigned short value2 = op2->us;
8641
8642 exp->type = 2;
8643 exp->string = PrintUShort(op1->us ^= value2);
8644 if(!exp->expType)
8645 {
8646 exp->expType = op1->type;
8647 if(op1->type)
8648 op1->type->refCount++;
8649 }
8650 return 0x1;
8651 }
8652
8653 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8654 {
8655 char value2 = op2->c;
8656
8657 exp->type = 2;
8658 exp->string = PrintChar(op1->c ^= value2);
8659 if(!exp->expType)
8660 {
8661 exp->expType = op1->type;
8662 if(op1->type)
8663 op1->type->refCount++;
8664 }
8665 return 0x1;
8666 }
8667
8668 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8669 {
8670 unsigned char value2 = op2->uc;
8671
8672 exp->type = 2;
8673 exp->string = PrintUChar(op1->uc ^= value2);
8674 if(!exp->expType)
8675 {
8676 exp->expType = op1->type;
8677 if(op1->type)
8678 op1->type->refCount++;
8679 }
8680 return 0x1;
8681 }
8682
8683 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8684 {
8685 int value2 = op2->i;
8686
8687 exp->type = 2;
8688 exp->string = PrintInt(op1->i <<= value2);
8689 if(!exp->expType)
8690 {
8691 exp->expType = op1->type;
8692 if(op1->type)
8693 op1->type->refCount++;
8694 }
8695 return 0x1;
8696 }
8697
8698 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8699 {
8700 unsigned int value2 = op2->ui;
8701
8702 exp->type = 2;
8703 exp->string = PrintUInt(op1->ui <<= value2);
8704 if(!exp->expType)
8705 {
8706 exp->expType = op1->type;
8707 if(op1->type)
8708 op1->type->refCount++;
8709 }
8710 return 0x1;
8711 }
8712
8713 static unsigned int Int64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8714 {
8715 int value2 = op2->i;
8716
8717 exp->type = 2;
8718 exp->string = PrintInt64(op1->i <<= value2);
8719 if(!exp->expType)
8720 {
8721 exp->expType = op1->type;
8722 if(op1->type)
8723 op1->type->refCount++;
8724 }
8725 return 0x1;
8726 }
8727
8728 static unsigned int UInt64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8729 {
8730 unsigned int value2 = op2->ui;
8731
8732 exp->type = 2;
8733 exp->string = PrintUInt64(op1->ui <<= value2);
8734 if(!exp->expType)
8735 {
8736 exp->expType = op1->type;
8737 if(op1->type)
8738 op1->type->refCount++;
8739 }
8740 return 0x1;
8741 }
8742
8743 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8744 {
8745 short value2 = op2->s;
8746
8747 exp->type = 2;
8748 exp->string = PrintShort(op1->s <<= value2);
8749 if(!exp->expType)
8750 {
8751 exp->expType = op1->type;
8752 if(op1->type)
8753 op1->type->refCount++;
8754 }
8755 return 0x1;
8756 }
8757
8758 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8759 {
8760 unsigned short value2 = op2->us;
8761
8762 exp->type = 2;
8763 exp->string = PrintUShort(op1->us <<= value2);
8764 if(!exp->expType)
8765 {
8766 exp->expType = op1->type;
8767 if(op1->type)
8768 op1->type->refCount++;
8769 }
8770 return 0x1;
8771 }
8772
8773 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8774 {
8775 char value2 = op2->c;
8776
8777 exp->type = 2;
8778 exp->string = PrintChar(op1->c <<= value2);
8779 if(!exp->expType)
8780 {
8781 exp->expType = op1->type;
8782 if(op1->type)
8783 op1->type->refCount++;
8784 }
8785 return 0x1;
8786 }
8787
8788 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8789 {
8790 unsigned char value2 = op2->uc;
8791
8792 exp->type = 2;
8793 exp->string = PrintUChar(op1->uc <<= value2);
8794 if(!exp->expType)
8795 {
8796 exp->expType = op1->type;
8797 if(op1->type)
8798 op1->type->refCount++;
8799 }
8800 return 0x1;
8801 }
8802
8803 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8804 {
8805 int value2 = op2->i;
8806
8807 exp->type = 2;
8808 exp->string = PrintInt(op1->i >>= value2);
8809 if(!exp->expType)
8810 {
8811 exp->expType = op1->type;
8812 if(op1->type)
8813 op1->type->refCount++;
8814 }
8815 return 0x1;
8816 }
8817
8818 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8819 {
8820 unsigned int value2 = op2->ui;
8821
8822 exp->type = 2;
8823 exp->string = PrintUInt(op1->ui >>= value2);
8824 if(!exp->expType)
8825 {
8826 exp->expType = op1->type;
8827 if(op1->type)
8828 op1->type->refCount++;
8829 }
8830 return 0x1;
8831 }
8832
8833 static unsigned int Int64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8834 {
8835 int value2 = op2->i;
8836
8837 exp->type = 2;
8838 exp->string = PrintInt64(op1->i >>= value2);
8839 if(!exp->expType)
8840 {
8841 exp->expType = op1->type;
8842 if(op1->type)
8843 op1->type->refCount++;
8844 }
8845 return 0x1;
8846 }
8847
8848 static unsigned int UInt64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8849 {
8850 unsigned int value2 = op2->ui;
8851
8852 exp->type = 2;
8853 exp->string = PrintUInt64(op1->ui >>= value2);
8854 if(!exp->expType)
8855 {
8856 exp->expType = op1->type;
8857 if(op1->type)
8858 op1->type->refCount++;
8859 }
8860 return 0x1;
8861 }
8862
8863 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8864 {
8865 short value2 = op2->s;
8866
8867 exp->type = 2;
8868 exp->string = PrintShort(op1->s >>= value2);
8869 if(!exp->expType)
8870 {
8871 exp->expType = op1->type;
8872 if(op1->type)
8873 op1->type->refCount++;
8874 }
8875 return 0x1;
8876 }
8877
8878 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8879 {
8880 unsigned short value2 = op2->us;
8881
8882 exp->type = 2;
8883 exp->string = PrintUShort(op1->us >>= value2);
8884 if(!exp->expType)
8885 {
8886 exp->expType = op1->type;
8887 if(op1->type)
8888 op1->type->refCount++;
8889 }
8890 return 0x1;
8891 }
8892
8893 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8894 {
8895 char value2 = op2->c;
8896
8897 exp->type = 2;
8898 exp->string = PrintChar(op1->c >>= value2);
8899 if(!exp->expType)
8900 {
8901 exp->expType = op1->type;
8902 if(op1->type)
8903 op1->type->refCount++;
8904 }
8905 return 0x1;
8906 }
8907
8908 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8909 {
8910 unsigned char value2 = op2->uc;
8911
8912 exp->type = 2;
8913 exp->string = PrintUChar(op1->uc >>= value2);
8914 if(!exp->expType)
8915 {
8916 exp->expType = op1->type;
8917 if(op1->type)
8918 op1->type->refCount++;
8919 }
8920 return 0x1;
8921 }
8922
8923 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
8924 {
8925 exp->type = 2;
8926 exp->string = PrintInt((int)(!op1->i));
8927 if(!exp->expType)
8928 {
8929 exp->expType = op1->type;
8930 if(op1->type)
8931 op1->type->refCount++;
8932 }
8933 return 0x1;
8934 }
8935
8936 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
8937 {
8938 exp->type = 2;
8939 exp->string = PrintUInt((unsigned int)(!op1->ui));
8940 if(!exp->expType)
8941 {
8942 exp->expType = op1->type;
8943 if(op1->type)
8944 op1->type->refCount++;
8945 }
8946 return 0x1;
8947 }
8948
8949 static unsigned int Int64Not(struct Expression * exp, struct Operand * op1)
8950 {
8951 exp->type = 2;
8952 exp->string = PrintInt64((int)(!op1->i));
8953 if(!exp->expType)
8954 {
8955 exp->expType = op1->type;
8956 if(op1->type)
8957 op1->type->refCount++;
8958 }
8959 return 0x1;
8960 }
8961
8962 static unsigned int UInt64Not(struct Expression * exp, struct Operand * op1)
8963 {
8964 exp->type = 2;
8965 exp->string = PrintUInt64((unsigned int)(!op1->ui));
8966 if(!exp->expType)
8967 {
8968 exp->expType = op1->type;
8969 if(op1->type)
8970 op1->type->refCount++;
8971 }
8972 return 0x1;
8973 }
8974
8975 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
8976 {
8977 exp->type = 2;
8978 exp->string = PrintShort((short)(!op1->s));
8979 if(!exp->expType)
8980 {
8981 exp->expType = op1->type;
8982 if(op1->type)
8983 op1->type->refCount++;
8984 }
8985 return 0x1;
8986 }
8987
8988 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
8989 {
8990 exp->type = 2;
8991 exp->string = PrintUShort((unsigned short)(!op1->us));
8992 if(!exp->expType)
8993 {
8994 exp->expType = op1->type;
8995 if(op1->type)
8996 op1->type->refCount++;
8997 }
8998 return 0x1;
8999 }
9000
9001 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
9002 {
9003 exp->type = 2;
9004 exp->string = PrintChar((char)(!op1->c));
9005 if(!exp->expType)
9006 {
9007 exp->expType = op1->type;
9008 if(op1->type)
9009 op1->type->refCount++;
9010 }
9011 return 0x1;
9012 }
9013
9014 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
9015 {
9016 exp->type = 2;
9017 exp->string = PrintUChar((unsigned char)(!op1->uc));
9018 if(!exp->expType)
9019 {
9020 exp->expType = op1->type;
9021 if(op1->type)
9022 op1->type->refCount++;
9023 }
9024 return 0x1;
9025 }
9026
9027 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9028 {
9029 int value2 = op2->i;
9030
9031 exp->type = 2;
9032 exp->string = PrintInt(op1->i == value2);
9033 if(!exp->expType)
9034 {
9035 exp->expType = op1->type;
9036 if(op1->type)
9037 op1->type->refCount++;
9038 }
9039 return 0x1;
9040 }
9041
9042 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9043 {
9044 unsigned int value2 = op2->ui;
9045
9046 exp->type = 2;
9047 exp->string = PrintUInt(op1->ui == value2);
9048 if(!exp->expType)
9049 {
9050 exp->expType = op1->type;
9051 if(op1->type)
9052 op1->type->refCount++;
9053 }
9054 return 0x1;
9055 }
9056
9057 static unsigned int Int64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9058 {
9059 int value2 = op2->i;
9060
9061 exp->type = 2;
9062 exp->string = PrintInt64(op1->i == value2);
9063 if(!exp->expType)
9064 {
9065 exp->expType = op1->type;
9066 if(op1->type)
9067 op1->type->refCount++;
9068 }
9069 return 0x1;
9070 }
9071
9072 static unsigned int UInt64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9073 {
9074 unsigned int value2 = op2->ui;
9075
9076 exp->type = 2;
9077 exp->string = PrintUInt64(op1->ui == value2);
9078 if(!exp->expType)
9079 {
9080 exp->expType = op1->type;
9081 if(op1->type)
9082 op1->type->refCount++;
9083 }
9084 return 0x1;
9085 }
9086
9087 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9088 {
9089 short value2 = op2->s;
9090
9091 exp->type = 2;
9092 exp->string = PrintShort(op1->s == value2);
9093 if(!exp->expType)
9094 {
9095 exp->expType = op1->type;
9096 if(op1->type)
9097 op1->type->refCount++;
9098 }
9099 return 0x1;
9100 }
9101
9102 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9103 {
9104 unsigned short value2 = op2->us;
9105
9106 exp->type = 2;
9107 exp->string = PrintUShort(op1->us == value2);
9108 if(!exp->expType)
9109 {
9110 exp->expType = op1->type;
9111 if(op1->type)
9112 op1->type->refCount++;
9113 }
9114 return 0x1;
9115 }
9116
9117 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9118 {
9119 char value2 = op2->c;
9120
9121 exp->type = 2;
9122 exp->string = PrintChar(op1->c == value2);
9123 if(!exp->expType)
9124 {
9125 exp->expType = op1->type;
9126 if(op1->type)
9127 op1->type->refCount++;
9128 }
9129 return 0x1;
9130 }
9131
9132 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9133 {
9134 unsigned char value2 = op2->uc;
9135
9136 exp->type = 2;
9137 exp->string = PrintUChar(op1->uc == value2);
9138 if(!exp->expType)
9139 {
9140 exp->expType = op1->type;
9141 if(op1->type)
9142 op1->type->refCount++;
9143 }
9144 return 0x1;
9145 }
9146
9147 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9148 {
9149 float value2 = op2->f;
9150
9151 exp->type = 2;
9152 exp->string = PrintFloat(op1->f == value2);
9153 if(!exp->expType)
9154 {
9155 exp->expType = op1->type;
9156 if(op1->type)
9157 op1->type->refCount++;
9158 }
9159 return 0x1;
9160 }
9161
9162 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9163 {
9164 double value2 = op2->d;
9165
9166 exp->type = 2;
9167 exp->string = PrintDouble(op1->d == value2);
9168 if(!exp->expType)
9169 {
9170 exp->expType = op1->type;
9171 if(op1->type)
9172 op1->type->refCount++;
9173 }
9174 return 0x1;
9175 }
9176
9177 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9178 {
9179 int value2 = op2->i;
9180
9181 exp->type = 2;
9182 exp->string = PrintInt(op1->i != value2);
9183 if(!exp->expType)
9184 {
9185 exp->expType = op1->type;
9186 if(op1->type)
9187 op1->type->refCount++;
9188 }
9189 return 0x1;
9190 }
9191
9192 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9193 {
9194 unsigned int value2 = op2->ui;
9195
9196 exp->type = 2;
9197 exp->string = PrintUInt(op1->ui != value2);
9198 if(!exp->expType)
9199 {
9200 exp->expType = op1->type;
9201 if(op1->type)
9202 op1->type->refCount++;
9203 }
9204 return 0x1;
9205 }
9206
9207 static unsigned int Int64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9208 {
9209 int value2 = op2->i;
9210
9211 exp->type = 2;
9212 exp->string = PrintInt64(op1->i != value2);
9213 if(!exp->expType)
9214 {
9215 exp->expType = op1->type;
9216 if(op1->type)
9217 op1->type->refCount++;
9218 }
9219 return 0x1;
9220 }
9221
9222 static unsigned int UInt64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9223 {
9224 unsigned int value2 = op2->ui;
9225
9226 exp->type = 2;
9227 exp->string = PrintUInt64(op1->ui != value2);
9228 if(!exp->expType)
9229 {
9230 exp->expType = op1->type;
9231 if(op1->type)
9232 op1->type->refCount++;
9233 }
9234 return 0x1;
9235 }
9236
9237 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9238 {
9239 short value2 = op2->s;
9240
9241 exp->type = 2;
9242 exp->string = PrintShort(op1->s != value2);
9243 if(!exp->expType)
9244 {
9245 exp->expType = op1->type;
9246 if(op1->type)
9247 op1->type->refCount++;
9248 }
9249 return 0x1;
9250 }
9251
9252 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9253 {
9254 unsigned short value2 = op2->us;
9255
9256 exp->type = 2;
9257 exp->string = PrintUShort(op1->us != value2);
9258 if(!exp->expType)
9259 {
9260 exp->expType = op1->type;
9261 if(op1->type)
9262 op1->type->refCount++;
9263 }
9264 return 0x1;
9265 }
9266
9267 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9268 {
9269 char value2 = op2->c;
9270
9271 exp->type = 2;
9272 exp->string = PrintChar(op1->c != value2);
9273 if(!exp->expType)
9274 {
9275 exp->expType = op1->type;
9276 if(op1->type)
9277 op1->type->refCount++;
9278 }
9279 return 0x1;
9280 }
9281
9282 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9283 {
9284 unsigned char value2 = op2->uc;
9285
9286 exp->type = 2;
9287 exp->string = PrintUChar(op1->uc != value2);
9288 if(!exp->expType)
9289 {
9290 exp->expType = op1->type;
9291 if(op1->type)
9292 op1->type->refCount++;
9293 }
9294 return 0x1;
9295 }
9296
9297 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9298 {
9299 float value2 = op2->f;
9300
9301 exp->type = 2;
9302 exp->string = PrintFloat(op1->f != value2);
9303 if(!exp->expType)
9304 {
9305 exp->expType = op1->type;
9306 if(op1->type)
9307 op1->type->refCount++;
9308 }
9309 return 0x1;
9310 }
9311
9312 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9313 {
9314 double value2 = op2->d;
9315
9316 exp->type = 2;
9317 exp->string = PrintDouble(op1->d != value2);
9318 if(!exp->expType)
9319 {
9320 exp->expType = op1->type;
9321 if(op1->type)
9322 op1->type->refCount++;
9323 }
9324 return 0x1;
9325 }
9326
9327 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9328 {
9329 int value2 = op2->i;
9330
9331 exp->type = 2;
9332 exp->string = PrintInt(op1->i && value2);
9333 if(!exp->expType)
9334 {
9335 exp->expType = op1->type;
9336 if(op1->type)
9337 op1->type->refCount++;
9338 }
9339 return 0x1;
9340 }
9341
9342 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9343 {
9344 unsigned int value2 = op2->ui;
9345
9346 exp->type = 2;
9347 exp->string = PrintUInt(op1->ui && value2);
9348 if(!exp->expType)
9349 {
9350 exp->expType = op1->type;
9351 if(op1->type)
9352 op1->type->refCount++;
9353 }
9354 return 0x1;
9355 }
9356
9357 static unsigned int Int64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9358 {
9359 int value2 = op2->i;
9360
9361 exp->type = 2;
9362 exp->string = PrintInt64(op1->i && value2);
9363 if(!exp->expType)
9364 {
9365 exp->expType = op1->type;
9366 if(op1->type)
9367 op1->type->refCount++;
9368 }
9369 return 0x1;
9370 }
9371
9372 static unsigned int UInt64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9373 {
9374 unsigned int value2 = op2->ui;
9375
9376 exp->type = 2;
9377 exp->string = PrintUInt64(op1->ui && value2);
9378 if(!exp->expType)
9379 {
9380 exp->expType = op1->type;
9381 if(op1->type)
9382 op1->type->refCount++;
9383 }
9384 return 0x1;
9385 }
9386
9387 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9388 {
9389 short value2 = op2->s;
9390
9391 exp->type = 2;
9392 exp->string = PrintShort(op1->s && value2);
9393 if(!exp->expType)
9394 {
9395 exp->expType = op1->type;
9396 if(op1->type)
9397 op1->type->refCount++;
9398 }
9399 return 0x1;
9400 }
9401
9402 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9403 {
9404 unsigned short value2 = op2->us;
9405
9406 exp->type = 2;
9407 exp->string = PrintUShort(op1->us && value2);
9408 if(!exp->expType)
9409 {
9410 exp->expType = op1->type;
9411 if(op1->type)
9412 op1->type->refCount++;
9413 }
9414 return 0x1;
9415 }
9416
9417 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9418 {
9419 char value2 = op2->c;
9420
9421 exp->type = 2;
9422 exp->string = PrintChar(op1->c && value2);
9423 if(!exp->expType)
9424 {
9425 exp->expType = op1->type;
9426 if(op1->type)
9427 op1->type->refCount++;
9428 }
9429 return 0x1;
9430 }
9431
9432 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9433 {
9434 unsigned char value2 = op2->uc;
9435
9436 exp->type = 2;
9437 exp->string = PrintUChar(op1->uc && value2);
9438 if(!exp->expType)
9439 {
9440 exp->expType = op1->type;
9441 if(op1->type)
9442 op1->type->refCount++;
9443 }
9444 return 0x1;
9445 }
9446
9447 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9448 {
9449 float value2 = op2->f;
9450
9451 exp->type = 2;
9452 exp->string = PrintFloat(op1->f && value2);
9453 if(!exp->expType)
9454 {
9455 exp->expType = op1->type;
9456 if(op1->type)
9457 op1->type->refCount++;
9458 }
9459 return 0x1;
9460 }
9461
9462 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9463 {
9464 double value2 = op2->d;
9465
9466 exp->type = 2;
9467 exp->string = PrintDouble(op1->d && value2);
9468 if(!exp->expType)
9469 {
9470 exp->expType = op1->type;
9471 if(op1->type)
9472 op1->type->refCount++;
9473 }
9474 return 0x1;
9475 }
9476
9477 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9478 {
9479 int value2 = op2->i;
9480
9481 exp->type = 2;
9482 exp->string = PrintInt(op1->i || value2);
9483 if(!exp->expType)
9484 {
9485 exp->expType = op1->type;
9486 if(op1->type)
9487 op1->type->refCount++;
9488 }
9489 return 0x1;
9490 }
9491
9492 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9493 {
9494 unsigned int value2 = op2->ui;
9495
9496 exp->type = 2;
9497 exp->string = PrintUInt(op1->ui || value2);
9498 if(!exp->expType)
9499 {
9500 exp->expType = op1->type;
9501 if(op1->type)
9502 op1->type->refCount++;
9503 }
9504 return 0x1;
9505 }
9506
9507 static unsigned int Int64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9508 {
9509 int value2 = op2->i;
9510
9511 exp->type = 2;
9512 exp->string = PrintInt64(op1->i || value2);
9513 if(!exp->expType)
9514 {
9515 exp->expType = op1->type;
9516 if(op1->type)
9517 op1->type->refCount++;
9518 }
9519 return 0x1;
9520 }
9521
9522 static unsigned int UInt64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9523 {
9524 unsigned int value2 = op2->ui;
9525
9526 exp->type = 2;
9527 exp->string = PrintUInt64(op1->ui || value2);
9528 if(!exp->expType)
9529 {
9530 exp->expType = op1->type;
9531 if(op1->type)
9532 op1->type->refCount++;
9533 }
9534 return 0x1;
9535 }
9536
9537 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9538 {
9539 short value2 = op2->s;
9540
9541 exp->type = 2;
9542 exp->string = PrintShort(op1->s || value2);
9543 if(!exp->expType)
9544 {
9545 exp->expType = op1->type;
9546 if(op1->type)
9547 op1->type->refCount++;
9548 }
9549 return 0x1;
9550 }
9551
9552 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9553 {
9554 unsigned short value2 = op2->us;
9555
9556 exp->type = 2;
9557 exp->string = PrintUShort(op1->us || value2);
9558 if(!exp->expType)
9559 {
9560 exp->expType = op1->type;
9561 if(op1->type)
9562 op1->type->refCount++;
9563 }
9564 return 0x1;
9565 }
9566
9567 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9568 {
9569 char value2 = op2->c;
9570
9571 exp->type = 2;
9572 exp->string = PrintChar(op1->c || value2);
9573 if(!exp->expType)
9574 {
9575 exp->expType = op1->type;
9576 if(op1->type)
9577 op1->type->refCount++;
9578 }
9579 return 0x1;
9580 }
9581
9582 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9583 {
9584 unsigned char value2 = op2->uc;
9585
9586 exp->type = 2;
9587 exp->string = PrintUChar(op1->uc || value2);
9588 if(!exp->expType)
9589 {
9590 exp->expType = op1->type;
9591 if(op1->type)
9592 op1->type->refCount++;
9593 }
9594 return 0x1;
9595 }
9596
9597 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9598 {
9599 float value2 = op2->f;
9600
9601 exp->type = 2;
9602 exp->string = PrintFloat(op1->f || value2);
9603 if(!exp->expType)
9604 {
9605 exp->expType = op1->type;
9606 if(op1->type)
9607 op1->type->refCount++;
9608 }
9609 return 0x1;
9610 }
9611
9612 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9613 {
9614 double value2 = op2->d;
9615
9616 exp->type = 2;
9617 exp->string = PrintDouble(op1->d || value2);
9618 if(!exp->expType)
9619 {
9620 exp->expType = op1->type;
9621 if(op1->type)
9622 op1->type->refCount++;
9623 }
9624 return 0x1;
9625 }
9626
9627 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9628 {
9629 int value2 = op2->i;
9630
9631 exp->type = 2;
9632 exp->string = PrintInt(op1->i > value2);
9633 if(!exp->expType)
9634 {
9635 exp->expType = op1->type;
9636 if(op1->type)
9637 op1->type->refCount++;
9638 }
9639 return 0x1;
9640 }
9641
9642 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9643 {
9644 unsigned int value2 = op2->ui;
9645
9646 exp->type = 2;
9647 exp->string = PrintUInt(op1->ui > value2);
9648 if(!exp->expType)
9649 {
9650 exp->expType = op1->type;
9651 if(op1->type)
9652 op1->type->refCount++;
9653 }
9654 return 0x1;
9655 }
9656
9657 static unsigned int Int64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9658 {
9659 int value2 = op2->i;
9660
9661 exp->type = 2;
9662 exp->string = PrintInt64(op1->i > value2);
9663 if(!exp->expType)
9664 {
9665 exp->expType = op1->type;
9666 if(op1->type)
9667 op1->type->refCount++;
9668 }
9669 return 0x1;
9670 }
9671
9672 static unsigned int UInt64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9673 {
9674 unsigned int value2 = op2->ui;
9675
9676 exp->type = 2;
9677 exp->string = PrintUInt64(op1->ui > value2);
9678 if(!exp->expType)
9679 {
9680 exp->expType = op1->type;
9681 if(op1->type)
9682 op1->type->refCount++;
9683 }
9684 return 0x1;
9685 }
9686
9687 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9688 {
9689 short value2 = op2->s;
9690
9691 exp->type = 2;
9692 exp->string = PrintShort(op1->s > value2);
9693 if(!exp->expType)
9694 {
9695 exp->expType = op1->type;
9696 if(op1->type)
9697 op1->type->refCount++;
9698 }
9699 return 0x1;
9700 }
9701
9702 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9703 {
9704 unsigned short value2 = op2->us;
9705
9706 exp->type = 2;
9707 exp->string = PrintUShort(op1->us > value2);
9708 if(!exp->expType)
9709 {
9710 exp->expType = op1->type;
9711 if(op1->type)
9712 op1->type->refCount++;
9713 }
9714 return 0x1;
9715 }
9716
9717 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9718 {
9719 char value2 = op2->c;
9720
9721 exp->type = 2;
9722 exp->string = PrintChar(op1->c > value2);
9723 if(!exp->expType)
9724 {
9725 exp->expType = op1->type;
9726 if(op1->type)
9727 op1->type->refCount++;
9728 }
9729 return 0x1;
9730 }
9731
9732 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9733 {
9734 unsigned char value2 = op2->uc;
9735
9736 exp->type = 2;
9737 exp->string = PrintUChar(op1->uc > value2);
9738 if(!exp->expType)
9739 {
9740 exp->expType = op1->type;
9741 if(op1->type)
9742 op1->type->refCount++;
9743 }
9744 return 0x1;
9745 }
9746
9747 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9748 {
9749 float value2 = op2->f;
9750
9751 exp->type = 2;
9752 exp->string = PrintFloat(op1->f > value2);
9753 if(!exp->expType)
9754 {
9755 exp->expType = op1->type;
9756 if(op1->type)
9757 op1->type->refCount++;
9758 }
9759 return 0x1;
9760 }
9761
9762 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9763 {
9764 double value2 = op2->d;
9765
9766 exp->type = 2;
9767 exp->string = PrintDouble(op1->d > value2);
9768 if(!exp->expType)
9769 {
9770 exp->expType = op1->type;
9771 if(op1->type)
9772 op1->type->refCount++;
9773 }
9774 return 0x1;
9775 }
9776
9777 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9778 {
9779 int value2 = op2->i;
9780
9781 exp->type = 2;
9782 exp->string = PrintInt(op1->i < value2);
9783 if(!exp->expType)
9784 {
9785 exp->expType = op1->type;
9786 if(op1->type)
9787 op1->type->refCount++;
9788 }
9789 return 0x1;
9790 }
9791
9792 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9793 {
9794 unsigned int value2 = op2->ui;
9795
9796 exp->type = 2;
9797 exp->string = PrintUInt(op1->ui < value2);
9798 if(!exp->expType)
9799 {
9800 exp->expType = op1->type;
9801 if(op1->type)
9802 op1->type->refCount++;
9803 }
9804 return 0x1;
9805 }
9806
9807 static unsigned int Int64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9808 {
9809 int value2 = op2->i;
9810
9811 exp->type = 2;
9812 exp->string = PrintInt64(op1->i < value2);
9813 if(!exp->expType)
9814 {
9815 exp->expType = op1->type;
9816 if(op1->type)
9817 op1->type->refCount++;
9818 }
9819 return 0x1;
9820 }
9821
9822 static unsigned int UInt64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9823 {
9824 unsigned int value2 = op2->ui;
9825
9826 exp->type = 2;
9827 exp->string = PrintUInt64(op1->ui < value2);
9828 if(!exp->expType)
9829 {
9830 exp->expType = op1->type;
9831 if(op1->type)
9832 op1->type->refCount++;
9833 }
9834 return 0x1;
9835 }
9836
9837 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9838 {
9839 short value2 = op2->s;
9840
9841 exp->type = 2;
9842 exp->string = PrintShort(op1->s < value2);
9843 if(!exp->expType)
9844 {
9845 exp->expType = op1->type;
9846 if(op1->type)
9847 op1->type->refCount++;
9848 }
9849 return 0x1;
9850 }
9851
9852 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9853 {
9854 unsigned short value2 = op2->us;
9855
9856 exp->type = 2;
9857 exp->string = PrintUShort(op1->us < value2);
9858 if(!exp->expType)
9859 {
9860 exp->expType = op1->type;
9861 if(op1->type)
9862 op1->type->refCount++;
9863 }
9864 return 0x1;
9865 }
9866
9867 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9868 {
9869 char value2 = op2->c;
9870
9871 exp->type = 2;
9872 exp->string = PrintChar(op1->c < value2);
9873 if(!exp->expType)
9874 {
9875 exp->expType = op1->type;
9876 if(op1->type)
9877 op1->type->refCount++;
9878 }
9879 return 0x1;
9880 }
9881
9882 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9883 {
9884 unsigned char value2 = op2->uc;
9885
9886 exp->type = 2;
9887 exp->string = PrintUChar(op1->uc < value2);
9888 if(!exp->expType)
9889 {
9890 exp->expType = op1->type;
9891 if(op1->type)
9892 op1->type->refCount++;
9893 }
9894 return 0x1;
9895 }
9896
9897 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9898 {
9899 float value2 = op2->f;
9900
9901 exp->type = 2;
9902 exp->string = PrintFloat(op1->f < value2);
9903 if(!exp->expType)
9904 {
9905 exp->expType = op1->type;
9906 if(op1->type)
9907 op1->type->refCount++;
9908 }
9909 return 0x1;
9910 }
9911
9912 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9913 {
9914 double value2 = op2->d;
9915
9916 exp->type = 2;
9917 exp->string = PrintDouble(op1->d < value2);
9918 if(!exp->expType)
9919 {
9920 exp->expType = op1->type;
9921 if(op1->type)
9922 op1->type->refCount++;
9923 }
9924 return 0x1;
9925 }
9926
9927 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9928 {
9929 int value2 = op2->i;
9930
9931 exp->type = 2;
9932 exp->string = PrintInt(op1->i >= value2);
9933 if(!exp->expType)
9934 {
9935 exp->expType = op1->type;
9936 if(op1->type)
9937 op1->type->refCount++;
9938 }
9939 return 0x1;
9940 }
9941
9942 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9943 {
9944 unsigned int value2 = op2->ui;
9945
9946 exp->type = 2;
9947 exp->string = PrintUInt(op1->ui >= value2);
9948 if(!exp->expType)
9949 {
9950 exp->expType = op1->type;
9951 if(op1->type)
9952 op1->type->refCount++;
9953 }
9954 return 0x1;
9955 }
9956
9957 static unsigned int Int64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9958 {
9959 int value2 = op2->i;
9960
9961 exp->type = 2;
9962 exp->string = PrintInt64(op1->i >= value2);
9963 if(!exp->expType)
9964 {
9965 exp->expType = op1->type;
9966 if(op1->type)
9967 op1->type->refCount++;
9968 }
9969 return 0x1;
9970 }
9971
9972 static unsigned int UInt64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9973 {
9974 unsigned int value2 = op2->ui;
9975
9976 exp->type = 2;
9977 exp->string = PrintUInt64(op1->ui >= value2);
9978 if(!exp->expType)
9979 {
9980 exp->expType = op1->type;
9981 if(op1->type)
9982 op1->type->refCount++;
9983 }
9984 return 0x1;
9985 }
9986
9987 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9988 {
9989 short value2 = op2->s;
9990
9991 exp->type = 2;
9992 exp->string = PrintShort(op1->s >= value2);
9993 if(!exp->expType)
9994 {
9995 exp->expType = op1->type;
9996 if(op1->type)
9997 op1->type->refCount++;
9998 }
9999 return 0x1;
10000 }
10001
10002 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10003 {
10004 unsigned short value2 = op2->us;
10005
10006 exp->type = 2;
10007 exp->string = PrintUShort(op1->us >= value2);
10008 if(!exp->expType)
10009 {
10010 exp->expType = op1->type;
10011 if(op1->type)
10012 op1->type->refCount++;
10013 }
10014 return 0x1;
10015 }
10016
10017 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10018 {
10019 char value2 = op2->c;
10020
10021 exp->type = 2;
10022 exp->string = PrintChar(op1->c >= value2);
10023 if(!exp->expType)
10024 {
10025 exp->expType = op1->type;
10026 if(op1->type)
10027 op1->type->refCount++;
10028 }
10029 return 0x1;
10030 }
10031
10032 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10033 {
10034 unsigned char value2 = op2->uc;
10035
10036 exp->type = 2;
10037 exp->string = PrintUChar(op1->uc >= value2);
10038 if(!exp->expType)
10039 {
10040 exp->expType = op1->type;
10041 if(op1->type)
10042 op1->type->refCount++;
10043 }
10044 return 0x1;
10045 }
10046
10047 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10048 {
10049 float value2 = op2->f;
10050
10051 exp->type = 2;
10052 exp->string = PrintFloat(op1->f >= value2);
10053 if(!exp->expType)
10054 {
10055 exp->expType = op1->type;
10056 if(op1->type)
10057 op1->type->refCount++;
10058 }
10059 return 0x1;
10060 }
10061
10062 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10063 {
10064 double value2 = op2->d;
10065
10066 exp->type = 2;
10067 exp->string = PrintDouble(op1->d >= value2);
10068 if(!exp->expType)
10069 {
10070 exp->expType = op1->type;
10071 if(op1->type)
10072 op1->type->refCount++;
10073 }
10074 return 0x1;
10075 }
10076
10077 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10078 {
10079 int value2 = op2->i;
10080
10081 exp->type = 2;
10082 exp->string = PrintInt(op1->i <= value2);
10083 if(!exp->expType)
10084 {
10085 exp->expType = op1->type;
10086 if(op1->type)
10087 op1->type->refCount++;
10088 }
10089 return 0x1;
10090 }
10091
10092 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10093 {
10094 unsigned int value2 = op2->ui;
10095
10096 exp->type = 2;
10097 exp->string = PrintUInt(op1->ui <= value2);
10098 if(!exp->expType)
10099 {
10100 exp->expType = op1->type;
10101 if(op1->type)
10102 op1->type->refCount++;
10103 }
10104 return 0x1;
10105 }
10106
10107 static unsigned int Int64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10108 {
10109 int value2 = op2->i;
10110
10111 exp->type = 2;
10112 exp->string = PrintInt64(op1->i <= value2);
10113 if(!exp->expType)
10114 {
10115 exp->expType = op1->type;
10116 if(op1->type)
10117 op1->type->refCount++;
10118 }
10119 return 0x1;
10120 }
10121
10122 static unsigned int UInt64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10123 {
10124 unsigned int value2 = op2->ui;
10125
10126 exp->type = 2;
10127 exp->string = PrintUInt64(op1->ui <= value2);
10128 if(!exp->expType)
10129 {
10130 exp->expType = op1->type;
10131 if(op1->type)
10132 op1->type->refCount++;
10133 }
10134 return 0x1;
10135 }
10136
10137 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10138 {
10139 short value2 = op2->s;
10140
10141 exp->type = 2;
10142 exp->string = PrintShort(op1->s <= value2);
10143 if(!exp->expType)
10144 {
10145 exp->expType = op1->type;
10146 if(op1->type)
10147 op1->type->refCount++;
10148 }
10149 return 0x1;
10150 }
10151
10152 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10153 {
10154 unsigned short value2 = op2->us;
10155
10156 exp->type = 2;
10157 exp->string = PrintUShort(op1->us <= value2);
10158 if(!exp->expType)
10159 {
10160 exp->expType = op1->type;
10161 if(op1->type)
10162 op1->type->refCount++;
10163 }
10164 return 0x1;
10165 }
10166
10167 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10168 {
10169 char value2 = op2->c;
10170
10171 exp->type = 2;
10172 exp->string = PrintChar(op1->c <= value2);
10173 if(!exp->expType)
10174 {
10175 exp->expType = op1->type;
10176 if(op1->type)
10177 op1->type->refCount++;
10178 }
10179 return 0x1;
10180 }
10181
10182 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10183 {
10184 unsigned char value2 = op2->uc;
10185
10186 exp->type = 2;
10187 exp->string = PrintUChar(op1->uc <= value2);
10188 if(!exp->expType)
10189 {
10190 exp->expType = op1->type;
10191 if(op1->type)
10192 op1->type->refCount++;
10193 }
10194 return 0x1;
10195 }
10196
10197 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10198 {
10199 float value2 = op2->f;
10200
10201 exp->type = 2;
10202 exp->string = PrintFloat(op1->f <= value2);
10203 if(!exp->expType)
10204 {
10205 exp->expType = op1->type;
10206 if(op1->type)
10207 op1->type->refCount++;
10208 }
10209 return 0x1;
10210 }
10211
10212 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10213 {
10214 double value2 = op2->d;
10215
10216 exp->type = 2;
10217 exp->string = PrintDouble(op1->d <= value2);
10218 if(!exp->expType)
10219 {
10220 exp->expType = op1->type;
10221 if(op1->type)
10222 op1->type->refCount++;
10223 }
10224 return 0x1;
10225 }
10226
10227 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10228 {
10229 exp->type = 2;
10230 exp->string = PrintInt(op1->i ? op2->i : op3->i);
10231 if(!exp->expType)
10232 {
10233 exp->expType = op1->type;
10234 if(op1->type)
10235 op1->type->refCount++;
10236 }
10237 return 0x1;
10238 }
10239
10240 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10241 {
10242 exp->type = 2;
10243 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
10244 if(!exp->expType)
10245 {
10246 exp->expType = op1->type;
10247 if(op1->type)
10248 op1->type->refCount++;
10249 }
10250 return 0x1;
10251 }
10252
10253 static unsigned int Int64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10254 {
10255 exp->type = 2;
10256 exp->string = PrintInt64(op1->i ? op2->i : op3->i);
10257 if(!exp->expType)
10258 {
10259 exp->expType = op1->type;
10260 if(op1->type)
10261 op1->type->refCount++;
10262 }
10263 return 0x1;
10264 }
10265
10266 static unsigned int UInt64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10267 {
10268 exp->type = 2;
10269 exp->string = PrintUInt64(op1->ui ? op2->ui : op3->ui);
10270 if(!exp->expType)
10271 {
10272 exp->expType = op1->type;
10273 if(op1->type)
10274 op1->type->refCount++;
10275 }
10276 return 0x1;
10277 }
10278
10279 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10280 {
10281 exp->type = 2;
10282 exp->string = PrintShort(op1->s ? op2->s : op3->s);
10283 if(!exp->expType)
10284 {
10285 exp->expType = op1->type;
10286 if(op1->type)
10287 op1->type->refCount++;
10288 }
10289 return 0x1;
10290 }
10291
10292 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10293 {
10294 exp->type = 2;
10295 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
10296 if(!exp->expType)
10297 {
10298 exp->expType = op1->type;
10299 if(op1->type)
10300 op1->type->refCount++;
10301 }
10302 return 0x1;
10303 }
10304
10305 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10306 {
10307 exp->type = 2;
10308 exp->string = PrintChar(op1->c ? op2->c : op3->c);
10309 if(!exp->expType)
10310 {
10311 exp->expType = op1->type;
10312 if(op1->type)
10313 op1->type->refCount++;
10314 }
10315 return 0x1;
10316 }
10317
10318 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10319 {
10320 exp->type = 2;
10321 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
10322 if(!exp->expType)
10323 {
10324 exp->expType = op1->type;
10325 if(op1->type)
10326 op1->type->refCount++;
10327 }
10328 return 0x1;
10329 }
10330
10331 static unsigned int FloatCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10332 {
10333 exp->type = 2;
10334 exp->string = PrintFloat(op1->f ? op2->f : op3->f);
10335 if(!exp->expType)
10336 {
10337 exp->expType = op1->type;
10338 if(op1->type)
10339 op1->type->refCount++;
10340 }
10341 return 0x1;
10342 }
10343
10344 static unsigned int DoubleCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10345 {
10346 exp->type = 2;
10347 exp->string = PrintDouble(op1->d ? op2->d : op3->d);
10348 if(!exp->expType)
10349 {
10350 exp->expType = op1->type;
10351 if(op1->type)
10352 op1->type->refCount++;
10353 }
10354 return 0x1;
10355 }
10356
10357 struct OpTable intOps = 
10358 {
10359 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
10360 };
10361
10362 struct OpTable uintOps = 
10363 {
10364 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
10365 };
10366
10367 struct OpTable int64Ops = 
10368 {
10369 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
10370 };
10371
10372 struct OpTable uint64Ops = 
10373 {
10374 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
10375 };
10376
10377 struct OpTable shortOps = 
10378 {
10379 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
10380 };
10381
10382 struct OpTable ushortOps = 
10383 {
10384 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
10385 };
10386
10387 struct OpTable floatOps = 
10388 {
10389 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
10390 };
10391
10392 struct OpTable doubleOps = 
10393 {
10394 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
10395 };
10396
10397 struct OpTable charOps = 
10398 {
10399 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
10400 };
10401
10402 struct OpTable ucharOps = 
10403 {
10404 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
10405 };
10406
10407 void ReadString(char * output, char * string)
10408 {
10409 int len = strlen(string);
10410 int c, d = 0;
10411 unsigned int quoted = 0x0, escaped = 0x0;
10412
10413 for(c = 0; c < len; c++)
10414 {
10415 char ch = string[c];
10416
10417 if(escaped)
10418 {
10419 switch(ch)
10420 {
10421 case 'n':
10422 output[d] = '\n';
10423 break;
10424 case 't':
10425 output[d] = '\t';
10426 break;
10427 case 'a':
10428 output[d] = '\a';
10429 break;
10430 case 'b':
10431 output[d] = '\b';
10432 break;
10433 case 'f':
10434 output[d] = '\f';
10435 break;
10436 case 'r':
10437 output[d] = '\r';
10438 break;
10439 case 'v':
10440 output[d] = '\v';
10441 break;
10442 case '\\':
10443 output[d] = '\\';
10444 break;
10445 case '\"':
10446 output[d] = '\"';
10447 break;
10448 default:
10449 output[d++] = '\\';
10450 output[d] = ch;
10451 }
10452 d++;
10453 escaped = 0x0;
10454 }
10455 else
10456 {
10457 if(ch == '\"')
10458 quoted ^= 0x1;
10459 else if(quoted)
10460 {
10461 if(ch == '\\')
10462 escaped = 0x1;
10463 else
10464 output[d++] = ch;
10465 }
10466 }
10467 }
10468 output[d] = '\0';
10469 }
10470
10471 extern long long __ecereNameSpace__ecere__com___strtoi64(char *  string, char * *  endString, int base);
10472
10473 extern uint64 __ecereNameSpace__ecere__com___strtoui64(char *  string, char * *  endString, int base);
10474
10475 extern double strtod(char * , char * * );
10476
10477 struct Operand GetOperand(struct Expression * exp)
10478 {
10479 struct Operand op = 
10480 {
10481 0, 0, 0, 0, 
10482 {
10483 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10484 }
10485 };
10486 struct Type * type = exp->expType;
10487
10488 if(type)
10489 {
10490 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
10491 {
10492 if(!type->_class->registered->dataType)
10493 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
10494 type = type->_class->registered->dataType;
10495 }
10496 op.kind = type->kind;
10497 op.type = exp->expType;
10498 if(exp->isConstant && exp->type == 2)
10499 {
10500 switch(op.kind)
10501 {
10502 case 24:
10503 case 1:
10504 {
10505 if(exp->constant[0] == '\'')
10506 op.c = exp->constant[1];
10507 else if(type->isSigned)
10508 {
10509 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
10510 op.ops = charOps;
10511 }
10512 else
10513 {
10514 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
10515 op.ops = ucharOps;
10516 }
10517 break;
10518 }
10519 case 2:
10520 if(type->isSigned)
10521 {
10522 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
10523 op.ops = shortOps;
10524 }
10525 else
10526 {
10527 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
10528 op.ops = ushortOps;
10529 }
10530 break;
10531 case 3:
10532 case 5:
10533 if(type->isSigned)
10534 {
10535 op.i = strtol(exp->constant, (((void *)0)), 0);
10536 op.ops = intOps;
10537 }
10538 else
10539 {
10540 op.ui = strtoul(exp->constant, (((void *)0)), 0);
10541 op.ops = uintOps;
10542 }
10543 op.kind = 3;
10544 break;
10545 case 4:
10546 if(type->isSigned)
10547 {
10548 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10549 op.ops = intOps;
10550 }
10551 else
10552 {
10553 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10554 op.ops = uintOps;
10555 }
10556 op.kind = 4;
10557 break;
10558 case 22:
10559 if(type->isSigned)
10560 {
10561 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10562 op.ops = int64Ops;
10563 }
10564 else
10565 {
10566 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10567 op.ops = uint64Ops;
10568 }
10569 op.kind = 4;
10570 break;
10571 case 23:
10572 if(type->isSigned)
10573 {
10574 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10575 op.ops = int64Ops;
10576 }
10577 else
10578 {
10579 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10580 op.ops = uint64Ops;
10581 }
10582 op.kind = 4;
10583 break;
10584 case 6:
10585 op.f = (float)strtod(exp->constant, (((void *)0)));
10586 op.ops = floatOps;
10587 break;
10588 case 7:
10589 op.d = (double)strtod(exp->constant, (((void *)0)));
10590 op.ops = doubleOps;
10591 break;
10592 case 12:
10593 case 13:
10594 case 8:
10595 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10596 op.kind = 13;
10597 op.ops = uintOps;
10598 break;
10599 }
10600 }
10601 }
10602 return op;
10603 }
10604
10605 int __ecereVMethodID_class_OnGetString;
10606
10607 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
10608
10609 static void UnusedFunction()
10610 {
10611 int a;
10612
10613 ((char *  (*)(struct __ecereNameSpace__ecere__com__Class *, void *, char *  tempString, void *  fieldData, unsigned int *  needClass))__ecereClass_int->_vTbl[__ecereVMethodID_class_OnGetString])(__ecereClass_int, &a, 0, 0, 0);
10614 }
10615
10616 extern int __ecereVMethodID_class_OnGetString;
10617
10618 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
10619 {
10620 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10621
10622 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
10623 {
10624 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
10625 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
10626 else
10627 {
10628 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10629 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
10630 struct Type * type;
10631 void * ptr = inst->data + dataMember->offset + offset;
10632 char * result = (((void *)0));
10633
10634 exp->loc = member->loc = inst->loc;
10635 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
10636 if(!dataMember->dataType)
10637 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
10638 type = dataMember->dataType;
10639 if(type->kind == 8)
10640 {
10641 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10642
10643 if(_class->type == 4)
10644 {
10645 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
10646
10647 if(enumClass)
10648 {
10649 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
10650 struct __ecereNameSpace__ecere__sys__NamedLink * item;
10651
10652 for(item = e->values.first; item; item = item->next)
10653 {
10654 if((int)item->data == *(int *)ptr)
10655 {
10656 result = item->name;
10657 break;
10658 }
10659 }
10660 if(result)
10661 {
10662 exp->identifier = MkIdentifier(result);
10663 exp->type = 0;
10664 exp->destType = MkClassType(_class->fullName);
10665 ProcessExpressionType(exp);
10666 }
10667 }
10668 }
10669 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
10670 {
10671 if(!_class->dataType)
10672 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10673 type = _class->dataType;
10674 }
10675 }
10676 if(!result)
10677 {
10678 switch(type->kind)
10679 {
10680 case 6:
10681 {
10682 FreeExpContents(exp);
10683 exp->constant = PrintFloat(*(float *)ptr);
10684 exp->type = 2;
10685 break;
10686 }
10687 case 7:
10688 {
10689 FreeExpContents(exp);
10690 exp->constant = PrintDouble(*(double *)ptr);
10691 exp->type = 2;
10692 break;
10693 }
10694 case 3:
10695 {
10696 FreeExpContents(exp);
10697 exp->constant = PrintInt(*(int *)ptr);
10698 exp->type = 2;
10699 break;
10700 }
10701 case 4:
10702 {
10703 FreeExpContents(exp);
10704 exp->constant = PrintInt64(*(long long *)ptr);
10705 exp->type = 2;
10706 break;
10707 }
10708 case 22:
10709 {
10710 FreeExpContents(exp);
10711 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
10712 exp->type = 2;
10713 break;
10714 }
10715 case 23:
10716 {
10717 FreeExpContents(exp);
10718 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
10719 exp->type = 2;
10720 break;
10721 }
10722 default:
10723 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
10724 }
10725 }
10726 ListAdd(memberList, member);
10727 }
10728 if(parentDataMember->type == 1)
10729 break;
10730 }
10731 }
10732
10733 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
10734
10735 void PopulateInstance(struct Instantiation * inst)
10736 {
10737 struct Symbol * classSym = inst->_class->symbol;
10738 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
10739 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10740 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
10741
10742 if(!inst->members)
10743 inst->members = MkListOne(MkMembersInitList(memberList));
10744 else
10745 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
10746 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
10747 {
10748 if(!dataMember->isProperty)
10749 {
10750 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
10751 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
10752 else
10753 {
10754 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10755 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
10756 struct Type * type;
10757 void * ptr = inst->data + dataMember->offset;
10758 char * result = (((void *)0));
10759
10760 exp->loc = member->loc = inst->loc;
10761 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
10762 if(!dataMember->dataType)
10763 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
10764 type = dataMember->dataType;
10765 if(type->kind == 8)
10766 {
10767 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10768
10769 if(_class->type == 4)
10770 {
10771 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
10772
10773 if(enumClass)
10774 {
10775 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
10776 struct __ecereNameSpace__ecere__sys__NamedLink * item;
10777
10778 for(item = e->values.first; item; item = item->next)
10779 {
10780 if((int)item->data == *(int *)ptr)
10781 {
10782 result = item->name;
10783 break;
10784 }
10785 }
10786 }
10787 if(result)
10788 {
10789 exp->identifier = MkIdentifier(result);
10790 exp->type = 0;
10791 exp->destType = MkClassType(_class->fullName);
10792 ProcessExpressionType(exp);
10793 }
10794 }
10795 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
10796 {
10797 if(!_class->dataType)
10798 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10799 type = _class->dataType;
10800 }
10801 }
10802 if(!result)
10803 {
10804 switch(type->kind)
10805 {
10806 case 6:
10807 {
10808 exp->constant = PrintFloat(*(float *)ptr);
10809 exp->type = 2;
10810 break;
10811 }
10812 case 7:
10813 {
10814 exp->constant = PrintDouble(*(double *)ptr);
10815 exp->type = 2;
10816 break;
10817 }
10818 case 3:
10819 {
10820 exp->constant = PrintInt(*(int *)ptr);
10821 exp->type = 2;
10822 break;
10823 }
10824 case 4:
10825 {
10826 exp->constant = PrintInt64(*(long long *)ptr);
10827 exp->type = 2;
10828 break;
10829 }
10830 case 22:
10831 {
10832 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
10833 exp->type = 2;
10834 break;
10835 }
10836 default:
10837 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
10838 }
10839 }
10840 ListAdd(memberList, member);
10841 }
10842 }
10843 }
10844 }
10845
10846 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(struct __ecereNameSpace__ecere__com__Class * _class, char *  name, unsigned int *  offset, struct __ecereNameSpace__ecere__com__Instance * module, struct __ecereNameSpace__ecere__com__DataMember **  subMemberStack, int *  subMemberStackPos);
10847
10848 extern void FreeInstance(struct Instantiation * inst);
10849
10850 void ComputeInstantiation(struct Expression * exp)
10851 {
10852 struct Instantiation * inst = exp->instance;
10853 struct MembersInit * members;
10854 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
10855 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
10856 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
10857 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
10858 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
10859 int subMemberStackPos = 0;
10860 uint64 bits = 0;
10861
10862 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
10863 {
10864 if(inst->data)
10865 return ;
10866 if(_class->type == 0 || _class->type == 5)
10867 {
10868 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
10869 if(_class->type == 0)
10870 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)inst->data))->_refCount++;
10871 }
10872 else
10873 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10874 }
10875 if(inst->members)
10876 {
10877 for(members = (*inst->members).first; members; members = members->next)
10878 {
10879 switch(members->type)
10880 {
10881 case 0:
10882 {
10883 if(members->dataMembers)
10884 {
10885 struct MemberInit * member;
10886
10887 for(member = (*members->dataMembers).first; member; member = member->next)
10888 {
10889 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
10890 unsigned int found = 0x0;
10891 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
10892 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
10893 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
10894 unsigned int dataMemberOffset;
10895
10896 if(!ident)
10897 {
10898 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
10899 if(curMember)
10900 {
10901 if(curMember->isProperty)
10902 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
10903 else
10904 {
10905 dataMember = curMember;
10906 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
10907 if(_class->type == 0)
10908 dataMemberOffset += _class->base->structSize;
10909 }
10910 found = 0x1;
10911 }
10912 }
10913 else
10914 {
10915 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
10916 if(prop)
10917 {
10918 found = 0x1;
10919 if(prop->memberAccess == 1)
10920 {
10921 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
10922 curClass = prop->_class;
10923 }
10924 }
10925 else
10926 {
10927 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
10928 int _subMemberStackPos = 0;
10929
10930 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
10931 if(dataMember)
10932 {
10933 found = 0x1;
10934 if(dataMember->memberAccess == 1)
10935 {
10936 curMember = dataMember;
10937 curClass = dataMember->_class;
10938 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
10939 subMemberStackPos = _subMemberStackPos;
10940 }
10941 }
10942 }
10943 }
10944 if(found && member->initializer && member->initializer->type == 0)
10945 {
10946 struct Expression * value = member->initializer->exp;
10947 struct Type * type = (((void *)0));
10948 unsigned int deepMember = 0x0;
10949
10950 if(prop)
10951 {
10952 type = prop->dataType;
10953 }
10954 else if(dataMember)
10955 {
10956 if(!dataMember->dataType)
10957 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
10958 type = dataMember->dataType;
10959 }
10960 if(ident && ident->next)
10961 {
10962 deepMember = 0x1;
10963 for(ident = ident->next; ident && type; ident = ident->next)
10964 {
10965 if(type->kind == 8)
10966 {
10967 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
10968 if(prop)
10969 type = prop->dataType;
10970 else
10971 {
10972 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
10973 if(dataMember)
10974 type = dataMember->dataType;
10975 }
10976 }
10977 else if(type->kind == 9 || type->kind == 10)
10978 {
10979 struct Type * memberType;
10980
10981 for(memberType = type->members.first; memberType; memberType = memberType->next)
10982 {
10983 if(!strcmp(memberType->name, ident->string))
10984 {
10985 type = memberType;
10986 break;
10987 }
10988 }
10989 }
10990 }
10991 }
10992 if(value)
10993 {
10994 FreeType(value->destType);
10995 value->destType = type;
10996 if(type)
10997 type->refCount++;
10998 ComputeExpression(value);
10999 }
11000 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11001 {
11002 if(type->kind == 8)
11003 {
11004 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11005
11006 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
11007 {
11008 if(!_class->dataType)
11009 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11010 type = _class->dataType;
11011 }
11012 }
11013 if(dataMember)
11014 {
11015 void * ptr = inst->data + dataMemberOffset;
11016
11017 if(value->type == 2)
11018 {
11019 switch(type->kind)
11020 {
11021 case 3:
11022 {
11023 GetInt(value, (int *)ptr);
11024 break;
11025 }
11026 case 4:
11027 {
11028 GetInt64(value, (long long *)ptr);
11029 break;
11030 }
11031 case 22:
11032 {
11033 GetIntPtr(value, (intptr_t *)ptr);
11034 break;
11035 }
11036 case 23:
11037 {
11038 GetIntSize(value, (ssize_t *)ptr);
11039 break;
11040 }
11041 case 6:
11042 {
11043 GetFloat(value, (float *)ptr);
11044 break;
11045 }
11046 case 7:
11047 {
11048 GetDouble(value, (double *)ptr);
11049 break;
11050 }
11051 }
11052 }
11053 else if(value->type == 1)
11054 {
11055 if(type->kind == 8)
11056 {
11057 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11058
11059 if(_class->type == 1)
11060 {
11061 ComputeTypeSize(type);
11062 if(value->instance->data)
11063 memcpy(ptr, value->instance->data, type->size);
11064 }
11065 }
11066 }
11067 }
11068 else if(prop)
11069 {
11070 if(value->type == 1 && value->instance->data)
11071 {
11072 if(type->kind == 8)
11073 {
11074 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11075
11076 if(_class && (_class->type != 0 || __ecereNameSpace__ecere__com__eClass_IsDerived(((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)value->instance->data))->_class, _class)))
11077 {
11078 void (* Set)(void *, void *) = (void *)prop->Set;
11079
11080 Set(inst->data, value->instance->data);
11081 PopulateInstance(inst);
11082 }
11083 }
11084 }
11085 else if(value->type == 2)
11086 {
11087 switch(type->kind)
11088 {
11089 case 7:
11090 {
11091 void (* Set)(void *, double) = (void *)prop->Set;
11092
11093 Set(inst->data, strtod(value->constant, (((void *)0))));
11094 break;
11095 }
11096 case 6:
11097 {
11098 void (* Set)(void *, float) = (void *)prop->Set;
11099
11100 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
11101 break;
11102 }
11103 case 3:
11104 {
11105 void (* Set)(void *, int) = (void *)prop->Set;
11106
11107 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
11108 break;
11109 }
11110 case 4:
11111 {
11112 void (* Set)(void *, long long) = (void *)prop->Set;
11113
11114 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11115 break;
11116 }
11117 case 22:
11118 {
11119 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11120
11121 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11122 break;
11123 }
11124 case 23:
11125 {
11126 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11127
11128 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11129 break;
11130 }
11131 }
11132 }
11133 else if(value->type == 3)
11134 {
11135 char temp[1024];
11136
11137 ReadString(temp, value->string);
11138 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
11139 }
11140 }
11141 }
11142 else if(!deepMember && type && _class->type == 3)
11143 {
11144 if(prop)
11145 {
11146 if(value->type == 2)
11147 {
11148 if(type->kind == 8)
11149 {
11150 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11151
11152 if(_class->type == 3)
11153 {
11154 if(!_class->dataType)
11155 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11156 type = _class->dataType;
11157 }
11158 }
11159 switch(type->kind)
11160 {
11161 case 6:
11162 {
11163 float fValue;
11164 float (* Set)(float) = (void *)prop->Set;
11165
11166 GetFloat(member->initializer->exp, &fValue);
11167 exp->constant = PrintFloat(Set(fValue));
11168 exp->type = 2;
11169 break;
11170 }
11171 case 7:
11172 {
11173 double dValue;
11174 double (* Set)(double) = (void *)prop->Set;
11175
11176 GetDouble(member->initializer->exp, &dValue);
11177 exp->constant = PrintDouble(Set(dValue));
11178 exp->type = 2;
11179 break;
11180 }
11181 }
11182 }
11183 }
11184 }
11185 else if(!deepMember && type && _class->type == 2)
11186 {
11187 if(prop)
11188 {
11189 if(value->type == 1 && value->instance->data)
11190 {
11191 unsigned int (* Set)(void *) = (void *)prop->Set;
11192
11193 bits = Set(value->instance->data);
11194 }
11195 else if(value->type == 2)
11196 {
11197 }
11198 }
11199 else if(dataMember)
11200 {
11201 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
11202 struct Type * type;
11203 int part = 0;
11204
11205 GetInt(value, &part);
11206 bits = (bits & ~bitMember->mask);
11207 if(!bitMember->dataType)
11208 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
11209 type = bitMember->dataType;
11210 if(type->kind == 8 && type->_class && type->_class->registered)
11211 {
11212 if(!type->_class->registered->dataType)
11213 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
11214 type = type->_class->registered->dataType;
11215 }
11216 switch(type->kind)
11217 {
11218 case 24:
11219 case 1:
11220 if(type->isSigned)
11221 bits |= ((char)part << bitMember->pos);
11222 else
11223 bits |= ((unsigned char)part << bitMember->pos);
11224 break;
11225 case 2:
11226 if(type->isSigned)
11227 bits |= ((short)part << bitMember->pos);
11228 else
11229 bits |= ((unsigned short)part << bitMember->pos);
11230 break;
11231 case 3:
11232 case 5:
11233 if(type->isSigned)
11234 bits |= (part << bitMember->pos);
11235 else
11236 bits |= ((unsigned int)part << bitMember->pos);
11237 break;
11238 case 4:
11239 if(type->isSigned)
11240 bits |= ((long long)part << bitMember->pos);
11241 else
11242 bits |= ((uint64)part << bitMember->pos);
11243 break;
11244 case 22:
11245 if(type->isSigned)
11246 {
11247 bits |= ((intptr_t)part << bitMember->pos);
11248 }
11249 else
11250 {
11251 bits |= ((uintptr_t)part << bitMember->pos);
11252 }
11253 break;
11254 case 23:
11255 if(type->isSigned)
11256 {
11257 bits |= ((ssize_t)part << bitMember->pos);
11258 }
11259 else
11260 {
11261 bits |= ((size_t)part << bitMember->pos);
11262 }
11263 break;
11264 }
11265 }
11266 }
11267 }
11268 else
11269 {
11270 if(_class && _class->type == 3)
11271 {
11272 ComputeExpression(member->initializer->exp);
11273 exp->constant = member->initializer->exp->constant;
11274 exp->type = 2;
11275 member->initializer->exp->constant = (((void *)0));
11276 }
11277 }
11278 }
11279 }
11280 break;
11281 }
11282 }
11283 }
11284 }
11285 if(_class && _class->type == 2)
11286 {
11287 exp->constant = PrintHexUInt(bits);
11288 exp->type = 2;
11289 }
11290 if(exp->type != 1)
11291 {
11292 FreeInstance(inst);
11293 }
11294 }
11295
11296 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
11297 {
11298 if(exp->op.op == SIZEOF)
11299 {
11300 FreeExpContents(exp);
11301 exp->type = 2;
11302 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
11303 }
11304 else
11305 {
11306 if(!exp->op.exp1)
11307 {
11308 switch(exp->op.op)
11309 {
11310 case '+':
11311 {
11312 struct Expression * exp2 = exp->op.exp2;
11313
11314 exp->op.exp2 = (((void *)0));
11315 FreeExpContents(exp);
11316 FreeType(exp->expType);
11317 FreeType(exp->destType);
11318 *exp = *exp2;
11319 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
11320 break;
11321 }
11322 case '-':
11323 if(op1->ops.Neg)
11324 {
11325 FreeExpContents(exp);
11326 op1->ops.Neg(exp, op1);
11327 }
11328 break;
11329 case '~':
11330 if(op1->ops.BitNot)
11331 {
11332 FreeExpContents(exp);
11333 op1->ops.BitNot(exp, op1);
11334 }
11335 break;
11336 case '!':
11337 if(op1->ops.Not)
11338 {
11339 FreeExpContents(exp);
11340 op1->ops.Not(exp, op1);
11341 }
11342 break;
11343 }
11344 }
11345 else
11346 {
11347 switch(exp->op.op)
11348 {
11349 case '+':
11350 if(op1->ops.Add)
11351 {
11352 FreeExpContents(exp);
11353 op1->ops.Add(exp, op1, op2);
11354 }
11355 break;
11356 case '-':
11357 if(op1->ops.Sub)
11358 {
11359 FreeExpContents(exp);
11360 op1->ops.Sub(exp, op1, op2);
11361 }
11362 break;
11363 case '*':
11364 if(op1->ops.Mul)
11365 {
11366 FreeExpContents(exp);
11367 op1->ops.Mul(exp, op1, op2);
11368 }
11369 break;
11370 case '/':
11371 if(op1->ops.Div)
11372 {
11373 FreeExpContents(exp);
11374 op1->ops.Div(exp, op1, op2);
11375 }
11376 break;
11377 case '%':
11378 if(op1->ops.Mod)
11379 {
11380 FreeExpContents(exp);
11381 op1->ops.Mod(exp, op1, op2);
11382 }
11383 break;
11384 case '&':
11385 if(exp->op.exp2)
11386 {
11387 if(op1->ops.BitAnd)
11388 {
11389 FreeExpContents(exp);
11390 op1->ops.BitAnd(exp, op1, op2);
11391 }
11392 }
11393 break;
11394 case '|':
11395 if(op1->ops.BitOr)
11396 {
11397 FreeExpContents(exp);
11398 op1->ops.BitOr(exp, op1, op2);
11399 }
11400 break;
11401 case '^':
11402 if(op1->ops.BitXor)
11403 {
11404 FreeExpContents(exp);
11405 op1->ops.BitXor(exp, op1, op2);
11406 }
11407 break;
11408 case LEFT_OP:
11409 if(op1->ops.LShift)
11410 {
11411 FreeExpContents(exp);
11412 op1->ops.LShift(exp, op1, op2);
11413 }
11414 break;
11415 case RIGHT_OP:
11416 if(op1->ops.RShift)
11417 {
11418 FreeExpContents(exp);
11419 op1->ops.RShift(exp, op1, op2);
11420 }
11421 break;
11422 case EQ_OP:
11423 if(op1->ops.Equ)
11424 {
11425 FreeExpContents(exp);
11426 op1->ops.Equ(exp, op1, op2);
11427 }
11428 break;
11429 case NE_OP:
11430 if(op1->ops.Nqu)
11431 {
11432 FreeExpContents(exp);
11433 op1->ops.Nqu(exp, op1, op2);
11434 }
11435 break;
11436 case AND_OP:
11437 if(op1->ops.And)
11438 {
11439 FreeExpContents(exp);
11440 op1->ops.And(exp, op1, op2);
11441 }
11442 break;
11443 case OR_OP:
11444 if(op1->ops.Or)
11445 {
11446 FreeExpContents(exp);
11447 op1->ops.Or(exp, op1, op2);
11448 }
11449 break;
11450 case '>':
11451 if(op1->ops.Grt)
11452 {
11453 FreeExpContents(exp);
11454 op1->ops.Grt(exp, op1, op2);
11455 }
11456 break;
11457 case '<':
11458 if(op1->ops.Sma)
11459 {
11460 FreeExpContents(exp);
11461 op1->ops.Sma(exp, op1, op2);
11462 }
11463 break;
11464 case GE_OP:
11465 if(op1->ops.GrtEqu)
11466 {
11467 FreeExpContents(exp);
11468 op1->ops.GrtEqu(exp, op1, op2);
11469 }
11470 break;
11471 case LE_OP:
11472 if(op1->ops.SmaEqu)
11473 {
11474 FreeExpContents(exp);
11475 op1->ops.SmaEqu(exp, op1, op2);
11476 }
11477 break;
11478 }
11479 }
11480 }
11481 }
11482
11483 void PrintTypeNoConst(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
11484
11485 extern struct Expression * MkExpIdentifier(struct Identifier * id);
11486
11487 void ComputeExpression(struct Expression * exp)
11488 {
11489 char expString[10240];
11490
11491 expString[0] = '\0';
11492 switch(exp->type)
11493 {
11494 case 1:
11495 {
11496 ComputeInstantiation(exp);
11497 break;
11498 }
11499 case 4:
11500 {
11501 struct Expression * exp1, * exp2 = (((void *)0));
11502 struct Operand op1 = 
11503 {
11504 0, 0, 0, 0, 
11505 {
11506 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11507 }
11508 };
11509 struct Operand op2 = 
11510 {
11511 0, 0, 0, 0, 
11512 {
11513 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11514 }
11515 };
11516
11517 if(exp->op.exp2)
11518 ComputeExpression(exp->op.exp2);
11519 if(exp->op.exp1)
11520 {
11521 ComputeExpression(exp->op.exp1);
11522 exp1 = exp->op.exp1;
11523 exp2 = exp->op.exp2;
11524 op1 = GetOperand(exp1);
11525 if(op1.type)
11526 op1.type->refCount++;
11527 if(exp2)
11528 {
11529 op2 = GetOperand(exp2);
11530 if(op2.type)
11531 op2.type->refCount++;
11532 }
11533 }
11534 else
11535 {
11536 exp1 = exp->op.exp2;
11537 op1 = GetOperand(exp1);
11538 if(op1.type)
11539 op1.type->refCount++;
11540 }
11541 CallOperator(exp, exp1, exp2, &op1, &op2);
11542 if(op1.type)
11543 FreeType(op1.type);
11544 if(op2.type)
11545 FreeType(op2.type);
11546 break;
11547 }
11548 case 5:
11549 case 34:
11550 {
11551 struct Expression * e, * n;
11552
11553 for(e = (*exp->list).first; e; e = n)
11554 {
11555 n = e->next;
11556 if(!n)
11557 {
11558 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
11559
11560 ComputeExpression(e);
11561 FreeType(exp->expType);
11562 FreeType(exp->destType);
11563 *exp = *e;
11564 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
11565 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
11566 }
11567 else
11568 {
11569 FreeExpression(e);
11570 }
11571 }
11572 break;
11573 }
11574 case 8:
11575 {
11576 struct Expression * memberExp = exp->member.exp;
11577 struct Identifier * memberID = exp->member.member;
11578 struct Type * type;
11579
11580 ComputeExpression(exp->member.exp);
11581 type = exp->member.exp->expType;
11582 if(type)
11583 {
11584 struct __ecereNameSpace__ecere__com__Class * _class = (exp->member.member && exp->member.member->classSym) ? exp->member.member->classSym->registered : (((type->kind == 8 || type->kind == 19) && type->_class) ? type->_class->registered : (((void *)0)));
11585 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11586 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11587 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
11588
11589 if(type->kind == 19 && exp->member.exp->type == 26)
11590 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
11591 if(!_class)
11592 {
11593 char string[256];
11594 struct Symbol * classSym;
11595
11596 string[0] = '\0';
11597 PrintTypeNoConst(type, string, 0x0, 0x1);
11598 classSym = FindClass(string);
11599 _class = classSym ? classSym->registered : (((void *)0));
11600 }
11601 if(exp->member.member)
11602 {
11603 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
11604 if(!prop)
11605 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
11606 }
11607 if(!prop && !member && _class && exp->member.member)
11608 {
11609 struct Symbol * classSym = FindClass(exp->member.member->string);
11610
11611 convertTo = _class;
11612 _class = classSym ? classSym->registered : (((void *)0));
11613 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
11614 }
11615 if(prop)
11616 {
11617 if(prop->compiled)
11618 {
11619 struct Type * type = prop->dataType;
11620
11621 if(_class->type == 3)
11622 {
11623 if(type->kind == 8)
11624 {
11625 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11626
11627 if(_class->type == 3)
11628 {
11629 if(!_class->dataType)
11630 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11631 type = _class->dataType;
11632 }
11633 }
11634 switch(type->kind)
11635 {
11636 case 6:
11637 {
11638 float value;
11639 float (* Get)(float) = (void *)prop->Get;
11640
11641 GetFloat(exp->member.exp, &value);
11642 exp->constant = PrintFloat(Get ? Get(value) : value);
11643 exp->type = 2;
11644 break;
11645 }
11646 case 7:
11647 {
11648 double value;
11649 double (* Get)(double);
11650
11651 GetDouble(exp->member.exp, &value);
11652 if(convertTo)
11653 Get = (void *)prop->Set;
11654 else
11655 Get = (void *)prop->Get;
11656 exp->constant = PrintDouble(Get ? Get(value) : value);
11657 exp->type = 2;
11658 break;
11659 }
11660 }
11661 }
11662 else
11663 {
11664 if(convertTo)
11665 {
11666 struct Expression * value = exp->member.exp;
11667 struct Type * type;
11668
11669 if(!prop->dataType)
11670 ProcessPropertyType(prop);
11671 type = prop->dataType;
11672 if(!type)
11673 {
11674 }
11675 else if(_class->type == 1)
11676 {
11677 switch(type->kind)
11678 {
11679 case 8:
11680 {
11681 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
11682
11683 if(propertyClass->type == 1 && value->type == 1)
11684 {
11685 void (* Set)(void *, void *) = (void *)prop->Set;
11686
11687 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11688 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11689 exp->instance->_class = MkSpecifierName(_class->fullName);
11690 exp->instance->loc = exp->loc;
11691 exp->type = 1;
11692 Set(exp->instance->data, value->instance->data);
11693 PopulateInstance(exp->instance);
11694 }
11695 break;
11696 }
11697 case 3:
11698 {
11699 int intValue;
11700 void (* Set)(void *, int) = (void *)prop->Set;
11701
11702 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11703 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11704 exp->instance->_class = MkSpecifierName(_class->fullName);
11705 exp->instance->loc = exp->loc;
11706 exp->type = 1;
11707 GetInt(value, &intValue);
11708 Set(exp->instance->data, intValue);
11709 PopulateInstance(exp->instance);
11710 break;
11711 }
11712 case 4:
11713 {
11714 long long intValue;
11715 void (* Set)(void *, long long) = (void *)prop->Set;
11716
11717 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11718 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11719 exp->instance->_class = MkSpecifierName(_class->fullName);
11720 exp->instance->loc = exp->loc;
11721 exp->type = 1;
11722 GetInt64(value, &intValue);
11723 Set(exp->instance->data, intValue);
11724 PopulateInstance(exp->instance);
11725 break;
11726 }
11727 case 22:
11728 {
11729 intptr_t intValue;
11730 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11731
11732 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11733 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11734 exp->instance->_class = MkSpecifierName(_class->fullName);
11735 exp->instance->loc = exp->loc;
11736 exp->type = 1;
11737 GetIntPtr(value, &intValue);
11738 Set(exp->instance->data, intValue);
11739 PopulateInstance(exp->instance);
11740 break;
11741 }
11742 case 23:
11743 {
11744 ssize_t intValue;
11745 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11746
11747 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11748 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11749 exp->instance->_class = MkSpecifierName(_class->fullName);
11750 exp->instance->loc = exp->loc;
11751 exp->type = 1;
11752 GetIntSize(value, &intValue);
11753 Set(exp->instance->data, intValue);
11754 PopulateInstance(exp->instance);
11755 break;
11756 }
11757 case 7:
11758 {
11759 double doubleValue;
11760 void (* Set)(void *, double) = (void *)prop->Set;
11761
11762 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11763 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11764 exp->instance->_class = MkSpecifierName(_class->fullName);
11765 exp->instance->loc = exp->loc;
11766 exp->type = 1;
11767 GetDouble(value, &doubleValue);
11768 Set(exp->instance->data, doubleValue);
11769 PopulateInstance(exp->instance);
11770 break;
11771 }
11772 }
11773 }
11774 else if(_class->type == 2)
11775 {
11776 switch(type->kind)
11777 {
11778 case 8:
11779 {
11780 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
11781
11782 if(propertyClass->type == 1 && value->instance->data)
11783 {
11784 unsigned int (* Set)(void *) = (void *)prop->Set;
11785 unsigned int bits = Set(value->instance->data);
11786
11787 exp->constant = PrintHexUInt(bits);
11788 exp->type = 2;
11789 break;
11790 }
11791 else if(_class->type == 2)
11792 {
11793 unsigned int value;
11794 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
11795 unsigned int bits;
11796
11797 GetUInt(exp->member.exp, &value);
11798 bits = Set(value);
11799 exp->constant = PrintHexUInt(bits);
11800 exp->type = 2;
11801 }
11802 }
11803 }
11804 }
11805 }
11806 else
11807 {
11808 if(_class->type == 2)
11809 {
11810 unsigned int value;
11811
11812 GetUInt(exp->member.exp, &value);
11813 switch(type->kind)
11814 {
11815 case 8:
11816 {
11817 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11818
11819 if(_class->type == 1)
11820 {
11821 void (* Get)(unsigned int, void *) = (void *)prop->Get;
11822
11823 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11824 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11825 exp->instance->_class = MkSpecifierName(_class->fullName);
11826 exp->instance->loc = exp->loc;
11827 exp->type = 1;
11828 Get(value, exp->instance->data);
11829 PopulateInstance(exp->instance);
11830 }
11831 else if(_class->type == 2)
11832 {
11833 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
11834 uint64 bits = Get(value);
11835
11836 exp->constant = PrintHexUInt64(bits);
11837 exp->type = 2;
11838 }
11839 break;
11840 }
11841 }
11842 }
11843 else if(_class->type == 1)
11844 {
11845 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
11846
11847 switch(type->kind)
11848 {
11849 case 8:
11850 {
11851 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11852
11853 if(_class->type == 1 && value)
11854 {
11855 void (* Get)(void *, void *) = (void *)prop->Get;
11856
11857 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11858 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11859 exp->instance->_class = MkSpecifierName(_class->fullName);
11860 exp->instance->loc = exp->loc;
11861 exp->type = 1;
11862 Get(value, exp->instance->data);
11863 PopulateInstance(exp->instance);
11864 }
11865 break;
11866 }
11867 }
11868 }
11869 }
11870 }
11871 }
11872 else
11873 {
11874 exp->isConstant = 0x0;
11875 }
11876 }
11877 else if(member)
11878 {
11879 }
11880 }
11881 if(exp->type != 8)
11882 {
11883 FreeExpression(memberExp);
11884 FreeIdentifier(memberID);
11885 }
11886 break;
11887 }
11888 case 10:
11889 {
11890 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
11891
11892 FreeExpContents(exp);
11893 exp->constant = PrintUInt(ComputeTypeSize(type));
11894 exp->type = 2;
11895 FreeType(type);
11896 break;
11897 }
11898 case 15:
11899 {
11900 struct Symbol * classSym = exp->_class->symbol;
11901
11902 if(classSym && classSym->registered)
11903 {
11904 if(classSym->registered->fixed)
11905 {
11906 FreeSpecifier(exp->_class);
11907 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
11908 exp->type = 2;
11909 }
11910 else
11911 {
11912 char className[1024];
11913
11914 strcpy(className, "__ecereClass_");
11915 FullClassNameCat(className, classSym->string, 0x1);
11916 MangleClassName(className);
11917 DeclareClass(classSym, className);
11918 FreeExpContents(exp);
11919 exp->type = 9;
11920 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
11921 exp->member.member = MkIdentifier("structSize");
11922 }
11923 }
11924 break;
11925 }
11926 case 11:
11927 {
11928 struct Type * type;
11929 struct Expression * e = exp;
11930
11931 if(exp->type == 11)
11932 {
11933 if(exp->cast.exp)
11934 ComputeExpression(exp->cast.exp);
11935 e = exp->cast.exp;
11936 }
11937 if(e && exp->expType)
11938 {
11939 type = exp->expType;
11940 if(type->kind == 8)
11941 {
11942 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11943
11944 if(_class && (_class->type == 3 || _class->type == 2))
11945 {
11946 if(!_class->dataType)
11947 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11948 type = _class->dataType;
11949 }
11950 }
11951 switch(type->kind)
11952 {
11953 case 24:
11954 case 1:
11955 if(type->isSigned)
11956 {
11957 char value;
11958
11959 GetChar(e, &value);
11960 FreeExpContents(exp);
11961 exp->constant = PrintChar(value);
11962 exp->type = 2;
11963 }
11964 else
11965 {
11966 unsigned char value;
11967
11968 GetUChar(e, &value);
11969 FreeExpContents(exp);
11970 exp->constant = PrintUChar(value);
11971 exp->type = 2;
11972 }
11973 break;
11974 case 2:
11975 if(type->isSigned)
11976 {
11977 short value;
11978
11979 GetShort(e, &value);
11980 FreeExpContents(exp);
11981 exp->constant = PrintShort(value);
11982 exp->type = 2;
11983 }
11984 else
11985 {
11986 unsigned short value;
11987
11988 GetUShort(e, &value);
11989 FreeExpContents(exp);
11990 exp->constant = PrintUShort(value);
11991 exp->type = 2;
11992 }
11993 break;
11994 case 3:
11995 if(type->isSigned)
11996 {
11997 int value;
11998
11999 GetInt(e, &value);
12000 FreeExpContents(exp);
12001 exp->constant = PrintInt(value);
12002 exp->type = 2;
12003 }
12004 else
12005 {
12006 unsigned int value;
12007
12008 GetUInt(e, &value);
12009 FreeExpContents(exp);
12010 exp->constant = PrintUInt(value);
12011 exp->type = 2;
12012 }
12013 break;
12014 case 4:
12015 if(type->isSigned)
12016 {
12017 long long value;
12018
12019 GetInt64(e, &value);
12020 FreeExpContents(exp);
12021 exp->constant = PrintInt64(value);
12022 exp->type = 2;
12023 }
12024 else
12025 {
12026 uint64 value;
12027
12028 GetUInt64(e, &value);
12029 FreeExpContents(exp);
12030 exp->constant = PrintUInt64(value);
12031 exp->type = 2;
12032 }
12033 break;
12034 case 22:
12035 if(type->isSigned)
12036 {
12037 intptr_t value;
12038
12039 GetIntPtr(e, &value);
12040 FreeExpContents(exp);
12041 exp->constant = PrintInt64((long long)value);
12042 exp->type = 2;
12043 }
12044 else
12045 {
12046 uintptr_t value;
12047
12048 GetUIntPtr(e, &value);
12049 FreeExpContents(exp);
12050 exp->constant = PrintUInt64((uint64)value);
12051 exp->type = 2;
12052 }
12053 break;
12054 case 23:
12055 if(type->isSigned)
12056 {
12057 ssize_t value;
12058
12059 GetIntSize(e, &value);
12060 FreeExpContents(exp);
12061 exp->constant = PrintInt64((long long)value);
12062 exp->type = 2;
12063 }
12064 else
12065 {
12066 size_t value;
12067
12068 GetUIntSize(e, &value);
12069 FreeExpContents(exp);
12070 exp->constant = PrintUInt64((uint64)value);
12071 exp->type = 2;
12072 }
12073 break;
12074 case 6:
12075 {
12076 float value;
12077
12078 GetFloat(e, &value);
12079 FreeExpContents(exp);
12080 exp->constant = PrintFloat(value);
12081 exp->type = 2;
12082 break;
12083 }
12084 case 7:
12085 {
12086 double value;
12087
12088 GetDouble(e, &value);
12089 FreeExpContents(exp);
12090 exp->constant = PrintDouble(value);
12091 exp->type = 2;
12092 break;
12093 }
12094 }
12095 }
12096 break;
12097 }
12098 case 12:
12099 {
12100 struct Operand op1 = 
12101 {
12102 0, 0, 0, 0, 
12103 {
12104 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12105 }
12106 };
12107 struct Operand op2 = 
12108 {
12109 0, 0, 0, 0, 
12110 {
12111 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12112 }
12113 };
12114 struct Operand op3 = 
12115 {
12116 0, 0, 0, 0, 
12117 {
12118 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12119 }
12120 };
12121
12122 if(exp->cond.exp)
12123 ComputeExpression((*exp->cond.exp).last);
12124 if(exp->cond.elseExp)
12125 ComputeExpression(exp->cond.elseExp);
12126 if(exp->cond.cond)
12127 ComputeExpression(exp->cond.cond);
12128 op1 = GetOperand(exp->cond.cond);
12129 if(op1.type)
12130 op1.type->refCount++;
12131 op2 = GetOperand((*exp->cond.exp).last);
12132 if(op2.type)
12133 op2.type->refCount++;
12134 op3 = GetOperand(exp->cond.elseExp);
12135 if(op3.type)
12136 op3.type->refCount++;
12137 if(op1.ops.Cond)
12138 {
12139 FreeExpContents(exp);
12140 op1.ops.Cond(exp, &op1, &op2, &op3);
12141 }
12142 if(op1.type)
12143 FreeType(op1.type);
12144 if(op2.type)
12145 FreeType(op2.type);
12146 if(op3.type)
12147 FreeType(op3.type);
12148 break;
12149 }
12150 }
12151 }
12152
12153 void ApplyAnyObjectLogic(struct Expression * e);
12154
12155 extern void CopyTypeInto(struct Type * type, struct Type * src);
12156
12157 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
12158 {
12159 unsigned int result = 0x1;
12160
12161 if(destType)
12162 {
12163 struct __ecereNameSpace__ecere__sys__OldList converts = 
12164 {
12165 0, 0, 0, 0, 0
12166 };
12167 struct Conversion * convert;
12168
12169 if(destType->kind == 0)
12170 return 0x0;
12171 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
12172 result = 0x0;
12173 if(converts.count)
12174 {
12175 for(convert = converts.first; convert; convert = convert->next)
12176 {
12177 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
12178
12179 if(!empty)
12180 {
12181 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12182 int objectType = exp->expType ? exp->expType->classObjectType : 0;
12183
12184 *newExp = *exp;
12185 newExp->destType = (((void *)0));
12186 if(convert->isGet)
12187 {
12188 exp->type = 8;
12189 exp->addedThis = 0x1;
12190 exp->member.exp = newExp;
12191 FreeType(exp->member.exp->expType);
12192 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
12193 exp->member.exp->expType->classObjectType = objectType;
12194 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
12195 exp->member.memberType = 1;
12196 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12197 exp->needCast = 0x1;
12198 if(exp->expType)
12199 exp->expType->refCount++;
12200 ApplyAnyObjectLogic(exp->member.exp);
12201 }
12202 else
12203 {
12204 {
12205 exp->type = 8;
12206 exp->addedThis = 0x1;
12207 exp->member.exp = newExp;
12208 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
12209 {
12210 newExp->byReference = 0x1;
12211 }
12212 FreeType(exp->member.exp->expType);
12213 exp->member.exp->expType = (((void *)0));
12214 if(convert->convert->dataType)
12215 {
12216 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12217 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
12218 exp->member.exp->expType->refCount = 1;
12219 exp->member.exp->expType->classObjectType = objectType;
12220 ApplyAnyObjectLogic(exp->member.exp);
12221 }
12222 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
12223 exp->member.memberType = 4;
12224 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12225 exp->needCast = 0x1;
12226 if(convert->resultType)
12227 convert->resultType->refCount++;
12228 }
12229 }
12230 }
12231 else
12232 {
12233 FreeType(exp->expType);
12234 if(convert->isGet)
12235 {
12236 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12237 exp->needCast = 0x1;
12238 if(exp->expType)
12239 exp->expType->refCount++;
12240 }
12241 else
12242 {
12243 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12244 exp->needCast = 0x1;
12245 if(convert->resultType)
12246 convert->resultType->refCount++;
12247 }
12248 }
12249 }
12250 if(exp->isConstant && inCompiler)
12251 ComputeExpression(exp);
12252 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
12253 }
12254 if(!result && exp->expType && converts.count)
12255 {
12256 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
12257 }
12258 if(!result && exp->expType && exp->destType)
12259 {
12260 if((exp->destType->kind == 8 && exp->expType->kind == 13 && exp->expType->type->kind == 8 && exp->expType->type->_class == exp->destType->_class && exp->destType->_class->registered && exp->destType->_class->registered->type == 1) || (exp->expType->kind == 8 && exp->destType->kind == 13 && exp->destType->type->kind == 8 && exp->destType->type->_class == exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1))
12261 result = 0x1;
12262 }
12263 }
12264 return result;
12265 }
12266
12267 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
12268
12269 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
12270
12271 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
12272
12273 void CheckTemplateTypes(struct Expression * exp)
12274 {
12275 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
12276 {
12277 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12278 struct Statement * compound;
12279 struct Context * context;
12280
12281 *newExp = *exp;
12282 if(exp->destType)
12283 exp->destType->refCount++;
12284 if(exp->expType)
12285 exp->expType->refCount++;
12286 newExp->prev = (((void *)0));
12287 newExp->next = (((void *)0));
12288 switch(exp->expType->kind)
12289 {
12290 case 7:
12291 if(exp->destType->classObjectType)
12292 {
12293 if(exp->destType)
12294 exp->destType->refCount--;
12295 if(exp->expType)
12296 exp->expType->refCount--;
12297 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12298 }
12299 else
12300 {
12301 struct __ecereNameSpace__ecere__sys__OldList * specs;
12302 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12303 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12304
12305 context = PushContext();
12306 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12307 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12308 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12309 exp->type = 25;
12310 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12311 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
12312 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
12313 exp->compound->compound.context = context;
12314 PopContext(context);
12315 }
12316 break;
12317 default:
12318 exp->type = 11;
12319 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
12320 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12321 break;
12322 }
12323 }
12324 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
12325 {
12326 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12327 struct Statement * compound;
12328 struct Context * context;
12329
12330 *newExp = *exp;
12331 if(exp->destType)
12332 exp->destType->refCount++;
12333 if(exp->expType)
12334 exp->expType->refCount++;
12335 newExp->prev = (((void *)0));
12336 newExp->next = (((void *)0));
12337 switch(exp->expType->kind)
12338 {
12339 case 7:
12340 if(exp->destType->classObjectType)
12341 {
12342 if(exp->destType)
12343 exp->destType->refCount--;
12344 if(exp->expType)
12345 exp->expType->refCount--;
12346 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12347 }
12348 else
12349 {
12350 struct __ecereNameSpace__ecere__sys__OldList * specs;
12351 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12352 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12353
12354 context = PushContext();
12355 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12356 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12357 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12358 exp->type = 25;
12359 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12360 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
12361 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
12362 exp->compound->compound.context = context;
12363 PopContext(context);
12364 }
12365 break;
12366 case 8:
12367 {
12368 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
12369 {
12370 exp->type = 5;
12371 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
12372 ProcessExpressionType((*exp->list).first);
12373 break;
12374 }
12375 else
12376 {
12377 exp->type = 5;
12378 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
12379 newExp->needCast = 0x1;
12380 ProcessExpressionType((*exp->list).first);
12381 break;
12382 }
12383 }
12384 default:
12385 {
12386 if(exp->expType->kind == 20)
12387 {
12388 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
12389
12390 if(type)
12391 {
12392 FreeType(exp->destType);
12393 FreeType(exp->expType);
12394 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12395 break;
12396 }
12397 }
12398 if(newExp->type == 8 && newExp->member.memberType == 3)
12399 {
12400 exp->type = 4;
12401 exp->op.op = '*';
12402 exp->op.exp1 = (((void *)0));
12403 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
12404 }
12405 else
12406 {
12407 char typeString[1024];
12408 struct Declarator * decl;
12409 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12410
12411 typeString[0] = '\0';
12412 PrintType(exp->expType, typeString, 0x0, 0x0);
12413 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12414 exp->type = 11;
12415 exp->cast.typeName = MkTypeName(specs, decl);
12416 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12417 exp->cast.exp->needCast = 0x1;
12418 }
12419 break;
12420 }
12421 }
12422 }
12423 }
12424
12425 extern int strncmp(const char * , const char * , size_t n);
12426
12427 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char *  key);
12428
12429 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
12430 {
12431 int nsLen = strlen(nameSpace);
12432 struct Symbol * symbol;
12433
12434 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)))
12435 {
12436 char * s = symbol->string;
12437
12438 if(!strncmp(s, nameSpace, nsLen))
12439 {
12440 int c;
12441 char * namePart;
12442
12443 for(c = strlen(s) - 1; c >= 0; c--)
12444 if(s[c] == ':')
12445 break;
12446 namePart = s + c + 1;
12447 if(!strcmp(namePart, name))
12448 {
12449 return symbol;
12450 }
12451 }
12452 else
12453 break;
12454 }
12455 return (((void *)0));
12456 }
12457
12458 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
12459 {
12460 int c;
12461 char nameSpace[1024];
12462 char * namePart;
12463 unsigned int gotColon = 0x0;
12464
12465 nameSpace[0] = '\0';
12466 for(c = strlen(name) - 1; c >= 0; c--)
12467 if(name[c] == ':')
12468 {
12469 gotColon = 0x1;
12470 break;
12471 }
12472 namePart = name + c + 1;
12473 while(c >= 0 && name[c] == ':')
12474 c--;
12475 if(c >= 0)
12476 {
12477 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
12478
12479 if(symbol)
12480 return symbol;
12481 memcpy(nameSpace, name, c + 1);
12482 nameSpace[c + 1] = (char)0;
12483 return ScanWithNameSpace(tree, nameSpace, namePart);
12484 }
12485 else if(gotColon)
12486 {
12487 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12488
12489 return symbol;
12490 }
12491 else
12492 {
12493 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12494
12495 if(symbol)
12496 return symbol;
12497 return ScanWithNameSpace(tree, "", namePart);
12498 }
12499 return (((void *)0));
12500 }
12501
12502 static void ProcessDeclaration(struct Declaration * decl);
12503
12504 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
12505 {
12506 struct Context * ctx;
12507 struct Symbol * symbol = (((void *)0));
12508
12509 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
12510 {
12511 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
12512 {
12513 symbol = (((void *)0));
12514 if(thisNameSpace)
12515 {
12516 char curName[1024];
12517
12518 strcpy(curName, thisNameSpace);
12519 strcat(curName, "::");
12520 strcat(curName, name);
12521 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
12522 }
12523 if(!symbol)
12524 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
12525 }
12526 else
12527 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
12528 if(symbol || ctx == endContext)
12529 break;
12530 }
12531 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
12532 {
12533 if(symbol->pointerExternal->type == 0)
12534 {
12535 struct FunctionDefinition * function = symbol->pointerExternal->function;
12536 struct Context * tmpContext = curContext;
12537
12538 curContext = (((void *)0));
12539 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
12540 curContext = tmpContext;
12541 symbol->pointerExternal->symbol = symbol;
12542 DeclareType(symbol->type, 0x1, 0x1);
12543 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
12544 symbol->id = curExternal->symbol->idCode;
12545 }
12546 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
12547 {
12548 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
12549 symbol->id = curExternal->symbol->idCode;
12550 }
12551 }
12552 return symbol;
12553 }
12554
12555 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
12556 {
12557 if(!type->isSigned && type->kind != 22 && type->kind != 23)
12558 ListAdd(specs, MkSpecifier(UNSIGNED));
12559 switch(type->kind)
12560 {
12561 case 8:
12562 {
12563 if(type->_class->registered)
12564 {
12565 if(!type->_class->registered->dataType)
12566 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
12567 GetTypeSpecs(type->_class->registered->dataType, specs);
12568 }
12569 break;
12570 }
12571 case 7:
12572 ListAdd(specs, MkSpecifier(DOUBLE));
12573 break;
12574 case 6:
12575 ListAdd(specs, MkSpecifier(FLOAT));
12576 break;
12577 case 1:
12578 ListAdd(specs, MkSpecifier(CHAR));
12579 break;
12580 case 24:
12581 ListAdd(specs, MkSpecifier(_BOOL));
12582 break;
12583 case 2:
12584 ListAdd(specs, MkSpecifier(SHORT));
12585 break;
12586 case 4:
12587 ListAdd(specs, MkSpecifier(INT64));
12588 break;
12589 case 22:
12590 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
12591 break;
12592 case 23:
12593 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
12594 break;
12595 case 3:
12596 default:
12597 ListAdd(specs, MkSpecifier(INT));
12598 break;
12599 }
12600 }
12601
12602 static void PrintArraySize(struct Type * arrayType, char * string)
12603 {
12604 char size[256];
12605
12606 size[0] = '\0';
12607 strcat(size, "[");
12608 if(arrayType->enumClass)
12609 strcat(size, arrayType->enumClass->string);
12610 else if(arrayType->arraySizeExp)
12611 PrintExpression(arrayType->arraySizeExp, size);
12612 strcat(size, "]");
12613 strcat(string, size);
12614 }
12615
12616 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
12617 {
12618 if(type)
12619 {
12620 if(printConst && type->constant)
12621 strcat(string, "const ");
12622 switch(type->kind)
12623 {
12624 case 8:
12625 {
12626 struct Symbol * c = type->_class;
12627
12628 if(type->classObjectType == 2)
12629 strcat(string, "typed_object");
12630 else if(type->classObjectType == 3)
12631 strcat(string, "any_object");
12632 else
12633 {
12634 if(c && c->string)
12635 strcat(string, (fullName || !c->registered) ? c->string : c->registered->name);
12636 }
12637 if(type->byReference)
12638 strcat(string, " &");
12639 break;
12640 }
12641 case 0:
12642 strcat(string, "void");
12643 break;
12644 case 3:
12645 strcat(string, type->isSigned ? "int" : "uint");
12646 break;
12647 case 4:
12648 strcat(string, type->isSigned ? "int64" : "uint64");
12649 break;
12650 case 22:
12651 strcat(string, type->isSigned ? "intptr" : "uintptr");
12652 break;
12653 case 23:
12654 strcat(string, type->isSigned ? "intsize" : "uintsize");
12655 break;
12656 case 1:
12657 strcat(string, type->isSigned ? "char" : "byte");
12658 break;
12659 case 24:
12660 strcat(string, "_Bool");
12661 break;
12662 case 2:
12663 strcat(string, type->isSigned ? "short" : "uint16");
12664 break;
12665 case 6:
12666 strcat(string, "float");
12667 break;
12668 case 7:
12669 strcat(string, "double");
12670 break;
12671 case 9:
12672 if(type->enumName)
12673 {
12674 strcat(string, "struct ");
12675 strcat(string, type->enumName);
12676 }
12677 else if(type->typeName)
12678 strcat(string, type->typeName);
12679 else
12680 {
12681 struct Type * member;
12682
12683 strcat(string, "struct { ");
12684 for(member = type->members.first; member; member = member->next)
12685 {
12686 PrintType(member, string, 0x1, fullName);
12687 strcat(string, "; ");
12688 }
12689 strcat(string, "}");
12690 }
12691 break;
12692 case 10:
12693 if(type->enumName)
12694 {
12695 strcat(string, "union ");
12696 strcat(string, type->enumName);
12697 }
12698 else if(type->typeName)
12699 strcat(string, type->typeName);
12700 else
12701 {
12702 strcat(string, "union ");
12703 strcat(string, "(unnamed)");
12704 }
12705 break;
12706 case 15:
12707 if(type->enumName)
12708 {
12709 strcat(string, "enum ");
12710 strcat(string, type->enumName);
12711 }
12712 else if(type->typeName)
12713 strcat(string, type->typeName);
12714 else
12715 strcat(string, "int");
12716 break;
12717 case 14:
12718 strcat(string, "...");
12719 break;
12720 case 19:
12721 strcat(string, "subclass(");
12722 strcat(string, type->_class ? type->_class->string : "int");
12723 strcat(string, ")");
12724 break;
12725 case 20:
12726 strcat(string, type->templateParameter->identifier->string);
12727 break;
12728 case 21:
12729 strcat(string, "thisclass");
12730 break;
12731 case 17:
12732 strcat(string, "__builtin_va_list");
12733 break;
12734 }
12735 }
12736 }
12737
12738 extern char *  __ecereNameSpace__ecere__sys__RSearchString(char *  buffer, char *  subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
12739
12740 static void PrintName(struct Type * type, char * string, unsigned int fullName)
12741 {
12742 if(type->name && type->name[0])
12743 {
12744 if(fullName)
12745 strcat(string, type->name);
12746 else
12747 {
12748 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
12749
12750 if(name)
12751 name += 2;
12752 else
12753 name = type->name;
12754 strcat(string, name);
12755 }
12756 }
12757 }
12758
12759 static void PrintAttribs(struct Type * type, char * string)
12760 {
12761 if(type)
12762 {
12763 if(type->dllExport)
12764 strcat(string, "dllexport ");
12765 if(type->attrStdcall)
12766 strcat(string, "stdcall ");
12767 }
12768 }
12769
12770 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
12771 {
12772 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
12773 {
12774 struct Type * attrType = (((void *)0));
12775
12776 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
12777 PrintAttribs(type, string);
12778 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
12779 strcat(string, " const");
12780 PrePrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName, type, printConst);
12781 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
12782 strcat(string, " (");
12783 if(type->kind == 13)
12784 {
12785 if(type->type->kind == 11 || type->type->kind == 16)
12786 PrintAttribs(type->type, string);
12787 }
12788 if(type->kind == 13)
12789 {
12790 if(type->type->kind == 11 || type->type->kind == 16 || type->type->kind == 12)
12791 strcat(string, "*");
12792 else
12793 strcat(string, " *");
12794 }
12795 if(printConst && type->constant && type->kind == 13)
12796 strcat(string, " const");
12797 }
12798 else
12799 PrintTypeSpecs(type, string, fullName, printConst);
12800 }
12801
12802 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
12803 {
12804 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
12805 strcat(string, ")");
12806 if(type->kind == 12)
12807 PrintArraySize(type, string);
12808 else if(type->kind == 11)
12809 {
12810 struct Type * param;
12811
12812 strcat(string, "(");
12813 for(param = type->params.first; param; param = param->next)
12814 {
12815 PrintType(param, string, 0x1, fullName);
12816 if(param->next)
12817 strcat(string, ", ");
12818 }
12819 strcat(string, ")");
12820 }
12821 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
12822 PostPrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName);
12823 }
12824
12825 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
12826 {
12827 PrePrintType(type, string, fullName, (((void *)0)), printConst);
12828 if(type->thisClass || (printName && type->name && type->name[0]))
12829 strcat(string, " ");
12830 if((type->thisClass || type->staticMethod))
12831 {
12832 struct Symbol * _class = type->thisClass;
12833
12834 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
12835 {
12836 if(type->classObjectType == 1)
12837 strcat(string, "class");
12838 else
12839 strcat(string, type->byReference ? "typed_object&" : "typed_object");
12840 }
12841 else if(_class && _class->string)
12842 {
12843 char * s = _class->string;
12844
12845 if(fullName)
12846 strcat(string, s);
12847 else
12848 {
12849 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 0x1, 0x0);
12850
12851 if(name)
12852 name += 2;
12853 else
12854 name = s;
12855 strcat(string, name);
12856 }
12857 }
12858 strcat(string, "::");
12859 }
12860 if(printName && type->name)
12861 PrintName(type, string, fullName);
12862 PostPrintType(type, string, fullName);
12863 if(type->bitFieldCount)
12864 {
12865 char count[100];
12866
12867 sprintf(count, ":%d", type->bitFieldCount);
12868 strcat(string, count);
12869 }
12870 }
12871
12872 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
12873 {
12874 _PrintType(type, string, printName, fullName, 0x1);
12875 }
12876
12877 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
12878 {
12879 _PrintType(type, string, printName, fullName, 0x0);
12880 }
12881
12882 static struct Type * FindMember(struct Type * type, char * string)
12883 {
12884 struct Type * memberType;
12885
12886 for(memberType = type->members.first; memberType; memberType = memberType->next)
12887 {
12888 if(!memberType->name)
12889 {
12890 struct Type * subType = FindMember(memberType, string);
12891
12892 if(subType)
12893 return subType;
12894 }
12895 else if(!strcmp(memberType->name, string))
12896 return memberType;
12897 }
12898 return (((void *)0));
12899 }
12900
12901 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
12902 {
12903 struct Type * memberType;
12904
12905 for(memberType = type->members.first; memberType; memberType = memberType->next)
12906 {
12907 if(!memberType->name)
12908 {
12909 struct Type * subType = FindMember(memberType, string);
12910
12911 if(subType)
12912 {
12913 *offset += memberType->offset;
12914 return subType;
12915 }
12916 }
12917 else if(!strcmp(memberType->name, string))
12918 {
12919 *offset += memberType->offset;
12920 return memberType;
12921 }
12922 }
12923 return (((void *)0));
12924 }
12925
12926 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
12927
12928 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
12929
12930 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
12931
12932 struct Expression * ParseExpressionString(char * expression)
12933 {
12934 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
12935 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__extension__ ({
12936 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
12937
12938 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
12939 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
12940 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
12941 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
12942
12943 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
12944 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
12945 echoOn = 0x0;
12946 parsedExpression = (((void *)0));
12947 resetScanner();
12948 expression_yyparse();
12949 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
12950 return parsedExpression;
12951 }
12952
12953 extern char *  QMkString(char *  source);
12954
12955 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
12956 {
12957 struct Identifier * id = exp->identifier;
12958 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
12959 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
12960 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
12961 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
12962
12963 if(_class && _class->type == 4)
12964 {
12965 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
12966 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
12967
12968 if(enumClass)
12969 {
12970 struct __ecereNameSpace__ecere__com__Class * baseClass;
12971
12972 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
12973 {
12974 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
12975
12976 for(value = e->values.first; value; value = value->next)
12977 {
12978 if(!strcmp(value->name, id->string))
12979 break;
12980 }
12981 if(value)
12982 {
12983 char constant[256];
12984
12985 FreeExpContents(exp);
12986 exp->type = 2;
12987 exp->isConstant = 0x1;
12988 if(!strcmp(baseClass->dataTypeString, "int"))
12989 sprintf(constant, "%d", (int)value->data);
12990 else
12991 sprintf(constant, "0x%X", (int)value->data);
12992 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
12993 exp->expType = MkClassType(baseClass->fullName);
12994 break;
12995 }
12996 }
12997 }
12998 if(value)
12999 return 0x1;
13000 }
13001 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
13002 {
13003 ProcessMethodType(method);
13004 exp->expType = __extension__ ({
13005 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13006
13007 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1->methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
13008 });
13009 return 0x1;
13010 }
13011 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
13012 {
13013 if(!prop->dataType)
13014 ProcessPropertyType(prop);
13015 exp->expType = prop->dataType;
13016 if(prop->dataType)
13017 prop->dataType->refCount++;
13018 return 0x1;
13019 }
13020 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
13021 {
13022 if(!member->dataType)
13023 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13024 exp->expType = member->dataType;
13025 if(member->dataType)
13026 member->dataType->refCount++;
13027 return 0x1;
13028 }
13029 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
13030 {
13031 if(!classProp->dataType)
13032 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
13033 if(classProp->constant)
13034 {
13035 FreeExpContents(exp);
13036 exp->isConstant = 0x1;
13037 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
13038 {
13039 exp->type = 3;
13040 exp->constant = QMkString((char *)classProp->Get(_class));
13041 }
13042 else
13043 {
13044 char constant[256];
13045
13046 exp->type = 2;
13047 sprintf(constant, "%d", (int)classProp->Get(_class));
13048 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13049 }
13050 }
13051 else
13052 {
13053 }
13054 exp->expType = classProp->dataType;
13055 if(classProp->dataType)
13056 classProp->dataType->refCount++;
13057 return 0x1;
13058 }
13059 return 0x0;
13060 }
13061
13062 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
13063 {
13064 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
13065 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
13066 struct __ecereNameSpace__ecere__com__NameSpace * child;
13067
13068 if(!data)
13069 {
13070 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)))
13071 {
13072 data = ScanGlobalData(child, name);
13073 if(data)
13074 break;
13075 }
13076 }
13077 return data;
13078 }
13079
13080 extern struct __ecereNameSpace__ecere__com__NameSpace *  globalData;
13081
13082 extern char *  strncpy(char * , const char * , size_t n);
13083
13084 static struct GlobalData * FindGlobalData(char * name)
13085 {
13086 int start = 0, c;
13087 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13088
13089 nameSpace = globalData;
13090 for(c = 0; name[c]; c++)
13091 {
13092 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
13093 {
13094 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
13095 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
13096
13097 strncpy(spaceName, name + start, c - start);
13098 spaceName[c - start] = '\0';
13099 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
13100 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
13101 if(!newSpace)
13102 return (((void *)0));
13103 nameSpace = newSpace;
13104 if(name[c] == ':')
13105 c++;
13106 start = c + 1;
13107 }
13108 }
13109 if(c - start)
13110 {
13111 return ScanGlobalData(nameSpace, name + start);
13112 }
13113 return (((void *)0));
13114 }
13115
13116 static int definedExpStackPos;
13117
13118 static void * definedExpStack[512];
13119
13120 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
13121 {
13122 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
13123
13124 FreeExpContents(checkedExp);
13125 FreeType(checkedExp->expType);
13126 FreeType(checkedExp->destType);
13127 *checkedExp = *newExp;
13128 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13129 checkedExp->prev = prev;
13130 checkedExp->next = next;
13131 }
13132
13133 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
13134
13135 extern int printf(char * , ...);
13136
13137 void __ecereMethod_Expression_Clear();
13138
13139 void ApplyAnyObjectLogic(struct Expression * e)
13140 {
13141 struct Type * destType = e->destType;
13142
13143 if(destType && (destType->classObjectType == 3))
13144 {
13145 if(e && e->expType)
13146 {
13147 struct Type * type = e->expType;
13148 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
13149
13150 if(type->kind == 8 && type->_class && type->_class->registered)
13151 {
13152 _class = type->_class->registered;
13153 }
13154 else if(type->kind == 19)
13155 {
13156 _class = FindClass("ecere::com::Class")->registered;
13157 }
13158 else
13159 {
13160 char string[1024] = "";
13161 struct Symbol * classSym;
13162
13163 PrintTypeNoConst(type, string, 0x0, 0x1);
13164 classSym = FindClass(string);
13165 if(classSym)
13166 _class = classSym->registered;
13167 }
13168 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->_class || !type->_class->registered || type->_class->registered->type == 1))) || destType->byReference)))
13169 {
13170 if(!_class || strcmp(_class->fullName, "char *"))
13171 {
13172 struct Expression * checkedExp = e, * newExp;
13173
13174 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
13175 {
13176 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
13177 {
13178 if(checkedExp->type == 25)
13179 {
13180 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13181 }
13182 else
13183 checkedExp = (*checkedExp->list).last;
13184 }
13185 else if(checkedExp->type == 11)
13186 checkedExp = checkedExp->cast.exp;
13187 }
13188 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
13189 {
13190 newExp = checkedExp->op.exp2;
13191 checkedExp->op.exp2 = (((void *)0));
13192 FreeExpContents(checkedExp);
13193 if(e->expType && e->expType->passAsTemplate)
13194 {
13195 char size[100];
13196
13197 ComputeTypeSize(e->expType);
13198 sprintf(size, "%d", e->expType->size);
13199 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))))));
13200 }
13201 ReplaceExpContents(checkedExp, newExp);
13202 e->byReference = 0x1;
13203 }
13204 else if(!e->byReference || (_class && _class->type == 5))
13205 {
13206 struct Expression * checkedExp, * newExp;
13207
13208 {
13209 unsigned int hasAddress = e->type == 0 || (e->type == 8 && e->member.memberType == 3) || (e->type == 9 && e->member.memberType == 3) || (e->type == 4 && !e->op.exp1 && e->op.op == '*') || e->type == 6;
13210
13211 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
13212 {
13213 struct Context * context = PushContext();
13214 struct Declarator * decl;
13215 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13216 char typeString[1024];
13217 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13218
13219 typeString[0] = '\0';
13220 *newExp = *e;
13221 newExp->prev = (((void *)0));
13222 newExp->next = (((void *)0));
13223 newExp->expType = (((void *)0));
13224 PrintTypeNoConst(e->expType, typeString, 0x0, 0x1);
13225 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13226 newExp->destType = ProcessType(specs, decl);
13227 curContext = context;
13228 if(curCompound)
13229 {
13230 char name[100];
13231 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
13232
13233 e->type = 25;
13234 sprintf(name, "__internalValue%03X", internalValueCounter++);
13235 if(!curCompound->compound.declarations)
13236 curCompound->compound.declarations = MkList();
13237 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
13238 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
13239 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
13240 e->compound = MkCompoundStmt((((void *)0)), stmts);
13241 }
13242 else
13243 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
13244 {
13245 struct Type * type = e->destType;
13246
13247 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13248 CopyTypeInto(e->destType, type);
13249 e->destType->refCount = 1;
13250 e->destType->classObjectType = 0;
13251 FreeType(type);
13252 }
13253 e->compound->compound.context = context;
13254 PopContext(context);
13255 curContext = context->parent;
13256 }
13257 }
13258 checkedExp = e;
13259 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
13260 {
13261 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
13262 {
13263 if(checkedExp->type == 25)
13264 {
13265 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13266 }
13267 else
13268 checkedExp = (*checkedExp->list).last;
13269 }
13270 else if(checkedExp->type == 11)
13271 checkedExp = checkedExp->cast.exp;
13272 }
13273 {
13274 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13275
13276 *operand = *checkedExp;
13277 checkedExp->destType = (((void *)0));
13278 checkedExp->expType = (((void *)0));
13279 __ecereMethod_Expression_Clear(checkedExp);
13280 checkedExp->type = 4;
13281 checkedExp->op.op = '&';
13282 checkedExp->op.exp1 = (((void *)0));
13283 checkedExp->op.exp2 = operand;
13284 }
13285 }
13286 }
13287 }
13288 }
13289 }
13290 {
13291 }
13292 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->_class && e->expType->_class->registered && (e->expType->_class->registered->type == 2 || e->expType->_class->registered->type == 4 || e->expType->_class->registered->type == 3))))
13293 {
13294 if(e->expType->classObjectType && destType && destType->classObjectType)
13295 {
13296 return ;
13297 }
13298 else
13299 {
13300 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13301
13302 *thisExp = *e;
13303 thisExp->prev = (((void *)0));
13304 thisExp->next = (((void *)0));
13305 __ecereMethod_Expression_Clear(e);
13306 e->type = 5;
13307 e->list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
13308 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
13309 ((struct Expression *)(*e->list).first)->byReference = 0x1;
13310 {
13311 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13312 CopyTypeInto(e->expType, thisExp->expType);
13313 e->expType->byReference = 0x0;
13314 e->expType->refCount = 1;
13315 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && (e->expType->_class->registered->type == 2 || e->expType->_class->registered->type == 4 || e->expType->_class->registered->type == 3))
13316 {
13317 e->expType->classObjectType = 0;
13318 }
13319 }
13320 }
13321 }
13322 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
13323 {
13324 if(destType->kind == 14)
13325 {
13326 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unspecified type\n", (((void *)0))));
13327 }
13328 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
13329 {
13330 unsigned int byReference = e->expType->byReference;
13331 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13332 struct Declarator * decl;
13333 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13334 char typeString[1024];
13335 struct Type * type;
13336 int backupClassObjectType;
13337 unsigned int backupByReference;
13338
13339 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
13340 type = e->expType;
13341 else
13342 type = destType;
13343 backupClassObjectType = type->classObjectType;
13344 backupByReference = type->byReference;
13345 type->classObjectType = 0;
13346 type->byReference = 0x0;
13347 typeString[0] = '\0';
13348 PrintType(type, typeString, 0x0, 0x1);
13349 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13350 type->classObjectType = backupClassObjectType;
13351 type->byReference = backupByReference;
13352 *thisExp = *e;
13353 thisExp->prev = (((void *)0));
13354 thisExp->next = (((void *)0));
13355 __ecereMethod_Expression_Clear(e);
13356 if((type->kind == 8 && type->_class && type->_class->registered && (type->_class->registered->type == 1000 || type->_class->registered->type == 2 || type->_class->registered->type == 4 || type->_class->registered->type == 3)) || (type->kind != 13 && type->kind != 22 && type->kind != 12 && type->kind != 8) || (!destType->byReference && byReference && (destType->kind != 13 || type->kind != 13)))
13357 {
13358 e->type = 4;
13359 e->op.op = '*';
13360 e->op.exp1 = (((void *)0));
13361 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
13362 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13363 CopyTypeInto(e->expType, type);
13364 e->expType->byReference = 0x0;
13365 e->expType->refCount = 1;
13366 }
13367 else
13368 {
13369 e->type = 11;
13370 e->cast.typeName = MkTypeName(specs, decl);
13371 e->cast.exp = thisExp;
13372 e->byReference = 0x1;
13373 e->expType = type;
13374 type->refCount++;
13375 }
13376 e->destType = destType;
13377 destType->refCount++;
13378 }
13379 }
13380 }
13381
13382 extern char *  strstr(const char * , const char * );
13383
13384 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
13385
13386 struct __ecereNameSpace__ecere__com__DefinedExpression
13387 {
13388 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
13389 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
13390 char *  name;
13391 char *  value;
13392 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
13393 } __attribute__ ((gcc_struct));
13394
13395 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
13396
13397 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
13398
13399 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char *  string, int *  numBytes);
13400
13401 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
13402
13403 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
13404
13405 extern struct Expression * CopyExpression(struct Expression * exp);
13406
13407 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
13408
13409 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList *  specifiers, struct Declarator * decl);
13410
13411 static void ProcessStatement(struct Statement * stmt);
13412
13413 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
13414
13415 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
13416
13417 extern char *  __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, void * object, ...);
13418
13419 extern char *  sourceFile;
13420
13421 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
13422
13423 void ProcessExpressionType(struct Expression * exp)
13424 {
13425 unsigned int unresolved = 0x0;
13426 struct Location oldyylloc = yylloc;
13427 unsigned int notByReference = 0x0;
13428
13429 if(!exp || exp->expType)
13430 return ;
13431 yylloc = exp->loc;
13432 switch(exp->type)
13433 {
13434 case 0:
13435 {
13436 struct Identifier * id = exp->identifier;
13437
13438 if(!id)
13439 return ;
13440 if(id->_class && id->_class->name)
13441 {
13442 id->classSym = id->_class->symbol;
13443 }
13444 if(strstr(id->string, "__ecereClass") == id->string)
13445 {
13446 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
13447 break;
13448 }
13449 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
13450 {
13451 ReplaceClassMembers(exp, thisClass);
13452 if(exp->type != 0)
13453 {
13454 ProcessExpressionType(exp);
13455 break;
13456 }
13457 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
13458 break;
13459 }
13460 else
13461 {
13462 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13463
13464 if(!symbol)
13465 {
13466 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
13467 break;
13468 else
13469 {
13470 if(thisClass)
13471 {
13472 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
13473 if(exp->type != 0)
13474 {
13475 ProcessExpressionType(exp);
13476 break;
13477 }
13478 }
13479 else if(currentClass && !id->_class)
13480 {
13481 if(ResolveIdWithClass(exp, currentClass, 0x1))
13482 break;
13483 }
13484 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13485 }
13486 }
13487 if(symbol)
13488 {
13489 struct Type * type = symbol->type;
13490 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
13491
13492 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
13493 {
13494 struct Context * context = SetupTemplatesContext(_class);
13495
13496 type = ReplaceThisClassType(_class);
13497 FinishTemplatesContext(context);
13498 if(type)
13499 type->refCount = 0;
13500 }
13501 FreeSpecifier(id->_class);
13502 id->_class = (((void *)0));
13503 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13504 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
13505 id->classSym = (((void *)0));
13506 exp->expType = type;
13507 if(type)
13508 type->refCount++;
13509 if(type && (type->kind == 15 || (_class && _class->type == 4)))
13510 exp->isConstant = 0x1;
13511 if(symbol->isParam || !strcmp(id->string, "this"))
13512 {
13513 if(_class && _class->type == 1 && !type->declaredWithStruct)
13514 exp->byReference = 0x1;
13515 }
13516 if(symbol->isIterator)
13517 {
13518 if(symbol->isIterator == 3)
13519 {
13520 exp->type = 5;
13521 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
13522 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
13523 exp->expType = (((void *)0));
13524 ProcessExpressionType(exp);
13525 }
13526 else if(symbol->isIterator != 4)
13527 {
13528 exp->type = 8;
13529 exp->member.exp = MkExpIdentifier(exp->identifier);
13530 exp->member.exp->expType = exp->expType;
13531 exp->member.member = MkIdentifier("data");
13532 exp->expType = (((void *)0));
13533 ProcessExpressionType(exp);
13534 }
13535 }
13536 break;
13537 }
13538 else
13539 {
13540 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
13541
13542 if(thisNameSpace && !(id->_class && !id->_class->name))
13543 {
13544 char name[1024];
13545
13546 strcpy(name, thisNameSpace);
13547 strcat(name, "::");
13548 strcat(name, id->string);
13549 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
13550 }
13551 if(!definedExp)
13552 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
13553 if(definedExp)
13554 {
13555 int c;
13556
13557 for(c = 0; c < definedExpStackPos; c++)
13558 if(definedExpStack[c] == definedExp)
13559 break;
13560 if(c == definedExpStackPos && c < sizeof definedExpStack / sizeof(void *))
13561 {
13562 struct Location backupYylloc = yylloc;
13563
13564 definedExpStack[definedExpStackPos++] = definedExp;
13565 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13566 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__extension__ ({
13567 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13568
13569 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13570 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
13571 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13572 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13573
13574 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13575 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13576 echoOn = 0x0;
13577 parsedExpression = (((void *)0));
13578 resetScanner();
13579 expression_yyparse();
13580 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13581 yylloc = backupYylloc;
13582 if(parsedExpression)
13583 {
13584 FreeIdentifier(id);
13585 exp->type = 5;
13586 exp->list = MkListOne(parsedExpression);
13587 parsedExpression->loc = yylloc;
13588 ProcessExpressionType(exp);
13589 definedExpStackPos--;
13590 return ;
13591 }
13592 definedExpStackPos--;
13593 }
13594 else
13595 {
13596 if(inCompiler)
13597 {
13598 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Recursion in defined expression %s\n", (((void *)0))), id->string);
13599 }
13600 }
13601 }
13602 else
13603 {
13604 struct GlobalData * data = (((void *)0));
13605
13606 if(thisNameSpace && !(id->_class && !id->_class->name))
13607 {
13608 char name[1024];
13609
13610 strcpy(name, thisNameSpace);
13611 strcat(name, "::");
13612 strcat(name, id->string);
13613 data = FindGlobalData(name);
13614 }
13615 if(!data)
13616 data = FindGlobalData(id->string);
13617 if(data)
13618 {
13619 DeclareGlobalData(data);
13620 exp->expType = data->dataType;
13621 if(data->dataType)
13622 data->dataType->refCount++;
13623 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13624 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
13625 FreeSpecifier(id->_class);
13626 id->_class = (((void *)0));
13627 break;
13628 }
13629 else
13630 {
13631 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
13632
13633 if(thisNameSpace && !(id->_class && !id->_class->name))
13634 {
13635 char name[1024];
13636
13637 strcpy(name, thisNameSpace);
13638 strcat(name, "::");
13639 strcat(name, id->string);
13640 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
13641 }
13642 if(!function)
13643 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
13644 if(function)
13645 {
13646 char name[1024];
13647
13648 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13649 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
13650 name[0] = (char)0;
13651 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
13652 strcpy(name, "__ecereFunction_");
13653 FullClassNameCat(name, id->string, 0x0);
13654 if(DeclareFunction(function, name))
13655 {
13656 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13657 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
13658 }
13659 exp->expType = function->dataType;
13660 if(function->dataType)
13661 function->dataType->refCount++;
13662 FreeSpecifier(id->_class);
13663 id->_class = (((void *)0));
13664 break;
13665 }
13666 }
13667 }
13668 }
13669 }
13670 unresolved = 0x1;
13671 break;
13672 }
13673 case 1:
13674 {
13675 struct __ecereNameSpace__ecere__com__Class * _class;
13676
13677 if(!exp->instance->_class)
13678 {
13679 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
13680 {
13681 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
13682 }
13683 }
13684 ProcessInstantiationType(exp->instance);
13685 exp->isConstant = exp->instance->isConstant;
13686 if(exp->instance->_class)
13687 {
13688 exp->expType = MkClassType(exp->instance->_class->name);
13689 }
13690 break;
13691 }
13692 case 2:
13693 {
13694 if(!exp->expType)
13695 {
13696 char * constant = exp->constant;
13697 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
13698
13699 exp->expType = type;
13700 if(constant[0] == '\'')
13701 {
13702 if((int)((unsigned char *)constant)[1] > 127)
13703 {
13704 int nb;
13705 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
13706
13707 if(nb < 2)
13708 ch = constant[1];
13709 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
13710 exp->constant = PrintUInt(ch);
13711 type->kind = 8;
13712 type->_class = FindClass("unichar");
13713 type->isSigned = 0x0;
13714 }
13715 else
13716 {
13717 type->kind = 1;
13718 type->isSigned = 0x1;
13719 }
13720 }
13721 else
13722 {
13723 char * dot = strchr(constant, '.');
13724 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
13725 char * exponent;
13726
13727 if(isHex)
13728 {
13729 exponent = strchr(constant, 'p');
13730 if(!exponent)
13731 exponent = strchr(constant, 'P');
13732 }
13733 else
13734 {
13735 exponent = strchr(constant, 'e');
13736 if(!exponent)
13737 exponent = strchr(constant, 'E');
13738 }
13739 if(dot || exponent)
13740 {
13741 if(strchr(constant, 'f') || strchr(constant, 'F'))
13742 type->kind = 6;
13743 else
13744 type->kind = 7;
13745 type->isSigned = 0x1;
13746 }
13747 else
13748 {
13749 unsigned int isSigned = constant[0] == '-';
13750 long long i64 = strtoll(constant, (((void *)0)), 0);
13751 uint64 ui64 = strtoull(constant, (((void *)0)), 0);
13752 unsigned int is64Bit = 0x0;
13753
13754 if(isSigned)
13755 {
13756 if(i64 < (((int)0x80000000)))
13757 is64Bit = 0x1;
13758 }
13759 else
13760 {
13761 if(ui64 > (((int)0x7fffffff)))
13762 {
13763 if(ui64 > (0xffffffff))
13764 {
13765 is64Bit = 0x1;
13766 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
13767 isSigned = 0x1;
13768 }
13769 }
13770 else if(constant[0] != '0' || !constant[1])
13771 isSigned = 0x1;
13772 }
13773 type->kind = is64Bit ? 4 : 3;
13774 type->isSigned = isSigned;
13775 }
13776 }
13777 exp->isConstant = 0x1;
13778 if(exp->destType && exp->destType->kind == 7)
13779 type->kind = 7;
13780 else if(exp->destType && exp->destType->kind == 6)
13781 type->kind = 6;
13782 else if(exp->destType && exp->destType->kind == 4)
13783 type->kind = 4;
13784 }
13785 break;
13786 }
13787 case 3:
13788 {
13789 exp->isConstant = 0x1;
13790 exp->expType = __extension__ ({
13791 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13792
13793 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
13794 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13795
13796 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 1, __ecereInstance1->constant = 0x1, __ecereInstance1->isSigned = 0x1, __ecereInstance1;
13797 }), __ecereInstance2;
13798 });
13799 break;
13800 }
13801 case 13:
13802 case 28:
13803 ProcessExpressionType(exp->_new.size);
13804 exp->expType = __extension__ ({
13805 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13806
13807 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_new.typeName->qualifiers, exp->_new.typeName->declarator), __ecereInstance1;
13808 });
13809 DeclareType(exp->expType->type, 0x0, 0x0);
13810 break;
13811 case 14:
13812 case 29:
13813 ProcessExpressionType(exp->_renew.size);
13814 ProcessExpressionType(exp->_renew.exp);
13815 exp->expType = __extension__ ({
13816 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13817
13818 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_renew.typeName->qualifiers, exp->_renew.typeName->declarator), __ecereInstance1;
13819 });
13820 DeclareType(exp->expType->type, 0x0, 0x0);
13821 break;
13822 case 4:
13823 {
13824 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
13825 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
13826 unsigned int useDestType = 0x0, useSideType = 0x0;
13827 struct Location oldyylloc = yylloc;
13828 unsigned int useSideUnit = 0x0;
13829 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
13830
13831 switch(exp->op.op)
13832 {
13833 case '=':
13834 case MUL_ASSIGN:
13835 case DIV_ASSIGN:
13836 case MOD_ASSIGN:
13837 case ADD_ASSIGN:
13838 case SUB_ASSIGN:
13839 case LEFT_ASSIGN:
13840 case RIGHT_ASSIGN:
13841 case AND_ASSIGN:
13842 case XOR_ASSIGN:
13843 case OR_ASSIGN:
13844 assign = 0x1;
13845 break;
13846 case '!':
13847 break;
13848 case AND_OP:
13849 case OR_OP:
13850 boolOps = 0x1;
13851 boolResult = 0x1;
13852 break;
13853 case EQ_OP:
13854 case '<':
13855 case '>':
13856 case LE_OP:
13857 case GE_OP:
13858 case NE_OP:
13859 boolResult = 0x1;
13860 useSideType = 0x1;
13861 break;
13862 case '+':
13863 case '-':
13864 useSideUnit = 0x1;
13865 case '|':
13866 case '&':
13867 case '^':
13868 case '/':
13869 case '%':
13870 case '*':
13871 if(exp->op.op != '*' || exp->op.exp1)
13872 {
13873 useSideType = 0x1;
13874 useDestType = 0x1;
13875 }
13876 break;
13877 }
13878 if(exp->op.op == '&')
13879 {
13880 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
13881 {
13882 struct Identifier * id = exp->op.exp2->identifier;
13883 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13884
13885 if(symbol && symbol->isIterator == 2)
13886 {
13887 exp->type = 8;
13888 exp->member.exp = exp->op.exp2;
13889 exp->member.member = MkIdentifier("key");
13890 exp->expType = (((void *)0));
13891 exp->op.exp2->expType = symbol->type;
13892 symbol->type->refCount++;
13893 ProcessExpressionType(exp);
13894 FreeType(dummy);
13895 break;
13896 }
13897 }
13898 }
13899 if(exp->op.exp1)
13900 {
13901 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class && exp->destType->_class->registered && useDestType && ((exp->destType->_class->registered->type == 3 && useSideUnit) || exp->destType->_class->registered->type == 4 || exp->destType->_class->registered->type == 2))
13902 {
13903 if(exp->op.exp1->destType)
13904 FreeType(exp->op.exp1->destType);
13905 exp->op.exp1->destType = exp->destType;
13906 if(exp->destType)
13907 exp->destType->refCount++;
13908 }
13909 else if(!assign)
13910 {
13911 if(exp->op.exp1->destType)
13912 FreeType(exp->op.exp1->destType);
13913 exp->op.exp1->destType = dummy;
13914 dummy->refCount++;
13915 }
13916 if(exp->op.exp1->destType && exp->op.op != '=')
13917 exp->op.exp1->destType->count++;
13918 ProcessExpressionType(exp->op.exp1);
13919 if(exp->op.exp1->destType && exp->op.op != '=')
13920 exp->op.exp1->destType->count--;
13921 if(exp->op.exp1->destType == dummy)
13922 {
13923 FreeType(dummy);
13924 exp->op.exp1->destType = (((void *)0));
13925 }
13926 type1 = exp->op.exp1->expType;
13927 }
13928 if(exp->op.exp2)
13929 {
13930 char expString[10240];
13931
13932 expString[0] = '\0';
13933 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
13934 {
13935 if(exp->op.exp1)
13936 {
13937 exp->op.exp2->destType = exp->op.exp1->expType;
13938 if(exp->op.exp1->expType)
13939 exp->op.exp1->expType->refCount++;
13940 }
13941 else
13942 {
13943 exp->op.exp2->destType = exp->destType;
13944 if(exp->destType)
13945 exp->destType->refCount++;
13946 }
13947 if(type1)
13948 type1->refCount++;
13949 exp->expType = type1;
13950 }
13951 else if(assign)
13952 {
13953 if(inCompiler)
13954 PrintExpression(exp->op.exp2, expString);
13955 if(type1 && type1->kind == 13)
13956 {
13957 if(exp->op.op == MUL_ASSIGN || exp->op.op == DIV_ASSIGN || exp->op.op == MOD_ASSIGN || exp->op.op == LEFT_ASSIGN || exp->op.op == RIGHT_ASSIGN || exp->op.op == AND_ASSIGN || exp->op.op == OR_ASSIGN)
13958 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
13959 else if(exp->op.op == '=')
13960 {
13961 if(exp->op.exp2->destType)
13962 FreeType(exp->op.exp2->destType);
13963 exp->op.exp2->destType = type1;
13964 if(type1)
13965 type1->refCount++;
13966 }
13967 }
13968 else
13969 {
13970 if(exp->op.op == MUL_ASSIGN || exp->op.op == DIV_ASSIGN || exp->op.op == MOD_ASSIGN || exp->op.op == LEFT_ASSIGN || exp->op.op == RIGHT_ASSIGN)
13971 ;
13972 else
13973 {
13974 if(exp->op.exp2->destType)
13975 FreeType(exp->op.exp2->destType);
13976 exp->op.exp2->destType = type1;
13977 if(type1)
13978 type1->refCount++;
13979 }
13980 }
13981 if(type1)
13982 type1->refCount++;
13983 exp->expType = type1;
13984 }
13985 else if(exp->destType && exp->destType->kind == 8 && exp->destType->_class && exp->destType->_class->registered && ((exp->destType->_class->registered->type == 3 && useDestType && useSideUnit) || (exp->destType->_class->registered->type == 4 && useDestType)))
13986 {
13987 if(exp->op.exp2->destType)
13988 FreeType(exp->op.exp2->destType);
13989 exp->op.exp2->destType = exp->destType;
13990 if(exp->destType)
13991 exp->destType->refCount++;
13992 }
13993 else
13994 {
13995 if(exp->op.exp2->destType)
13996 FreeType(exp->op.exp2->destType);
13997 exp->op.exp2->destType = dummy;
13998 dummy->refCount++;
13999 }
14000 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
14001 {
14002 FreeType(exp->op.exp2->destType);
14003 exp->op.exp2->destType = type1;
14004 type1->refCount++;
14005 }
14006 if(exp->op.exp2->destType && exp->op.op != '=')
14007 exp->op.exp2->destType->count++;
14008 ProcessExpressionType(exp->op.exp2);
14009 if(exp->op.exp2->destType && exp->op.op != '=')
14010 exp->op.exp2->destType->count--;
14011 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
14012 {
14013 if(exp->op.exp2->expType->kind == 23 || exp->op.exp2->expType->kind == 22 || exp->op.exp2->expType->kind == 4 || exp->op.exp2->expType->kind == 3 || exp->op.exp2->expType->kind == 2 || exp->op.exp2->expType->kind == 1)
14014 {
14015 if(exp->op.op != '=' && type1->type->kind == 0)
14016 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
14017 }
14018 else if(exp->op.exp2->expType->kind == 13 || exp->op.exp2->expType->kind == 12 || exp->op.exp2->expType->kind == 11 || exp->op.exp2->expType->kind == 16 || (type1->type->kind == 0 && exp->op.exp2->expType->kind == 8 && exp->op.exp2->expType->_class->registered && (exp->op.exp2->expType->_class->registered->type == 0 || exp->op.exp2->expType->_class->registered->type == 1 || exp->op.exp2->expType->_class->registered->type == 5)))
14019 {
14020 if(exp->op.op == ADD_ASSIGN)
14021 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
14022 }
14023 else if((exp->op.exp2->expType->kind == 8 && type1->kind == 13 && type1->type->kind == 8 && type1->type->_class == exp->op.exp2->expType->_class && exp->op.exp2->expType->_class->registered && exp->op.exp2->expType->_class->registered->type == 1))
14024 {
14025 if(exp->op.op == ADD_ASSIGN)
14026 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
14027 }
14028 else if(inCompiler)
14029 {
14030 char type1String[1024];
14031 char type2String[1024];
14032
14033 type1String[0] = '\0';
14034 type2String[0] = '\0';
14035 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
14036 PrintType(type1, type2String, 0x0, 0x1);
14037 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14038 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
14039 }
14040 }
14041 if(exp->op.exp2->destType == dummy)
14042 {
14043 FreeType(dummy);
14044 exp->op.exp2->destType = (((void *)0));
14045 }
14046 if(exp->op.op == '-' && !exp->op.exp1 && exp->op.exp2->expType && !exp->op.exp2->expType->isSigned)
14047 {
14048 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14049 type2->refCount = 1;
14050 CopyTypeInto(type2, exp->op.exp2->expType);
14051 type2->isSigned = 0x1;
14052 }
14053 else if(exp->op.op == '~' && !exp->op.exp1 && exp->op.exp2->expType && (!exp->op.exp2->expType->isSigned || exp->op.exp2->expType->kind != 3))
14054 {
14055 type2 = __extension__ ({
14056 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14057
14058 __ecereInstance1->kind = 3, __ecereInstance1;
14059 });
14060 type2->refCount = 1;
14061 type2->isSigned = 0x1;
14062 }
14063 else
14064 type2 = exp->op.exp2->expType;
14065 }
14066 dummy->kind = 0;
14067 if(exp->op.op == SIZEOF)
14068 {
14069 exp->expType = __extension__ ({
14070 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14071
14072 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
14073 });
14074 exp->isConstant = 0x1;
14075 }
14076 else if(exp->op.op == '*' && !exp->op.exp1)
14077 {
14078 exp->expType = Dereference(type2);
14079 if(type2 && type2->kind == 8)
14080 notByReference = 0x1;
14081 }
14082 else if(exp->op.op == '&' && !exp->op.exp1)
14083 exp->expType = Reference(type2);
14084 else if(!assign)
14085 {
14086 if(boolOps)
14087 {
14088 if(exp->op.exp1)
14089 {
14090 if(exp->op.exp1->destType)
14091 FreeType(exp->op.exp1->destType);
14092 exp->op.exp1->destType = MkClassType("bool");
14093 exp->op.exp1->destType->truth = 0x1;
14094 if(!exp->op.exp1->expType)
14095 ProcessExpressionType(exp->op.exp1);
14096 else
14097 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14098 FreeType(exp->op.exp1->expType);
14099 exp->op.exp1->expType = MkClassType("bool");
14100 exp->op.exp1->expType->truth = 0x1;
14101 }
14102 if(exp->op.exp2)
14103 {
14104 if(exp->op.exp2->destType)
14105 FreeType(exp->op.exp2->destType);
14106 exp->op.exp2->destType = MkClassType("bool");
14107 exp->op.exp2->destType->truth = 0x1;
14108 if(!exp->op.exp2->expType)
14109 ProcessExpressionType(exp->op.exp2);
14110 else
14111 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14112 FreeType(exp->op.exp2->expType);
14113 exp->op.exp2->expType = MkClassType("bool");
14114 exp->op.exp2->expType->truth = 0x1;
14115 }
14116 }
14117 else if(exp->op.exp1 && exp->op.exp2 && ((useSideType) || ((!type1 || type1->kind != 8 || !strcmp(type1->_class->string, "String")) && (!type2 || type2->kind != 8 || !strcmp(type2->_class->string, "String")))))
14118 {
14119 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
14120 {
14121 if(exp->op.exp2->destType)
14122 FreeType(exp->op.exp2->destType);
14123 exp->op.exp2->destType = type1;
14124 type1->refCount++;
14125 if(exp->op.exp1->destType)
14126 FreeType(exp->op.exp1->destType);
14127 exp->op.exp1->destType = type2;
14128 type2->refCount++;
14129 if(!boolResult && type1->kind == 8 && (!exp->destType || exp->destType->kind != 8) && type1->_class->registered && type1->_class->registered->type == 3 && type2->_class->registered && type2->_class->registered->type == 3 && type1->_class->registered != type2->_class->registered)
14130 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "operating on %s and %s with an untyped result, assuming %s\n", (((void *)0))), type1->_class->string, type2->_class->string, type1->_class->string);
14131 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
14132 {
14133 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14134
14135 if(argExp)
14136 {
14137 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14138
14139 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
14140 ProcessExpressionType(exp->op.exp1);
14141 if(type2->kind != 13)
14142 {
14143 ProcessExpressionType(classExp);
14144 exp->op.exp2 = MkExpBrackets(MkListOne(MkExpOp(exp->op.exp2, '*', MkExpBrackets(MkListOne(MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(MkExpOp(MkExpMember(CopyExpression(classExp), MkIdentifier("type")), EQ_OP, MkExpConstant("5")), OR_OP, MkExpOp(MkExpMember(CopyExpression(classExp), MkIdentifier("type")), EQ_OP, MkExpConstant("0"))))), MkListOne(MkExpTypeSize(MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))))), MkExpMember(classExp, MkIdentifier("typeSize"))))))));
14145 if(!exp->op.exp2->expType)
14146 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
14147 ProcessExpressionType(exp->op.exp2);
14148 }
14149 }
14150 }
14151 if(!boolResult && ((type1->kind == 13 || type1->kind == 12 || (type1->kind == 8 && !strcmp(type1->_class->string, "String"))) && (type2->kind == 23 || type2->kind == 22 || type2->kind == 4 || type2->kind == 3 || type2->kind == 2 || type2->kind == 1)))
14152 {
14153 if(type1->kind != 8 && type1->type->kind == 0)
14154 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
14155 exp->expType = type1;
14156 if(type1)
14157 type1->refCount++;
14158 }
14159 else if(!boolResult && ((type2->kind == 13 || type2->kind == 12 || (type2->kind == 8 && !strcmp(type2->_class->string, "String"))) && (type1->kind == 23 || type1->kind == 22 || type1->kind == 4 || type1->kind == 3 || type1->kind == 2 || type1->kind == 1)))
14160 {
14161 if(type2->kind != 8 && type2->type->kind == 0)
14162 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
14163 exp->expType = type2;
14164 if(type2)
14165 type2->refCount++;
14166 }
14167 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))
14168 {
14169 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "different levels of indirection\n", (((void *)0))));
14170 }
14171 else
14172 {
14173 unsigned int success = 0x0;
14174
14175 if(type1->kind == 13 && type2->kind == 13)
14176 {
14177 if(exp->op.op == '+')
14178 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
14179 else if(exp->op.op == '-')
14180 {
14181 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
14182 {
14183 exp->expType = __extension__ ({
14184 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14185
14186 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
14187 });
14188 success = 0x1;
14189 if(type1->type->kind == 20)
14190 {
14191 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14192
14193 if(argExp)
14194 {
14195 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14196
14197 ProcessExpressionType(classExp);
14198 exp->type = 5;
14199 exp->list = MkListOne(MkExpOp(MkExpBrackets(MkListOne(MkExpOp(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(exp->op.exp1))), exp->op.op, MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(exp->op.exp2)))))), '/', MkExpBrackets(MkListOne(MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(MkExpOp(MkExpMember(CopyExpression(classExp), MkIdentifier("type")), EQ_OP, MkExpIdentifier(MkIdentifier("noHeadClass"))), OR_OP, MkExpOp(MkExpMember(CopyExpression(classExp), MkIdentifier("type")), EQ_OP, MkExpIdentifier(MkIdentifier("normalClass")))))), MkListOne(MkExpTypeSize(MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))))), MkExpMember(classExp, MkIdentifier("typeSize")))))));
14200 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
14201 FreeType(dummy);
14202 return ;
14203 }
14204 }
14205 }
14206 }
14207 }
14208 if(!success && exp->op.exp1->type == 2)
14209 {
14210 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14211 {
14212 if(exp->expType)
14213 FreeType(exp->expType);
14214 exp->expType = exp->op.exp1->destType;
14215 if(exp->op.exp1->destType)
14216 exp->op.exp1->destType->refCount++;
14217 success = 0x1;
14218 }
14219 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14220 {
14221 if(exp->expType)
14222 FreeType(exp->expType);
14223 exp->expType = exp->op.exp2->destType;
14224 if(exp->op.exp2->destType)
14225 exp->op.exp2->destType->refCount++;
14226 success = 0x1;
14227 }
14228 }
14229 else if(!success)
14230 {
14231 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14232 {
14233 if(exp->expType)
14234 FreeType(exp->expType);
14235 exp->expType = exp->op.exp2->destType;
14236 if(exp->op.exp2->destType)
14237 exp->op.exp2->destType->refCount++;
14238 success = 0x1;
14239 }
14240 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14241 {
14242 if(exp->expType)
14243 FreeType(exp->expType);
14244 exp->expType = exp->op.exp1->destType;
14245 if(exp->op.exp1->destType)
14246 exp->op.exp1->destType->refCount++;
14247 success = 0x1;
14248 }
14249 }
14250 if(!success)
14251 {
14252 char expString1[10240];
14253 char expString2[10240];
14254 char type1[1024];
14255 char type2[1024];
14256
14257 expString1[0] = '\0';
14258 expString2[0] = '\0';
14259 type1[0] = '\0';
14260 type2[0] = '\0';
14261 if(inCompiler)
14262 {
14263 PrintExpression(exp->op.exp1, expString1);
14264 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
14265 PrintExpression(exp->op.exp2, expString2);
14266 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
14267 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
14268 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
14269 }
14270 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
14271 }
14272 }
14273 }
14274 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
14275 {
14276 if(exp->op.exp1->destType)
14277 FreeType(exp->op.exp1->destType);
14278 exp->op.exp1->destType = type2->_class->registered->dataType;
14279 if(type2->_class->registered->dataType)
14280 type2->_class->registered->dataType->refCount++;
14281 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14282 exp->expType = type2;
14283 if(type2)
14284 type2->refCount++;
14285 }
14286 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
14287 {
14288 if(exp->op.exp2->destType)
14289 FreeType(exp->op.exp2->destType);
14290 exp->op.exp2->destType = type1->_class->registered->dataType;
14291 if(type1->_class->registered->dataType)
14292 type1->_class->registered->dataType->refCount++;
14293 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14294 exp->expType = type1;
14295 if(type1)
14296 type1->refCount++;
14297 }
14298 else if(type1)
14299 {
14300 unsigned int valid = 0x0;
14301
14302 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
14303 {
14304 if(exp->op.exp2->destType)
14305 FreeType(exp->op.exp2->destType);
14306 if(!type1->_class->registered->dataType)
14307 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
14308 exp->op.exp2->destType = type1->_class->registered->dataType;
14309 exp->op.exp2->destType->refCount++;
14310 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14311 type2 = exp->op.exp2->destType;
14312 exp->expType = type2;
14313 type2->refCount++;
14314 }
14315 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
14316 {
14317 if(exp->op.exp1->destType)
14318 FreeType(exp->op.exp1->destType);
14319 if(!type2->_class->registered->dataType)
14320 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
14321 exp->op.exp1->destType = type2->_class->registered->dataType;
14322 exp->op.exp1->destType->refCount++;
14323 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14324 type1 = exp->op.exp1->destType;
14325 exp->expType = type1;
14326 type1->refCount++;
14327 }
14328 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
14329 {
14330 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
14331 {
14332 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
14333 {
14334 if(exp->expType)
14335 FreeType(exp->expType);
14336 exp->expType = exp->op.exp1->expType;
14337 if(exp->op.exp2->expType)
14338 exp->op.exp1->expType->refCount++;
14339 valid = 0x1;
14340 }
14341 }
14342 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
14343 {
14344 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
14345 {
14346 if(exp->expType)
14347 FreeType(exp->expType);
14348 exp->expType = exp->op.exp2->expType;
14349 if(exp->op.exp2->expType)
14350 exp->op.exp2->expType->refCount++;
14351 valid = 0x1;
14352 }
14353 }
14354 }
14355 if(!valid)
14356 {
14357 if(exp->op.exp2->destType)
14358 FreeType(exp->op.exp2->destType);
14359 exp->op.exp2->destType = type1;
14360 type1->refCount++;
14361 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14362 {
14363 if(exp->expType)
14364 FreeType(exp->expType);
14365 exp->expType = exp->op.exp2->destType;
14366 if(exp->op.exp2->destType)
14367 exp->op.exp2->destType->refCount++;
14368 }
14369 else if(type1 && type2)
14370 {
14371 char expString1[10240];
14372 char expString2[10240];
14373 char type1String[1024];
14374 char type2String[1024];
14375
14376 expString1[0] = '\0';
14377 expString2[0] = '\0';
14378 type1String[0] = '\0';
14379 type2String[0] = '\0';
14380 if(inCompiler)
14381 {
14382 PrintExpression(exp->op.exp1, expString1);
14383 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
14384 PrintExpression(exp->op.exp2, expString2);
14385 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
14386 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
14387 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
14388 }
14389 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
14390 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
14391 {
14392 exp->expType = exp->op.exp1->expType;
14393 if(exp->op.exp1->expType)
14394 exp->op.exp1->expType->refCount++;
14395 }
14396 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
14397 {
14398 exp->expType = exp->op.exp2->expType;
14399 if(exp->op.exp2->expType)
14400 exp->op.exp2->expType->refCount++;
14401 }
14402 }
14403 }
14404 }
14405 else if(type2)
14406 {
14407 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
14408 {
14409 struct Type * oldType = exp->op.exp1->expType;
14410
14411 exp->op.exp1->expType = (((void *)0));
14412 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14413 FreeType(oldType);
14414 else
14415 exp->op.exp1->expType = oldType;
14416 }
14417 if(exp->op.exp1->destType)
14418 FreeType(exp->op.exp1->destType);
14419 exp->op.exp1->destType = type2;
14420 type2->refCount++;
14421 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14422 {
14423 if(exp->expType)
14424 FreeType(exp->expType);
14425 exp->expType = exp->op.exp1->destType;
14426 if(exp->op.exp1->destType)
14427 exp->op.exp1->destType->refCount++;
14428 }
14429 }
14430 }
14431 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
14432 {
14433 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
14434 {
14435 if(exp->op.exp1->destType)
14436 FreeType(exp->op.exp1->destType);
14437 exp->op.exp1->destType = type2->_class->registered->dataType;
14438 if(type2->_class->registered->dataType)
14439 type2->_class->registered->dataType->refCount++;
14440 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14441 }
14442 if(exp->op.op == '!')
14443 {
14444 exp->expType = MkClassType("bool");
14445 exp->expType->truth = 0x1;
14446 }
14447 else
14448 {
14449 exp->expType = type2;
14450 if(type2)
14451 type2->refCount++;
14452 }
14453 }
14454 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
14455 {
14456 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
14457 {
14458 if(exp->op.exp2->destType)
14459 FreeType(exp->op.exp2->destType);
14460 exp->op.exp2->destType = type1->_class->registered->dataType;
14461 if(type1->_class->registered->dataType)
14462 type1->_class->registered->dataType->refCount++;
14463 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14464 }
14465 exp->expType = type1;
14466 if(type1)
14467 type1->refCount++;
14468 }
14469 }
14470 yylloc = exp->loc;
14471 if(exp->op.exp1 && !exp->op.exp1->expType)
14472 {
14473 char expString[10000];
14474
14475 expString[0] = '\0';
14476 if(inCompiler)
14477 {
14478 PrintExpression(exp->op.exp1, expString);
14479 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14480 }
14481 if(expString[0])
14482 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14483 }
14484 if(exp->op.exp2 && !exp->op.exp2->expType)
14485 {
14486 char expString[10240];
14487
14488 expString[0] = '\0';
14489 if(inCompiler)
14490 {
14491 PrintExpression(exp->op.exp2, expString);
14492 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14493 }
14494 if(expString[0])
14495 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14496 }
14497 if(boolResult)
14498 {
14499 FreeType(exp->expType);
14500 exp->expType = MkClassType("bool");
14501 exp->expType->truth = 0x1;
14502 }
14503 if(exp->op.op != SIZEOF)
14504 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
14505 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
14506 {
14507 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
14508 }
14509 yylloc = oldyylloc;
14510 FreeType(dummy);
14511 break;
14512 }
14513 case 5:
14514 case 34:
14515 {
14516 struct Expression * e;
14517
14518 exp->isConstant = 0x1;
14519 for(e = (*exp->list).first; e; e = e->next)
14520 {
14521 unsigned int inced = 0x0;
14522
14523 if(!e->next)
14524 {
14525 FreeType(e->destType);
14526 e->destType = exp->destType;
14527 if(e->destType)
14528 {
14529 exp->destType->refCount++;
14530 e->destType->count++;
14531 inced = 0x1;
14532 }
14533 }
14534 ProcessExpressionType(e);
14535 if(inced)
14536 exp->destType->count--;
14537 if(!exp->expType && !e->next)
14538 {
14539 exp->expType = e->expType;
14540 if(e->expType)
14541 e->expType->refCount++;
14542 }
14543 if(!e->isConstant)
14544 exp->isConstant = 0x0;
14545 }
14546 e = (*exp->list).first;
14547 if(!e->next && e->type == 8)
14548 {
14549 struct Expression * next = exp->next, * prev = exp->prev;
14550
14551 FreeType(exp->expType);
14552 FreeType(exp->destType);
14553 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14554 *exp = *e;
14555 exp->prev = prev;
14556 exp->next = next;
14557 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
14558 ProcessExpressionType(exp);
14559 }
14560 break;
14561 }
14562 case 6:
14563 {
14564 struct Expression * e;
14565
14566 exp->isConstant = 0x1;
14567 ProcessExpressionType(exp->index.exp);
14568 if(!exp->index.exp->isConstant)
14569 exp->isConstant = 0x0;
14570 if(exp->index.exp->expType)
14571 {
14572 struct Type * source = exp->index.exp->expType;
14573
14574 if(source->kind == 8 && source->_class && source->_class->registered)
14575 {
14576 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
14577 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
14578
14579 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
14580 {
14581 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
14582 if(exp->index.index && (*exp->index.index).last)
14583 {
14584 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
14585 }
14586 }
14587 }
14588 }
14589 for(e = (*exp->index.index).first; e; e = e->next)
14590 {
14591 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
14592 {
14593 if(e->destType)
14594 FreeType(e->destType);
14595 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
14596 }
14597 ProcessExpressionType(e);
14598 if(!e->next)
14599 {
14600 }
14601 if(!e->isConstant)
14602 exp->isConstant = 0x0;
14603 }
14604 if(!exp->expType)
14605 exp->expType = Dereference(exp->index.exp->expType);
14606 if(exp->expType)
14607 DeclareType(exp->expType, 0x0, 0x0);
14608 break;
14609 }
14610 case 7:
14611 {
14612 struct Expression * e;
14613 struct Type * functionType;
14614 struct Type * methodType = (((void *)0));
14615 char name[1024];
14616
14617 name[0] = '\0';
14618 if(inCompiler)
14619 {
14620 PrintExpression(exp->call.exp, name);
14621 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
14622 {
14623 PrintExpression(exp->call.exp, name);
14624 }
14625 }
14626 if(exp->call.exp->type == 0)
14627 {
14628 struct Expression * idExp = exp->call.exp;
14629 struct Identifier * id = idExp->identifier;
14630
14631 if(!strcmp(id->string, "__builtin_frame_address"))
14632 {
14633 exp->expType = ProcessTypeString("void *", 0x1);
14634 if(exp->call.arguments && (*exp->call.arguments).first)
14635 ProcessExpressionType((*exp->call.arguments).first);
14636 break;
14637 }
14638 else if(!strcmp(id->string, "__ENDIAN_PAD"))
14639 {
14640 exp->expType = ProcessTypeString("int", 0x1);
14641 if(exp->call.arguments && (*exp->call.arguments).first)
14642 ProcessExpressionType((*exp->call.arguments).first);
14643 break;
14644 }
14645 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
14646 {
14647 struct Expression * a = (((void *)0));
14648 struct Expression * b = (((void *)0));
14649 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
14650
14651 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
14652 {
14653 a = (*exp->call.arguments).first;
14654 b = (*exp->call.arguments).last;
14655 tempExp1 = a;
14656 tempExp2 = b;
14657 }
14658 else if((*exp->call.arguments).count == 1)
14659 {
14660 a = (*exp->call.arguments).first;
14661 tempExp1 = a;
14662 }
14663 if(a)
14664 {
14665 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
14666 idExp->identifier = (((void *)0));
14667 FreeExpContents(exp);
14668 ProcessExpressionType(a);
14669 if(b)
14670 ProcessExpressionType(b);
14671 exp->type = 5;
14672 exp->list = MkList();
14673 if(a->expType && (!b || b->expType))
14674 {
14675 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
14676 {
14677 if(inCompiler)
14678 {
14679 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14680 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
14681 struct Declaration * decl;
14682 char temp1[1024], temp2[1024];
14683
14684 GetTypeSpecs(a->expType, specs);
14685 if(a && !a->isConstant && a->type != 0)
14686 {
14687 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
14688 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
14689 tempExp1 = QMkExpId(temp1);
14690 tempExp1->expType = a->expType;
14691 if(a->expType)
14692 a->expType->refCount++;
14693 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
14694 }
14695 if(b && !b->isConstant && b->type != 0)
14696 {
14697 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
14698 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
14699 tempExp2 = QMkExpId(temp2);
14700 tempExp2->expType = b->expType;
14701 if(b->expType)
14702 b->expType->refCount++;
14703 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
14704 }
14705 decl = MkDeclaration(specs, decls);
14706 if(!curCompound->compound.declarations)
14707 curCompound->compound.declarations = MkList();
14708 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
14709 }
14710 }
14711 }
14712 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
14713 {
14714 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
14715
14716 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
14717 exp->expType = a->expType;
14718 if(a->expType)
14719 a->expType->refCount++;
14720 }
14721 else if(!strcmp(id->string, "Abs"))
14722 {
14723 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
14724 exp->expType = a->expType;
14725 if(a->expType)
14726 a->expType->refCount++;
14727 }
14728 else if(!strcmp(id->string, "Sgn"))
14729 {
14730 ListAdd(exp->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"))))));
14731 exp->expType = ProcessTypeString("int", 0x0);
14732 }
14733 FreeExpression(tempExp1);
14734 if(tempExp2)
14735 FreeExpression(tempExp2);
14736 FreeIdentifier(id);
14737 break;
14738 }
14739 }
14740 }
14741 {
14742 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
14743
14744 if(!exp->call.exp->destType)
14745 {
14746 exp->call.exp->destType = dummy;
14747 dummy->refCount++;
14748 }
14749 ProcessExpressionType(exp->call.exp);
14750 if(exp->call.exp->destType == dummy)
14751 {
14752 FreeType(dummy);
14753 exp->call.exp->destType = (((void *)0));
14754 }
14755 FreeType(dummy);
14756 }
14757 functionType = exp->call.exp->expType;
14758 if(functionType && functionType->kind == 16)
14759 {
14760 methodType = functionType;
14761 functionType = methodType->method->dataType;
14762 if(exp->call.exp->expType->usedClass)
14763 {
14764 char typeString[1024];
14765
14766 typeString[0] = '\0';
14767 {
14768 struct Symbol * back = functionType->thisClass;
14769
14770 functionType->thisClass = (((void *)0));
14771 PrintType(functionType, typeString, 0x1, 0x1);
14772 functionType->thisClass = back;
14773 }
14774 if(strstr(typeString, "thisclass"))
14775 {
14776 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14777 struct Declarator * decl;
14778
14779 {
14780 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
14781
14782 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14783 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
14784 thisClassParams = 0x0;
14785 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
14786 {
14787 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
14788
14789 thisClass = exp->call.exp->expType->usedClass;
14790 ProcessDeclarator(decl);
14791 thisClass = backupThisClass;
14792 }
14793 thisClassParams = 0x1;
14794 functionType = ProcessType(specs, decl);
14795 functionType->refCount = 0;
14796 FinishTemplatesContext(context);
14797 }
14798 FreeList(specs, FreeSpecifier);
14799 FreeDeclarator(decl);
14800 }
14801 }
14802 }
14803 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
14804 {
14805 struct Type * type = functionType->type;
14806
14807 if(!functionType->refCount)
14808 {
14809 functionType->type = (((void *)0));
14810 FreeType(functionType);
14811 }
14812 functionType = type;
14813 }
14814 if(functionType && functionType->kind != 11)
14815 {
14816 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "called object %s is not a function\n", (((void *)0))), name);
14817 }
14818 else if(functionType)
14819 {
14820 unsigned int emptyParams = 0x0, noParams = 0x0;
14821 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
14822 struct Type * type = functionType->params.first;
14823 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
14824 int extra = 0;
14825 struct Location oldyylloc = yylloc;
14826
14827 if(!type)
14828 emptyParams = 0x1;
14829 if(functionType->extraParam && e && functionType->thisClass)
14830 {
14831 e->destType = MkClassType(functionType->thisClass->string);
14832 e = e->next;
14833 }
14834 if(!functionType->staticMethod && !functionType->extraParam)
14835 {
14836 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
14837 {
14838 type = MkClassType(memberExp->member.exp->expType->_class->string);
14839 if(e)
14840 {
14841 e->destType = type;
14842 e = e->next;
14843 type = functionType->params.first;
14844 }
14845 else
14846 type->refCount = 0;
14847 }
14848 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
14849 {
14850 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
14851 type->byReference = functionType->byReference;
14852 type->typedByReference = functionType->typedByReference;
14853 if(e)
14854 {
14855 if(e->next && type->kind == 8 && (functionType && functionType->thisClass) && functionType->classObjectType == 2)
14856 e = e->next;
14857 e->destType = type;
14858 e = e->next;
14859 type = functionType->params.first;
14860 }
14861 else
14862 type->refCount = 0;
14863 }
14864 }
14865 if(type && type->kind == 0)
14866 {
14867 noParams = 0x1;
14868 if(!type->refCount)
14869 FreeType(type);
14870 type = (((void *)0));
14871 }
14872 for(; e; e = e->next)
14873 {
14874 if(!type && !emptyParams)
14875 {
14876 yylloc = e->loc;
14877 if(methodType && methodType->methodClass)
14878 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many arguments for method %s::%s (%d given, expected %d)\n", (((void *)0))), methodType->methodClass->fullName, methodType->method->name, (*exp->call.arguments).count, noParams ? 0 : functionType->params.count);
14879 else
14880 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many arguments for function %s (%d given, expected %d)\n", (((void *)0))), name, (*exp->call.arguments).count, noParams ? 0 : functionType->params.count);
14881 break;
14882 }
14883 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
14884 {
14885 struct Type * templatedType = (((void *)0));
14886 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
14887 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
14888 int id = 0;
14889
14890 if(_class && _class->templateArgs)
14891 {
14892 struct __ecereNameSpace__ecere__com__Class * sClass;
14893
14894 for(sClass = _class; sClass; sClass = sClass->base)
14895 {
14896 if(sClass->templateClass)
14897 sClass = sClass->templateClass;
14898 id = 0;
14899 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
14900 {
14901 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
14902 {
14903 struct __ecereNameSpace__ecere__com__Class * nextClass;
14904
14905 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
14906 {
14907 if(nextClass->templateClass)
14908 nextClass = nextClass->templateClass;
14909 id += nextClass->templateParams.count;
14910 }
14911 break;
14912 }
14913 id++;
14914 }
14915 if(curParam)
14916 break;
14917 }
14918 }
14919 if(curParam && _class->templateArgs[id].dataTypeString)
14920 {
14921 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
14922
14923 {
14924 struct Context * context = SetupTemplatesContext(_class);
14925
14926 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
14927 FinishTemplatesContext(context);
14928 }
14929 e->destType = templatedType;
14930 if(templatedType)
14931 {
14932 templatedType->passAsTemplate = 0x1;
14933 }
14934 }
14935 else
14936 {
14937 e->destType = type;
14938 if(type)
14939 type->refCount++;
14940 }
14941 }
14942 else
14943 {
14944 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
14945 {
14946 e->destType = type->prev;
14947 e->destType->refCount++;
14948 }
14949 else
14950 {
14951 e->destType = type;
14952 if(type)
14953 type->refCount++;
14954 }
14955 }
14956 if(type && type->kind != 14)
14957 {
14958 struct Type * next = type->next;
14959
14960 if(!type->refCount)
14961 FreeType(type);
14962 type = next;
14963 }
14964 }
14965 if(type && type->kind != 14)
14966 {
14967 if(methodType && methodType->methodClass)
14968 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "not enough arguments for method %s::%s (%d given, expected %d)\n", (((void *)0))), methodType->methodClass->fullName, methodType->method->name, exp->call.arguments ? (*exp->call.arguments).count : 0, functionType->params.count + extra);
14969 else
14970 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "not enough arguments for function %s (%d given, expected %d)\n", (((void *)0))), name, exp->call.arguments ? (*exp->call.arguments).count : 0, functionType->params.count + extra);
14971 }
14972 yylloc = oldyylloc;
14973 if(type && !type->refCount)
14974 FreeType(type);
14975 }
14976 else
14977 {
14978 functionType = __extension__ ({
14979 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14980
14981 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
14982 });
14983 if(exp->call.exp->type == 0)
14984 {
14985 char * string = exp->call.exp->identifier->string;
14986
14987 if(inCompiler)
14988 {
14989 struct Symbol * symbol;
14990 struct Location oldyylloc = yylloc;
14991
14992 yylloc = exp->call.exp->identifier->loc;
14993 if(strstr(string, "__builtin_") == string)
14994 {
14995 if(exp->destType)
14996 {
14997 functionType->returnType = exp->destType;
14998 exp->destType->refCount++;
14999 }
15000 }
15001 else
15002 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s undefined; assuming extern returning int\n", (((void *)0))), string);
15003 symbol = __extension__ ({
15004 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
15005
15006 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 0x1), __ecereInstance1;
15007 });
15008 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
15009 if(strstr(symbol->string, "::"))
15010 globalContext->hasNameSpace = 0x1;
15011 yylloc = oldyylloc;
15012 }
15013 }
15014 else if(exp->call.exp->type == 8)
15015 {
15016 }
15017 else
15018 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "callable object undefined; extern assuming returning int\n", (((void *)0))));
15019 if(!functionType->returnType)
15020 {
15021 functionType->returnType = __extension__ ({
15022 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15023
15024 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15025 });
15026 }
15027 }
15028 if(functionType && functionType->kind == 11)
15029 {
15030 exp->expType = functionType->returnType;
15031 if(functionType->returnType)
15032 functionType->returnType->refCount++;
15033 if(!functionType->refCount)
15034 FreeType(functionType);
15035 }
15036 if(exp->call.arguments)
15037 {
15038 for(e = (*exp->call.arguments).first; e; e = e->next)
15039 {
15040 struct Type * destType = e->destType;
15041
15042 ProcessExpressionType(e);
15043 }
15044 }
15045 break;
15046 }
15047 case 8:
15048 {
15049 struct Type * type;
15050 struct Location oldyylloc = yylloc;
15051 unsigned int thisPtr;
15052 struct Expression * checkExp = exp->member.exp;
15053
15054 while(checkExp)
15055 {
15056 if(checkExp->type == 11)
15057 checkExp = checkExp->cast.exp;
15058 else if(checkExp->type == 5)
15059 checkExp = checkExp->list ? (*checkExp->list).first : (((void *)0));
15060 else
15061 break;
15062 }
15063 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->identifier->string, "this"));
15064 exp->thisPtr = thisPtr;
15065 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
15066 {
15067 exp->member.member->classSym = exp->member.member->_class->symbol;
15068 }
15069 ProcessExpressionType(exp->member.exp);
15070 if(exp->member.exp->expType && exp->member.exp->expType->kind == 8 && exp->member.exp->expType->_class && exp->member.exp->expType->_class->registered && exp->member.exp->expType->_class->registered->type == 0)
15071 {
15072 exp->isConstant = 0x0;
15073 }
15074 else
15075 exp->isConstant = exp->member.exp->isConstant;
15076 type = exp->member.exp->expType;
15077 yylloc = exp->loc;
15078 if(type && (type->kind == 20))
15079 {
15080 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
15081 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
15082
15083 if(_class)
15084 {
15085 for(param = _class->templateParams.first; param; param = param->next)
15086 {
15087 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
15088 break;
15089 }
15090 }
15091 if(param && param->defaultArg.member)
15092 {
15093 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
15094
15095 if(argExp)
15096 {
15097 struct Expression * expMember = exp->member.exp;
15098 struct Declarator * decl;
15099 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15100 char thisClassTypeString[1024];
15101
15102 FreeIdentifier(exp->member.member);
15103 ProcessExpressionType(argExp);
15104 {
15105 char * colon = strstr(param->defaultArg.memberString, "::");
15106
15107 if(colon)
15108 {
15109 char className[1024];
15110 struct __ecereNameSpace__ecere__com__Class * sClass;
15111
15112 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
15113 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
15114 }
15115 else
15116 strcpy(thisClassTypeString, _class->fullName);
15117 }
15118 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
15119 exp->expType = ProcessType(specs, decl);
15120 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
15121 {
15122 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
15123 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
15124 int c;
15125 int paramCount = 0;
15126 int lastParam = -1;
15127 char templateString[1024];
15128 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
15129
15130 sprintf(templateString, "%s<", expClass->templateClass->fullName);
15131 for(cClass = expClass; cClass; cClass = cClass->base)
15132 {
15133 int p = 0;
15134
15135 for(param = cClass->templateParams.first; param; param = param->next)
15136 {
15137 int id = p;
15138 struct __ecereNameSpace__ecere__com__Class * sClass;
15139 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
15140
15141 for(sClass = cClass->base; sClass; sClass = sClass->base)
15142 id += sClass->templateParams.count;
15143 arg = expClass->templateArgs[id];
15144 for(sClass = _class; sClass; sClass = sClass->base)
15145 {
15146 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
15147 int p = 0;
15148 struct __ecereNameSpace__ecere__com__Class * nextClass;
15149
15150 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15151 p += nextClass->templateParams.count;
15152 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
15153 {
15154 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
15155 {
15156 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15157 {
15158 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
15159 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
15160 break;
15161 }
15162 }
15163 }
15164 }
15165 {
15166 char argument[256];
15167
15168 argument[0] = '\0';
15169 switch(param->type)
15170 {
15171 case 2:
15172 {
15173 char expString[1024];
15174 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15175 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
15176 struct Expression * exp;
15177 char * string = PrintHexUInt64(arg.expression.ui64);
15178
15179 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
15180 ProcessExpressionType(exp);
15181 ComputeExpression(exp);
15182 expString[0] = '\0';
15183 PrintExpression(exp, expString);
15184 strcat(argument, expString);
15185 FreeExpression(exp);
15186 break;
15187 }
15188 case 1:
15189 {
15190 strcat(argument, arg.member->name);
15191 break;
15192 }
15193 case 0:
15194 {
15195 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15196 {
15197 if(!strcmp(arg.dataTypeString, "thisclass"))
15198 strcat(argument, thisClassTypeString);
15199 else
15200 strcat(argument, arg.dataTypeString);
15201 }
15202 break;
15203 }
15204 }
15205 if(argument[0])
15206 {
15207 if(paramCount)
15208 strcat(templateString, ", ");
15209 if(lastParam != p - 1)
15210 {
15211 strcat(templateString, param->name);
15212 strcat(templateString, " = ");
15213 }
15214 strcat(templateString, argument);
15215 paramCount++;
15216 lastParam = p;
15217 }
15218 p++;
15219 }
15220 }
15221 }
15222 {
15223 int len = strlen(templateString);
15224
15225 if(templateString[len - 1] == '>')
15226 templateString[len++] = ' ';
15227 templateString[len++] = '>';
15228 templateString[len++] = '\0';
15229 }
15230 {
15231 struct Context * context = SetupTemplatesContext(_class);
15232
15233 FreeType(exp->expType);
15234 exp->expType = ProcessTypeString(templateString, 0x0);
15235 FinishTemplatesContext(context);
15236 }
15237 }
15238 exp->type = 5;
15239 exp->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")))))))));
15240 }
15241 }
15242 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
15243 {
15244 type = ProcessTemplateParameterType(type->templateParameter);
15245 }
15246 }
15247 if(type && (type->kind == 20))
15248 ;
15249 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->type->kind == 1)))
15250 {
15251 struct Identifier * id = exp->member.member;
15252 int typeKind = type->kind;
15253 struct __ecereNameSpace__ecere__com__Class * _class = (id && (!id->_class || id->_class->name)) ? (id->classSym ? id->classSym->registered : (type->_class ? type->_class->registered : (((void *)0)))) : (((void *)0));
15254
15255 if(typeKind == 19 && exp->member.exp->type == 26)
15256 {
15257 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
15258 typeKind = 8;
15259 }
15260 if(id)
15261 {
15262 if(typeKind == 3 || typeKind == 15)
15263 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
15264 else if(!_class)
15265 {
15266 if(type->kind == 8 && type->_class && type->_class->registered)
15267 {
15268 _class = type->_class->registered;
15269 }
15270 else if((type->kind == 12 || type->kind == 13) && type->type && type->type->kind == 1)
15271 {
15272 _class = FindClass("char *")->registered;
15273 }
15274 else if(type->kind == 13)
15275 {
15276 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
15277 FreeType(exp->expType);
15278 exp->expType = ProcessTypeString("uintptr", 0x0);
15279 exp->byReference = 0x1;
15280 }
15281 else
15282 {
15283 char string[1024] = "";
15284 struct Symbol * classSym;
15285
15286 PrintTypeNoConst(type, string, 0x0, 0x1);
15287 classSym = FindClass(string);
15288 if(classSym)
15289 _class = classSym->registered;
15290 }
15291 }
15292 }
15293 if(_class && id)
15294 {
15295 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
15296 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
15297 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
15298 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
15299 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
15300
15301 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
15302 exp->member.memberType = 1;
15303 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
15304 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
15305 if(typeKind != 19)
15306 {
15307 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
15308 {
15309 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
15310 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
15311 {
15312 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15313 if(prop)
15314 member = (((void *)0));
15315 }
15316 if(!member && !prop)
15317 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15318 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
15319 exp->member.thisPtr = 0x1;
15320 }
15321 else
15322 {
15323 if(!id->classSym)
15324 {
15325 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
15326 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
15327 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
15328 }
15329 if(!prop && !member)
15330 {
15331 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
15332 if(!method)
15333 {
15334 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15335 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
15336 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
15337 }
15338 }
15339 if(member && prop)
15340 {
15341 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
15342 prop = (((void *)0));
15343 else
15344 member = (((void *)0));
15345 }
15346 }
15347 }
15348 if(!prop && !member && !method)
15349 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
15350 if(!prop && !member && !method)
15351 {
15352 if(typeKind == 19)
15353 {
15354 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
15355 if(classProp)
15356 {
15357 exp->member.memberType = 5;
15358 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
15359 }
15360 else
15361 {
15362 char structName[1024];
15363 struct Identifier * id = exp->member.member;
15364 struct Expression * classExp = exp->member.exp;
15365
15366 type->refCount++;
15367 FreeType(classExp->expType);
15368 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
15369 strcpy(structName, "__ecereClassData_");
15370 FullClassNameCat(structName, type->_class->string, 0x0);
15371 exp->type = 9;
15372 exp->member.member = id;
15373 exp->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->_class->string)), (((void *)0))), MkIdentifier("offsetClass"))))))));
15374 FreeType(type);
15375 ProcessExpressionType(exp);
15376 return ;
15377 }
15378 }
15379 else
15380 {
15381 struct Symbol * classSym = FindClass(id->string);
15382
15383 if(classSym)
15384 {
15385 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
15386
15387 if(convertClass)
15388 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
15389 }
15390 }
15391 }
15392 if(prop)
15393 {
15394 exp->member.memberType = 1;
15395 if(!prop->dataType)
15396 ProcessPropertyType(prop);
15397 exp->expType = prop->dataType;
15398 if(prop->dataType)
15399 prop->dataType->refCount++;
15400 }
15401 else if(member)
15402 {
15403 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
15404 {
15405 FreeExpContents(exp);
15406 exp->type = 0;
15407 exp->identifier = MkIdentifier("class");
15408 ProcessExpressionType(exp);
15409 return ;
15410 }
15411 exp->member.memberType = 3;
15412 DeclareStruct(_class->fullName, 0x0);
15413 if(!member->dataType)
15414 {
15415 struct Context * context = SetupTemplatesContext(_class);
15416
15417 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
15418 FinishTemplatesContext(context);
15419 }
15420 exp->expType = member->dataType;
15421 if(member->dataType)
15422 member->dataType->refCount++;
15423 }
15424 else if(revConvert)
15425 {
15426 exp->member.memberType = 4;
15427 exp->expType = MkClassType(revConvert->_class->fullName);
15428 }
15429 else if(method)
15430 {
15431 {
15432 exp->member.memberType = 2;
15433 }
15434 if(!method->dataType)
15435 ProcessMethodType(method);
15436 exp->expType = __extension__ ({
15437 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15438
15439 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1;
15440 });
15441 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
15442 exp->expType->usedClass = _class;
15443 }
15444 else if(!classProp)
15445 {
15446 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
15447 {
15448 FreeExpContents(exp);
15449 exp->type = 0;
15450 exp->identifier = MkIdentifier("class");
15451 ProcessExpressionType(exp);
15452 return ;
15453 }
15454 yylloc = exp->member.member->loc;
15455 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
15456 if(inCompiler)
15457 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
15458 }
15459 if(_class && exp->expType)
15460 {
15461 struct __ecereNameSpace__ecere__com__Class * tClass;
15462
15463 tClass = _class;
15464 while(tClass && !tClass->templateClass)
15465 tClass = tClass->base;
15466 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
15467 {
15468 int id = 0;
15469 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15470 struct __ecereNameSpace__ecere__com__Class * sClass;
15471
15472 for(sClass = tClass; sClass; sClass = sClass->base)
15473 {
15474 id = 0;
15475 if(sClass->templateClass)
15476 sClass = sClass->templateClass;
15477 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15478 {
15479 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
15480 {
15481 for(sClass = sClass->base; sClass; sClass = sClass->base)
15482 id += sClass->templateParams.count;
15483 break;
15484 }
15485 id++;
15486 }
15487 if(curParam)
15488 break;
15489 }
15490 if(curParam && tClass->templateArgs[id].dataTypeString)
15491 {
15492 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
15493 struct Context * context = SetupTemplatesContext(tClass);
15494
15495 FreeType(exp->expType);
15496 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
15497 if(exp->expType)
15498 {
15499 if(exp->expType->kind == 21)
15500 {
15501 FreeType(exp->expType);
15502 exp->expType = ReplaceThisClassType(_class);
15503 }
15504 if(tClass->templateClass)
15505 exp->expType->passAsTemplate = 0x1;
15506 if(!exp->destType)
15507 {
15508 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
15509 if(exp->destType->kind == 21)
15510 {
15511 FreeType(exp->destType);
15512 exp->destType = ReplaceThisClassType(_class);
15513 }
15514 }
15515 }
15516 FinishTemplatesContext(context);
15517 }
15518 }
15519 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
15520 {
15521 int id = 0;
15522 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15523 struct __ecereNameSpace__ecere__com__Class * sClass;
15524
15525 for(sClass = tClass; sClass; sClass = sClass->base)
15526 {
15527 id = 0;
15528 if(sClass->templateClass)
15529 sClass = sClass->templateClass;
15530 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15531 {
15532 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
15533 {
15534 for(sClass = sClass->base; sClass; sClass = sClass->base)
15535 id += sClass->templateParams.count;
15536 break;
15537 }
15538 id++;
15539 }
15540 if(curParam)
15541 break;
15542 }
15543 if(curParam)
15544 {
15545 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
15546 struct Context * context = SetupTemplatesContext(tClass);
15547 struct Type * basicType;
15548
15549 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
15550 if(basicType)
15551 {
15552 if(basicType->kind == 21)
15553 {
15554 FreeType(basicType);
15555 basicType = ReplaceThisClassType(_class);
15556 }
15557 FreeType(exp->expType);
15558 exp->expType = __extension__ ({
15559 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15560
15561 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = basicType, __ecereInstance1;
15562 });
15563 if(!exp->destType)
15564 {
15565 exp->destType = exp->expType;
15566 exp->destType->refCount++;
15567 }
15568 {
15569 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
15570 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15571 struct Declarator * decl;
15572
15573 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
15574 *newExp = *exp;
15575 if(exp->destType)
15576 exp->destType->refCount++;
15577 if(exp->expType)
15578 exp->expType->refCount++;
15579 exp->type = 11;
15580 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
15581 exp->cast.exp = newExp;
15582 }
15583 }
15584 FinishTemplatesContext(context);
15585 }
15586 }
15587 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
15588 {
15589 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
15590
15591 if(expClass)
15592 {
15593 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
15594 int c;
15595 int p = 0;
15596 int paramCount = 0;
15597 int lastParam = -1;
15598 char templateString[1024];
15599 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
15600
15601 sprintf(templateString, "%s<", expClass->templateClass->fullName);
15602 while(cClass != expClass)
15603 {
15604 struct __ecereNameSpace__ecere__com__Class * sClass;
15605
15606 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
15607 ;
15608 cClass = sClass;
15609 for(param = cClass->templateParams.first; param; param = param->next)
15610 {
15611 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
15612 int c;
15613 int cp = 0;
15614 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
15615 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
15616
15617 while(cClassCur != tClass && !paramCur)
15618 {
15619 struct __ecereNameSpace__ecere__com__Class * sClassCur;
15620
15621 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
15622 ;
15623 cClassCur = sClassCur;
15624 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
15625 {
15626 if(!strcmp(paramCur->name, param->name))
15627 {
15628 break;
15629 }
15630 cp++;
15631 }
15632 }
15633 if(paramCur && paramCur->type == 0)
15634 arg = tClass->templateArgs[cp];
15635 else
15636 arg = expClass->templateArgs[p];
15637 {
15638 char argument[256];
15639
15640 argument[0] = '\0';
15641 switch(param->type)
15642 {
15643 case 2:
15644 {
15645 char expString[1024];
15646 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15647 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
15648 struct Expression * exp;
15649 char * string = PrintHexUInt64(arg.expression.ui64);
15650
15651 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
15652 ProcessExpressionType(exp);
15653 ComputeExpression(exp);
15654 expString[0] = '\0';
15655 PrintExpression(exp, expString);
15656 strcat(argument, expString);
15657 FreeExpression(exp);
15658 break;
15659 }
15660 case 1:
15661 {
15662 strcat(argument, arg.member->name);
15663 break;
15664 }
15665 case 0:
15666 {
15667 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15668 strcat(argument, arg.dataTypeString);
15669 break;
15670 }
15671 }
15672 if(argument[0])
15673 {
15674 if(paramCount)
15675 strcat(templateString, ", ");
15676 if(lastParam != p - 1)
15677 {
15678 strcat(templateString, param->name);
15679 strcat(templateString, " = ");
15680 }
15681 strcat(templateString, argument);
15682 paramCount++;
15683 lastParam = p;
15684 }
15685 }
15686 p++;
15687 }
15688 }
15689 {
15690 int len = strlen(templateString);
15691
15692 if(templateString[len - 1] == '>')
15693 templateString[len++] = ' ';
15694 templateString[len++] = '>';
15695 templateString[len++] = '\0';
15696 }
15697 FreeType(exp->expType);
15698 {
15699 struct Context * context = SetupTemplatesContext(tClass);
15700
15701 exp->expType = ProcessTypeString(templateString, 0x0);
15702 FinishTemplatesContext(context);
15703 }
15704 }
15705 }
15706 }
15707 }
15708 else
15709 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "undefined class %s\n", (((void *)0))), (id && (!id->_class || id->_class->name)) ? (id->classSym ? id->classSym->string : (type->_class ? type->_class->string : (((void *)0)))) : "(null)");
15710 }
15711 else if(type && (type->kind == 9 || type->kind == 10))
15712 {
15713 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
15714
15715 if(memberType)
15716 {
15717 exp->expType = memberType;
15718 if(memberType)
15719 memberType->refCount++;
15720 }
15721 }
15722 else
15723 {
15724 char expString[10240];
15725
15726 expString[0] = '\0';
15727 if(inCompiler)
15728 {
15729 PrintExpression(exp, expString);
15730 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15731 }
15732 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "member operator on non-structure type expression %s\n", (((void *)0))), expString);
15733 }
15734 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
15735 {
15736 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
15737 {
15738 struct Identifier * id = exp->member.member;
15739 struct __ecereNameSpace__ecere__com__Class * _class = (id && (!id->_class || id->_class->name)) ? (id->classSym ? id->classSym->registered : (type->_class ? type->_class->registered : (((void *)0)))) : (((void *)0));
15740
15741 if(_class)
15742 {
15743 FreeType(exp->expType);
15744 exp->expType = ReplaceThisClassType(_class);
15745 }
15746 }
15747 }
15748 yylloc = oldyylloc;
15749 break;
15750 }
15751 case 9:
15752 {
15753 struct Type * destType = exp->destType;
15754
15755 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
15756 {
15757 exp->member.member->classSym = exp->member.member->_class->symbol;
15758 }
15759 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
15760 exp->type = 8;
15761 if(destType)
15762 destType->count++;
15763 ProcessExpressionType(exp);
15764 if(destType)
15765 destType->count--;
15766 break;
15767 }
15768 case 15:
15769 {
15770 struct Symbol * classSym = exp->_class->symbol;
15771
15772 if(classSym && classSym->registered)
15773 {
15774 if(classSym->registered->type == 5)
15775 {
15776 char name[1024];
15777
15778 name[0] = '\0';
15779 DeclareStruct(classSym->string, 0x0);
15780 FreeSpecifier(exp->_class);
15781 exp->type = 10;
15782 FullClassNameCat(name, classSym->string, 0x0);
15783 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
15784 }
15785 else
15786 {
15787 if(classSym->registered->fixed)
15788 {
15789 FreeSpecifier(exp->_class);
15790 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
15791 exp->type = 2;
15792 }
15793 else
15794 {
15795 char className[1024];
15796
15797 strcpy(className, "__ecereClass_");
15798 FullClassNameCat(className, classSym->string, 0x1);
15799 MangleClassName(className);
15800 DeclareClass(classSym, className);
15801 FreeExpContents(exp);
15802 exp->type = 9;
15803 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
15804 exp->member.member = MkIdentifier("structSize");
15805 }
15806 }
15807 }
15808 exp->expType = __extension__ ({
15809 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15810
15811 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15812 });
15813 break;
15814 }
15815 case 10:
15816 {
15817 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
15818
15819 exp->expType = __extension__ ({
15820 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15821
15822 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15823 });
15824 exp->isConstant = 0x1;
15825 DeclareType(type, 0x0, 0x0);
15826 FreeType(type);
15827 break;
15828 }
15829 case 11:
15830 {
15831 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
15832
15833 type->count = 1;
15834 FreeType(exp->cast.exp->destType);
15835 exp->cast.exp->destType = type;
15836 type->refCount++;
15837 ProcessExpressionType(exp->cast.exp);
15838 type->count = 0;
15839 exp->expType = type;
15840 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
15841 {
15842 void * prev = exp->prev, * next = exp->next;
15843 struct Type * expType = exp->cast.exp->destType;
15844 struct Expression * castExp = exp->cast.exp;
15845 struct Type * destType = exp->destType;
15846
15847 if(expType)
15848 expType->refCount++;
15849 FreeType(exp->expType);
15850 FreeTypeName(exp->cast.typeName);
15851 *exp = *castExp;
15852 FreeType(exp->expType);
15853 FreeType(exp->destType);
15854 exp->expType = expType;
15855 exp->destType = destType;
15856 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
15857 exp->prev = prev;
15858 exp->next = next;
15859 }
15860 else
15861 {
15862 exp->isConstant = exp->cast.exp->isConstant;
15863 }
15864 break;
15865 }
15866 case 35:
15867 {
15868 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
15869
15870 exp->expType = type;
15871 break;
15872 }
15873 case 36:
15874 {
15875 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
15876
15877 ProcessExpressionType(exp->vaArg.exp);
15878 exp->expType = type;
15879 break;
15880 }
15881 case 12:
15882 {
15883 struct Expression * e;
15884
15885 exp->isConstant = 0x1;
15886 FreeType(exp->cond.cond->destType);
15887 exp->cond.cond->destType = MkClassType("bool");
15888 exp->cond.cond->destType->truth = 0x1;
15889 ProcessExpressionType(exp->cond.cond);
15890 if(!exp->cond.cond->isConstant)
15891 exp->isConstant = 0x0;
15892 for(e = (*exp->cond.exp).first; e; e = e->next)
15893 {
15894 if(!e->next)
15895 {
15896 FreeType(e->destType);
15897 e->destType = exp->destType;
15898 if(e->destType)
15899 e->destType->refCount++;
15900 }
15901 ProcessExpressionType(e);
15902 if(!e->next)
15903 {
15904 exp->expType = e->expType;
15905 if(e->expType)
15906 e->expType->refCount++;
15907 }
15908 if(!e->isConstant)
15909 exp->isConstant = 0x0;
15910 }
15911 FreeType(exp->cond.elseExp->destType);
15912 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
15913 if(exp->cond.elseExp->destType)
15914 exp->cond.elseExp->destType->refCount++;
15915 ProcessExpressionType(exp->cond.elseExp);
15916 if(!exp->cond.elseExp->isConstant)
15917 exp->isConstant = 0x0;
15918 break;
15919 }
15920 case 25:
15921 {
15922 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
15923 {
15924 struct Statement * last = (*exp->compound->compound.statements).last;
15925
15926 if(last->type == 3 && last->expressions && (*last->expressions).last)
15927 {
15928 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
15929 if(exp->destType)
15930 exp->destType->refCount++;
15931 }
15932 ProcessStatement(exp->compound);
15933 exp->expType = (last->expressions && (*last->expressions).last) ? ((struct Expression *)(*last->expressions).last)->expType : (((void *)0));
15934 if(exp->expType)
15935 exp->expType->refCount++;
15936 }
15937 break;
15938 }
15939 case 26:
15940 {
15941 struct Specifier * spec = (*exp->_classExp.specifiers).first;
15942
15943 if(spec && spec->type == 1)
15944 {
15945 exp->expType = MkClassType(spec->name);
15946 exp->expType->kind = 19;
15947 exp->byReference = 0x1;
15948 }
15949 else
15950 {
15951 exp->expType = MkClassType("ecere::com::Class");
15952 exp->byReference = 0x1;
15953 }
15954 break;
15955 }
15956 case 27:
15957 {
15958 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
15959
15960 if(_class)
15961 {
15962 struct Identifier * id = exp->classData.id;
15963 char structName[1024];
15964 struct Expression * classExp;
15965
15966 strcpy(structName, "__ecereClassData_");
15967 FullClassNameCat(structName, _class->fullName, 0x0);
15968 exp->type = 9;
15969 exp->member.member = id;
15970 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
15971 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
15972 else
15973 classExp = MkExpIdentifier(MkIdentifier("class"));
15974 exp->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"))))))));
15975 ProcessExpressionType(exp);
15976 return ;
15977 }
15978 break;
15979 }
15980 case 37:
15981 {
15982 struct Type * type = (((void *)0));
15983 char * typeString = (((void *)0));
15984 char typeStringBuf[1024];
15985
15986 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class && exp->destType->_class->registered && exp->destType->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(exp->destType->_class->registered, containerClass))
15987 {
15988 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
15989
15990 typeString = templateClass->templateArgs[2].dataTypeString;
15991 }
15992 else if(exp->list)
15993 {
15994 struct Expression * e;
15995
15996 for(e = (*exp->list).first; e; e = e->next)
15997 {
15998 ProcessExpressionType(e);
15999 if(e->expType)
16000 {
16001 if(!type)
16002 {
16003 type = e->expType;
16004 type->refCount++;
16005 }
16006 else
16007 {
16008 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
16009 {
16010 FreeType(type);
16011 type = e->expType;
16012 e->expType = (((void *)0));
16013 e = (*exp->list).first;
16014 ProcessExpressionType(e);
16015 if(e->expType)
16016 {
16017 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
16018 {
16019 FreeType(e->expType);
16020 e->expType = (((void *)0));
16021 FreeType(type);
16022 type = (((void *)0));
16023 break;
16024 }
16025 }
16026 }
16027 }
16028 if(e->expType)
16029 {
16030 FreeType(e->expType);
16031 e->expType = (((void *)0));
16032 }
16033 }
16034 }
16035 if(type)
16036 {
16037 typeStringBuf[0] = '\0';
16038 PrintTypeNoConst(type, typeStringBuf, 0x0, 0x1);
16039 typeString = typeStringBuf;
16040 FreeType(type);
16041 type = (((void *)0));
16042 }
16043 }
16044 if(typeString)
16045 {
16046 char templateString[1024];
16047 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
16048 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
16049 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16050 struct Expression * expExt;
16051 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16052
16053 sprintf(templateString, "Container<%s>", typeString);
16054 if(exp->list)
16055 {
16056 struct Expression * e;
16057
16058 type = ProcessTypeString(typeString, 0x0);
16059 while(e = (*exp->list).first)
16060 {
16061 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
16062 e->destType = type;
16063 type->refCount++;
16064 ProcessExpressionType(e);
16065 ListAdd(initializers, MkInitializerAssignment(e));
16066 }
16067 FreeType(type);
16068 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
16069 }
16070 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
16071 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
16072 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16073 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
16074 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16075 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
16076 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16077 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
16078 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16079 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
16080 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16081
16082 __ecereInstance1->type = 2, __ecereInstance1->constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, (void *)0), __ecereInstance1;
16083 })));
16084 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16085 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
16086 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16087 exp->expType = ProcessTypeString(templateString, 0x0);
16088 exp->type = 5;
16089 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
16090 ProcessExpressionType(expExt);
16091 }
16092 else
16093 {
16094 exp->expType = ProcessTypeString("Container", 0x0);
16095 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
16096 }
16097 break;
16098 }
16099 }
16100 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
16101 {
16102 FreeType(exp->expType);
16103 exp->expType = ReplaceThisClassType(thisClass);
16104 }
16105 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
16106 {
16107 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
16108
16109 if(symbol)
16110 {
16111 if(exp->expType->kind != 15)
16112 {
16113 struct Type * member;
16114 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
16115
16116 FreeType(exp->expType);
16117 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16118 exp->expType->kind = symbol->type->kind;
16119 exp->expType->refCount++;
16120 exp->expType->enumName = enumName;
16121 exp->expType->members = symbol->type->members;
16122 for(member = symbol->type->members.first; member; member = member->next)
16123 member->refCount++;
16124 }
16125 else
16126 {
16127 struct __ecereNameSpace__ecere__sys__NamedLink * member;
16128
16129 for(member = symbol->type->members.first; member; member = member->next)
16130 {
16131 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(structSize_NamedLink), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
16132
16133 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
16134 }
16135 }
16136 }
16137 }
16138 yylloc = exp->loc;
16139 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
16140 ;
16141 else if(exp->destType && !exp->destType->keepCast)
16142 {
16143 if(!CheckExpressionType(exp, exp->destType, 0x0))
16144 {
16145 if(!exp->destType->count || unresolved)
16146 {
16147 if(!exp->expType)
16148 {
16149 yylloc = exp->loc;
16150 if(exp->destType->kind != 14)
16151 {
16152 char type2[1024];
16153
16154 type2[0] = '\0';
16155 if(inCompiler)
16156 {
16157 char expString[10240];
16158
16159 expString[0] = '\0';
16160 PrintType(exp->destType, type2, 0x0, 0x1);
16161 if(inCompiler)
16162 {
16163 PrintExpression(exp, expString);
16164 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16165 }
16166 if(unresolved)
16167 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
16168 else if(exp->type != 16)
16169 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
16170 }
16171 }
16172 else
16173 {
16174 char expString[10240];
16175
16176 expString[0] = '\0';
16177 if(inCompiler)
16178 {
16179 PrintExpression(exp, expString);
16180 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16181 }
16182 if(unresolved)
16183 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), expString);
16184 else if(exp->type != 16)
16185 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
16186 }
16187 }
16188 else
16189 {
16190 char type1[1024];
16191 char type2[1024];
16192
16193 type1[0] = '\0';
16194 type2[0] = '\0';
16195 if(inCompiler)
16196 {
16197 PrintType(exp->expType, type1, 0x0, 0x1);
16198 PrintType(exp->destType, type2, 0x0, 0x1);
16199 }
16200 if(exp->destType->truth && exp->destType->_class && exp->destType->_class->registered && !strcmp(exp->destType->_class->registered->name, "bool") && exp->expType->kind != 0 && exp->expType->kind != 9 && exp->expType->kind != 10 && (exp->expType->kind != 8 || exp->expType->classObjectType || (exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type != 1)))
16201 ;
16202 else
16203 {
16204 char expString[10240];
16205
16206 expString[0] = '\0';
16207 if(inCompiler)
16208 {
16209 PrintExpression(exp, expString);
16210 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16211 }
16212 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
16213 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
16214 FreeType(exp->expType);
16215 exp->destType->refCount++;
16216 exp->expType = exp->destType;
16217 }
16218 }
16219 }
16220 }
16221 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
16222 {
16223 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16224 char typeString[1024];
16225 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16226 struct Declarator * decl;
16227
16228 typeString[0] = '\0';
16229 *newExp = *exp;
16230 if(exp->expType)
16231 exp->expType->refCount++;
16232 if(exp->expType)
16233 exp->expType->refCount++;
16234 exp->type = 11;
16235 newExp->destType = exp->expType;
16236 PrintType(exp->expType, typeString, 0x0, 0x0);
16237 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16238 exp->cast.typeName = MkTypeName(specs, decl);
16239 exp->cast.exp = newExp;
16240 }
16241 }
16242 else if(unresolved)
16243 {
16244 if(exp->identifier->_class && exp->identifier->_class->name)
16245 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
16246 else if(exp->identifier->string && exp->identifier->string[0])
16247 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
16248 }
16249 else if(!exp->expType && exp->type != 16)
16250 {
16251 char expString[10240];
16252
16253 expString[0] = '\0';
16254 if(inCompiler)
16255 {
16256 PrintExpression(exp, expString);
16257 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16258 }
16259 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
16260 }
16261 if(inCompiler)
16262 ApplyAnyObjectLogic(exp);
16263 if(!notByReference && exp->expType && exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->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)))
16264 {
16265 exp->byReference = 0x1;
16266 }
16267 yylloc = oldyylloc;
16268 }
16269
16270 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)
16271 {
16272 if(*curMember)
16273 {
16274 *curMember = (*curMember)->next;
16275 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
16276 {
16277 *curMember = subMemberStack[--(*subMemberStackPos)];
16278 *curMember = (*curMember)->next;
16279 }
16280 while((*curMember) && (*curMember)->isProperty)
16281 *curMember = (*curMember)->next;
16282 if(subMemberStackPos)
16283 {
16284 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
16285 {
16286 subMemberStack[(*subMemberStackPos)++] = *curMember;
16287 *curMember = (*curMember)->members.first;
16288 while(*curMember && (*curMember)->isProperty)
16289 *curMember = (*curMember)->next;
16290 }
16291 }
16292 }
16293 while(!*curMember)
16294 {
16295 if(!*curMember)
16296 {
16297 if(subMemberStackPos && *subMemberStackPos)
16298 {
16299 *curMember = subMemberStack[--(*subMemberStackPos)];
16300 *curMember = (*curMember)->next;
16301 }
16302 else
16303 {
16304 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
16305
16306 if(*curClass == _class)
16307 break;
16308 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
16309 ;
16310 *curMember = (*curClass)->membersAndProperties.first;
16311 }
16312 while((*curMember) && (*curMember)->isProperty)
16313 *curMember = (*curMember)->next;
16314 if(subMemberStackPos)
16315 {
16316 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
16317 {
16318 subMemberStack[(*subMemberStackPos)++] = *curMember;
16319 *curMember = (*curMember)->members.first;
16320 while(*curMember && (*curMember)->isProperty)
16321 *curMember = (*curMember)->next;
16322 }
16323 }
16324 }
16325 }
16326 }
16327
16328 static void ProcessInitializer(struct Initializer * init, struct Type * type)
16329 {
16330 switch(init->type)
16331 {
16332 case 0:
16333 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
16334 {
16335 if(init->exp && !init->exp->destType)
16336 {
16337 FreeType(init->exp->destType);
16338 init->exp->destType = type;
16339 if(type)
16340 type->refCount++;
16341 }
16342 if(init->exp)
16343 {
16344 ProcessExpressionType(init->exp);
16345 init->isConstant = init->exp->isConstant;
16346 }
16347 break;
16348 }
16349 else
16350 {
16351 struct Expression * exp = init->exp;
16352 struct Instantiation * inst = exp->instance;
16353 struct MembersInit * members;
16354
16355 init->type = 1;
16356 init->list = MkList();
16357 if(inst->members)
16358 {
16359 for(members = (*inst->members).first; members; members = members->next)
16360 {
16361 if(members->type == 0)
16362 {
16363 struct MemberInit * member;
16364
16365 for(member = (*members->dataMembers).first; member; member = member->next)
16366 {
16367 ListAdd(init->list, member->initializer);
16368 member->initializer = (((void *)0));
16369 }
16370 }
16371 }
16372 }
16373 FreeExpression(exp);
16374 }
16375 case 1:
16376 {
16377 struct Initializer * i;
16378 struct Type * initializerType = (((void *)0));
16379 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
16380 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
16381 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
16382 int subMemberStackPos = 0;
16383
16384 if(type && type->kind == 12)
16385 initializerType = Dereference(type);
16386 else if(type && (type->kind == 9 || type->kind == 10))
16387 initializerType = type->members.first;
16388 for(i = (*init->list).first; i; i = i->next)
16389 {
16390 if(type && type->kind == 8 && type->_class && type->_class->registered)
16391 {
16392 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
16393 if(curMember)
16394 {
16395 if(!curMember->dataType)
16396 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
16397 initializerType = curMember->dataType;
16398 }
16399 }
16400 ProcessInitializer(i, initializerType);
16401 if(initializerType && type && (type->kind == 9 || type->kind == 10))
16402 initializerType = initializerType->next;
16403 if(!i->isConstant)
16404 init->isConstant = 0x0;
16405 }
16406 if(type && type->kind == 12)
16407 FreeType(initializerType);
16408 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
16409 {
16410 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Assigning list initializer to non list\n", (((void *)0))));
16411 }
16412 break;
16413 }
16414 }
16415 }
16416
16417 extern struct Symbol * FindType(struct Context * ctx, char *  name);
16418
16419 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
16420
16421 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
16422 {
16423 switch(spec->type)
16424 {
16425 case 0:
16426 {
16427 if(spec->specifier == THISCLASS)
16428 {
16429 if(thisClass)
16430 {
16431 spec->type = 1;
16432 spec->name = ReplaceThisClass(thisClass);
16433 spec->symbol = FindClass(spec->name);
16434 ProcessSpecifier(spec, declareStruct);
16435 }
16436 }
16437 break;
16438 }
16439 case 1:
16440 {
16441 struct Symbol * symbol = FindType(curContext, spec->name);
16442
16443 if(symbol)
16444 DeclareType(symbol->type, 0x1, 0x1);
16445 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
16446 DeclareStruct(spec->name, 0x0);
16447 break;
16448 }
16449 case 2:
16450 {
16451 struct Enumerator * e;
16452
16453 if(spec->list)
16454 {
16455 for(e = (*spec->list).first; e; e = e->next)
16456 {
16457 if(e->exp)
16458 ProcessExpressionType(e->exp);
16459 }
16460 }
16461 break;
16462 }
16463 case 3:
16464 case 4:
16465 {
16466 if(spec->definitions)
16467 {
16468 struct ClassDef * def;
16469 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
16470
16471 ProcessClass(spec->definitions, symbol);
16472 }
16473 break;
16474 }
16475 }
16476 }
16477
16478 static void ProcessDeclarator(struct Declarator * decl)
16479 {
16480 switch(decl->type)
16481 {
16482 case 1:
16483 if(decl->identifier->classSym)
16484 {
16485 FreeSpecifier(decl->identifier->_class);
16486 decl->identifier->_class = (((void *)0));
16487 }
16488 break;
16489 case 3:
16490 if(decl->array.exp)
16491 ProcessExpressionType(decl->array.exp);
16492 case 0:
16493 case 2:
16494 case 4:
16495 case 5:
16496 case 6:
16497 case 7:
16498 if(decl->declarator)
16499 ProcessDeclarator(decl->declarator);
16500 if(decl->type == 4)
16501 {
16502 struct Identifier * id = GetDeclId(decl);
16503
16504 if(id && id->_class)
16505 {
16506 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
16507
16508 if(!decl->function.parameters)
16509 decl->function.parameters = MkList();
16510 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
16511 id->_class = (((void *)0));
16512 }
16513 if(decl->function.parameters)
16514 {
16515 struct TypeName * param;
16516
16517 for(param = (*decl->function.parameters).first; param; param = param->next)
16518 {
16519 if(param->qualifiers && (*param->qualifiers).first)
16520 {
16521 struct Specifier * spec = (*param->qualifiers).first;
16522
16523 if(spec && spec->specifier == TYPED_OBJECT)
16524 {
16525 struct Declarator * d = param->declarator;
16526 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);
16527
16528 FreeList(param->qualifiers, FreeSpecifier);
16529 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
16530 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
16531 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
16532 param = newParam;
16533 }
16534 else if(spec && spec->specifier == ANY_OBJECT)
16535 {
16536 struct Declarator * d = param->declarator;
16537
16538 FreeList(param->qualifiers, FreeSpecifier);
16539 param->qualifiers = MkListOne(MkSpecifier(VOID));
16540 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
16541 }
16542 else if(spec->specifier == THISCLASS)
16543 {
16544 if(thisClass)
16545 {
16546 spec->type = 1;
16547 spec->name = ReplaceThisClass(thisClass);
16548 spec->symbol = FindClass(spec->name);
16549 ProcessSpecifier(spec, 0x0);
16550 }
16551 }
16552 }
16553 if(param->declarator)
16554 ProcessDeclarator(param->declarator);
16555 }
16556 }
16557 }
16558 break;
16559 }
16560 }
16561
16562 extern struct Identifier * CopyIdentifier(struct Identifier * id);
16563
16564 extern void FreeInitDeclarator(struct InitDeclarator * decl);
16565
16566 static void ProcessDeclaration(struct Declaration * decl)
16567 {
16568 yylloc = decl->loc;
16569 switch(decl->type)
16570 {
16571 case 1:
16572 {
16573 unsigned int declareStruct = 0x0;
16574
16575 if(decl->declarators)
16576 {
16577 struct InitDeclarator * d;
16578
16579 for(d = (*decl->declarators).first; d; d = d->next)
16580 {
16581 struct Type * type, * subType;
16582
16583 ProcessDeclarator(d->declarator);
16584 type = ProcessType(decl->specifiers, d->declarator);
16585 if(d->initializer)
16586 {
16587 ProcessInitializer(d->initializer, type);
16588 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
16589 {
16590 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
16591 {
16592 struct Instantiation * inst = d->initializer->exp->instance;
16593
16594 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
16595 d->initializer->exp->instance = (((void *)0));
16596 if(decl->specifiers)
16597 FreeList(decl->specifiers, FreeSpecifier);
16598 FreeList(decl->declarators, FreeInitDeclarator);
16599 d = (((void *)0));
16600 decl->type = 2;
16601 decl->inst = inst;
16602 }
16603 }
16604 }
16605 for(subType = type; subType; )
16606 {
16607 if(subType->kind == 8)
16608 {
16609 declareStruct = 0x1;
16610 break;
16611 }
16612 else if(subType->kind == 13)
16613 break;
16614 else if(subType->kind == 12)
16615 subType = subType->arrayType;
16616 else
16617 break;
16618 }
16619 FreeType(type);
16620 if(!d)
16621 break;
16622 }
16623 }
16624 if(decl->specifiers)
16625 {
16626 struct Specifier * s;
16627
16628 for(s = (*decl->specifiers).first; s; s = s->next)
16629 {
16630 ProcessSpecifier(s, declareStruct);
16631 }
16632 }
16633 break;
16634 }
16635 case 2:
16636 {
16637 ProcessInstantiationType(decl->inst);
16638 break;
16639 }
16640 case 0:
16641 {
16642 struct Specifier * spec;
16643 struct Declarator * d;
16644 unsigned int declareStruct = 0x0;
16645
16646 if(decl->declarators)
16647 {
16648 for(d = (*decl->declarators).first; d; d = d->next)
16649 {
16650 struct Type * type = ProcessType(decl->specifiers, d->declarator);
16651 struct Type * subType;
16652
16653 ProcessDeclarator(d);
16654 for(subType = type; subType; )
16655 {
16656 if(subType->kind == 8)
16657 {
16658 declareStruct = 0x1;
16659 break;
16660 }
16661 else if(subType->kind == 13)
16662 break;
16663 else if(subType->kind == 12)
16664 subType = subType->arrayType;
16665 else
16666 break;
16667 }
16668 FreeType(type);
16669 }
16670 }
16671 if(decl->specifiers)
16672 {
16673 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
16674 ProcessSpecifier(spec, declareStruct);
16675 }
16676 break;
16677 }
16678 }
16679 }
16680
16681 static struct FunctionDefinition * curFunction;
16682
16683 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
16684 {
16685 char propName[1024], propNameM[1024];
16686 char getName[1024], setName[1024];
16687 struct __ecereNameSpace__ecere__sys__OldList * args;
16688
16689 DeclareProperty(prop, setName, getName);
16690 strcpy(propName, "__ecereProp_");
16691 FullClassNameCat(propName, prop->_class->fullName, 0x0);
16692 strcat(propName, "_");
16693 FullClassNameCat(propName, prop->name, 0x1);
16694 MangleClassName(propName);
16695 strcpy(propNameM, "__ecerePropM_");
16696 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
16697 strcat(propNameM, "_");
16698 FullClassNameCat(propNameM, prop->name, 0x1);
16699 MangleClassName(propNameM);
16700 if(prop->isWatchable)
16701 {
16702 args = MkList();
16703 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
16704 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
16705 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
16706 args = MkList();
16707 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
16708 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
16709 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
16710 }
16711 {
16712 args = MkList();
16713 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
16714 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
16715 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
16716 args = MkList();
16717 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
16718 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
16719 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
16720 }
16721 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
16722 curFunction->propSet->fireWatchersDone = 0x1;
16723 }
16724
16725 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
16726
16727 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
16728
16729 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
16730
16731 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
16732
16733 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
16734
16735 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
16736
16737 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
16738
16739 extern void FreePropertyWatch(struct PropertyWatch * watcher);
16740
16741 static void ProcessStatement(struct Statement * stmt)
16742 {
16743 yylloc = stmt->loc;
16744 switch(stmt->type)
16745 {
16746 case 0:
16747 ProcessStatement(stmt->labeled.stmt);
16748 break;
16749 case 1:
16750 if(stmt->caseStmt.exp)
16751 {
16752 FreeType(stmt->caseStmt.exp->destType);
16753 stmt->caseStmt.exp->destType = curSwitchType;
16754 if(curSwitchType)
16755 curSwitchType->refCount++;
16756 ProcessExpressionType(stmt->caseStmt.exp);
16757 ComputeExpression(stmt->caseStmt.exp);
16758 }
16759 if(stmt->caseStmt.stmt)
16760 ProcessStatement(stmt->caseStmt.stmt);
16761 break;
16762 case 2:
16763 {
16764 if(stmt->compound.context)
16765 {
16766 struct Declaration * decl;
16767 struct Statement * s;
16768 struct Statement * prevCompound = curCompound;
16769 struct Context * prevContext = curContext;
16770
16771 if(!stmt->compound.isSwitch)
16772 {
16773 curCompound = stmt;
16774 curContext = stmt->compound.context;
16775 }
16776 if(stmt->compound.declarations)
16777 {
16778 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
16779 ProcessDeclaration(decl);
16780 }
16781 if(stmt->compound.statements)
16782 {
16783 for(s = (*stmt->compound.statements).first; s; s = s->next)
16784 ProcessStatement(s);
16785 }
16786 curContext = prevContext;
16787 curCompound = prevCompound;
16788 }
16789 break;
16790 }
16791 case 3:
16792 {
16793 struct Expression * exp;
16794
16795 if(stmt->expressions)
16796 {
16797 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
16798 ProcessExpressionType(exp);
16799 }
16800 break;
16801 }
16802 case 4:
16803 {
16804 struct Expression * exp;
16805
16806 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
16807 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
16808 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
16809 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
16810 {
16811 ProcessExpressionType(exp);
16812 }
16813 if(stmt->ifStmt.stmt)
16814 ProcessStatement(stmt->ifStmt.stmt);
16815 if(stmt->ifStmt.elseStmt)
16816 ProcessStatement(stmt->ifStmt.elseStmt);
16817 break;
16818 }
16819 case 5:
16820 {
16821 struct Type * oldSwitchType = curSwitchType;
16822
16823 if(stmt->switchStmt.exp)
16824 {
16825 struct Expression * exp;
16826
16827 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
16828 {
16829 if(!exp->next)
16830 {
16831 ProcessExpressionType(exp);
16832 }
16833 if(!exp->next)
16834 curSwitchType = exp->expType;
16835 }
16836 }
16837 ProcessStatement(stmt->switchStmt.stmt);
16838 curSwitchType = oldSwitchType;
16839 break;
16840 }
16841 case 6:
16842 {
16843 if(stmt->whileStmt.exp)
16844 {
16845 struct Expression * exp;
16846
16847 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
16848 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
16849 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
16850 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
16851 {
16852 ProcessExpressionType(exp);
16853 }
16854 }
16855 if(stmt->whileStmt.stmt)
16856 ProcessStatement(stmt->whileStmt.stmt);
16857 break;
16858 }
16859 case 7:
16860 {
16861 if(stmt->doWhile.exp)
16862 {
16863 struct Expression * exp;
16864
16865 if((*stmt->doWhile.exp).last)
16866 {
16867 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
16868 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
16869 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
16870 }
16871 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
16872 {
16873 ProcessExpressionType(exp);
16874 }
16875 }
16876 if(stmt->doWhile.stmt)
16877 ProcessStatement(stmt->doWhile.stmt);
16878 break;
16879 }
16880 case 8:
16881 {
16882 struct Expression * exp;
16883
16884 if(stmt->forStmt.init)
16885 ProcessStatement(stmt->forStmt.init);
16886 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
16887 {
16888 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
16889 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
16890 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
16891 }
16892 if(stmt->forStmt.check)
16893 ProcessStatement(stmt->forStmt.check);
16894 if(stmt->forStmt.increment)
16895 {
16896 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
16897 ProcessExpressionType(exp);
16898 }
16899 if(stmt->forStmt.stmt)
16900 ProcessStatement(stmt->forStmt.stmt);
16901 break;
16902 }
16903 case 18:
16904 {
16905 struct Identifier * id = stmt->forEachStmt.id;
16906 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
16907 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
16908 struct Statement * block = stmt->forEachStmt.stmt;
16909 char iteratorType[1024];
16910 struct Type * source;
16911 struct Expression * e;
16912 unsigned int isBuiltin = exp && (*exp).last && (((struct Expression *)(*exp).last)->type == 37 || (((struct Expression *)(*exp).last)->type == 11 && ((struct Expression *)(*exp).last)->cast.exp->type == 37));
16913 struct Expression * arrayExp;
16914 char * typeString = (((void *)0));
16915 int builtinCount = 0;
16916
16917 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
16918 {
16919 if(!e->next)
16920 {
16921 FreeType(e->destType);
16922 e->destType = ProcessTypeString("Container", 0x0);
16923 }
16924 if(!isBuiltin || e->next)
16925 ProcessExpressionType(e);
16926 }
16927 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
16928 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
16929 {
16930 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
16931 struct Symbol * symbol;
16932 struct Expression * expIt = (((void *)0));
16933 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
16934 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
16935 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
16936 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
16937
16938 stmt->type = 2;
16939 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
16940 stmt->compound.context->parent = curContext;
16941 curContext = stmt->compound.context;
16942 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
16943 {
16944 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
16945 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
16946
16947 isCustomAVLTree = 0x1;
16948 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
16949 isAVLTree = 0x1;
16950 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
16951 isMap = 0x1;
16952 }
16953 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
16954 isArray = 0x1;
16955 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
16956 {
16957 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
16958
16959 isLinkList = 0x1;
16960 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
16961 }
16962 if(isArray)
16963 {
16964 struct Declarator * decl;
16965 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16966
16967 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
16968 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
16969 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
16970 }
16971 else if(isBuiltin)
16972 {
16973 struct Type * type = (((void *)0));
16974 char typeStringBuf[1024];
16975
16976 arrayExp = (((struct Expression *)(*exp).last)->type == 37) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
16977 if(((struct Expression *)(*exp).last)->type == 11)
16978 {
16979 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
16980
16981 if(typeName)
16982 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
16983 }
16984 if(arrayExp->destType && arrayExp->destType->kind == 8 && arrayExp->destType->_class && arrayExp->destType->_class->registered && arrayExp->destType->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(arrayExp->destType->_class->registered, containerClass) && arrayExp->destType->_class->registered->templateArgs)
16985 {
16986 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
16987
16988 typeString = templateClass->templateArgs[2].dataTypeString;
16989 }
16990 else if(arrayExp->list)
16991 {
16992 struct Expression * e;
16993
16994 for(e = (*arrayExp->list).first; e; e = e->next)
16995 {
16996 ProcessExpressionType(e);
16997 if(e->expType)
16998 {
16999 if(!type)
17000 {
17001 type = e->expType;
17002 type->refCount++;
17003 }
17004 else
17005 {
17006 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
17007 {
17008 FreeType(type);
17009 type = e->expType;
17010 e->expType = (((void *)0));
17011 e = (*arrayExp->list).first;
17012 ProcessExpressionType(e);
17013 if(e->expType)
17014 {
17015 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
17016 {
17017 FreeType(e->expType);
17018 e->expType = (((void *)0));
17019 FreeType(type);
17020 type = (((void *)0));
17021 break;
17022 }
17023 }
17024 }
17025 }
17026 if(e->expType)
17027 {
17028 FreeType(e->expType);
17029 e->expType = (((void *)0));
17030 }
17031 }
17032 }
17033 if(type)
17034 {
17035 typeStringBuf[0] = '\0';
17036 PrintType(type, typeStringBuf, 0x0, 0x1);
17037 typeString = typeStringBuf;
17038 FreeType(type);
17039 }
17040 }
17041 if(typeString)
17042 {
17043 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
17044 struct Declarator * decl;
17045 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17046
17047 if(arrayExp->list)
17048 {
17049 struct Expression * e;
17050
17051 builtinCount = (*arrayExp->list).count;
17052 type = ProcessTypeString(typeString, 0x0);
17053 while(e = (*arrayExp->list).first)
17054 {
17055 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
17056 e->destType = type;
17057 type->refCount++;
17058 ProcessExpressionType(e);
17059 ListAdd(initializers, MkInitializerAssignment(e));
17060 }
17061 FreeType(type);
17062 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
17063 }
17064 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
17065 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
17066 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
17067 FreeList(exp, FreeExpression);
17068 }
17069 else
17070 {
17071 arrayExp->expType = ProcessTypeString("Container", 0x0);
17072 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
17073 }
17074 }
17075 else if(isLinkList && !isList)
17076 {
17077 struct Declarator * decl;
17078 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17079
17080 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
17081 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17082 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
17083 }
17084 else if(_class->templateArgs)
17085 {
17086 if(isMap)
17087 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
17088 else
17089 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
17090 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
17091 }
17092 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
17093 if(block)
17094 {
17095 switch(block->type)
17096 {
17097 case 2:
17098 if(block->compound.context)
17099 block->compound.context->parent = stmt->compound.context;
17100 break;
17101 case 4:
17102 if(block->ifStmt.stmt && block->ifStmt.stmt->type == 2 && block->ifStmt.stmt->compound.context)
17103 block->ifStmt.stmt->compound.context->parent = stmt->compound.context;
17104 if(block->ifStmt.elseStmt && block->ifStmt.elseStmt->type == 2 && block->ifStmt.elseStmt->compound.context)
17105 block->ifStmt.elseStmt->compound.context->parent = stmt->compound.context;
17106 break;
17107 case 5:
17108 if(block->switchStmt.stmt && block->switchStmt.stmt->type == 2 && block->switchStmt.stmt->compound.context)
17109 block->switchStmt.stmt->compound.context->parent = stmt->compound.context;
17110 break;
17111 case 6:
17112 if(block->whileStmt.stmt && block->whileStmt.stmt->type == 2 && block->whileStmt.stmt->compound.context)
17113 block->whileStmt.stmt->compound.context->parent = stmt->compound.context;
17114 break;
17115 case 7:
17116 if(block->doWhile.stmt && block->doWhile.stmt->type == 2 && block->doWhile.stmt->compound.context)
17117 block->doWhile.stmt->compound.context->parent = stmt->compound.context;
17118 break;
17119 case 8:
17120 if(block->forStmt.stmt && block->forStmt.stmt->type == 2 && block->forStmt.stmt->compound.context)
17121 block->forStmt.stmt->compound.context->parent = stmt->compound.context;
17122 break;
17123 case 18:
17124 if(block->forEachStmt.stmt && block->forEachStmt.stmt->type == 2 && block->forEachStmt.stmt->compound.context)
17125 block->forEachStmt.stmt->compound.context->parent = stmt->compound.context;
17126 break;
17127 }
17128 }
17129 if(filter)
17130 {
17131 block = MkIfStmt(filter, block, (((void *)0)));
17132 }
17133 if(isArray)
17134 {
17135 stmt->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));
17136 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17137 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17138 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17139 }
17140 else if(isBuiltin)
17141 {
17142 char count[128];
17143
17144 sprintf(count, "%d", builtinCount);
17145 stmt->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));
17146 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17147 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17148 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17149 }
17150 else if(isLinkList && !isList)
17151 {
17152 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
17153 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
17154
17155 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
17156 {
17157 stmt->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));
17158 }
17159 else
17160 {
17161 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17162 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
17163
17164 stmt->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));
17165 }
17166 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17167 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17168 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17169 }
17170 else
17171 {
17172 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
17173 }
17174 ProcessExpressionType(expIt);
17175 if((*stmt->compound.declarations).first)
17176 ProcessDeclaration((*stmt->compound.declarations).first);
17177 if(symbol)
17178 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
17179 ProcessStatement(stmt);
17180 curContext = stmt->compound.context->parent;
17181 break;
17182 }
17183 else
17184 {
17185 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Expression is not a container\n", (((void *)0))));
17186 }
17187 break;
17188 }
17189 case 9:
17190 break;
17191 case 10:
17192 break;
17193 case 11:
17194 break;
17195 case 12:
17196 {
17197 struct Expression * exp;
17198
17199 if(stmt->expressions)
17200 {
17201 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
17202 {
17203 if(!exp->next)
17204 {
17205 if(curFunction && !curFunction->type)
17206 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
17207 FreeType(exp->destType);
17208 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
17209 if(exp->destType)
17210 exp->destType->refCount++;
17211 }
17212 ProcessExpressionType(exp);
17213 }
17214 }
17215 break;
17216 }
17217 case 14:
17218 {
17219 ProcessDeclaration(stmt->decl);
17220 break;
17221 }
17222 case 13:
17223 {
17224 struct AsmField * field;
17225
17226 if(stmt->asmStmt.inputFields)
17227 {
17228 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
17229 if(field->expression)
17230 ProcessExpressionType(field->expression);
17231 }
17232 if(stmt->asmStmt.outputFields)
17233 {
17234 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
17235 if(field->expression)
17236 ProcessExpressionType(field->expression);
17237 }
17238 if(stmt->asmStmt.clobberedFields)
17239 {
17240 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
17241 {
17242 if(field->expression)
17243 ProcessExpressionType(field->expression);
17244 }
17245 }
17246 break;
17247 }
17248 case 17:
17249 {
17250 struct PropertyWatch * propWatch;
17251 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17252 struct Expression * object = stmt->_watch.object;
17253 struct Expression * watcher = stmt->_watch.watcher;
17254
17255 if(watcher)
17256 ProcessExpressionType(watcher);
17257 if(object)
17258 ProcessExpressionType(object);
17259 if(inCompiler)
17260 {
17261 if(watcher || thisClass)
17262 {
17263 struct External * external = curExternal;
17264 struct Context * context = curContext;
17265
17266 stmt->type = 3;
17267 stmt->expressions = MkList();
17268 curExternal = external->prev;
17269 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
17270 {
17271 struct ClassFunction * func;
17272 char watcherName[1024];
17273 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
17274 struct External * createdExternal;
17275 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
17276
17277 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
17278 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
17279 if(propWatch->deleteWatch)
17280 strcat(watcherName, "_delete");
17281 else
17282 {
17283 struct Identifier * propID;
17284
17285 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
17286 {
17287 strcat(watcherName, "_");
17288 strcat(watcherName, propID->string);
17289 }
17290 }
17291 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
17292 {
17293 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
17294 ProcessClassFunctionBody(func, propWatch->compound);
17295 propWatch->compound = (((void *)0));
17296 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
17297 createdExternal->symbol->idCode = external->symbol->idCode;
17298 curExternal = createdExternal;
17299 ProcessFunction(createdExternal->function);
17300 {
17301 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
17302
17303 externalDecl->declaration = decl;
17304 if(decl->symbol && !decl->symbol->pointerExternal)
17305 decl->symbol->pointerExternal = externalDecl;
17306 }
17307 if(propWatch->deleteWatch)
17308 {
17309 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17310
17311 ListAdd(args, CopyExpression(object));
17312 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17313 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
17314 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
17315 }
17316 else
17317 {
17318 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
17319 struct Identifier * propID;
17320
17321 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
17322 {
17323 char propName[1024];
17324 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17325
17326 if(prop)
17327 {
17328 char getName[1024], setName[1024];
17329 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17330
17331 DeclareProperty(prop, setName, getName);
17332 strcpy(propName, "__ecereProp_");
17333 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17334 strcat(propName, "_");
17335 FullClassNameCat(propName, prop->name, 0x1);
17336 ListAdd(args, CopyExpression(object));
17337 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17338 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17339 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
17340 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
17341 }
17342 else
17343 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
17344 }
17345 }
17346 }
17347 else
17348 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid watched object\n", (((void *)0))));
17349 }
17350 curExternal = external;
17351 curContext = context;
17352 if(watcher)
17353 FreeExpression(watcher);
17354 if(object)
17355 FreeExpression(object);
17356 FreeList(watches, FreePropertyWatch);
17357 }
17358 else
17359 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a _class\n", (((void *)0))));
17360 }
17361 else
17362 {
17363 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
17364 {
17365 ProcessStatement(propWatch->compound);
17366 }
17367 }
17368 break;
17369 }
17370 case 15:
17371 {
17372 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17373 struct Expression * object = stmt->_watch.object;
17374 struct __ecereNameSpace__ecere__com__Class * _class;
17375
17376 if(object)
17377 ProcessExpressionType(object);
17378 if(inCompiler)
17379 {
17380 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
17381 if(_class)
17382 {
17383 struct Identifier * propID;
17384
17385 stmt->type = 3;
17386 stmt->expressions = MkList();
17387 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
17388 {
17389 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
17390 }
17391 else if(!watches)
17392 {
17393 }
17394 if(watches)
17395 {
17396 for(propID = (*watches).first; propID; propID = propID->next)
17397 {
17398 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17399
17400 if(prop)
17401 {
17402 CreateFireWatcher(prop, object, stmt);
17403 }
17404 else
17405 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
17406 }
17407 }
17408 else
17409 {
17410 struct __ecereNameSpace__ecere__com__Property * prop;
17411 struct __ecereNameSpace__ecere__com__Class * base;
17412
17413 for(base = _class; base; base = base->base)
17414 {
17415 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
17416 {
17417 if(prop->isProperty && prop->isWatchable)
17418 {
17419 CreateFireWatcher(prop, object, stmt);
17420 }
17421 }
17422 }
17423 }
17424 if(object)
17425 FreeExpression(object);
17426 FreeList(watches, FreeIdentifier);
17427 }
17428 else
17429 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
17430 }
17431 break;
17432 }
17433 case 16:
17434 {
17435 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17436 struct Expression * object = stmt->_watch.object;
17437 struct Expression * watcher = stmt->_watch.watcher;
17438 struct __ecereNameSpace__ecere__com__Class * _class;
17439
17440 if(object)
17441 ProcessExpressionType(object);
17442 if(watcher)
17443 ProcessExpressionType(watcher);
17444 if(inCompiler)
17445 {
17446 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
17447 if(watcher || thisClass)
17448 {
17449 if(_class)
17450 {
17451 struct Identifier * propID;
17452
17453 stmt->type = 3;
17454 stmt->expressions = MkList();
17455 if(!watches)
17456 {
17457 struct __ecereNameSpace__ecere__sys__OldList * args;
17458
17459 args = MkList();
17460 ListAdd(args, CopyExpression(object));
17461 ListAdd(args, MkExpConstant("0"));
17462 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17463 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
17464 }
17465 else
17466 {
17467 for(propID = (*watches).first; propID; propID = propID->next)
17468 {
17469 char propName[1024];
17470 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17471
17472 if(prop)
17473 {
17474 char getName[1024], setName[1024];
17475 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17476
17477 DeclareProperty(prop, setName, getName);
17478 strcpy(propName, "__ecereProp_");
17479 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17480 strcat(propName, "_");
17481 FullClassNameCat(propName, prop->name, 0x1);
17482 MangleClassName(propName);
17483 ListAdd(args, CopyExpression(object));
17484 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17485 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17486 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
17487 }
17488 else
17489 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
17490 }
17491 }
17492 if(object)
17493 FreeExpression(object);
17494 if(watcher)
17495 FreeExpression(watcher);
17496 FreeList(watches, FreeIdentifier);
17497 }
17498 else
17499 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
17500 }
17501 else
17502 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a class\n", (((void *)0))));
17503 }
17504 break;
17505 }
17506 }
17507 }
17508
17509 extern struct Expression * QBrackets(struct Expression * exp);
17510
17511 extern struct TypeName * QMkType(char *  spec, struct Declarator * decl);
17512
17513 extern struct Declarator * QMkPtrDecl(char *  id);
17514
17515 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
17516
17517 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
17518
17519 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
17520
17521 static void ProcessFunction(struct FunctionDefinition * function)
17522 {
17523 struct Identifier * id = GetDeclId(function->declarator);
17524 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
17525 struct Type * type = symbol ? symbol->type : (((void *)0));
17526 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
17527 struct Context * oldTopContext = topContext;
17528
17529 yylloc = function->loc;
17530 if(type && type->thisClass)
17531 {
17532 struct Symbol * classSym = type->thisClass;
17533 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
17534 char className[1024];
17535 char structName[1024];
17536 struct Declarator * funcDecl;
17537 struct Symbol * thisSymbol;
17538 unsigned int typedObject = 0x0;
17539
17540 if(_class && !_class->base)
17541 {
17542 _class = currentClass;
17543 if(_class && !_class->symbol)
17544 _class->symbol = FindClass(_class->fullName);
17545 classSym = _class ? _class->symbol : (((void *)0));
17546 typedObject = 0x1;
17547 }
17548 thisClass = _class;
17549 if(inCompiler && _class)
17550 {
17551 if(type->kind == 11)
17552 {
17553 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
17554 {
17555 struct Type * param = symbol->type->params.first;
17556
17557 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
17558 FreeType(param);
17559 }
17560 if(type->classObjectType != 1)
17561 {
17562 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
17563 symbol->type->staticMethod = 0x1;
17564 symbol->type->thisClass = (((void *)0));
17565 symbol->type->extraParam = 0x0;
17566 }
17567 }
17568 strcpy(className, "__ecereClass_");
17569 FullClassNameCat(className, _class->fullName, 0x1);
17570 MangleClassName(className);
17571 structName[0] = (char)0;
17572 FullClassNameCat(structName, _class->fullName, 0x0);
17573 funcDecl = GetFuncDecl(function->declarator);
17574 if(funcDecl)
17575 {
17576 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
17577 {
17578 struct TypeName * param = (*funcDecl->function.parameters).first;
17579
17580 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
17581 {
17582 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
17583 FreeTypeName(param);
17584 }
17585 }
17586 if(!function->propertyNoThis)
17587 {
17588 struct TypeName * thisParam;
17589
17590 if(type->classObjectType != 1)
17591 {
17592 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
17593 if(!funcDecl->function.parameters)
17594 funcDecl->function.parameters = MkList();
17595 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
17596 }
17597 if(typedObject)
17598 {
17599 if(type->classObjectType != 1)
17600 {
17601 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
17602 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
17603 }
17604 thisParam = __extension__ ({
17605 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
17606
17607 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
17608 });
17609 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
17610 }
17611 }
17612 }
17613 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
17614 {
17615 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
17616
17617 funcDecl = GetFuncDecl(initDecl->declarator);
17618 if(funcDecl)
17619 {
17620 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
17621 {
17622 struct TypeName * param = (*funcDecl->function.parameters).first;
17623
17624 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
17625 {
17626 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
17627 FreeTypeName(param);
17628 }
17629 }
17630 if(type->classObjectType != 1)
17631 {
17632 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
17633 {
17634 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
17635
17636 if(!funcDecl->function.parameters)
17637 funcDecl->function.parameters = MkList();
17638 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
17639 }
17640 }
17641 }
17642 }
17643 }
17644 if(function->body)
17645 {
17646 if(type->classObjectType != 1)
17647 {
17648 thisSymbol = __extension__ ({
17649 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
17650
17651 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
17652 });
17653 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17654 if(typedObject && thisSymbol->type)
17655 {
17656 thisSymbol->type->classObjectType = 2;
17657 thisSymbol->type->byReference = type->byReference;
17658 thisSymbol->type->typedByReference = type->byReference;
17659 }
17660 }
17661 }
17662 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
17663 {
17664 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
17665
17666 {
17667 struct __ecereNameSpace__ecere__com__Class * base;
17668
17669 for(base = _class; base && base->type != 1000; base = base->next)
17670 {
17671 for(member = base->membersAndProperties.first; member; member = member->next)
17672 if(!member->isProperty)
17673 break;
17674 if(member)
17675 break;
17676 }
17677 }
17678 for(member = _class->membersAndProperties.first; member; member = member->next)
17679 if(!member->isProperty)
17680 break;
17681 if(member)
17682 {
17683 char pointerName[1024];
17684 struct Declaration * decl;
17685 struct Initializer * initializer;
17686 struct Expression * exp, * bytePtr;
17687
17688 strcpy(pointerName, "__ecerePointer_");
17689 FullClassNameCat(pointerName, _class->fullName, 0x0);
17690 {
17691 char className[1024];
17692
17693 strcpy(className, "__ecereClass_");
17694 FullClassNameCat(className, classSym->string, 0x1);
17695 MangleClassName(className);
17696 DeclareClass(classSym, className);
17697 }
17698 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
17699 if(_class->fixed)
17700 {
17701 char string[256];
17702
17703 sprintf(string, "%d", _class->offset);
17704 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
17705 }
17706 else
17707 {
17708 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
17709 }
17710 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
17711 exp->expType = __extension__ ({
17712 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17713
17714 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
17715 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17716
17717 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
17718 }), __ecereInstance2;
17719 });
17720 if(function->body)
17721 {
17722 yylloc = function->body->loc;
17723 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
17724 {
17725 struct Context * prevContext = curContext;
17726
17727 curContext = function->body->compound.context;
17728 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
17729 curContext = prevContext;
17730 }
17731 decl->symbol = (((void *)0));
17732 if(!function->body->compound.declarations)
17733 function->body->compound.declarations = MkList();
17734 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
17735 }
17736 }
17737 }
17738 }
17739 else
17740 thisClass = (((void *)0));
17741 if(id)
17742 {
17743 FreeSpecifier(id->_class);
17744 id->_class = (((void *)0));
17745 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
17746 {
17747 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
17748
17749 id = GetDeclId(initDecl->declarator);
17750 FreeSpecifier(id->_class);
17751 id->_class = (((void *)0));
17752 }
17753 }
17754 if(function->body)
17755 topContext = function->body->compound.context;
17756 {
17757 struct FunctionDefinition * oldFunction = curFunction;
17758
17759 curFunction = function;
17760 if(function->body)
17761 ProcessStatement(function->body);
17762 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
17763 {
17764 struct Statement * prevCompound = curCompound;
17765 struct Context * prevContext = curContext;
17766 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
17767
17768 if(!function->body->compound.statements)
17769 function->body->compound.statements = MkList();
17770 ListAdd(function->body->compound.statements, fireWatchers);
17771 curCompound = function->body;
17772 curContext = function->body->compound.context;
17773 ProcessStatement(fireWatchers);
17774 curContext = prevContext;
17775 curCompound = prevCompound;
17776 }
17777 curFunction = oldFunction;
17778 }
17779 if(function->declarator)
17780 {
17781 ProcessDeclarator(function->declarator);
17782 }
17783 topContext = oldTopContext;
17784 thisClass = oldThisClass;
17785 }
17786
17787 extern void FreeSymbol(struct Symbol * symbol);
17788
17789 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
17790
17791 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
17792 {
17793 struct ClassDef * def;
17794 struct External * external = curExternal;
17795 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
17796
17797 for(def = definitions->first; def; def = def->next)
17798 {
17799 if(def->type == 0)
17800 {
17801 if(def->function->declarator)
17802 curExternal = def->function->declarator->symbol->pointerExternal;
17803 else
17804 curExternal = external;
17805 ProcessFunction((struct FunctionDefinition *)def->function);
17806 }
17807 else if(def->type == 2)
17808 {
17809 if(def->decl->type == 2)
17810 {
17811 thisClass = regClass;
17812 ProcessInstantiationType(def->decl->inst);
17813 thisClass = (((void *)0));
17814 }
17815 else
17816 {
17817 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
17818
17819 if(regClass)
17820 thisClass = regClass;
17821 ProcessDeclaration(def->decl);
17822 thisClass = backThisClass;
17823 }
17824 }
17825 else if(def->type == 1 && def->defProperties)
17826 {
17827 struct MemberInit * defProperty;
17828 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);
17829
17830 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17831 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
17832 {
17833 thisClass = regClass;
17834 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
17835 thisClass = (((void *)0));
17836 }
17837 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17838 FreeSymbol(thisSymbol);
17839 }
17840 else if(def->type == 3 && def->propertyDef)
17841 {
17842 struct PropertyDef * prop = def->propertyDef;
17843
17844 thisClass = regClass;
17845 if(prop->setStmt)
17846 {
17847 if(regClass)
17848 {
17849 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
17850
17851 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17852 }
17853 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
17854 ProcessStatement(prop->setStmt);
17855 }
17856 if(prop->getStmt)
17857 {
17858 if(regClass)
17859 {
17860 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
17861
17862 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17863 }
17864 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
17865 ProcessStatement(prop->getStmt);
17866 }
17867 if(prop->issetStmt)
17868 {
17869 if(regClass)
17870 {
17871 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
17872
17873 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17874 }
17875 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
17876 ProcessStatement(prop->issetStmt);
17877 }
17878 thisClass = (((void *)0));
17879 }
17880 else if(def->type == 4 && def->propertyWatch)
17881 {
17882 struct PropertyWatch * propertyWatch = def->propertyWatch;
17883
17884 thisClass = regClass;
17885 if(propertyWatch->compound)
17886 {
17887 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);
17888
17889 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17890 curExternal = (((void *)0));
17891 ProcessStatement(propertyWatch->compound);
17892 }
17893 thisClass = (((void *)0));
17894 }
17895 }
17896 }
17897
17898 void DeclareFunctionUtil(char * s)
17899 {
17900 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
17901
17902 if(function)
17903 {
17904 char name[1024];
17905
17906 name[0] = (char)0;
17907 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
17908 strcpy(name, "__ecereFunction_");
17909 FullClassNameCat(name, s, 0x0);
17910 DeclareFunction(function, name);
17911 }
17912 }
17913
17914 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
17915
17916 void ComputeDataTypes()
17917 {
17918 struct External * external;
17919 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
17920 struct External * after = (((void *)0));
17921
17922 currentClass = (((void *)0));
17923 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
17924 for(external = (*ast).first; external; external = external->next)
17925 {
17926 if(external->type == 1)
17927 {
17928 struct Declaration * decl = external->declaration;
17929
17930 if(decl)
17931 {
17932 struct __ecereNameSpace__ecere__sys__OldList * decls = decl->declarators;
17933
17934 if(decls)
17935 {
17936 struct InitDeclarator * initDecl = (*decls).first;
17937
17938 if(initDecl)
17939 {
17940 struct Declarator * declarator = initDecl->declarator;
17941
17942 if(declarator && declarator->type == 1)
17943 {
17944 struct Identifier * id = declarator->identifier;
17945
17946 if(id && id->string)
17947 {
17948 if(!strcmp(id->string, "uintptr_t") || !strcmp(id->string, "intptr_t") || !strcmp(id->string, "size_t") || !strcmp(id->string, "ssize_t"))
17949 {
17950 external->symbol->id = -1001, external->symbol->idCode = -1001;
17951 after = external;
17952 }
17953 }
17954 }
17955 }
17956 }
17957 }
17958 }
17959 }
17960 temp->symbol = __extension__ ({
17961 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
17962
17963 __ecereInstance1->id = -1000, __ecereInstance1->idCode = -1000, __ecereInstance1;
17964 });
17965 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
17966 curExternal = temp;
17967 DeclareFunctionUtil("eSystem_New");
17968 DeclareFunctionUtil("eSystem_New0");
17969 DeclareFunctionUtil("eSystem_Renew");
17970 DeclareFunctionUtil("eSystem_Renew0");
17971 DeclareFunctionUtil("eClass_GetProperty");
17972 DeclareStruct("ecere::com::Class", 0x0);
17973 DeclareStruct("ecere::com::Instance", 0x0);
17974 DeclareStruct("ecere::com::Property", 0x0);
17975 DeclareStruct("ecere::com::DataMember", 0x0);
17976 DeclareStruct("ecere::com::Method", 0x0);
17977 DeclareStruct("ecere::com::SerialBuffer", 0x0);
17978 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
17979 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
17980 for(external = (*ast).first; external; external = external->next)
17981 {
17982 afterExternal = curExternal = external;
17983 if(external->type == 0)
17984 {
17985 currentClass = external->function->_class;
17986 ProcessFunction(external->function);
17987 }
17988 else if(external->type == 1)
17989 {
17990 currentClass = (((void *)0));
17991 ProcessDeclaration(external->declaration);
17992 }
17993 else if(external->type == 2)
17994 {
17995 struct ClassDefinition * _class = external->_class;
17996
17997 currentClass = external->symbol->registered;
17998 if(_class->definitions)
17999 {
18000 ProcessClass(_class->definitions, _class->symbol);
18001 }
18002 if(inCompiler)
18003 {
18004 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
18005 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
18006 }
18007 }
18008 else if(external->type == 4)
18009 {
18010 thisNameSpace = external->id->string;
18011 }
18012 }
18013 currentClass = (((void *)0));
18014 thisNameSpace = (((void *)0));
18015 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
18016 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
18017 }
18018
18019 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_RegisterFunction(char *  name, char *  type, void *  func, struct __ecereNameSpace__ecere__com__Instance * module, int declMode);
18020
18021 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_RegisterClass(int type, char *  name, char *  baseName, int size, int sizeClass, unsigned int (*  Constructor)(void * ), void (*  Destructor)(void * ), struct __ecereNameSpace__ecere__com__Instance * module, int declMode, int inheritanceAccess);
18022
18023 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
18024 {
18025 struct __ecereNameSpace__ecere__com__Class * class;
18026
18027 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
18028 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
18029 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
18030 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
18031 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
18032 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
18033 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
18034 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
18035 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
18036 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
18037 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
18038 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
18039 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
18040 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
18041 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
18042 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
18043 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
18044 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
18045 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
18046 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
18047 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
18048 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
18049 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
18050 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
18051 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
18052 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
18053 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
18054 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
18055 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
18056 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
18057 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
18058 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
18059 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
18060 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
18061 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
18062 __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);
18063 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
18064 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
18065 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
18066 __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);
18067 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
18068 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
18069 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
18070 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
18071 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
18072 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
18073 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
18074 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
18075 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
18076 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
18077 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
18078 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
18079 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
18080 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
18081 __ecereClass_Conversion = class;
18082 __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)", MatchTypes, module, 1);
18083 __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);
18084 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
18085 __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);
18086 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
18087 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
18088 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
18089 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
18090 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
18091 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
18092 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
18093 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
18094 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
18095 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
18096 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
18097 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
18098 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
18099 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
18100 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
18101 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
18102 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(String s)", DeclareFunctionUtil, module, 1);
18103 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
18104 }
18105
18106 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
18107 {
18108
18109 }
18110