compiler/libec: Added support for symbolic identifier for GCC inline assembly
[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 struct Identifier * symbolic;
1033 } __attribute__ ((gcc_struct));
1034
1035 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attribute;
1036
1037 struct Attribute;
1038
1039 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
1040
1041 struct ClassFunction
1042 {
1043 struct ClassFunction * prev;
1044 struct ClassFunction * next;
1045 struct Location loc;
1046 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1047 struct Declarator * declarator;
1048 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
1049 struct Statement * body;
1050 struct __ecereNameSpace__ecere__com__Class * _class;
1051 struct __ecereNameSpace__ecere__sys__OldList attached;
1052 int declMode;
1053 struct Type * type;
1054 struct Symbol * propSet;
1055 unsigned int isVirtual;
1056 unsigned int isConstructor;
1057 unsigned int isDestructor;
1058 unsigned int dontMangle;
1059 int id;
1060 int idCode;
1061 } __attribute__ ((gcc_struct));
1062
1063 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
1064
1065 struct MembersInit
1066 {
1067 struct MembersInit * prev;
1068 struct MembersInit * next;
1069 struct Location loc;
1070 int type;
1071 union
1072 {
1073 struct __ecereNameSpace__ecere__sys__OldList *  dataMembers;
1074 struct ClassFunction * function;
1075 } __attribute__ ((gcc_struct));
1076 } __attribute__ ((gcc_struct));
1077
1078 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
1079
1080 struct MemberInit
1081 {
1082 struct MemberInit * prev;
1083 struct MemberInit * next;
1084 struct Location loc;
1085 struct Location realLoc;
1086 struct __ecereNameSpace__ecere__sys__OldList *  identifiers;
1087 struct Initializer * initializer;
1088 unsigned int used;
1089 unsigned int variable;
1090 unsigned int takeOutExp;
1091 } __attribute__ ((gcc_struct));
1092
1093 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1094
1095 struct PropertyDef
1096 {
1097 struct PropertyDef * prev;
1098 struct PropertyDef * next;
1099 struct Location loc;
1100 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1101 struct Declarator * declarator;
1102 struct Identifier * id;
1103 struct Statement * getStmt;
1104 struct Statement * setStmt;
1105 struct Statement * issetStmt;
1106 struct Symbol * symbol;
1107 unsigned int conversion;
1108 unsigned int isWatchable;
1109 struct Expression * category;
1110 } __attribute__ ((gcc_struct));
1111
1112 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1113
1114 struct PropertyWatch
1115 {
1116 struct PropertyWatch * prev;
1117 struct PropertyWatch * next;
1118 struct Location loc;
1119 struct Statement * compound;
1120 struct __ecereNameSpace__ecere__sys__OldList *  properties;
1121 unsigned int deleteWatch;
1122 } __attribute__ ((gcc_struct));
1123
1124 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1125
1126 struct ClassDef
1127 {
1128 struct ClassDef * prev;
1129 struct ClassDef * next;
1130 struct Location loc;
1131 int type;
1132 union
1133 {
1134 struct Declaration * decl;
1135 struct ClassFunction * function;
1136 struct __ecereNameSpace__ecere__sys__OldList *  defProperties;
1137 struct PropertyDef * propertyDef;
1138 struct PropertyWatch * propertyWatch;
1139 char *  designer;
1140 struct Identifier * defaultProperty;
1141 struct
1142 {
1143 struct Identifier * id;
1144 struct Initializer * initializer;
1145 } __attribute__ ((gcc_struct));
1146 } __attribute__ ((gcc_struct));
1147 int memberAccess;
1148 void *  object;
1149 } __attribute__ ((gcc_struct));
1150
1151 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1152
1153 struct DBTableEntry;
1154
1155 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1156
1157 struct DBIndexItem;
1158
1159 extern YYSTYPE yylval;
1160
1161 extern struct Location yylloc;
1162
1163 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1164
1165 extern int returnCode;
1166
1167 extern struct Expression * parsedExpression;
1168
1169 extern unsigned int yydebug;
1170
1171 void SetYydebug(unsigned int b)
1172 {
1173 yydebug = b;
1174 }
1175
1176 extern unsigned int echoOn;
1177
1178 void resetScanner();
1179
1180 int propWatcherID;
1181
1182 int expression_yyparse();
1183
1184 static struct Statement * curCompound;
1185
1186 struct External * curExternal, * afterExternal;
1187
1188 static struct Type * curSwitchType;
1189
1190 static struct __ecereNameSpace__ecere__com__Class * currentClass;
1191
1192 struct __ecereNameSpace__ecere__com__Class * thisClass;
1193
1194 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
1195 {
1196 thisClass = c;
1197 }
1198
1199 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
1200 {
1201 return thisClass;
1202 }
1203
1204 static char * thisNameSpace;
1205
1206 struct __ecereNameSpace__ecere__com__Class * containerClass;
1207
1208 unsigned int thisClassParams = 0x1;
1209
1210 unsigned int internalValueCounter;
1211
1212 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
1213
1214 extern size_t strlen(const char * );
1215
1216 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
1217
1218 extern void *  __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1219
1220 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
1221
1222 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
1223
1224 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
1225
1226 void PrintExpression(struct Expression * exp, char * string)
1227 {
1228 {
1229 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
1230 int count;
1231
1232 if(exp)
1233 OutputExpression(exp, f);
1234 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
1235 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
1236
1237 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
1238 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
1239 count = strlen(string);
1240 count += ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__extension__ ({
1241 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
1242
1243 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
1244 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Read])(f, string + count, 1, 1023);
1245 string[count] = '\0';
1246 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
1247 }
1248 }
1249
1250 extern struct Type * ProcessTypeString(char *  string, unsigned int staticMethod);
1251
1252 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1253
1254 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1255 {
1256 if(param && param->type == 0 && (param->dataType || param->dataTypeString))
1257 {
1258 if(!param->baseType)
1259 {
1260 if(param->dataTypeString)
1261 param->baseType = ProcessTypeString(param->dataTypeString, 0x0);
1262 else
1263 param->baseType = ProcessType(param->dataType->specifiers, param->dataType->decl);
1264 }
1265 return param->baseType;
1266 }
1267 return (((void *)0));
1268 }
1269
1270 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1271 {
1272 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1273 return 0x1;
1274 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0x0)
1275 {
1276 return 0x0;
1277 }
1278 if(type1->kind == type2->kind)
1279 {
1280 switch(type1->kind)
1281 {
1282 case 24:
1283 case 1:
1284 case 2:
1285 case 3:
1286 case 4:
1287 case 22:
1288 case 23:
1289 if(type1->passAsTemplate && !type2->passAsTemplate)
1290 return 0x1;
1291 return type1->isSigned != type2->isSigned;
1292 case 8:
1293 return type1->_class != type2->_class;
1294 case 13:
1295 return NeedCast(type1->type, type2->type);
1296 default:
1297 return 0x1;
1298 }
1299 }
1300 return 0x1;
1301 }
1302
1303 extern int strcmp(const char * , const char * );
1304
1305 extern struct Context * curContext;
1306
1307 extern struct Context * topContext;
1308
1309 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
1310
1311 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);
1312
1313 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1314
1315 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);
1316
1317 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);
1318
1319 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassProperty;
1320
1321 struct __ecereNameSpace__ecere__com__ClassProperty
1322 {
1323 char *  name;
1324 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1325 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1326 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1327 int depth;
1328 void (*  Set)(struct __ecereNameSpace__ecere__com__Class *, long long);
1329 long long (*  Get)(struct __ecereNameSpace__ecere__com__Class *);
1330 char *  dataTypeString;
1331 struct Type * dataType;
1332 unsigned int constant;
1333 } __attribute__ ((gcc_struct));
1334
1335 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, char *  name);
1336
1337 extern struct Expression * QMkExpId(char *  id);
1338
1339 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateParameter;
1340
1341 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
1342 {
1343 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
1344 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
1345 char *  name;
1346 int type;
1347 union
1348 {
1349 char *  dataTypeString;
1350 int memberType;
1351 } __attribute__ ((gcc_struct));
1352 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
1353 void *  param;
1354 } __attribute__ ((gcc_struct));
1355
1356 extern struct Expression * GetTemplateArgExpByName(char *  paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
1357
1358 extern struct __ecereNameSpace__ecere__sys__OldList *  MkList(void);
1359
1360 extern void FreeIdentifier(struct Identifier * id);
1361
1362 void ProcessExpressionType(struct Expression * exp);
1363
1364 extern struct Declarator * SpecDeclFromString(char *  string, struct __ecereNameSpace__ecere__sys__OldList *  specs, struct Declarator * baseDecl);
1365
1366 extern struct __ecereNameSpace__ecere__sys__OldList *  MkListOne(void *  item);
1367
1368 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1369
1370 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1371
1372 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1373
1374 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1375
1376 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1377
1378 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char *  key);
1379
1380 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
1381 {
1382 if(exp->type == 0 && exp->identifier)
1383 {
1384 struct Identifier * id = exp->identifier;
1385 struct Context * ctx;
1386 struct Symbol * symbol = (((void *)0));
1387
1388 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
1389 {
1390 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
1391 {
1392 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
1393 if(symbol)
1394 break;
1395 }
1396 }
1397 if(!symbol && ((!id->_class || (id->_class->name && !strcmp(id->_class->name, "property"))) || (id->classSym && __ecereNameSpace__ecere__com__eClass_IsDerived(_class, id->classSym->registered))))
1398 {
1399 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
1400 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
1401 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
1402 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
1403
1404 if(!prop)
1405 {
1406 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
1407 }
1408 if(!prop && !method)
1409 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
1410 if(!prop && !method && !member)
1411 {
1412 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
1413 }
1414 if(prop || method || member || classProp)
1415 {
1416 exp->type = 8;
1417 exp->member.member = id;
1418 exp->member.memberType = 0;
1419 exp->member.exp = QMkExpId("this");
1420 exp->addedThis = 0x1;
1421 }
1422 else if(_class && _class->templateParams.first)
1423 {
1424 struct __ecereNameSpace__ecere__com__Class * sClass;
1425
1426 for(sClass = _class; sClass; sClass = sClass->base)
1427 {
1428 if(sClass->templateParams.first)
1429 {
1430 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
1431
1432 for(param = sClass->templateParams.first; param; param = param->next)
1433 {
1434 if(param->type == 2 && !strcmp(param->name, id->string))
1435 {
1436 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
1437
1438 if(argExp)
1439 {
1440 struct Declarator * decl;
1441 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1442
1443 FreeIdentifier(exp->member.member);
1444 ProcessExpressionType(argExp);
1445 decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
1446 exp->expType = ProcessType(specs, decl);
1447 exp->type = 5;
1448 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
1449 }
1450 }
1451 }
1452 }
1453 }
1454 }
1455 }
1456 }
1457 }
1458
1459 extern int sprintf(char * , char * , ...);
1460
1461 extern int __ecereNameSpace__ecere__com__GetRuntimePlatform(void);
1462
1463 extern char *  __ecereNameSpace__ecere__sys__CopyString(char *  string);
1464
1465 char * PrintInt(long long result)
1466 {
1467 char temp[100];
1468
1469 if(result > (((long long)0x7fffffffffffffffLL)))
1470 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1471 else
1472 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1473 return __ecereNameSpace__ecere__sys__CopyString(temp);
1474 }
1475
1476 char * PrintUInt(uint64 result)
1477 {
1478 char temp[100];
1479
1480 if(result > (0xffffffff))
1481 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1482 else if(result > (((int)0x7fffffff)))
1483 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1484 else
1485 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1486 return __ecereNameSpace__ecere__sys__CopyString(temp);
1487 }
1488
1489 char * PrintInt64(long long result)
1490 {
1491 char temp[100];
1492
1493 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1494 return __ecereNameSpace__ecere__sys__CopyString(temp);
1495 }
1496
1497 char * PrintUInt64(uint64 result)
1498 {
1499 char temp[100];
1500
1501 if(result > (((long long)0x7fffffffffffffffLL)))
1502 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1503 else
1504 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1505 return __ecereNameSpace__ecere__sys__CopyString(temp);
1506 }
1507
1508 char * PrintHexUInt(uint64 result)
1509 {
1510 char temp[100];
1511
1512 if(result > (0xffffffff))
1513 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1514 else
1515 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1516 return __ecereNameSpace__ecere__sys__CopyString(temp);
1517 }
1518
1519 char * PrintHexUInt64(uint64 result)
1520 {
1521 char temp[100];
1522
1523 if(result > (0xffffffff))
1524 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1525 else
1526 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1527 return __ecereNameSpace__ecere__sys__CopyString(temp);
1528 }
1529
1530 char * PrintShort(short result)
1531 {
1532 char temp[100];
1533
1534 sprintf(temp, "%d", (unsigned short)result);
1535 return __ecereNameSpace__ecere__sys__CopyString(temp);
1536 }
1537
1538 char * PrintUShort(unsigned short result)
1539 {
1540 char temp[100];
1541
1542 if(result > (unsigned short)32767)
1543 sprintf(temp, "0x%X", (int)result);
1544 else
1545 sprintf(temp, "%d", (int)result);
1546 return __ecereNameSpace__ecere__sys__CopyString(temp);
1547 }
1548
1549 extern int isprint(int c);
1550
1551 char * PrintChar(char result)
1552 {
1553 char temp[100];
1554
1555 if(result > (char)0 && isprint(result))
1556 sprintf(temp, "'%c'", result);
1557 else if(result < (char)0)
1558 sprintf(temp, "%d", (int)result);
1559 else
1560 sprintf(temp, "0x%X", (unsigned char)result);
1561 return __ecereNameSpace__ecere__sys__CopyString(temp);
1562 }
1563
1564 char * PrintUChar(unsigned char result)
1565 {
1566 char temp[100];
1567
1568 sprintf(temp, "0x%X", result);
1569 return __ecereNameSpace__ecere__sys__CopyString(temp);
1570 }
1571
1572 char * PrintFloat(float result)
1573 {
1574 char temp[350];
1575
1576 sprintf(temp, "%.16ff", result);
1577 return __ecereNameSpace__ecere__sys__CopyString(temp);
1578 }
1579
1580 char * PrintDouble(double result)
1581 {
1582 char temp[350];
1583
1584 sprintf(temp, "%.16f", result);
1585 return __ecereNameSpace__ecere__sys__CopyString(temp);
1586 }
1587
1588 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1589
1590 struct OpTable
1591 {
1592 unsigned int (*  Add)(struct Expression *, struct Operand *, struct Operand *);
1593 unsigned int (*  Sub)(struct Expression *, struct Operand *, struct Operand *);
1594 unsigned int (*  Mul)(struct Expression *, struct Operand *, struct Operand *);
1595 unsigned int (*  Div)(struct Expression *, struct Operand *, struct Operand *);
1596 unsigned int (*  Mod)(struct Expression *, struct Operand *, struct Operand *);
1597 unsigned int (*  Neg)(struct Expression *, struct Operand *);
1598 unsigned int (*  Inc)(struct Expression *, struct Operand *);
1599 unsigned int (*  Dec)(struct Expression *, struct Operand *);
1600 unsigned int (*  Asign)(struct Expression *, struct Operand *, struct Operand *);
1601 unsigned int (*  AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1602 unsigned int (*  SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1603 unsigned int (*  MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1604 unsigned int (*  DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1605 unsigned int (*  ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1606 unsigned int (*  BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1607 unsigned int (*  BitOr)(struct Expression *, struct Operand *, struct Operand *);
1608 unsigned int (*  BitXor)(struct Expression *, struct Operand *, struct Operand *);
1609 unsigned int (*  LShift)(struct Expression *, struct Operand *, struct Operand *);
1610 unsigned int (*  RShift)(struct Expression *, struct Operand *, struct Operand *);
1611 unsigned int (*  BitNot)(struct Expression *, struct Operand *);
1612 unsigned int (*  AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1613 unsigned int (*  OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1614 unsigned int (*  XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1615 unsigned int (*  LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1616 unsigned int (*  RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1617 unsigned int (*  Not)(struct Expression *, struct Operand *);
1618 unsigned int (*  Equ)(struct Expression *, struct Operand *, struct Operand *);
1619 unsigned int (*  Nqu)(struct Expression *, struct Operand *, struct Operand *);
1620 unsigned int (*  And)(struct Expression *, struct Operand *, struct Operand *);
1621 unsigned int (*  Or)(struct Expression *, struct Operand *, struct Operand *);
1622 unsigned int (*  Grt)(struct Expression *, struct Operand *, struct Operand *);
1623 unsigned int (*  Sma)(struct Expression *, struct Operand *, struct Operand *);
1624 unsigned int (*  GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1625 unsigned int (*  SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1626 unsigned int (*  Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1627 } __attribute__ ((gcc_struct));
1628
1629 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1630
1631 struct Operand
1632 {
1633 int kind;
1634 struct Type * type;
1635 unsigned int ptrSize;
1636 union
1637 {
1638 char c;
1639 unsigned char uc;
1640 short s;
1641 unsigned short us;
1642 int i;
1643 unsigned int ui;
1644 float f;
1645 double d;
1646 long long i64;
1647 uint64 ui64;
1648 } __attribute__ ((gcc_struct));
1649 struct OpTable ops;
1650 } __attribute__ ((gcc_struct));
1651
1652 struct Operand GetOperand(struct Expression * exp);
1653
1654 unsigned int GetInt(struct Expression * exp, int * value2)
1655 {
1656 struct Operand op2 = GetOperand(exp);
1657
1658 if(op2.kind == 3 && op2.type->isSigned)
1659 *value2 = op2.i;
1660 else if(op2.kind == 3)
1661 *value2 = (int)op2.ui;
1662 else if(op2.kind == 4 && op2.type->isSigned)
1663 *value2 = (int)op2.i64;
1664 else if(op2.kind == 4)
1665 *value2 = (int)op2.ui64;
1666 else if(op2.kind == 23 && op2.type->isSigned)
1667 *value2 = (int)op2.i64;
1668 else if(op2.kind == 23)
1669 *value2 = (int)op2.ui64;
1670 else if(op2.kind == 22 && op2.type->isSigned)
1671 *value2 = (int)op2.i64;
1672 else if(op2.kind == 22)
1673 *value2 = (int)op2.ui64;
1674 else if(op2.kind == 2 && op2.type->isSigned)
1675 *value2 = (int)op2.s;
1676 else if(op2.kind == 2)
1677 *value2 = (int)op2.us;
1678 else if(op2.kind == 1 && op2.type->isSigned)
1679 *value2 = (int)op2.c;
1680 else if(op2.kind == 24 || op2.kind == 1)
1681 *value2 = (int)op2.uc;
1682 else if(op2.kind == 6)
1683 *value2 = (int)op2.f;
1684 else if(op2.kind == 7)
1685 *value2 = (int)op2.d;
1686 else if(op2.kind == 13)
1687 *value2 = (int)op2.ui64;
1688 else
1689 return 0x0;
1690 return 0x1;
1691 }
1692
1693 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1694 {
1695 struct Operand op2 = GetOperand(exp);
1696
1697 if(op2.kind == 3 && op2.type->isSigned)
1698 *value2 = (unsigned int)op2.i;
1699 else if(op2.kind == 3)
1700 *value2 = op2.ui;
1701 else if(op2.kind == 4 && op2.type->isSigned)
1702 *value2 = (unsigned int)op2.i64;
1703 else if(op2.kind == 4)
1704 *value2 = (unsigned int)op2.ui64;
1705 else if(op2.kind == 23 && op2.type->isSigned)
1706 *value2 = (unsigned int)op2.i64;
1707 else if(op2.kind == 23)
1708 *value2 = (unsigned int)op2.ui64;
1709 else if(op2.kind == 22 && op2.type->isSigned)
1710 *value2 = (unsigned int)op2.i64;
1711 else if(op2.kind == 22)
1712 *value2 = (unsigned int)op2.ui64;
1713 else if(op2.kind == 2 && op2.type->isSigned)
1714 *value2 = (unsigned int)op2.s;
1715 else if(op2.kind == 2)
1716 *value2 = (unsigned int)op2.us;
1717 else if(op2.kind == 1 && op2.type->isSigned)
1718 *value2 = (unsigned int)op2.c;
1719 else if(op2.kind == 24 || op2.kind == 1)
1720 *value2 = (unsigned int)op2.uc;
1721 else if(op2.kind == 6)
1722 *value2 = (unsigned int)op2.f;
1723 else if(op2.kind == 7)
1724 *value2 = (unsigned int)op2.d;
1725 else if(op2.kind == 13)
1726 *value2 = (unsigned int)op2.ui64;
1727 else
1728 return 0x0;
1729 return 0x1;
1730 }
1731
1732 unsigned int GetInt64(struct Expression * exp, long long * value2)
1733 {
1734 struct Operand op2 = GetOperand(exp);
1735
1736 if(op2.kind == 3 && op2.type->isSigned)
1737 *value2 = (long long)op2.i;
1738 else if(op2.kind == 3)
1739 *value2 = (long long)op2.ui;
1740 else if(op2.kind == 4 && op2.type->isSigned)
1741 *value2 = op2.i64;
1742 else if(op2.kind == 4)
1743 *value2 = (long long)op2.ui64;
1744 else if(op2.kind == 23 && op2.type->isSigned)
1745 *value2 = op2.i64;
1746 else if(op2.kind == 23)
1747 *value2 = (long long)op2.ui64;
1748 else if(op2.kind == 22 && op2.type->isSigned)
1749 *value2 = op2.i64;
1750 else if(op2.kind == 22)
1751 *value2 = (long long)op2.ui64;
1752 else if(op2.kind == 2 && op2.type->isSigned)
1753 *value2 = (long long)op2.s;
1754 else if(op2.kind == 2)
1755 *value2 = (long long)op2.us;
1756 else if(op2.kind == 1 && op2.type->isSigned)
1757 *value2 = (long long)op2.c;
1758 else if(op2.kind == 24 || op2.kind == 1)
1759 *value2 = (long long)op2.uc;
1760 else if(op2.kind == 6)
1761 *value2 = (long long)op2.f;
1762 else if(op2.kind == 7)
1763 *value2 = (long long)op2.d;
1764 else if(op2.kind == 13)
1765 *value2 = (long long)op2.ui64;
1766 else
1767 return 0x0;
1768 return 0x1;
1769 }
1770
1771 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1772 {
1773 struct Operand op2 = GetOperand(exp);
1774
1775 if(op2.kind == 3 && op2.type->isSigned)
1776 *value2 = (uint64)op2.i;
1777 else if(op2.kind == 3)
1778 *value2 = (uint64)op2.ui;
1779 else if(op2.kind == 4 && op2.type->isSigned)
1780 *value2 = (uint64)op2.i64;
1781 else if(op2.kind == 4)
1782 *value2 = op2.ui64;
1783 else if(op2.kind == 23 && op2.type->isSigned)
1784 *value2 = (uint64)op2.i64;
1785 else if(op2.kind == 23)
1786 *value2 = op2.ui64;
1787 else if(op2.kind == 22 && op2.type->isSigned)
1788 *value2 = (uint64)op2.i64;
1789 else if(op2.kind == 22)
1790 *value2 = op2.ui64;
1791 else if(op2.kind == 2 && op2.type->isSigned)
1792 *value2 = (uint64)op2.s;
1793 else if(op2.kind == 2)
1794 *value2 = (uint64)op2.us;
1795 else if(op2.kind == 1 && op2.type->isSigned)
1796 *value2 = (uint64)op2.c;
1797 else if(op2.kind == 24 || op2.kind == 1)
1798 *value2 = (uint64)op2.uc;
1799 else if(op2.kind == 6)
1800 *value2 = (uint64)op2.f;
1801 else if(op2.kind == 7)
1802 *value2 = (uint64)op2.d;
1803 else if(op2.kind == 13)
1804 *value2 = op2.ui64;
1805 else
1806 return 0x0;
1807 return 0x1;
1808 }
1809
1810 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
1811 {
1812 struct Operand op2 = GetOperand(exp);
1813
1814 if(op2.kind == 3 && op2.type->isSigned)
1815 *value2 = (intptr_t)op2.i;
1816 else if(op2.kind == 3)
1817 *value2 = (intptr_t)op2.ui;
1818 else if(op2.kind == 4 && op2.type->isSigned)
1819 *value2 = (intptr_t)op2.i64;
1820 else if(op2.kind == 4)
1821 *value2 = (intptr_t)op2.ui64;
1822 else if(op2.kind == 23 && op2.type->isSigned)
1823 *value2 = (intptr_t)op2.i64;
1824 else if(op2.kind == 23)
1825 *value2 = (intptr_t)op2.ui64;
1826 else if(op2.kind == 22 && op2.type->isSigned)
1827 *value2 = (intptr_t)op2.i64;
1828 else if(op2.kind == 22)
1829 *value2 = (intptr_t)op2.ui64;
1830 else if(op2.kind == 2 && op2.type->isSigned)
1831 *value2 = (intptr_t)op2.s;
1832 else if(op2.kind == 2)
1833 *value2 = (intptr_t)op2.us;
1834 else if(op2.kind == 1 && op2.type->isSigned)
1835 *value2 = (intptr_t)op2.c;
1836 else if(op2.kind == 24 || op2.kind == 1)
1837 *value2 = (intptr_t)op2.uc;
1838 else if(op2.kind == 6)
1839 *value2 = (intptr_t)op2.f;
1840 else if(op2.kind == 7)
1841 *value2 = (intptr_t)op2.d;
1842 else if(op2.kind == 13)
1843 *value2 = (intptr_t)op2.ui64;
1844 else
1845 return 0x0;
1846 return 0x1;
1847 }
1848
1849 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
1850 {
1851 struct Operand op2 = GetOperand(exp);
1852
1853 if(op2.kind == 3 && op2.type->isSigned)
1854 *value2 = (uintptr_t)op2.i;
1855 else if(op2.kind == 3)
1856 *value2 = (uintptr_t)op2.ui;
1857 else if(op2.kind == 4 && op2.type->isSigned)
1858 *value2 = (uintptr_t)op2.i64;
1859 else if(op2.kind == 4)
1860 *value2 = (uintptr_t)op2.ui64;
1861 else if(op2.kind == 23 && op2.type->isSigned)
1862 *value2 = (uintptr_t)op2.i64;
1863 else if(op2.kind == 23)
1864 *value2 = (uintptr_t)op2.ui64;
1865 else if(op2.kind == 22 && op2.type->isSigned)
1866 *value2 = (uintptr_t)op2.i64;
1867 else if(op2.kind == 22)
1868 *value2 = (uintptr_t)op2.ui64;
1869 else if(op2.kind == 2 && op2.type->isSigned)
1870 *value2 = (uintptr_t)op2.s;
1871 else if(op2.kind == 2)
1872 *value2 = (uintptr_t)op2.us;
1873 else if(op2.kind == 1 && op2.type->isSigned)
1874 *value2 = (uintptr_t)op2.c;
1875 else if(op2.kind == 24 || op2.kind == 1)
1876 *value2 = (uintptr_t)op2.uc;
1877 else if(op2.kind == 6)
1878 *value2 = (uintptr_t)op2.f;
1879 else if(op2.kind == 7)
1880 *value2 = (uintptr_t)op2.d;
1881 else if(op2.kind == 13)
1882 *value2 = (uintptr_t)op2.ui64;
1883 else
1884 return 0x0;
1885 return 0x1;
1886 }
1887
1888 unsigned int GetIntSize(struct Expression * exp, ssize_t * value2)
1889 {
1890 struct Operand op2 = GetOperand(exp);
1891
1892 if(op2.kind == 3 && op2.type->isSigned)
1893 *value2 = (ssize_t)op2.i;
1894 else if(op2.kind == 3)
1895 *value2 = (ssize_t)op2.ui;
1896 else if(op2.kind == 4 && op2.type->isSigned)
1897 *value2 = (ssize_t)op2.i64;
1898 else if(op2.kind == 4)
1899 *value2 = (ssize_t)op2.ui64;
1900 else if(op2.kind == 23 && op2.type->isSigned)
1901 *value2 = (ssize_t)op2.i64;
1902 else if(op2.kind == 23)
1903 *value2 = (ssize_t)op2.ui64;
1904 else if(op2.kind == 22 && op2.type->isSigned)
1905 *value2 = (ssize_t)op2.i64;
1906 else if(op2.kind == 22)
1907 *value2 = (ssize_t)op2.ui64;
1908 else if(op2.kind == 2 && op2.type->isSigned)
1909 *value2 = (ssize_t)op2.s;
1910 else if(op2.kind == 2)
1911 *value2 = (ssize_t)op2.us;
1912 else if(op2.kind == 1 && op2.type->isSigned)
1913 *value2 = (ssize_t)op2.c;
1914 else if(op2.kind == 24 || op2.kind == 1)
1915 *value2 = (ssize_t)op2.uc;
1916 else if(op2.kind == 6)
1917 *value2 = (ssize_t)op2.f;
1918 else if(op2.kind == 7)
1919 *value2 = (ssize_t)op2.d;
1920 else if(op2.kind == 13)
1921 *value2 = (ssize_t)op2.ui64;
1922 else
1923 return 0x0;
1924 return 0x1;
1925 }
1926
1927 unsigned int GetUIntSize(struct Expression * exp, size_t * value2)
1928 {
1929 struct Operand op2 = GetOperand(exp);
1930
1931 if(op2.kind == 3 && op2.type->isSigned)
1932 *value2 = (size_t)op2.i;
1933 else if(op2.kind == 3)
1934 *value2 = (size_t)op2.ui;
1935 else if(op2.kind == 4 && op2.type->isSigned)
1936 *value2 = (size_t)op2.i64;
1937 else if(op2.kind == 4)
1938 *value2 = (size_t)op2.ui64;
1939 else if(op2.kind == 23 && op2.type->isSigned)
1940 *value2 = (size_t)op2.i64;
1941 else if(op2.kind == 23)
1942 *value2 = (size_t)op2.ui64;
1943 else if(op2.kind == 22 && op2.type->isSigned)
1944 *value2 = (size_t)op2.i64;
1945 else if(op2.kind == 22)
1946 *value2 = (size_t)op2.ui64;
1947 else if(op2.kind == 2 && op2.type->isSigned)
1948 *value2 = (size_t)op2.s;
1949 else if(op2.kind == 2)
1950 *value2 = (size_t)op2.us;
1951 else if(op2.kind == 1 && op2.type->isSigned)
1952 *value2 = (size_t)op2.c;
1953 else if(op2.kind == 24 || op2.kind == 1)
1954 *value2 = (size_t)op2.uc;
1955 else if(op2.kind == 6)
1956 *value2 = (size_t)op2.f;
1957 else if(op2.kind == 7)
1958 *value2 = (size_t)op2.d;
1959 else if(op2.kind == 13)
1960 *value2 = (size_t)op2.ui64;
1961 else
1962 return 0x0;
1963 return 0x1;
1964 }
1965
1966 unsigned int GetShort(struct Expression * exp, short * value2)
1967 {
1968 struct Operand op2 = GetOperand(exp);
1969
1970 if(op2.kind == 3 && op2.type->isSigned)
1971 *value2 = (short)op2.i;
1972 else if(op2.kind == 3)
1973 *value2 = (short)op2.ui;
1974 else if(op2.kind == 4 && op2.type->isSigned)
1975 *value2 = (short)op2.i64;
1976 else if(op2.kind == 4)
1977 *value2 = (short)op2.ui64;
1978 else if(op2.kind == 23 && op2.type->isSigned)
1979 *value2 = (short)op2.i64;
1980 else if(op2.kind == 23)
1981 *value2 = (short)op2.ui64;
1982 else if(op2.kind == 22 && op2.type->isSigned)
1983 *value2 = (short)op2.i64;
1984 else if(op2.kind == 22)
1985 *value2 = (short)op2.ui64;
1986 else if(op2.kind == 2 && op2.type->isSigned)
1987 *value2 = op2.s;
1988 else if(op2.kind == 2)
1989 *value2 = (short)op2.us;
1990 else if(op2.kind == 1 && op2.type->isSigned)
1991 *value2 = (short)op2.c;
1992 else if(op2.kind == 24 || op2.kind == 1)
1993 *value2 = (short)op2.uc;
1994 else if(op2.kind == 6)
1995 *value2 = (short)op2.f;
1996 else if(op2.kind == 7)
1997 *value2 = (short)op2.d;
1998 else if(op2.kind == 13)
1999 *value2 = (short)op2.ui64;
2000 else
2001 return 0x0;
2002 return 0x1;
2003 }
2004
2005 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
2006 {
2007 struct Operand op2 = GetOperand(exp);
2008
2009 if(op2.kind == 3 && op2.type->isSigned)
2010 *value2 = (unsigned short)op2.i;
2011 else if(op2.kind == 3)
2012 *value2 = (unsigned short)op2.ui;
2013 else if(op2.kind == 4 && op2.type->isSigned)
2014 *value2 = (unsigned short)op2.i64;
2015 else if(op2.kind == 4)
2016 *value2 = (unsigned short)op2.ui64;
2017 else if(op2.kind == 23 && op2.type->isSigned)
2018 *value2 = (unsigned short)op2.i64;
2019 else if(op2.kind == 23)
2020 *value2 = (unsigned short)op2.ui64;
2021 else if(op2.kind == 22 && op2.type->isSigned)
2022 *value2 = (unsigned short)op2.i64;
2023 else if(op2.kind == 22)
2024 *value2 = (unsigned short)op2.ui64;
2025 else if(op2.kind == 2 && op2.type->isSigned)
2026 *value2 = (unsigned short)op2.s;
2027 else if(op2.kind == 2)
2028 *value2 = op2.us;
2029 else if(op2.kind == 1 && op2.type->isSigned)
2030 *value2 = (unsigned short)op2.c;
2031 else if(op2.kind == 24 || op2.kind == 1)
2032 *value2 = (unsigned short)op2.uc;
2033 else if(op2.kind == 6)
2034 *value2 = (unsigned short)op2.f;
2035 else if(op2.kind == 7)
2036 *value2 = (unsigned short)op2.d;
2037 else if(op2.kind == 13)
2038 *value2 = (unsigned short)op2.ui64;
2039 else
2040 return 0x0;
2041 return 0x1;
2042 }
2043
2044 unsigned int GetChar(struct Expression * exp, char * value2)
2045 {
2046 struct Operand op2 = GetOperand(exp);
2047
2048 if(op2.kind == 3 && op2.type->isSigned)
2049 *value2 = (char)op2.i;
2050 else if(op2.kind == 3)
2051 *value2 = (char)op2.ui;
2052 else if(op2.kind == 4 && op2.type->isSigned)
2053 *value2 = (char)op2.i64;
2054 else if(op2.kind == 4)
2055 *value2 = (char)op2.ui64;
2056 else if(op2.kind == 23 && op2.type->isSigned)
2057 *value2 = (char)op2.i64;
2058 else if(op2.kind == 23)
2059 *value2 = (char)op2.ui64;
2060 else if(op2.kind == 22 && op2.type->isSigned)
2061 *value2 = (char)op2.i64;
2062 else if(op2.kind == 22)
2063 *value2 = (char)op2.ui64;
2064 else if(op2.kind == 2 && op2.type->isSigned)
2065 *value2 = (char)op2.s;
2066 else if(op2.kind == 2)
2067 *value2 = (char)op2.us;
2068 else if(op2.kind == 1 && op2.type->isSigned)
2069 *value2 = op2.c;
2070 else if(op2.kind == 24 || op2.kind == 1)
2071 *value2 = (char)op2.uc;
2072 else if(op2.kind == 6)
2073 *value2 = (char)op2.f;
2074 else if(op2.kind == 7)
2075 *value2 = (char)op2.d;
2076 else if(op2.kind == 13)
2077 *value2 = (char)op2.ui64;
2078 else
2079 return 0x0;
2080 return 0x1;
2081 }
2082
2083 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
2084 {
2085 struct Operand op2 = GetOperand(exp);
2086
2087 if(op2.kind == 3 && op2.type->isSigned)
2088 *value2 = (unsigned char)op2.i;
2089 else if(op2.kind == 3)
2090 *value2 = (unsigned char)op2.ui;
2091 else if(op2.kind == 4 && op2.type->isSigned)
2092 *value2 = (unsigned char)op2.i64;
2093 else if(op2.kind == 4)
2094 *value2 = (unsigned char)op2.ui64;
2095 else if(op2.kind == 23 && op2.type->isSigned)
2096 *value2 = (unsigned char)op2.i64;
2097 else if(op2.kind == 23)
2098 *value2 = (unsigned char)op2.ui64;
2099 else if(op2.kind == 22 && op2.type->isSigned)
2100 *value2 = (unsigned char)op2.i64;
2101 else if(op2.kind == 22)
2102 *value2 = (unsigned char)op2.ui64;
2103 else if(op2.kind == 2 && op2.type->isSigned)
2104 *value2 = (unsigned char)op2.s;
2105 else if(op2.kind == 2)
2106 *value2 = (unsigned char)op2.us;
2107 else if(op2.kind == 1 && op2.type->isSigned)
2108 *value2 = (unsigned char)op2.c;
2109 else if(op2.kind == 24 || op2.kind == 1)
2110 *value2 = op2.uc;
2111 else if(op2.kind == 6)
2112 *value2 = (unsigned char)op2.f;
2113 else if(op2.kind == 7)
2114 *value2 = (unsigned char)op2.d;
2115 else if(op2.kind == 13)
2116 *value2 = (unsigned char)op2.ui64;
2117 else
2118 return 0x0;
2119 return 0x1;
2120 }
2121
2122 unsigned int GetFloat(struct Expression * exp, float * value2)
2123 {
2124 struct Operand op2 = GetOperand(exp);
2125
2126 if(op2.kind == 3 && op2.type->isSigned)
2127 *value2 = (float)(float)op2.i;
2128 else if(op2.kind == 3)
2129 *value2 = (float)(float)op2.ui;
2130 else if(op2.kind == 4 && op2.type->isSigned)
2131 *value2 = (float)(float)op2.i64;
2132 else if(op2.kind == 4)
2133 *value2 = (float)(float)op2.ui64;
2134 else if(op2.kind == 23 && op2.type->isSigned)
2135 *value2 = (float)(float)op2.i64;
2136 else if(op2.kind == 23)
2137 *value2 = (float)(float)op2.ui64;
2138 else if(op2.kind == 22 && op2.type->isSigned)
2139 *value2 = (float)(float)op2.i64;
2140 else if(op2.kind == 22)
2141 *value2 = (float)(float)op2.ui64;
2142 else if(op2.kind == 2 && op2.type->isSigned)
2143 *value2 = (float)(float)op2.s;
2144 else if(op2.kind == 2)
2145 *value2 = (float)(float)op2.us;
2146 else if(op2.kind == 1 && op2.type->isSigned)
2147 *value2 = (float)(float)op2.c;
2148 else if(op2.kind == 24 || op2.kind == 1)
2149 *value2 = (float)(float)op2.uc;
2150 else if(op2.kind == 6)
2151 *value2 = (float)op2.f;
2152 else if(op2.kind == 7)
2153 *value2 = (float)op2.d;
2154 else if(op2.kind == 13)
2155 *value2 = (float)(float)op2.ui64;
2156 else
2157 return 0x0;
2158 return 0x1;
2159 }
2160
2161 unsigned int GetDouble(struct Expression * exp, double * value2)
2162 {
2163 struct Operand op2 = GetOperand(exp);
2164
2165 if(op2.kind == 3 && op2.type->isSigned)
2166 *value2 = (double)(double)op2.i;
2167 else if(op2.kind == 3)
2168 *value2 = (double)(double)op2.ui;
2169 else if(op2.kind == 4 && op2.type->isSigned)
2170 *value2 = (double)(double)op2.i64;
2171 else if(op2.kind == 4)
2172 *value2 = (double)(double)op2.ui64;
2173 else if(op2.kind == 23 && op2.type->isSigned)
2174 *value2 = (double)(double)op2.i64;
2175 else if(op2.kind == 23)
2176 *value2 = (double)(double)op2.ui64;
2177 else if(op2.kind == 22 && op2.type->isSigned)
2178 *value2 = (double)(double)op2.i64;
2179 else if(op2.kind == 22)
2180 *value2 = (double)(double)op2.ui64;
2181 else if(op2.kind == 2 && op2.type->isSigned)
2182 *value2 = (double)(double)op2.s;
2183 else if(op2.kind == 2)
2184 *value2 = (double)(double)op2.us;
2185 else if(op2.kind == 1 && op2.type->isSigned)
2186 *value2 = (double)(double)op2.c;
2187 else if(op2.kind == 24 || op2.kind == 1)
2188 *value2 = (double)(double)op2.uc;
2189 else if(op2.kind == 6)
2190 *value2 = (double)op2.f;
2191 else if(op2.kind == 7)
2192 *value2 = (double)op2.d;
2193 else if(op2.kind == 13)
2194 *value2 = (double)(double)op2.ui64;
2195 else
2196 return 0x0;
2197 return 0x1;
2198 }
2199
2200 void ComputeExpression(struct Expression * exp);
2201
2202 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2203
2204 extern int targetBits;
2205
2206 int ComputeTypeSize(struct Type * type);
2207
2208 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2209
2210 struct __ecereNameSpace__ecere__com__BitMember
2211 {
2212 struct __ecereNameSpace__ecere__com__BitMember * prev;
2213 struct __ecereNameSpace__ecere__com__BitMember * next;
2214 char *  name;
2215 unsigned int isProperty;
2216 int memberAccess;
2217 int id;
2218 struct __ecereNameSpace__ecere__com__Class * _class;
2219 char *  dataTypeString;
2220 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2221 struct Type * dataType;
2222 int type;
2223 int size;
2224 int pos;
2225 uint64 mask;
2226 } __attribute__ ((gcc_struct));
2227
2228 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2229
2230 struct __ecereNameSpace__ecere__sys__OldLink
2231 {
2232 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2233 struct __ecereNameSpace__ecere__sys__OldLink * next;
2234 void *  data;
2235 } __attribute__ ((gcc_struct));
2236
2237 void FinishTemplatesContext(struct Context * context);
2238
2239 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2240 {
2241 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2242 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2243
2244 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))
2245 {
2246 int c;
2247 int unionMemberOffset = 0;
2248 int bitFields = 0;
2249
2250 if(member)
2251 {
2252 member->memberOffset = 0;
2253 if(targetBits < sizeof(void *) * 8)
2254 member->structAlignment = 0;
2255 }
2256 else if(targetBits < sizeof(void *) * 8)
2257 _class->structAlignment = 0;
2258 if(!member && ((_class->type == 0 || _class->type == 5) || (_class->type == 1 && _class->memberOffset && _class->memberOffset > _class->base->structSize)))
2259 _class->memberOffset = (_class->base && _class->type == 1) ? _class->base->structSize : 0;
2260 if(!member && _class->destructionWatchOffset)
2261 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2262 {
2263 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2264
2265 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2266 {
2267 if(!dataMember->isProperty)
2268 {
2269 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2270 {
2271 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
2272 }
2273 }
2274 }
2275 }
2276 {
2277 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2278
2279 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2280 {
2281 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2282 {
2283 if(!isMember && _class->type == 2 && dataMember->dataType)
2284 {
2285 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2286 uint64 mask = 0;
2287 int d;
2288
2289 ComputeTypeSize(dataMember->dataType);
2290 if(bitMember->pos == -1)
2291 bitMember->pos = _class->memberOffset;
2292 if(!bitMember->size)
2293 bitMember->size = dataMember->dataType->size * 8;
2294 _class->memberOffset = bitMember->pos + bitMember->size;
2295 for(d = 0; d < bitMember->size; d++)
2296 {
2297 if(d)
2298 mask <<= 1;
2299 mask |= 1;
2300 }
2301 bitMember->mask = mask << bitMember->pos;
2302 }
2303 else if(dataMember->type == 0 && dataMember->dataType)
2304 {
2305 int size;
2306 int alignment = 0;
2307
2308 if(dataMember->dataType->kind != 8 || ((!dataMember->dataType->_class || !dataMember->dataType->_class->registered || dataMember->dataType->_class->registered != _class || _class->type != 1)))
2309 ComputeTypeSize(dataMember->dataType);
2310 if(dataMember->dataType->bitFieldCount)
2311 {
2312 bitFields += dataMember->dataType->bitFieldCount;
2313 size = 0;
2314 }
2315 else
2316 {
2317 if(bitFields)
2318 {
2319 int size = (bitFields + 7) / 8;
2320
2321 if(isMember)
2322 {
2323 int __simpleStruct0;
2324
2325 if(alignment)
2326 {
2327 int __simpleStruct0;
2328
2329 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2330 if(member->memberOffset % alignment)
2331 member->memberOffset += alignment - (member->memberOffset % alignment);
2332 }
2333 dataMember->offset = member->memberOffset;
2334 if(member->type == 1)
2335 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2336 else
2337 {
2338 member->memberOffset += size;
2339 }
2340 }
2341 else
2342 {
2343 if(alignment)
2344 {
2345 int __simpleStruct0;
2346
2347 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2348 if(_class->memberOffset % alignment)
2349 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2350 }
2351 dataMember->offset = _class->memberOffset;
2352 _class->memberOffset += size;
2353 }
2354 bitFields = 0;
2355 }
2356 size = dataMember->dataType->size;
2357 alignment = dataMember->dataType->alignment;
2358 }
2359 if(isMember)
2360 {
2361 int __simpleStruct0;
2362
2363 if(alignment)
2364 {
2365 int __simpleStruct0;
2366
2367 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2368 if(member->memberOffset % alignment)
2369 member->memberOffset += alignment - (member->memberOffset % alignment);
2370 }
2371 dataMember->offset = member->memberOffset;
2372 if(member->type == 1)
2373 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2374 else
2375 {
2376 member->memberOffset += size;
2377 }
2378 }
2379 else
2380 {
2381 if(alignment)
2382 {
2383 int __simpleStruct0;
2384
2385 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2386 if(_class->memberOffset % alignment)
2387 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2388 }
2389 dataMember->offset = _class->memberOffset;
2390 _class->memberOffset += size;
2391 }
2392 }
2393 else
2394 {
2395 int alignment;
2396
2397 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 0x1);
2398 alignment = dataMember->structAlignment;
2399 if(isMember)
2400 {
2401 int __simpleStruct0;
2402
2403 if(alignment)
2404 {
2405 int __simpleStruct0;
2406
2407 if(member->memberOffset % alignment)
2408 member->memberOffset += alignment - (member->memberOffset % alignment);
2409 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2410 }
2411 dataMember->offset = member->memberOffset;
2412 if(member->type == 1)
2413 unionMemberOffset = (__simpleStruct0 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2414 else
2415 member->memberOffset += dataMember->memberOffset;
2416 }
2417 else
2418 {
2419 if(alignment)
2420 {
2421 int __simpleStruct0;
2422
2423 if(_class->memberOffset % alignment)
2424 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2425 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2426 }
2427 dataMember->offset = _class->memberOffset;
2428 _class->memberOffset += dataMember->memberOffset;
2429 }
2430 }
2431 }
2432 }
2433 if(bitFields)
2434 {
2435 int alignment = 0;
2436 int size = (bitFields + 7) / 8;
2437
2438 if(isMember)
2439 {
2440 int __simpleStruct0;
2441
2442 if(alignment)
2443 {
2444 int __simpleStruct0;
2445
2446 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2447 if(member->memberOffset % alignment)
2448 member->memberOffset += alignment - (member->memberOffset % alignment);
2449 }
2450 if(member->type == 1)
2451 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2452 else
2453 {
2454 member->memberOffset += size;
2455 }
2456 }
2457 else
2458 {
2459 if(alignment)
2460 {
2461 int __simpleStruct0;
2462
2463 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2464 if(_class->memberOffset % alignment)
2465 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2466 }
2467 _class->memberOffset += size;
2468 }
2469 bitFields = 0;
2470 }
2471 }
2472 if(member && member->type == 1)
2473 {
2474 member->memberOffset = unionMemberOffset;
2475 }
2476 if(!isMember)
2477 {
2478 if(_class->type != 2)
2479 {
2480 int extra = 0;
2481
2482 if(_class->structAlignment)
2483 {
2484 if(_class->memberOffset % _class->structAlignment)
2485 extra += _class->structAlignment - (_class->memberOffset % _class->structAlignment);
2486 }
2487 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset + extra;
2488 if(!member)
2489 {
2490 struct __ecereNameSpace__ecere__com__Property * prop;
2491
2492 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2493 {
2494 if(prop->isProperty && prop->isWatchable)
2495 {
2496 prop->watcherOffset = _class->structSize;
2497 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2498 }
2499 }
2500 }
2501 {
2502 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2503
2504 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2505 {
2506 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2507
2508 if(deriv->computeSize)
2509 {
2510 deriv->offset = _class->structSize;
2511 deriv->memberOffset = 0;
2512 deriv->structSize = deriv->offset;
2513 ComputeClassMembers(deriv, 0x0);
2514 }
2515 }
2516 }
2517 }
2518 }
2519 }
2520 if(context)
2521 FinishTemplatesContext(context);
2522 }
2523
2524 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2525
2526 struct __ecereNameSpace__ecere__com__NameSpace
2527 {
2528 char *  name;
2529 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
2530 struct __ecereNameSpace__ecere__com__NameSpace *  left;
2531 struct __ecereNameSpace__ecere__com__NameSpace *  right;
2532 int depth;
2533 struct __ecereNameSpace__ecere__com__NameSpace *  parent;
2534 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2535 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2536 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2537 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2538 } __attribute__ ((gcc_struct));
2539
2540 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2541
2542 struct __ecereNameSpace__ecere__com__Module
2543 {
2544 struct __ecereNameSpace__ecere__com__Instance * application;
2545 struct __ecereNameSpace__ecere__sys__OldList classes;
2546 struct __ecereNameSpace__ecere__sys__OldList defines;
2547 struct __ecereNameSpace__ecere__sys__OldList functions;
2548 struct __ecereNameSpace__ecere__sys__OldList modules;
2549 struct __ecereNameSpace__ecere__com__Instance * prev;
2550 struct __ecereNameSpace__ecere__com__Instance * next;
2551 char *  name;
2552 void *  library;
2553 void *  Unload;
2554 int importType;
2555 int origImportType;
2556 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2557 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2558 } __attribute__ ((gcc_struct));
2559
2560 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2561 {
2562 struct __ecereNameSpace__ecere__com__Class * _class;
2563 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2564
2565 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
2566 ComputeModuleClasses(subModule->data);
2567 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->classes.first; _class; _class = _class->next)
2568 ComputeClassMembers(_class, 0x0);
2569 }
2570
2571 extern unsigned int inCompiler;
2572
2573 extern void Compiler_Error(char *  format, ...);
2574
2575 extern char *  __ecereNameSpace__ecere__GetTranslatedString(struct __ecereNameSpace__ecere__com__Instance * module, char *  string, char *  stringAndContext);
2576
2577 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
2578
2579 int ComputeTypeSize(struct Type * type)
2580 {
2581 unsigned int size = type ? type->size : 0;
2582
2583 if(!size && type && !type->computing)
2584 {
2585 type->computing = 0x1;
2586 switch(type->kind)
2587 {
2588 case 24:
2589 type->alignment = size = sizeof(char);
2590 break;
2591 case 1:
2592 type->alignment = size = sizeof(char);
2593 break;
2594 case 3:
2595 type->alignment = size = sizeof(int);
2596 break;
2597 case 4:
2598 type->alignment = size = sizeof(long long);
2599 break;
2600 case 22:
2601 type->alignment = size = targetBits / 8;
2602 break;
2603 case 23:
2604 type->alignment = size = targetBits / 8;
2605 break;
2606 case 5:
2607 type->alignment = size = sizeof(long);
2608 break;
2609 case 2:
2610 type->alignment = size = sizeof(short);
2611 break;
2612 case 6:
2613 type->alignment = size = sizeof(float);
2614 break;
2615 case 7:
2616 type->alignment = size = sizeof(double);
2617 break;
2618 case 8:
2619 {
2620 struct __ecereNameSpace__ecere__com__Class * _class = type->_class ? type->_class->registered : (((void *)0));
2621
2622 if(_class && _class->type == 1)
2623 {
2624 ComputeClassMembers(_class, 0x0);
2625 type->alignment = _class->structAlignment;
2626 size = _class->structSize;
2627 if(type->alignment && size % type->alignment)
2628 size += type->alignment - (size % type->alignment);
2629 }
2630 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2631 {
2632 if(!_class->dataType)
2633 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2634 size = type->alignment = ComputeTypeSize(_class->dataType);
2635 }
2636 else
2637 size = type->alignment = targetBits / 8;
2638 break;
2639 }
2640 case 13:
2641 case 19:
2642 size = type->alignment = targetBits / 8;
2643 break;
2644 case 12:
2645 if(type->arraySizeExp)
2646 {
2647 ProcessExpressionType(type->arraySizeExp);
2648 ComputeExpression(type->arraySizeExp);
2649 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)))
2650 {
2651 struct Location oldLoc = yylloc;
2652 char expression[10240];
2653
2654 expression[0] = '\0';
2655 type->arraySizeExp->expType = (((void *)0));
2656 yylloc = type->arraySizeExp->loc;
2657 if(inCompiler)
2658 PrintExpression(type->arraySizeExp, expression);
2659 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Array size not constant int (%s)\n", (((void *)0))), expression);
2660 yylloc = oldLoc;
2661 }
2662 GetInt(type->arraySizeExp, &type->arraySize);
2663 }
2664 else if(type->enumClass)
2665 {
2666 if(type->enumClass && type->enumClass->registered && type->enumClass->registered->type == 4)
2667 {
2668 type->arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->enumClass->registered, "enumSize");
2669 }
2670 else
2671 type->arraySize = 0;
2672 }
2673 else
2674 {
2675 type->arraySize = 0;
2676 }
2677 size = ComputeTypeSize(type->type) * type->arraySize;
2678 if(type->type)
2679 type->alignment = type->type->alignment;
2680 break;
2681 case 9:
2682 {
2683 struct Type * member;
2684
2685 for(member = type->members.first; member; member = member->next)
2686 {
2687 int __simpleStruct0, __simpleStruct1;
2688 unsigned int addSize = ComputeTypeSize(member);
2689
2690 member->offset = size;
2691 if(member->alignment && size % member->alignment)
2692 member->offset += member->alignment - (size % member->alignment);
2693 size = member->offset;
2694 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2695 size += addSize;
2696 }
2697 if(type->alignment && size % type->alignment)
2698 size += type->alignment - (size % type->alignment);
2699 break;
2700 }
2701 case 10:
2702 {
2703 struct Type * member;
2704
2705 for(member = type->members.first; member; member = member->next)
2706 {
2707 int __simpleStruct0, __simpleStruct1;
2708 unsigned int addSize = ComputeTypeSize(member);
2709
2710 member->offset = size;
2711 if(member->alignment && size % member->alignment)
2712 member->offset += member->alignment - (size % member->alignment);
2713 size = member->offset;
2714 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2715 size = ((size > addSize) ? size : addSize);
2716 }
2717 if(type->alignment && size % type->alignment)
2718 size += type->alignment - (size % type->alignment);
2719 break;
2720 }
2721 case 20:
2722 {
2723 struct TemplateParameter * param = type->templateParameter;
2724 struct Type * baseType = ProcessTemplateParameterType(param);
2725
2726 if(baseType)
2727 {
2728 size = ComputeTypeSize(baseType);
2729 type->alignment = baseType->alignment;
2730 }
2731 else
2732 type->alignment = size = sizeof(uint64);
2733 break;
2734 }
2735 case 15:
2736 {
2737 type->alignment = size = sizeof(enum
2738 {
2739 test
2740 });
2741 break;
2742 }
2743 case 21:
2744 {
2745 type->alignment = size = targetBits / 8;
2746 break;
2747 }
2748 }
2749 type->size = size;
2750 type->computing = 0x0;
2751 }
2752 return size;
2753 }
2754
2755 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2756
2757 extern struct Identifier * MkIdentifier(char *  string);
2758
2759 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void *  item);
2760
2761 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2762
2763 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2764
2765 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2766
2767 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2768
2769 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2770
2771 extern void FreeType(struct Type * type);
2772
2773 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2774
2775 extern struct Specifier * MkSpecifier(int specifier);
2776
2777 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2778
2779 extern struct Expression * MkExpConstant(char *  string);
2780
2781 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)
2782 {
2783 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2784 unsigned int totalSize = 0;
2785 unsigned int maxSize = 0;
2786 int alignment, size;
2787 struct __ecereNameSpace__ecere__com__DataMember * member;
2788 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2789
2790 if(addedPadding)
2791 *addedPadding = 0x0;
2792 if(!isMember && _class->base)
2793 {
2794 maxSize = _class->structSize;
2795 {
2796 if(_class->type == 1 || _class->type == 5)
2797 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass, (((void *)0)));
2798 else
2799 {
2800 unsigned int baseSize = _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2801
2802 if(maxSize > baseSize)
2803 maxSize -= baseSize;
2804 else
2805 maxSize = 0;
2806 }
2807 }
2808 }
2809 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2810 {
2811 if(!member->isProperty)
2812 {
2813 switch(member->type)
2814 {
2815 case 0:
2816 {
2817 if(member->dataTypeString)
2818 {
2819 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2820 struct Declarator * decl;
2821
2822 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2823 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2824 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2825 if(!member->dataType)
2826 member->dataType = ProcessType(specs, decl);
2827 ReplaceThisClassSpecifiers(specs, topClass);
2828 {
2829 struct Type * type = ProcessType(specs, decl);
2830
2831 DeclareType(member->dataType, 0x0, 0x0);
2832 FreeType(type);
2833 }
2834 ComputeTypeSize(member->dataType);
2835 size = member->dataType->size;
2836 alignment = member->dataType->alignment;
2837 if(alignment)
2838 {
2839 if(totalSize % alignment)
2840 totalSize += alignment - (totalSize % alignment);
2841 }
2842 totalSize += size;
2843 }
2844 break;
2845 }
2846 case 1:
2847 case 2:
2848 {
2849 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
2850
2851 size = 0;
2852 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass, (((void *)0)));
2853 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
2854 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, (((void *)0)), (((void *)0)))));
2855 alignment = member->structAlignment;
2856 if(alignment)
2857 {
2858 if(totalSize % alignment)
2859 totalSize += alignment - (totalSize % alignment);
2860 }
2861 totalSize += size;
2862 break;
2863 }
2864 }
2865 }
2866 }
2867 if(retSize)
2868 {
2869 unsigned int __simpleStruct0;
2870
2871 if(topMember && topMember->type == 1)
2872 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
2873 else
2874 *retSize += totalSize;
2875 }
2876 else if(totalSize < maxSize && _class->type != 1000)
2877 {
2878 int autoPadding = 0;
2879
2880 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
2881 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
2882 if(totalSize + autoPadding < maxSize)
2883 {
2884 char sizeString[50];
2885
2886 sprintf(sizeString, "%d", maxSize - totalSize);
2887 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
2888 if(addedPadding)
2889 *addedPadding = 0x1;
2890 }
2891 }
2892 if(context)
2893 FinishTemplatesContext(context);
2894 return topMember ? topMember->memberID : _class->memberID;
2895 }
2896
2897 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2898 {
2899 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2900 unsigned int totalSize = 0;
2901 struct __ecereNameSpace__ecere__com__DataMember * member;
2902 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2903
2904 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
2905 DeclareMembers(_class->base, 0x0);
2906 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2907 {
2908 if(!member->isProperty)
2909 {
2910 switch(member->type)
2911 {
2912 case 0:
2913 {
2914 if(!member->dataType && member->dataTypeString)
2915 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
2916 if(member->dataType)
2917 DeclareType(member->dataType, 0x0, 0x0);
2918 break;
2919 }
2920 case 1:
2921 case 2:
2922 {
2923 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
2924 break;
2925 }
2926 }
2927 }
2928 }
2929 if(context)
2930 FinishTemplatesContext(context);
2931 return topMember ? topMember->memberID : _class->memberID;
2932 }
2933
2934 extern struct Symbol * FindClass(char *  name);
2935
2936 extern char *  strchr(const char * , int);
2937
2938 extern void FullClassNameCat(char *  output, char *  className, unsigned int includeTemplateParams);
2939
2940 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (*  FreeFunction)(void * ));
2941
2942 extern void FreeClassDef(struct ClassDef * def);
2943
2944 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
2945
2946 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
2947
2948 extern char *  strcpy(char * , const char * );
2949
2950 extern void MangleClassName(char *  className);
2951
2952 extern void DeclareClass(struct Symbol * classSym, char *  className);
2953
2954 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item, void *  prevItem);
2955
2956 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void *  prevItem, void *  item);
2957
2958 void DeclareStruct(char * name, unsigned int skipNoHead)
2959 {
2960 struct External * external = (((void *)0));
2961 struct Symbol * classSym = FindClass(name);
2962
2963 if(!inCompiler || !classSym)
2964 return ;
2965 if(classSym->registered && (classSym->registered->type == 2 || classSym->registered->type == 3 || classSym->registered->type == 4))
2966 return ;
2967 if(classSym->registered && classSym->imported && !classSym->declaredStructSym)
2968 {
2969 struct Declaration * decl;
2970 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
2971 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
2972 char structName[1024];
2973
2974 external = (classSym->registered && classSym->registered->type == 1) ? classSym->pointerExternal : classSym->structExternal;
2975 classSym->declaring++;
2976 if(strchr(classSym->string, '<'))
2977 {
2978 if(classSym->registered->templateClass)
2979 {
2980 DeclareStruct(classSym->registered->templateClass->fullName, skipNoHead);
2981 classSym->declaring--;
2982 }
2983 return ;
2984 }
2985 DeclareMembers(classSym->registered, 0x0);
2986 structName[0] = (char)0;
2987 FullClassNameCat(structName, name, 0x0);
2988 if(!skipNoHead)
2989 {
2990 unsigned int addedPadding = 0x0;
2991
2992 classSym->declaredStructSym = 0x1;
2993 declarations = MkList();
2994 AddMembers(declarations, classSym->registered, 0x0, (((void *)0)), classSym->registered, &addedPadding);
2995 if(!(*declarations).count || ((*declarations).count == 1 && addedPadding))
2996 {
2997 FreeList(declarations, FreeClassDef);
2998 declarations = (((void *)0));
2999 }
3000 }
3001 if(skipNoHead || declarations)
3002 {
3003 if(external && external->declaration)
3004 {
3005 ((struct Specifier *)(*external->declaration->specifiers).first)->definitions = declarations;
3006 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3007 {
3008 if(classSym->structExternal)
3009 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3010 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3011 classSym->id = curExternal->symbol->idCode;
3012 classSym->idCode = curExternal->symbol->idCode;
3013 }
3014 }
3015 else
3016 {
3017 if(!external)
3018 external = MkExternalDeclaration((((void *)0)));
3019 specifiers = MkList();
3020 declarators = MkList();
3021 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
3022 external->declaration = decl = MkDeclaration(specifiers, declarators);
3023 if(decl->symbol && !decl->symbol->pointerExternal)
3024 decl->symbol->pointerExternal = external;
3025 if(classSym->registered && classSym->registered->type == 1)
3026 {
3027 char className[1024];
3028
3029 strcpy(className, "__ecereClass_");
3030 FullClassNameCat(className, classSym->string, 0x1);
3031 MangleClassName(className);
3032 DeclareClass(classSym, className);
3033 external->symbol = classSym;
3034 classSym->pointerExternal = external;
3035 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3036 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3037 }
3038 else
3039 {
3040 char className[1024];
3041
3042 strcpy(className, "__ecereClass_");
3043 FullClassNameCat(className, classSym->string, 0x1);
3044 MangleClassName(className);
3045 classSym->structExternal = external;
3046 DeclareClass(classSym, className);
3047 external->symbol = classSym;
3048 }
3049 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
3050 }
3051 }
3052 classSym->declaring--;
3053 }
3054 else if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3055 {
3056 classSym->declaring++;
3057 {
3058 if(classSym->registered)
3059 DeclareMembers(classSym->registered, 0x0);
3060 }
3061 if(classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 5))
3062 {
3063 if(classSym->structExternal)
3064 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3065 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3066 classSym->id = curExternal->symbol->idCode;
3067 classSym->idCode = curExternal->symbol->idCode;
3068 }
3069 classSym->declaring--;
3070 }
3071 }
3072
3073 extern char *  strcat(char * , const char * );
3074
3075 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
3076
3077 extern struct ModuleImport * mainModule;
3078
3079 extern struct Specifier * MkSpecifierName(char *  name);
3080
3081 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
3082
3083 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
3084
3085 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
3086
3087 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
3088
3089 extern void FreeDeclarator(struct Declarator * decl);
3090
3091 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
3092
3093 struct PropertyImport
3094 {
3095 struct PropertyImport * prev;
3096 struct PropertyImport * next;
3097 char *  name;
3098 unsigned int isVirtual;
3099 unsigned int hasSet;
3100 unsigned int hasGet;
3101 } __attribute__ ((gcc_struct));
3102
3103 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
3104
3105 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
3106 {
3107 struct Symbol * symbol = prop->symbol;
3108 char propName[1024];
3109
3110 strcpy(setName, "__ecereProp_");
3111 FullClassNameCat(setName, prop->_class->fullName, 0x0);
3112 strcat(setName, "_Set_");
3113 FullClassNameCat(setName, prop->name, 0x1);
3114 strcpy(getName, "__ecereProp_");
3115 FullClassNameCat(getName, prop->_class->fullName, 0x0);
3116 strcat(getName, "_Get_");
3117 FullClassNameCat(getName, prop->name, 0x1);
3118 strcpy(propName, "__ecereProp_");
3119 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3120 strcat(propName, "_");
3121 FullClassNameCat(propName, prop->name, 0x1);
3122 MangleClassName(getName);
3123 MangleClassName(setName);
3124 MangleClassName(propName);
3125 if(prop->_class->type == 1)
3126 DeclareStruct(prop->_class->fullName, 0x0);
3127 if(!symbol || curExternal->symbol->idCode < symbol->id)
3128 {
3129 unsigned int imported = 0x0;
3130 unsigned int dllImport = 0x0;
3131
3132 if(!symbol || symbol->_import)
3133 {
3134 if(!symbol)
3135 {
3136 struct Symbol * classSym;
3137
3138 if(!prop->_class->symbol)
3139 prop->_class->symbol = FindClass(prop->_class->fullName);
3140 classSym = prop->_class->symbol;
3141 if(classSym && !classSym->_import)
3142 {
3143 struct ModuleImport * module;
3144
3145 if(prop->_class->module)
3146 module = FindModule(prop->_class->module);
3147 else
3148 module = mainModule;
3149 classSym->_import = __extension__ ({
3150 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
3151
3152 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
3153 });
3154 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3155 }
3156 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3157 symbol->_import = (struct ClassImport *)__extension__ ({
3158 struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
3159
3160 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0x0, __ecereInstance1->hasSet = prop->Set ? 0x1 : 0x0, __ecereInstance1->hasGet = prop->Get ? 0x1 : 0x0, __ecereInstance1;
3161 });
3162 if(classSym)
3163 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3164 }
3165 imported = 0x1;
3166 if(prop->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)prop->_class->module + structSize_Instance)))->importType != 1)
3167 dllImport = 0x1;
3168 }
3169 if(!symbol->type)
3170 {
3171 struct Context * context = SetupTemplatesContext(prop->_class);
3172
3173 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
3174 FinishTemplatesContext(context);
3175 }
3176 if(prop->Get)
3177 {
3178 if(!symbol->externalGet || symbol->externalGet->type == 0)
3179 {
3180 struct Declaration * decl;
3181 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3182 struct Declarator * d;
3183 struct __ecereNameSpace__ecere__sys__OldList * params;
3184 struct Specifier * spec;
3185 struct External * external;
3186 struct Declarator * typeDecl;
3187 unsigned int simple = 0x0;
3188
3189 specifiers = MkList();
3190 declarators = MkList();
3191 params = MkList();
3192 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3193 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3194 if(dllImport)
3195 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3196 {
3197 struct Context * context = SetupTemplatesContext(prop->_class);
3198
3199 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3200 FinishTemplatesContext(context);
3201 }
3202 for(spec = (*specifiers).first; spec; spec = spec->next)
3203 {
3204 if(spec->type == 1)
3205 {
3206 if((!typeDecl || typeDecl->type == 1))
3207 {
3208 struct Symbol * classSym = spec->symbol;
3209
3210 symbol->_class = classSym->registered;
3211 if(classSym->registered && classSym->registered->type == 1)
3212 {
3213 DeclareStruct(spec->name, 0x0);
3214 simple = 0x1;
3215 }
3216 }
3217 }
3218 }
3219 if(!simple)
3220 d = PlugDeclarator(typeDecl, d);
3221 else
3222 {
3223 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3224 specifiers = MkList();
3225 }
3226 d = MkDeclaratorFunction(d, params);
3227 if(dllImport)
3228 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3229 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3230 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3231 if(simple)
3232 ListAdd(specifiers, MkSpecifier(VOID));
3233 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3234 decl = MkDeclaration(specifiers, declarators);
3235 external = MkExternalDeclaration(decl);
3236 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3237 external->symbol = symbol;
3238 symbol->externalGet = external;
3239 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3240 if(typeDecl)
3241 FreeDeclarator(typeDecl);
3242 }
3243 else
3244 {
3245 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
3246 }
3247 }
3248 if(prop->Set)
3249 {
3250 if(!symbol->externalSet || symbol->externalSet->type == 0)
3251 {
3252 struct Declaration * decl;
3253 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3254 struct Declarator * d;
3255 struct __ecereNameSpace__ecere__sys__OldList * params;
3256 struct Specifier * spec;
3257 struct External * external;
3258 struct Declarator * typeDecl;
3259
3260 declarators = MkList();
3261 params = MkList();
3262 if(!prop->conversion || prop->_class->type == 1)
3263 {
3264 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3265 }
3266 specifiers = MkList();
3267 {
3268 struct Context * context = SetupTemplatesContext(prop->_class);
3269
3270 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3271 FinishTemplatesContext(context);
3272 }
3273 ListAdd(params, MkTypeName(specifiers, d));
3274 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3275 if(dllImport)
3276 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3277 d = MkDeclaratorFunction(d, params);
3278 for(spec = (*specifiers).first; spec; spec = spec->next)
3279 {
3280 if(spec->type == 1)
3281 {
3282 if((!typeDecl || typeDecl->type == 1))
3283 {
3284 struct Symbol * classSym = spec->symbol;
3285
3286 symbol->_class = classSym->registered;
3287 if(classSym->registered && classSym->registered->type == 1)
3288 DeclareStruct(spec->name, 0x0);
3289 }
3290 }
3291 }
3292 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3293 specifiers = MkList();
3294 if(dllImport)
3295 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3296 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3297 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3298 if(!prop->conversion || prop->_class->type == 1)
3299 ListAdd(specifiers, MkSpecifier(VOID));
3300 else
3301 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3302 decl = MkDeclaration(specifiers, declarators);
3303 external = MkExternalDeclaration(decl);
3304 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3305 external->symbol = symbol;
3306 symbol->externalSet = external;
3307 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3308 }
3309 else
3310 {
3311 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3312 }
3313 }
3314 if(!symbol->externalPtr)
3315 {
3316 struct Declaration * decl;
3317 struct External * external;
3318 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3319
3320 if(imported)
3321 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3322 else
3323 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3324 ListAdd(specifiers, MkSpecifierName("Property"));
3325 {
3326 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3327
3328 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3329 if(!imported)
3330 {
3331 strcpy(propName, "__ecerePropM_");
3332 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3333 strcat(propName, "_");
3334 FullClassNameCat(propName, prop->name, 0x1);
3335 MangleClassName(propName);
3336 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3337 }
3338 decl = MkDeclaration(specifiers, list);
3339 }
3340 external = MkExternalDeclaration(decl);
3341 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3342 external->symbol = symbol;
3343 symbol->externalPtr = external;
3344 }
3345 else
3346 {
3347 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3348 }
3349 symbol->id = curExternal->symbol->idCode;
3350 }
3351 }
3352
3353 struct Type * Dereference(struct Type * source)
3354 {
3355 struct Type * type = (((void *)0));
3356
3357 if(source)
3358 {
3359 if(source->kind == 13 || source->kind == 12)
3360 {
3361 type = source->type;
3362 source->type->refCount++;
3363 }
3364 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3365 {
3366 type = __extension__ ({
3367 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3368
3369 __ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
3370 });
3371 }
3372 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3373 {
3374 type = source;
3375 source->refCount++;
3376 }
3377 else
3378 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot dereference type\n", (((void *)0))));
3379 }
3380 return type;
3381 }
3382
3383 static struct Type * Reference(struct Type * source)
3384 {
3385 struct Type * type = (((void *)0));
3386
3387 if(source)
3388 {
3389 type = __extension__ ({
3390 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3391
3392 __ecereInstance1->kind = 13, __ecereInstance1->type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
3393 });
3394 source->refCount++;
3395 }
3396 return type;
3397 }
3398
3399 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);
3400
3401 extern void *  memcpy(void * , const void * , size_t size);
3402
3403 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3404
3405 extern void FreeExpression(struct Expression * exp);
3406
3407 extern void __ecereNameSpace__ecere__sys__ChangeCh(char *  string, char ch1, char ch2);
3408
3409 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);
3410
3411 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3412
3413 extern struct Type * MkClassType(char *  name);
3414
3415 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);
3416
3417 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)
3418 {
3419 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3420 unsigned int found = 0x0;
3421 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3422 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3423 unsigned int freeType = 0x0;
3424
3425 yylloc = member->loc;
3426 if(!ident)
3427 {
3428 if(curMember)
3429 {
3430 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3431 if(*curMember)
3432 {
3433 found = 0x1;
3434 dataMember = *curMember;
3435 }
3436 }
3437 }
3438 else
3439 {
3440 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3441 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3442 int _subMemberStackPos = 0;
3443
3444 if(!thisMember)
3445 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3446 if(thisMember)
3447 {
3448 dataMember = thisMember;
3449 if(curMember && thisMember->memberAccess == 1)
3450 {
3451 *curMember = thisMember;
3452 *curClass = thisMember->_class;
3453 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
3454 *subMemberStackPos = _subMemberStackPos;
3455 }
3456 found = 0x1;
3457 }
3458 else
3459 {
3460 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3461 if(method && method->type == 1)
3462 found = 0x1;
3463 else
3464 method = (((void *)0));
3465 }
3466 }
3467 if(found)
3468 {
3469 struct Type * type = (((void *)0));
3470
3471 if(dataMember)
3472 {
3473 if(!dataMember->dataType && dataMember->dataTypeString)
3474 {
3475 struct Context * context = SetupTemplatesContext(_class);
3476
3477 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3478 FinishTemplatesContext(context);
3479 }
3480 type = dataMember->dataType;
3481 }
3482 else if(method)
3483 {
3484 if(!method->dataType)
3485 ProcessMethodType(method);
3486 type = method->dataType;
3487 }
3488 if(ident && ident->next)
3489 {
3490 for(ident = ident->next; ident && type; ident = ident->next)
3491 {
3492 if(type->kind == 8)
3493 {
3494 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3495 if(!dataMember)
3496 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3497 if(dataMember)
3498 type = dataMember->dataType;
3499 }
3500 else if(type->kind == 9 || type->kind == 10)
3501 {
3502 struct Type * memberType;
3503
3504 for(memberType = type->members.first; memberType; memberType = memberType->next)
3505 {
3506 if(!strcmp(memberType->name, ident->string))
3507 {
3508 type = memberType;
3509 break;
3510 }
3511 }
3512 }
3513 }
3514 }
3515 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3516 {
3517 int id = 0;
3518 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3519 struct __ecereNameSpace__ecere__com__Class * sClass;
3520
3521 for(sClass = _class; sClass; sClass = sClass->base)
3522 {
3523 id = 0;
3524 if(sClass->templateClass)
3525 sClass = sClass->templateClass;
3526 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3527 {
3528 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3529 {
3530 for(sClass = sClass->base; sClass; sClass = sClass->base)
3531 {
3532 if(sClass->templateClass)
3533 sClass = sClass->templateClass;
3534 id += sClass->templateParams.count;
3535 }
3536 break;
3537 }
3538 id++;
3539 }
3540 if(curParam)
3541 break;
3542 }
3543 if(curParam)
3544 {
3545 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3546
3547 if(arg.dataTypeString)
3548 {
3549 type = ProcessTypeString(arg.dataTypeString, 0x0);
3550 freeType = 0x1;
3551 if(type && _class->templateClass)
3552 type->passAsTemplate = 0x1;
3553 if(type)
3554 {
3555 }
3556 }
3557 }
3558 }
3559 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3560 {
3561 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3562 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3563 int c;
3564 int paramCount = 0;
3565 int lastParam = -1;
3566 char templateString[1024];
3567 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3568
3569 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3570 for(cClass = expClass; cClass; cClass = cClass->base)
3571 {
3572 int p = 0;
3573
3574 if(cClass->templateClass)
3575 cClass = cClass->templateClass;
3576 for(param = cClass->templateParams.first; param; param = param->next)
3577 {
3578 int id = p;
3579 struct __ecereNameSpace__ecere__com__Class * sClass;
3580 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3581
3582 for(sClass = cClass->base; sClass; sClass = sClass->base)
3583 {
3584 if(sClass->templateClass)
3585 sClass = sClass->templateClass;
3586 id += sClass->templateParams.count;
3587 }
3588 arg = expClass->templateArgs[id];
3589 for(sClass = _class; sClass; sClass = sClass->base)
3590 {
3591 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3592 int p = 0;
3593 struct __ecereNameSpace__ecere__com__Class * nextClass;
3594
3595 if(sClass->templateClass)
3596 sClass = sClass->templateClass;
3597 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3598 {
3599 if(nextClass->templateClass)
3600 nextClass = nextClass->templateClass;
3601 p += nextClass->templateParams.count;
3602 }
3603 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3604 {
3605 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3606 {
3607 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3608 {
3609 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3610 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3611 break;
3612 }
3613 }
3614 }
3615 }
3616 {
3617 char argument[256];
3618
3619 argument[0] = '\0';
3620 switch(param->type)
3621 {
3622 case 2:
3623 {
3624 char expString[1024];
3625 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3626 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3627 struct Expression * exp;
3628 char * string = PrintHexUInt64(arg.expression.ui64);
3629
3630 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3631 ProcessExpressionType(exp);
3632 ComputeExpression(exp);
3633 expString[0] = '\0';
3634 PrintExpression(exp, expString);
3635 strcat(argument, expString);
3636 FreeExpression(exp);
3637 break;
3638 }
3639 case 1:
3640 {
3641 strcat(argument, arg.member->name);
3642 break;
3643 }
3644 case 0:
3645 {
3646 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3647 strcat(argument, arg.dataTypeString);
3648 break;
3649 }
3650 }
3651 if(argument[0])
3652 {
3653 if(paramCount)
3654 strcat(templateString, ", ");
3655 if(lastParam != p - 1)
3656 {
3657 strcat(templateString, param->name);
3658 strcat(templateString, " = ");
3659 }
3660 strcat(templateString, argument);
3661 paramCount++;
3662 lastParam = p;
3663 }
3664 p++;
3665 }
3666 }
3667 }
3668 {
3669 int len = strlen(templateString);
3670
3671 if(templateString[len - 1] == '<')
3672 len--;
3673 else
3674 {
3675 if(templateString[len - 1] == '>')
3676 templateString[len++] = ' ';
3677 templateString[len++] = '>';
3678 }
3679 templateString[len++] = '\0';
3680 }
3681 {
3682 struct Context * context = SetupTemplatesContext(_class);
3683
3684 if(freeType)
3685 FreeType(type);
3686 type = ProcessTypeString(templateString, 0x0);
3687 freeType = 0x1;
3688 FinishTemplatesContext(context);
3689 }
3690 }
3691 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3692 {
3693 ProcessExpressionType(member->initializer->exp);
3694 if(!member->initializer->exp->expType)
3695 {
3696 if(inCompiler)
3697 {
3698 char expString[10240];
3699
3700 expString[0] = '\0';
3701 PrintExpression(member->initializer->exp, expString);
3702 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3703 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3704 }
3705 }
3706 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0))
3707 {
3708 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible instance method %s\n", (((void *)0))), ident->string);
3709 }
3710 }
3711 else if(member->initializer)
3712 {
3713 ProcessInitializer(member->initializer, type);
3714 }
3715 if(freeType)
3716 FreeType(type);
3717 }
3718 else
3719 {
3720 if(_class && _class->type == 3)
3721 {
3722 if(member->initializer)
3723 {
3724 struct Type * type = MkClassType(_class->fullName);
3725
3726 ProcessInitializer(member->initializer, type);
3727 FreeType(type);
3728 }
3729 }
3730 else
3731 {
3732 if(member->initializer)
3733 {
3734 ProcessInitializer(member->initializer, (((void *)0)));
3735 }
3736 if(ident)
3737 {
3738 if(method)
3739 {
3740 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3741 }
3742 else if(_class)
3743 {
3744 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3745 if(inCompiler)
3746 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3747 }
3748 }
3749 else if(_class)
3750 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3751 }
3752 }
3753 }
3754
3755 extern struct Identifier * GetDeclId(struct Declarator * decl);
3756
3757 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);
3758
3759 extern void FreeSpecifier(struct Specifier * spec);
3760
3761 static void ProcessFunction(struct FunctionDefinition * function);
3762
3763 extern struct __ecereNameSpace__ecere__sys__OldList *  CopyList(struct __ecereNameSpace__ecere__sys__OldList *  source, void *  (*  CopyFunction)(void * ));
3764
3765 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3766
3767 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3768
3769 extern void FreeClassFunction(struct ClassFunction * func);
3770
3771 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3772
3773 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3774
3775 void ProcessInstantiationType(struct Instantiation * inst)
3776 {
3777 yylloc = inst->loc;
3778 if(inst->_class)
3779 {
3780 struct MembersInit * members;
3781 struct Symbol * classSym;
3782 struct __ecereNameSpace__ecere__com__Class * _class;
3783
3784 classSym = inst->_class->symbol;
3785 _class = classSym ? classSym->registered : (((void *)0));
3786 if(!_class || _class->type != 5)
3787 DeclareStruct(inst->_class->name, 0x0);
3788 afterExternal = afterExternal ? afterExternal : curExternal;
3789 if(inst->exp)
3790 ProcessExpressionType(inst->exp);
3791 inst->isConstant = 0x1;
3792 if(inst->members)
3793 {
3794 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3795 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3796 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3797 int subMemberStackPos = 0;
3798
3799 for(members = (*inst->members).first; members; members = members->next)
3800 {
3801 switch(members->type)
3802 {
3803 case 1:
3804 {
3805 char name[1024];
3806 static unsigned int instMethodID = 0;
3807 struct External * external = curExternal;
3808 struct Context * context = curContext;
3809 struct Declarator * declarator = members->function->declarator;
3810 struct Identifier * nameID = GetDeclId(declarator);
3811 char * unmangled = nameID ? nameID->string : (((void *)0));
3812 struct Expression * exp;
3813 struct External * createdExternal = (((void *)0));
3814
3815 if(inCompiler)
3816 {
3817 char number[16];
3818
3819 strcpy(name, "__ecereInstMeth_");
3820 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
3821 strcat(name, "_");
3822 strcat(name, nameID->string);
3823 strcat(name, "_");
3824 sprintf(number, "_%08d", instMethodID++);
3825 strcat(name, number);
3826 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
3827 }
3828 if(declarator)
3829 {
3830 struct Symbol * symbol = declarator->symbol;
3831 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
3832
3833 if(method && method->type == 1)
3834 {
3835 symbol->method = method;
3836 ProcessMethodType(method);
3837 if(!symbol->type->thisClass)
3838 {
3839 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
3840 {
3841 if(!currentClass->symbol)
3842 currentClass->symbol = FindClass(currentClass->fullName);
3843 symbol->type->thisClass = currentClass->symbol;
3844 }
3845 else
3846 {
3847 if(!_class->symbol)
3848 _class->symbol = FindClass(_class->fullName);
3849 symbol->type->thisClass = _class->symbol;
3850 }
3851 }
3852 DeclareType(symbol->type, 0x1, 0x1);
3853 }
3854 else if(classSym)
3855 {
3856 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
3857 }
3858 }
3859 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
3860 if(nameID)
3861 {
3862 FreeSpecifier(nameID->_class);
3863 nameID->_class = (((void *)0));
3864 }
3865 if(inCompiler)
3866 {
3867 struct Type * type = declarator->symbol->type;
3868 struct External * oldExternal = curExternal;
3869
3870 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
3871 {
3872 struct External * externalDecl;
3873
3874 externalDecl = MkExternalDeclaration((((void *)0)));
3875 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
3876 if(createdExternal->function)
3877 {
3878 ProcessFunction(createdExternal->function);
3879 {
3880 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
3881
3882 externalDecl->declaration = decl;
3883 if(decl->symbol && !decl->symbol->pointerExternal)
3884 decl->symbol->pointerExternal = externalDecl;
3885 declarator->symbol->pointerExternal = externalDecl;
3886 }
3887 }
3888 }
3889 }
3890 else if(declarator)
3891 {
3892 curExternal = declarator->symbol->pointerExternal;
3893 ProcessFunction((struct FunctionDefinition *)members->function);
3894 }
3895 curExternal = external;
3896 curContext = context;
3897 if(inCompiler)
3898 {
3899 FreeClassFunction(members->function);
3900 exp = QMkExpId(name);
3901 members->type = 0;
3902 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
3903 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
3904 }
3905 break;
3906 }
3907 case 0:
3908 {
3909 if(members->dataMembers && classSym)
3910 {
3911 struct MemberInit * member;
3912 struct Location oldyyloc = yylloc;
3913
3914 for(member = (*members->dataMembers).first; member; member = member->next)
3915 {
3916 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
3917 if(member->initializer && !member->initializer->isConstant)
3918 inst->isConstant = 0x0;
3919 }
3920 yylloc = oldyyloc;
3921 }
3922 break;
3923 }
3924 }
3925 }
3926 }
3927 }
3928 }
3929
3930 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
3931 {
3932 if(inCompiler)
3933 {
3934 if(type->kind == 11)
3935 {
3936 struct Type * param;
3937
3938 if(declareParams)
3939 {
3940 for(param = type->params.first; param; param = param->next)
3941 DeclareType(param, declarePointers, 0x1);
3942 }
3943 DeclareType(type->returnType, declarePointers, 0x1);
3944 }
3945 else if(type->kind == 13 && declarePointers)
3946 DeclareType(type->type, declarePointers, 0x0);
3947 else if(type->kind == 8)
3948 {
3949 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
3950 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
3951 }
3952 else if(type->kind == 9 || type->kind == 10)
3953 {
3954 struct Type * member;
3955
3956 for(member = type->members.first; member; member = member->next)
3957 DeclareType(member, 0x0, 0x0);
3958 }
3959 else if(type->kind == 12)
3960 DeclareType(type->arrayType, declarePointers, 0x0);
3961 }
3962 }
3963
3964 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
3965
3966 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
3967 {
3968 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
3969 int id = 0;
3970 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3971 struct __ecereNameSpace__ecere__com__Class * sClass;
3972
3973 for(sClass = _class; sClass; sClass = sClass->base)
3974 {
3975 id = 0;
3976 if(sClass->templateClass)
3977 sClass = sClass->templateClass;
3978 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3979 {
3980 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
3981 {
3982 for(sClass = sClass->base; sClass; sClass = sClass->base)
3983 {
3984 if(sClass->templateClass)
3985 sClass = sClass->templateClass;
3986 id += sClass->templateParams.count;
3987 }
3988 break;
3989 }
3990 id++;
3991 }
3992 if(curParam)
3993 break;
3994 }
3995 if(curParam)
3996 {
3997 arg = &_class->templateArgs[id];
3998 if(arg && param->type == 0)
3999 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
4000 }
4001 return arg;
4002 }
4003
4004 extern struct Context * PushContext(void);
4005
4006 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
4007
4008 struct TemplatedType
4009 {
4010 uintptr_t key;
4011 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4012 struct __ecereNameSpace__ecere__sys__BTNode * left;
4013 struct __ecereNameSpace__ecere__sys__BTNode * right;
4014 int depth;
4015 struct TemplateParameter * param;
4016 } __attribute__ ((gcc_struct));
4017
4018 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
4019
4020 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
4021 {
4022 struct Context * context = PushContext();
4023
4024 context->templateTypesOnly = 0x1;
4025 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
4026 {
4027 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
4028
4029 for(; param; param = param->next)
4030 {
4031 if(param->type == 0 && param->identifier)
4032 {
4033 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
4034
4035 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4036 }
4037 }
4038 }
4039 else if(_class)
4040 {
4041 struct __ecereNameSpace__ecere__com__Class * sClass;
4042
4043 for(sClass = _class; sClass; sClass = sClass->base)
4044 {
4045 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
4046
4047 for(p = sClass->templateParams.first; p; p = p->next)
4048 {
4049 if(p->type == 0)
4050 {
4051 struct TemplateParameter * param = p->param;
4052 struct TemplatedType * type;
4053
4054 if(!param)
4055 {
4056 p->param = param = __extension__ ({
4057 struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
4058
4059 __ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->dataTypeString, __ecereInstance1;
4060 });
4061 }
4062 type = __extension__ ({
4063 struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
4064
4065 __ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
4066 });
4067 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4068 }
4069 }
4070 }
4071 }
4072 return context;
4073 }
4074
4075 extern void PopContext(struct Context * ctx);
4076
4077 extern void FreeContext(struct Context * context);
4078
4079 void FinishTemplatesContext(struct Context * context)
4080 {
4081 PopContext(context);
4082 FreeContext(context);
4083 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
4084 }
4085
4086 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
4087 {
4088 if(!method->dataType)
4089 {
4090 struct Context * context = SetupTemplatesContext(method->_class);
4091
4092 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4093 FinishTemplatesContext(context);
4094 if(method->type != 1 && method->dataType)
4095 {
4096 if(!method->dataType->thisClass && !method->dataType->staticMethod)
4097 {
4098 if(!method->_class->symbol)
4099 method->_class->symbol = FindClass(method->_class->fullName);
4100 method->dataType->thisClass = method->_class->symbol;
4101 }
4102 }
4103 }
4104 }
4105
4106 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
4107 {
4108 if(!prop->dataType)
4109 {
4110 struct Context * context = SetupTemplatesContext(prop->_class);
4111
4112 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
4113 FinishTemplatesContext(context);
4114 }
4115 }
4116
4117 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4118
4119 extern void FreeTypeName(struct TypeName * typeName);
4120
4121 static void ProcessDeclarator(struct Declarator * decl);
4122
4123 extern struct __ecereNameSpace__ecere__sys__OldList *  excludedSymbols;
4124
4125 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4126
4127 struct MethodImport
4128 {
4129 struct MethodImport * prev;
4130 struct MethodImport * next;
4131 char *  name;
4132 unsigned int isVirtual;
4133 } __attribute__ ((gcc_struct));
4134
4135 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
4136
4137 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
4138 {
4139 struct Symbol * symbol = method->symbol;
4140
4141 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4142 {
4143 unsigned int imported = 0x0;
4144 unsigned int dllImport = 0x0;
4145
4146 if(!method->dataType)
4147 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4148 if(!symbol || symbol->_import || method->type == 1)
4149 {
4150 if(!symbol || method->type == 1)
4151 {
4152 struct Symbol * classSym;
4153
4154 if(!method->_class->symbol)
4155 method->_class->symbol = FindClass(method->_class->fullName);
4156 classSym = method->_class->symbol;
4157 if(!classSym->_import)
4158 {
4159 struct ModuleImport * module;
4160
4161 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->name)
4162 module = FindModule(method->_class->module);
4163 else
4164 module = mainModule;
4165 classSym->_import = __extension__ ({
4166 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
4167
4168 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
4169 });
4170 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4171 }
4172 if(!symbol)
4173 {
4174 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4175 }
4176 if(!symbol->_import)
4177 {
4178 symbol->_import = (struct ClassImport *)__extension__ ({
4179 struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
4180
4181 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
4182 });
4183 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4184 }
4185 if(!symbol)
4186 {
4187 symbol->type = method->dataType;
4188 if(symbol->type)
4189 symbol->type->refCount++;
4190 }
4191 }
4192 if(!method->dataType->dllExport)
4193 {
4194 imported = 0x1;
4195 if(method->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->importType != 1)
4196 dllImport = 0x1;
4197 }
4198 }
4199 if(method->type != 1 && method->dataType)
4200 DeclareType(method->dataType, 0x1, 0x1);
4201 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4202 {
4203 struct Declaration * decl;
4204 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4205 struct Declarator * d;
4206 struct Declarator * funcDecl;
4207 struct External * external;
4208
4209 specifiers = MkList();
4210 declarators = MkList();
4211 if(dllImport)
4212 ListAdd(specifiers, MkSpecifier(EXTERN));
4213 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4214 ListAdd(specifiers, MkSpecifier(STATIC));
4215 if(method->type == 1)
4216 {
4217 ListAdd(specifiers, MkSpecifier(INT));
4218 d = MkDeclaratorIdentifier(MkIdentifier(name));
4219 }
4220 else
4221 {
4222 d = MkDeclaratorIdentifier(MkIdentifier(name));
4223 if(dllImport)
4224 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4225 {
4226 struct Context * context = SetupTemplatesContext(method->_class);
4227
4228 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4229 FinishTemplatesContext(context);
4230 }
4231 funcDecl = GetFuncDecl(d);
4232 if(dllImport)
4233 {
4234 struct Specifier * spec, * next;
4235
4236 for(spec = (*specifiers).first; spec; spec = next)
4237 {
4238 next = spec->next;
4239 if(spec->type == 5)
4240 {
4241 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4242 FreeSpecifier(spec);
4243 }
4244 }
4245 }
4246 if(method->dataType && !method->dataType->staticMethod)
4247 {
4248 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
4249 {
4250 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
4251 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")));
4252 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
4253 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4254
4255 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
4256 {
4257 struct TypeName * param = (*funcDecl->function.parameters).first;
4258
4259 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
4260 FreeTypeName(param);
4261 }
4262 if(!funcDecl->function.parameters)
4263 funcDecl->function.parameters = MkList();
4264 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
4265 }
4266 }
4267 }
4268 ProcessDeclarator(d);
4269 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4270 decl = MkDeclaration(specifiers, declarators);
4271 ReplaceThisClassSpecifiers(specifiers, method->_class);
4272 if(symbol->pointerExternal)
4273 {
4274 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4275
4276 {
4277 *functionSymbol = *symbol;
4278 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4279 if(functionSymbol->type)
4280 functionSymbol->type->refCount++;
4281 }
4282 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4283 symbol->pointerExternal->symbol = functionSymbol;
4284 }
4285 external = MkExternalDeclaration(decl);
4286 if(curExternal)
4287 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4288 external->symbol = symbol;
4289 symbol->pointerExternal = external;
4290 }
4291 else if(ast)
4292 {
4293 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4294 }
4295 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4296 }
4297 }
4298
4299 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4300 {
4301 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4302 {
4303 unsigned int first = 0x1;
4304 int p = 0;
4305 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4306 int lastParam = -1;
4307 char className[1024];
4308
4309 strcpy(className, _class->fullName);
4310 for(param = _class->templateParams.first; param; param = param->next)
4311 {
4312 {
4313 if(first)
4314 strcat(className, "<");
4315 if(!first)
4316 strcat(className, ", ");
4317 if(lastParam + 1 != p)
4318 {
4319 strcat(className, param->name);
4320 strcat(className, " = ");
4321 }
4322 strcat(className, param->name);
4323 first = 0x0;
4324 lastParam = p;
4325 }
4326 p++;
4327 }
4328 if(!first)
4329 {
4330 int len = strlen(className);
4331
4332 if(className[len - 1] == '>')
4333 className[len++] = ' ';
4334 className[len++] = '>';
4335 className[len++] = '\0';
4336 }
4337 return __ecereNameSpace__ecere__sys__CopyString(className);
4338 }
4339 else
4340 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4341 }
4342
4343 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4344 {
4345 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4346 {
4347 unsigned int first = 0x1;
4348 int p = 0;
4349 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4350 int lastParam = -1;
4351 char className[1024];
4352
4353 strcpy(className, _class->fullName);
4354 for(param = _class->templateParams.first; param; param = param->next)
4355 {
4356 {
4357 if(first)
4358 strcat(className, "<");
4359 if(!first)
4360 strcat(className, ", ");
4361 if(lastParam + 1 != p)
4362 {
4363 strcat(className, param->name);
4364 strcat(className, " = ");
4365 }
4366 strcat(className, param->name);
4367 first = 0x0;
4368 lastParam = p;
4369 }
4370 p++;
4371 }
4372 if(!first)
4373 {
4374 int len = strlen(className);
4375
4376 if(className[len - 1] == '>')
4377 className[len++] = ' ';
4378 className[len++] = '>';
4379 className[len++] = '\0';
4380 }
4381 return MkClassType(className);
4382 }
4383 else
4384 {
4385 return MkClassType(_class->fullName);
4386 }
4387 }
4388
4389 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4390 {
4391 if(specs != (((void *)0)) && _class)
4392 {
4393 struct Specifier * spec;
4394
4395 for(spec = specs->first; spec; spec = spec->next)
4396 {
4397 if(spec->type == 0 && spec->specifier == THISCLASS)
4398 {
4399 spec->type = 1;
4400 spec->name = ReplaceThisClass(_class);
4401 spec->symbol = FindClass(spec->name);
4402 }
4403 }
4404 }
4405 }
4406
4407 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4408
4409 struct __ecereNameSpace__ecere__com__GlobalFunction
4410 {
4411 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4412 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4413 char *  name;
4414 int (*  function)();
4415 struct __ecereNameSpace__ecere__com__Instance * module;
4416 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
4417 char *  dataTypeString;
4418 struct Type * dataType;
4419 void *  symbol;
4420 } __attribute__ ((gcc_struct));
4421
4422 extern struct Context * globalContext;
4423
4424 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4425
4426 struct FunctionImport
4427 {
4428 struct FunctionImport * prev;
4429 struct FunctionImport * next;
4430 char *  name;
4431 } __attribute__ ((gcc_struct));
4432
4433 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4434 {
4435 struct Symbol * symbol = function->symbol;
4436
4437 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4438 {
4439 unsigned int imported = 0x0;
4440 unsigned int dllImport = 0x0;
4441
4442 if(!function->dataType)
4443 {
4444 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4445 if(!function->dataType->thisClass)
4446 function->dataType->staticMethod = 0x1;
4447 }
4448 if(inCompiler)
4449 {
4450 if(!symbol)
4451 {
4452 struct ModuleImport * module = FindModule(function->module);
4453
4454 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4455 if(module->name)
4456 {
4457 if(!function->dataType->dllExport)
4458 {
4459 symbol->_import = (struct ClassImport *)__extension__ ({
4460 struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
4461
4462 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
4463 });
4464 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4465 }
4466 }
4467 {
4468 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4469 if(!symbol->type->thisClass)
4470 symbol->type->staticMethod = 0x1;
4471 }
4472 }
4473 imported = symbol->_import ? 0x1 : 0x0;
4474 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1)
4475 dllImport = 0x1;
4476 }
4477 DeclareType(function->dataType, 0x1, 0x1);
4478 if(inCompiler)
4479 {
4480 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4481 {
4482 struct Declaration * decl;
4483 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4484 struct Declarator * d;
4485 struct Declarator * funcDecl;
4486 struct External * external;
4487
4488 specifiers = MkList();
4489 declarators = MkList();
4490 ListAdd(specifiers, MkSpecifier(EXTERN));
4491 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4492 if(dllImport)
4493 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4494 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4495 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType == 1)
4496 {
4497 struct Specifier * spec;
4498
4499 for(spec = (*specifiers).first; spec; spec = spec->next)
4500 if(spec->type == 5 && spec->extDecl && spec->extDecl->type == 0 && !strcmp(spec->extDecl->s, "dllexport"))
4501 {
4502 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4503 FreeSpecifier(spec);
4504 break;
4505 }
4506 }
4507 funcDecl = GetFuncDecl(d);
4508 if(funcDecl && !funcDecl->function.parameters)
4509 {
4510 funcDecl->function.parameters = MkList();
4511 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4512 }
4513 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4514 {
4515 struct Context * oldCtx = curContext;
4516
4517 curContext = globalContext;
4518 decl = MkDeclaration(specifiers, declarators);
4519 curContext = oldCtx;
4520 }
4521 if(symbol->pointerExternal)
4522 {
4523 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4524
4525 {
4526 *functionSymbol = *symbol;
4527 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4528 if(functionSymbol->type)
4529 functionSymbol->type->refCount++;
4530 }
4531 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4532 symbol->pointerExternal->symbol = functionSymbol;
4533 }
4534 external = MkExternalDeclaration(decl);
4535 if(curExternal)
4536 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4537 external->symbol = symbol;
4538 symbol->pointerExternal = external;
4539 }
4540 else
4541 {
4542 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4543 }
4544 if(curExternal)
4545 symbol->id = curExternal->symbol->idCode;
4546 }
4547 }
4548 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1) ? 0x1 : 0x0;
4549 }
4550
4551 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4552
4553 struct GlobalData
4554 {
4555 uintptr_t key;
4556 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4557 struct __ecereNameSpace__ecere__sys__BTNode * left;
4558 struct __ecereNameSpace__ecere__sys__BTNode * right;
4559 int depth;
4560 struct __ecereNameSpace__ecere__com__Instance * module;
4561 char *  dataTypeString;
4562 struct Type * dataType;
4563 void *  symbol;
4564 char *  fullName;
4565 } __attribute__ ((gcc_struct));
4566
4567 void DeclareGlobalData(struct GlobalData * data)
4568 {
4569 struct Symbol * symbol = data->symbol;
4570
4571 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4572 {
4573 if(inCompiler)
4574 {
4575 if(!symbol)
4576 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4577 }
4578 if(!data->dataType)
4579 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4580 DeclareType(data->dataType, 0x1, 0x1);
4581 if(inCompiler)
4582 {
4583 if(!symbol->pointerExternal)
4584 {
4585 struct Declaration * decl;
4586 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4587 struct Declarator * d;
4588 struct External * external;
4589
4590 specifiers = MkList();
4591 declarators = MkList();
4592 ListAdd(specifiers, MkSpecifier(EXTERN));
4593 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4594 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4595 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4596 decl = MkDeclaration(specifiers, declarators);
4597 external = MkExternalDeclaration(decl);
4598 if(curExternal)
4599 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4600 external->symbol = symbol;
4601 symbol->pointerExternal = external;
4602 }
4603 else
4604 {
4605 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4606 }
4607 if(curExternal)
4608 symbol->id = curExternal->symbol->idCode;
4609 }
4610 }
4611 }
4612
4613 struct Conversion
4614 {
4615 struct Conversion * prev, * next;
4616 struct __ecereNameSpace__ecere__com__Property * convert;
4617 unsigned int isGet;
4618 struct Type * resultType;
4619 } __attribute__ ((gcc_struct));
4620
4621 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4622
4623 extern void Compiler_Warning(char *  format, ...);
4624
4625 void PrintType(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
4626
4627 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)
4628 {
4629 if(source && dest)
4630 {
4631 if(source->kind == 20 && dest->kind != 20)
4632 {
4633 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4634
4635 if(type)
4636 source = type;
4637 }
4638 if(dest->kind == 20 && source->kind != 20)
4639 {
4640 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4641
4642 if(type)
4643 dest = type;
4644 }
4645 if(dest->classObjectType == 2)
4646 {
4647 if(source->classObjectType != 3)
4648 return 0x1;
4649 else
4650 {
4651 if((dest->_class && strcmp(dest->_class->string, "class")) || (source->_class && strcmp(source->_class->string, "class")))
4652 {
4653 return 0x1;
4654 }
4655 }
4656 }
4657 else
4658 {
4659 if(source->classObjectType == 3)
4660 return 0x1;
4661 if(dest->classObjectType == 3 && source->classObjectType != 2)
4662 return 0x1;
4663 }
4664 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4665 {
4666 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4667 return 0x1;
4668 }
4669 if(dest->kind == 14 && source->kind != 0)
4670 return 0x1;
4671 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))
4672 return 0x1;
4673 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))
4674 return 0x1;
4675 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4676 {
4677 if(source->_class->registered && source->_class->registered->type == 3)
4678 {
4679 if(conversions != (((void *)0)))
4680 {
4681 if(source->_class->registered == dest->_class->registered)
4682 return 0x1;
4683 }
4684 else
4685 {
4686 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4687
4688 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4689 ;
4690 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4691 ;
4692 if(sourceBase == destBase)
4693 return 0x1;
4694 }
4695 }
4696 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))
4697 return 0x1;
4698 else
4699 {
4700 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))
4701 {
4702 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4703 {
4704 return 0x1;
4705 }
4706 }
4707 }
4708 }
4709 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
4710 return 0x1;
4711 if(doConversion)
4712 {
4713 if(source->kind == 8)
4714 {
4715 struct __ecereNameSpace__ecere__com__Class * _class;
4716
4717 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4718 {
4719 struct __ecereNameSpace__ecere__com__Property * convert;
4720
4721 for(convert = _class->conversions.first; convert; convert = convert->next)
4722 {
4723 if(convert->memberAccess == 1 || _class->module == privateModule)
4724 {
4725 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4726
4727 if(!convert->dataType)
4728 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4729 if(MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x0, 0x1, 0x0, 0x1))
4730 {
4731 if(!conversions && !convert->Get)
4732 return 0x1;
4733 else if(conversions != (((void *)0)))
4734 {
4735 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))
4736 return 0x1;
4737 else
4738 {
4739 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4740
4741 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4742 return 0x1;
4743 }
4744 }
4745 }
4746 }
4747 }
4748 }
4749 }
4750 if(dest->kind == 8)
4751 {
4752 struct __ecereNameSpace__ecere__com__Class * _class;
4753
4754 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4755 {
4756 struct __ecereNameSpace__ecere__com__Property * convert;
4757
4758 for(convert = _class->conversions.first; convert; convert = convert->next)
4759 {
4760 if(convert->memberAccess == 1 || _class->module == privateModule)
4761 {
4762 if(!convert->dataType)
4763 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4764 if(convert->dataType != dest && MatchTypes(source, convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1))
4765 {
4766 if(!conversions && !convert->Set)
4767 return 0x1;
4768 else if(conversions != (((void *)0)))
4769 {
4770 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))
4771 return 0x1;
4772 else
4773 {
4774 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4775
4776 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4777 return 0x1;
4778 }
4779 }
4780 }
4781 }
4782 }
4783 }
4784 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
4785 {
4786 if(!dest->_class->registered->dataType)
4787 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
4788 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
4789 {
4790 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4791 {
4792 return 0x1;
4793 }
4794 }
4795 }
4796 }
4797 if(source->kind == 8)
4798 {
4799 struct __ecereNameSpace__ecere__com__Class * _class;
4800
4801 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4802 {
4803 struct __ecereNameSpace__ecere__com__Property * convert;
4804
4805 for(convert = _class->conversions.first; convert; convert = convert->next)
4806 {
4807 if(convert->memberAccess == 1 || _class->module == privateModule)
4808 {
4809 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4810
4811 if(!convert->dataType)
4812 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4813 if(convert->dataType != source && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x1))
4814 {
4815 if(!conversions && !convert->Get)
4816 return 0x1;
4817 else if(conversions != (((void *)0)))
4818 {
4819 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))
4820 return 0x1;
4821 else
4822 {
4823 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4824
4825 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4826 return 0x1;
4827 }
4828 }
4829 }
4830 }
4831 }
4832 }
4833 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
4834 {
4835 if(!source->_class->registered->dataType)
4836 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
4837 if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4838 {
4839 return 0x1;
4840 }
4841 }
4842 }
4843 }
4844 if(source->kind == 8 || source->kind == 19)
4845 ;
4846 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
4847 return 0x1;
4848 else if(dest->kind == 7 && source->kind == 6)
4849 return 0x1;
4850 else if(dest->kind == 2 && (source->kind == 1 || source->kind == 24))
4851 return 0x1;
4852 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 23))
4853 return 0x1;
4854 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 22 || source->kind == 23))
4855 return 0x1;
4856 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 23 || source->kind == 4))
4857 return 0x1;
4858 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 4 || source->kind == 22))
4859 return 0x1;
4860 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))
4861 return 0x1;
4862 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))
4863 return 0x1;
4864 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)))
4865 {
4866 struct Type * paramSource, * paramDest;
4867
4868 if(dest->kind == 16)
4869 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
4870 if(source->kind == 16)
4871 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
4872 if(dest->kind == 13 && dest->type->kind == 11)
4873 dest = dest->type;
4874 if(source->kind == 13 && source->type->kind == 11)
4875 source = source->type;
4876 if(dest->kind == 16)
4877 dest = dest->method->dataType;
4878 if(source->kind == 16)
4879 source = source->method->dataType;
4880 paramSource = source->params.first;
4881 if(paramSource && paramSource->kind == 0)
4882 paramSource = (((void *)0));
4883 paramDest = dest->params.first;
4884 if(paramDest && paramDest->kind == 0)
4885 paramDest = (((void *)0));
4886 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
4887 {
4888 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))))
4889 {
4890 if(paramDest && paramDest->kind == 8)
4891 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), paramDest->_class->string);
4892 else
4893 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class should not take an object\n", (((void *)0))));
4894 return 0x0;
4895 }
4896 paramDest = paramDest->next;
4897 }
4898 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
4899 {
4900 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
4901 {
4902 if(dest->thisClass)
4903 {
4904 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
4905 {
4906 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4907 return 0x0;
4908 }
4909 }
4910 else
4911 {
4912 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
4913 {
4914 if(owningClassDest)
4915 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
4916 else
4917 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "overriding class expected to be derived from method class\n", (((void *)0))));
4918 return 0x0;
4919 }
4920 }
4921 paramSource = paramSource->next;
4922 }
4923 else
4924 {
4925 if(dest->thisClass)
4926 {
4927 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
4928 {
4929 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4930 return 0x0;
4931 }
4932 }
4933 else
4934 {
4935 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
4936 {
4937 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), source->thisClass->registered->fullName);
4938 return 0x0;
4939 }
4940 }
4941 }
4942 }
4943 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4944 {
4945 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible return type for function\n", (((void *)0))));
4946 return 0x0;
4947 }
4948 for(; paramDest; paramDest = paramDest->next)
4949 {
4950 if(!paramSource)
4951 {
4952 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "not enough parameters\n", (((void *)0))));
4953 return 0x0;
4954 }
4955 {
4956 struct Type * paramDestType = paramDest;
4957 struct Type * paramSourceType = paramSource;
4958 struct Type * type = paramDestType;
4959
4960 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
4961 {
4962 int id = 0;
4963 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4964 struct __ecereNameSpace__ecere__com__Class * sClass;
4965
4966 for(sClass = owningClassSource; sClass; sClass = sClass->base)
4967 {
4968 id = 0;
4969 if(sClass->templateClass)
4970 sClass = sClass->templateClass;
4971 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4972 {
4973 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
4974 {
4975 for(sClass = sClass->base; sClass; sClass = sClass->base)
4976 {
4977 if(sClass->templateClass)
4978 sClass = sClass->templateClass;
4979 id += sClass->templateParams.count;
4980 }
4981 break;
4982 }
4983 id++;
4984 }
4985 if(curParam)
4986 break;
4987 }
4988 if(curParam)
4989 {
4990 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
4991
4992 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
4993 }
4994 }
4995 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)))
4996 {
4997 char type[1024];
4998
4999 type[0] = (char)0;
5000 PrintType(paramDest, type, 0x0, 0x1);
5001 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
5002 if(paramDestType != paramDest)
5003 FreeType(paramDestType);
5004 return 0x0;
5005 }
5006 if(paramDestType != paramDest)
5007 FreeType(paramDestType);
5008 }
5009 paramSource = paramSource->next;
5010 }
5011 if(paramSource)
5012 {
5013 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many parameters\n", (((void *)0))));
5014 return 0x0;
5015 }
5016 return 0x1;
5017 }
5018 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
5019 {
5020 return 0x1;
5021 }
5022 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
5023 {
5024 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5025 return 0x1;
5026 }
5027 }
5028 return 0x0;
5029 }
5030
5031 static void FreeConvert(struct Conversion * convert)
5032 {
5033 if(convert->resultType)
5034 FreeType(convert->resultType);
5035 }
5036
5037 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
5038
5039 struct __ecereNameSpace__ecere__com__BTNamedLink
5040 {
5041 char *  name;
5042 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
5043 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
5044 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
5045 int depth;
5046 void *  data;
5047 } __attribute__ ((gcc_struct));
5048
5049 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
5050
5051 struct __ecereNameSpace__ecere__com__EnumClassData
5052 {
5053 struct __ecereNameSpace__ecere__sys__OldList values;
5054 int largest;
5055 } __attribute__ ((gcc_struct));
5056
5057 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
5058
5059 struct __ecereNameSpace__ecere__sys__NamedLink
5060 {
5061 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
5062 struct __ecereNameSpace__ecere__sys__NamedLink * next;
5063 char *  name;
5064 void *  data;
5065 } __attribute__ ((gcc_struct));
5066
5067 extern void FreeExpContents(struct Expression * exp);
5068
5069 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
5070
5071 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
5072
5073 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
5074
5075 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
5076
5077 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (*  freeFn)(void * ));
5078
5079 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5080 {
5081 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
5082
5083 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)))
5084 {
5085 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
5086
5087 if(_class->type == 4)
5088 {
5089 struct __ecereNameSpace__ecere__sys__OldList converts = 
5090 {
5091 0, 0, 0, 0, 0
5092 };
5093 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5094
5095 type->kind = 8;
5096 if(!_class->symbol)
5097 _class->symbol = FindClass(_class->fullName);
5098 type->_class = _class->symbol;
5099 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0))
5100 {
5101 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5102 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5103
5104 if(enumClass)
5105 {
5106 struct __ecereNameSpace__ecere__com__Class * baseClass;
5107
5108 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
5109 {
5110 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
5111
5112 for(value = e->values.first; value; value = value->next)
5113 {
5114 if(!strcmp(value->name, string))
5115 break;
5116 }
5117 if(value)
5118 {
5119 FreeExpContents(sourceExp);
5120 FreeType(sourceExp->expType);
5121 sourceExp->isConstant = 0x1;
5122 sourceExp->expType = MkClassType(baseClass->fullName);
5123 {
5124 char constant[256];
5125
5126 sourceExp->type = 2;
5127 if(!strcmp(baseClass->dataTypeString, "int"))
5128 sprintf(constant, "%d", (int)value->data);
5129 else
5130 sprintf(constant, "0x%X", (int)value->data);
5131 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5132 }
5133 while(converts.first)
5134 {
5135 struct Conversion * convert = converts.first;
5136
5137 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
5138 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5139 }
5140 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5141 return 0x1;
5142 }
5143 }
5144 }
5145 }
5146 if(converts.first)
5147 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
5148 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5149 }
5150 }
5151 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)))
5152 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5153 return 0x1;
5154 return 0x0;
5155 }
5156
5157 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5158
5159 struct __ecereNameSpace__ecere__com__SubModule
5160 {
5161 struct __ecereNameSpace__ecere__com__SubModule * prev;
5162 struct __ecereNameSpace__ecere__com__SubModule * next;
5163 struct __ecereNameSpace__ecere__com__Instance * module;
5164 int importMode;
5165 } __attribute__ ((gcc_struct));
5166
5167 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5168 {
5169 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5170
5171 if(searchFor == searchIn)
5172 return 0x1;
5173 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
5174 {
5175 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->application)
5176 {
5177 if(ModuleVisibility(subModule->module, searchFor))
5178 return 0x1;
5179 }
5180 }
5181 return 0x0;
5182 }
5183
5184 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5185
5186 struct __ecereNameSpace__ecere__com__Application
5187 {
5188 int argc;
5189 char * *  argv;
5190 int exitCode;
5191 unsigned int isGUIApp;
5192 struct __ecereNameSpace__ecere__sys__OldList allModules;
5193 char *  parsedCommand;
5194 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5195 } __attribute__ ((gcc_struct));
5196
5197 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5198 {
5199 struct __ecereNameSpace__ecere__com__Instance * module;
5200
5201 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))
5202 return 0x1;
5203 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))
5204 return 0x1;
5205 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))
5206 return 0x1;
5207 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)
5208 {
5209 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5210 return 0x1;
5211 }
5212 return 0x0;
5213 }
5214
5215 extern unsigned long strtoul(const char *  nptr, char * *  endptr, int base);
5216
5217 void ReadString(char *  output, char *  string);
5218
5219 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5220
5221 extern struct TypeName * QMkClass(char *  spec, struct Declarator * decl);
5222
5223 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5224
5225 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
5226 {
5227 struct Type * source = sourceExp->expType;
5228 struct Type * realDest = dest;
5229 struct Type * backupSourceExpType = (((void *)0));
5230
5231 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
5232 return 0x1;
5233 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5234 {
5235 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
5236 {
5237 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5238
5239 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5240 ;
5241 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5242 ;
5243 if(sourceBase == destBase)
5244 return 0x1;
5245 }
5246 }
5247 if(source)
5248 {
5249 struct __ecereNameSpace__ecere__sys__OldList * specs;
5250 unsigned int flag = 0x0;
5251 long long value = (((int)0x7fffffff));
5252
5253 source->refCount++;
5254 dest->refCount++;
5255 if(sourceExp->type == 2)
5256 {
5257 if(source->isSigned)
5258 value = strtoll(sourceExp->constant, (((void *)0)), 0);
5259 else
5260 value = strtoull(sourceExp->constant, (((void *)0)), 0);
5261 }
5262 else if(sourceExp->type == 4 && sourceExp->op.op == '-' && !sourceExp->op.exp1 && sourceExp->op.exp2 && sourceExp->op.exp2->type == 2)
5263 {
5264 if(source->isSigned)
5265 value = -strtoll(sourceExp->op.exp2->constant, (((void *)0)), 0);
5266 else
5267 value = -strtoull(sourceExp->op.exp2->constant, (((void *)0)), 0);
5268 }
5269 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
5270 {
5271 FreeType(source);
5272 source = __extension__ ({
5273 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5274
5275 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0x0, __ecereInstance1->refCount = 1, __ecereInstance1;
5276 });
5277 }
5278 if(dest->kind == 8)
5279 {
5280 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5281
5282 if(_class && _class->type == 3)
5283 {
5284 if(source->kind != 8)
5285 {
5286 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5287 struct Type * tempDest, * tempSource;
5288
5289 for(; _class->base->type != 1000; _class = _class->base)
5290 ;
5291 tempSource = dest;
5292 tempDest = tempType;
5293 tempType->kind = 8;
5294 if(!_class->symbol)
5295 _class->symbol = FindClass(_class->fullName);
5296 tempType->_class = _class->symbol;
5297 tempType->truth = dest->truth;
5298 if(tempType->_class)
5299 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5300 backupSourceExpType = sourceExp->expType;
5301 sourceExp->expType = dest;
5302 dest->refCount++;
5303 flag = 0x1;
5304 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5305 }
5306 }
5307 if(_class && _class->type == 2 && source->kind != 8)
5308 {
5309 if(!dest->_class->registered->dataType)
5310 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5311 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5312 {
5313 FreeType(source);
5314 FreeType(sourceExp->expType);
5315 source = sourceExp->expType = MkClassType(dest->_class->string);
5316 source->refCount++;
5317 }
5318 }
5319 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5320 {
5321 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5322 struct Declarator * decl;
5323 char string[1024];
5324
5325 ReadString(string, sourceExp->string);
5326 decl = SpecDeclFromString(string, specs, (((void *)0)));
5327 FreeExpContents(sourceExp);
5328 FreeType(sourceExp->expType);
5329 sourceExp->type = 26;
5330 sourceExp->_classExp.specifiers = specs;
5331 sourceExp->_classExp.decl = decl;
5332 sourceExp->expType = dest;
5333 dest->refCount++;
5334 FreeType(source);
5335 FreeType(dest);
5336 if(backupSourceExpType)
5337 FreeType(backupSourceExpType);
5338 return 0x1;
5339 }
5340 }
5341 else if(source->kind == 8)
5342 {
5343 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5344
5345 if(_class && (_class->type == 3 || !strcmp(_class->fullName, "bool") || _class->type == 2))
5346 {
5347 if(dest->kind != 8)
5348 {
5349 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5350 struct Type * tempDest, * tempSource;
5351
5352 if(!source->_class->registered->dataType)
5353 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5354 for(; _class->base->type != 1000; _class = _class->base)
5355 ;
5356 tempDest = source;
5357 tempSource = tempType;
5358 tempType->kind = 8;
5359 tempType->_class = FindClass(_class->fullName);
5360 tempType->truth = source->truth;
5361 tempType->classObjectType = source->classObjectType;
5362 if(tempType->_class)
5363 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5364 if(conversions->last)
5365 {
5366 ((struct Conversion *)conversions->last)->resultType = dest;
5367 dest->refCount++;
5368 }
5369 FreeType(sourceExp->expType);
5370 sourceExp->expType = MkClassType(_class->fullName);
5371 sourceExp->expType->truth = source->truth;
5372 sourceExp->expType->classObjectType = source->classObjectType;
5373 if(!sourceExp->destType)
5374 {
5375 FreeType(sourceExp->destType);
5376 sourceExp->destType = sourceExp->expType;
5377 if(sourceExp->expType)
5378 sourceExp->expType->refCount++;
5379 }
5380 if(!_class->dataType)
5381 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5382 FreeType(dest);
5383 dest = MkClassType(source->_class->string);
5384 dest->truth = source->truth;
5385 dest->classObjectType = source->classObjectType;
5386 FreeType(source);
5387 source = _class->dataType;
5388 source->refCount++;
5389 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5390 }
5391 }
5392 }
5393 if(!flag)
5394 {
5395 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5396 {
5397 FreeType(source);
5398 FreeType(dest);
5399 return 0x1;
5400 }
5401 }
5402 if(dest->kind == 8)
5403 {
5404 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5405
5406 if(_class && !dest->truth && (_class->type == 3 || !strcmp(_class->fullName, "bool") || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5407 {
5408 if(_class->type == 0 || _class->type == 5)
5409 {
5410 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5411
5412 *newExp = *sourceExp;
5413 if(sourceExp->destType)
5414 sourceExp->destType->refCount++;
5415 if(sourceExp->expType)
5416 sourceExp->expType->refCount++;
5417 sourceExp->type = 11;
5418 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5419 sourceExp->cast.exp = newExp;
5420 FreeType(sourceExp->expType);
5421 sourceExp->expType = (((void *)0));
5422 ProcessExpressionType(sourceExp);
5423 if(!inCompiler)
5424 {
5425 FreeType(sourceExp->expType);
5426 sourceExp->expType = dest;
5427 }
5428 FreeType(source);
5429 if(inCompiler)
5430 FreeType(dest);
5431 if(backupSourceExpType)
5432 FreeType(backupSourceExpType);
5433 return 0x1;
5434 }
5435 if(!_class->dataType)
5436 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5437 FreeType(dest);
5438 dest = _class->dataType;
5439 dest->refCount++;
5440 }
5441 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))
5442 {
5443 specs = MkListOne(MkSpecifier(DOUBLE));
5444 }
5445 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))
5446 {
5447 specs = MkListOne(MkSpecifier(FLOAT));
5448 }
5449 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))
5450 {
5451 specs = MkList();
5452 if(!dest->isSigned)
5453 ListAdd(specs, MkSpecifier(UNSIGNED));
5454 ListAdd(specs, MkSpecifier(INT64));
5455 }
5456 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
5457 {
5458 specs = MkList();
5459 if(!dest->isSigned)
5460 ListAdd(specs, MkSpecifier(UNSIGNED));
5461 ListAdd(specs, MkSpecifier(INT));
5462 }
5463 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5464 {
5465 specs = MkList();
5466 if(!dest->isSigned)
5467 ListAdd(specs, MkSpecifier(UNSIGNED));
5468 ListAdd(specs, MkSpecifier(SHORT));
5469 }
5470 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 24 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5471 {
5472 specs = MkList();
5473 if(!dest->isSigned)
5474 ListAdd(specs, MkSpecifier(UNSIGNED));
5475 ListAdd(specs, MkSpecifier(CHAR));
5476 }
5477 else
5478 {
5479 FreeType(source);
5480 FreeType(dest);
5481 if(backupSourceExpType)
5482 {
5483 if(sourceExp->expType)
5484 FreeType(sourceExp->expType);
5485 sourceExp->expType = backupSourceExpType;
5486 }
5487 return 0x0;
5488 }
5489 }
5490 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))
5491 {
5492 specs = MkListOne(MkSpecifier(DOUBLE));
5493 }
5494 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))
5495 {
5496 specs = MkListOne(MkSpecifier(FLOAT));
5497 }
5498 else if(dest->kind == 24 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (value == 1 || value == 0))
5499 {
5500 specs = MkList();
5501 ListAdd(specs, MkSpecifier(BOOL));
5502 }
5503 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)))
5504 {
5505 specs = MkList();
5506 if(!dest->isSigned)
5507 ListAdd(specs, MkSpecifier(UNSIGNED));
5508 ListAdd(specs, MkSpecifier(CHAR));
5509 }
5510 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)))))
5511 {
5512 specs = MkList();
5513 if(!dest->isSigned)
5514 ListAdd(specs, MkSpecifier(UNSIGNED));
5515 ListAdd(specs, MkSpecifier(SHORT));
5516 }
5517 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3))
5518 {
5519 specs = MkList();
5520 if(!dest->isSigned)
5521 ListAdd(specs, MkSpecifier(UNSIGNED));
5522 ListAdd(specs, MkSpecifier(INT));
5523 }
5524 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5525 {
5526 specs = MkList();
5527 if(!dest->isSigned)
5528 ListAdd(specs, MkSpecifier(UNSIGNED));
5529 ListAdd(specs, MkSpecifier(INT64));
5530 }
5531 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
5532 {
5533 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5534 }
5535 else
5536 {
5537 FreeType(source);
5538 FreeType(dest);
5539 if(backupSourceExpType)
5540 {
5541 if(sourceExp->expType)
5542 FreeType(sourceExp->expType);
5543 sourceExp->expType = backupSourceExpType;
5544 }
5545 return 0x0;
5546 }
5547 if(!flag)
5548 {
5549 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5550
5551 *newExp = *sourceExp;
5552 newExp->prev = (((void *)0));
5553 newExp->next = (((void *)0));
5554 if(sourceExp->destType)
5555 sourceExp->destType->refCount++;
5556 if(sourceExp->expType)
5557 sourceExp->expType->refCount++;
5558 sourceExp->type = 11;
5559 if(realDest->kind == 8)
5560 {
5561 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5562 FreeList(specs, FreeSpecifier);
5563 }
5564 else
5565 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5566 if(newExp->type == 4)
5567 {
5568 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5569 }
5570 else
5571 sourceExp->cast.exp = newExp;
5572 FreeType(sourceExp->expType);
5573 sourceExp->expType = (((void *)0));
5574 ProcessExpressionType(sourceExp);
5575 }
5576 else
5577 FreeList(specs, FreeSpecifier);
5578 FreeType(dest);
5579 FreeType(source);
5580 if(backupSourceExpType)
5581 FreeType(backupSourceExpType);
5582 return 0x1;
5583 }
5584 else
5585 {
5586 while((sourceExp->type == 5 || sourceExp->type == 34) && sourceExp->list)
5587 sourceExp = (*sourceExp->list).last;
5588 if(sourceExp->type == 0)
5589 {
5590 struct Identifier * id = sourceExp->identifier;
5591
5592 if(dest->kind == 8)
5593 {
5594 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5595 {
5596 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5597 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5598
5599 if(enumClass)
5600 {
5601 for(; _class && _class->type == 4; _class = _class->base)
5602 {
5603 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5604 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5605
5606 for(value = e->values.first; value; value = value->next)
5607 {
5608 if(!strcmp(value->name, id->string))
5609 break;
5610 }
5611 if(value)
5612 {
5613 FreeExpContents(sourceExp);
5614 FreeType(sourceExp->expType);
5615 sourceExp->isConstant = 0x1;
5616 sourceExp->expType = MkClassType(_class->fullName);
5617 {
5618 char constant[256];
5619
5620 sourceExp->type = 2;
5621 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5622 sprintf(constant, "%d", (int)value->data);
5623 else
5624 sprintf(constant, "0x%X", (int)value->data);
5625 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5626 }
5627 return 0x1;
5628 }
5629 }
5630 }
5631 }
5632 }
5633 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5634 return 0x1;
5635 }
5636 }
5637 return 0x0;
5638 }
5639
5640 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5641 {
5642 int value2 = op2->i;
5643
5644 exp->type = 2;
5645 exp->string = PrintInt(op1->i + value2);
5646 if(!exp->expType)
5647 {
5648 exp->expType = op1->type;
5649 if(op1->type)
5650 op1->type->refCount++;
5651 }
5652 return 0x1;
5653 }
5654
5655 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5656 {
5657 unsigned int value2 = op2->ui;
5658
5659 exp->type = 2;
5660 exp->string = PrintUInt(op1->ui + value2);
5661 if(!exp->expType)
5662 {
5663 exp->expType = op1->type;
5664 if(op1->type)
5665 op1->type->refCount++;
5666 }
5667 return 0x1;
5668 }
5669
5670 static unsigned int Int64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5671 {
5672 int value2 = op2->i;
5673
5674 exp->type = 2;
5675 exp->string = PrintInt64(op1->i + value2);
5676 if(!exp->expType)
5677 {
5678 exp->expType = op1->type;
5679 if(op1->type)
5680 op1->type->refCount++;
5681 }
5682 return 0x1;
5683 }
5684
5685 static unsigned int UInt64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5686 {
5687 unsigned int value2 = op2->ui;
5688
5689 exp->type = 2;
5690 exp->string = PrintUInt64(op1->ui + value2);
5691 if(!exp->expType)
5692 {
5693 exp->expType = op1->type;
5694 if(op1->type)
5695 op1->type->refCount++;
5696 }
5697 return 0x1;
5698 }
5699
5700 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5701 {
5702 short value2 = op2->s;
5703
5704 exp->type = 2;
5705 exp->string = PrintShort(op1->s + value2);
5706 if(!exp->expType)
5707 {
5708 exp->expType = op1->type;
5709 if(op1->type)
5710 op1->type->refCount++;
5711 }
5712 return 0x1;
5713 }
5714
5715 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5716 {
5717 unsigned short value2 = op2->us;
5718
5719 exp->type = 2;
5720 exp->string = PrintUShort(op1->us + value2);
5721 if(!exp->expType)
5722 {
5723 exp->expType = op1->type;
5724 if(op1->type)
5725 op1->type->refCount++;
5726 }
5727 return 0x1;
5728 }
5729
5730 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5731 {
5732 char value2 = op2->c;
5733
5734 exp->type = 2;
5735 exp->string = PrintChar(op1->c + value2);
5736 if(!exp->expType)
5737 {
5738 exp->expType = op1->type;
5739 if(op1->type)
5740 op1->type->refCount++;
5741 }
5742 return 0x1;
5743 }
5744
5745 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5746 {
5747 unsigned char value2 = op2->uc;
5748
5749 exp->type = 2;
5750 exp->string = PrintUChar(op1->uc + value2);
5751 if(!exp->expType)
5752 {
5753 exp->expType = op1->type;
5754 if(op1->type)
5755 op1->type->refCount++;
5756 }
5757 return 0x1;
5758 }
5759
5760 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5761 {
5762 float value2 = op2->f;
5763
5764 exp->type = 2;
5765 exp->string = PrintFloat(op1->f + value2);
5766 if(!exp->expType)
5767 {
5768 exp->expType = op1->type;
5769 if(op1->type)
5770 op1->type->refCount++;
5771 }
5772 return 0x1;
5773 }
5774
5775 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5776 {
5777 double value2 = op2->d;
5778
5779 exp->type = 2;
5780 exp->string = PrintDouble(op1->d + value2);
5781 if(!exp->expType)
5782 {
5783 exp->expType = op1->type;
5784 if(op1->type)
5785 op1->type->refCount++;
5786 }
5787 return 0x1;
5788 }
5789
5790 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5791 {
5792 int value2 = op2->i;
5793
5794 exp->type = 2;
5795 exp->string = PrintInt(op1->i - value2);
5796 if(!exp->expType)
5797 {
5798 exp->expType = op1->type;
5799 if(op1->type)
5800 op1->type->refCount++;
5801 }
5802 return 0x1;
5803 }
5804
5805 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5806 {
5807 unsigned int value2 = op2->ui;
5808
5809 exp->type = 2;
5810 exp->string = PrintUInt(op1->ui - value2);
5811 if(!exp->expType)
5812 {
5813 exp->expType = op1->type;
5814 if(op1->type)
5815 op1->type->refCount++;
5816 }
5817 return 0x1;
5818 }
5819
5820 static unsigned int Int64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5821 {
5822 int value2 = op2->i;
5823
5824 exp->type = 2;
5825 exp->string = PrintInt64(op1->i - value2);
5826 if(!exp->expType)
5827 {
5828 exp->expType = op1->type;
5829 if(op1->type)
5830 op1->type->refCount++;
5831 }
5832 return 0x1;
5833 }
5834
5835 static unsigned int UInt64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5836 {
5837 unsigned int value2 = op2->ui;
5838
5839 exp->type = 2;
5840 exp->string = PrintUInt64(op1->ui - value2);
5841 if(!exp->expType)
5842 {
5843 exp->expType = op1->type;
5844 if(op1->type)
5845 op1->type->refCount++;
5846 }
5847 return 0x1;
5848 }
5849
5850 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5851 {
5852 short value2 = op2->s;
5853
5854 exp->type = 2;
5855 exp->string = PrintShort(op1->s - value2);
5856 if(!exp->expType)
5857 {
5858 exp->expType = op1->type;
5859 if(op1->type)
5860 op1->type->refCount++;
5861 }
5862 return 0x1;
5863 }
5864
5865 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5866 {
5867 unsigned short value2 = op2->us;
5868
5869 exp->type = 2;
5870 exp->string = PrintUShort(op1->us - value2);
5871 if(!exp->expType)
5872 {
5873 exp->expType = op1->type;
5874 if(op1->type)
5875 op1->type->refCount++;
5876 }
5877 return 0x1;
5878 }
5879
5880 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5881 {
5882 char value2 = op2->c;
5883
5884 exp->type = 2;
5885 exp->string = PrintChar(op1->c - value2);
5886 if(!exp->expType)
5887 {
5888 exp->expType = op1->type;
5889 if(op1->type)
5890 op1->type->refCount++;
5891 }
5892 return 0x1;
5893 }
5894
5895 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5896 {
5897 unsigned char value2 = op2->uc;
5898
5899 exp->type = 2;
5900 exp->string = PrintUChar(op1->uc - value2);
5901 if(!exp->expType)
5902 {
5903 exp->expType = op1->type;
5904 if(op1->type)
5905 op1->type->refCount++;
5906 }
5907 return 0x1;
5908 }
5909
5910 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5911 {
5912 float value2 = op2->f;
5913
5914 exp->type = 2;
5915 exp->string = PrintFloat(op1->f - value2);
5916 if(!exp->expType)
5917 {
5918 exp->expType = op1->type;
5919 if(op1->type)
5920 op1->type->refCount++;
5921 }
5922 return 0x1;
5923 }
5924
5925 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5926 {
5927 double value2 = op2->d;
5928
5929 exp->type = 2;
5930 exp->string = PrintDouble(op1->d - value2);
5931 if(!exp->expType)
5932 {
5933 exp->expType = op1->type;
5934 if(op1->type)
5935 op1->type->refCount++;
5936 }
5937 return 0x1;
5938 }
5939
5940 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5941 {
5942 int value2 = op2->i;
5943
5944 exp->type = 2;
5945 exp->string = PrintInt(op1->i * value2);
5946 if(!exp->expType)
5947 {
5948 exp->expType = op1->type;
5949 if(op1->type)
5950 op1->type->refCount++;
5951 }
5952 return 0x1;
5953 }
5954
5955 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5956 {
5957 unsigned int value2 = op2->ui;
5958
5959 exp->type = 2;
5960 exp->string = PrintUInt(op1->ui * value2);
5961 if(!exp->expType)
5962 {
5963 exp->expType = op1->type;
5964 if(op1->type)
5965 op1->type->refCount++;
5966 }
5967 return 0x1;
5968 }
5969
5970 static unsigned int Int64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5971 {
5972 int value2 = op2->i;
5973
5974 exp->type = 2;
5975 exp->string = PrintInt64(op1->i * value2);
5976 if(!exp->expType)
5977 {
5978 exp->expType = op1->type;
5979 if(op1->type)
5980 op1->type->refCount++;
5981 }
5982 return 0x1;
5983 }
5984
5985 static unsigned int UInt64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5986 {
5987 unsigned int value2 = op2->ui;
5988
5989 exp->type = 2;
5990 exp->string = PrintUInt64(op1->ui * value2);
5991 if(!exp->expType)
5992 {
5993 exp->expType = op1->type;
5994 if(op1->type)
5995 op1->type->refCount++;
5996 }
5997 return 0x1;
5998 }
5999
6000 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6001 {
6002 short value2 = op2->s;
6003
6004 exp->type = 2;
6005 exp->string = PrintShort(op1->s * value2);
6006 if(!exp->expType)
6007 {
6008 exp->expType = op1->type;
6009 if(op1->type)
6010 op1->type->refCount++;
6011 }
6012 return 0x1;
6013 }
6014
6015 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6016 {
6017 unsigned short value2 = op2->us;
6018
6019 exp->type = 2;
6020 exp->string = PrintUShort(op1->us * value2);
6021 if(!exp->expType)
6022 {
6023 exp->expType = op1->type;
6024 if(op1->type)
6025 op1->type->refCount++;
6026 }
6027 return 0x1;
6028 }
6029
6030 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6031 {
6032 char value2 = op2->c;
6033
6034 exp->type = 2;
6035 exp->string = PrintChar(op1->c * value2);
6036 if(!exp->expType)
6037 {
6038 exp->expType = op1->type;
6039 if(op1->type)
6040 op1->type->refCount++;
6041 }
6042 return 0x1;
6043 }
6044
6045 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6046 {
6047 unsigned char value2 = op2->uc;
6048
6049 exp->type = 2;
6050 exp->string = PrintUChar(op1->uc * value2);
6051 if(!exp->expType)
6052 {
6053 exp->expType = op1->type;
6054 if(op1->type)
6055 op1->type->refCount++;
6056 }
6057 return 0x1;
6058 }
6059
6060 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6061 {
6062 float value2 = op2->f;
6063
6064 exp->type = 2;
6065 exp->string = PrintFloat(op1->f * value2);
6066 if(!exp->expType)
6067 {
6068 exp->expType = op1->type;
6069 if(op1->type)
6070 op1->type->refCount++;
6071 }
6072 return 0x1;
6073 }
6074
6075 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6076 {
6077 double value2 = op2->d;
6078
6079 exp->type = 2;
6080 exp->string = PrintDouble(op1->d * value2);
6081 if(!exp->expType)
6082 {
6083 exp->expType = op1->type;
6084 if(op1->type)
6085 op1->type->refCount++;
6086 }
6087 return 0x1;
6088 }
6089
6090 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6091 {
6092 int value2 = op2->i;
6093
6094 exp->type = 2;
6095 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
6096 if(!exp->expType)
6097 {
6098 exp->expType = op1->type;
6099 if(op1->type)
6100 op1->type->refCount++;
6101 }
6102 return 0x1;
6103 }
6104
6105 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6106 {
6107 unsigned int value2 = op2->ui;
6108
6109 exp->type = 2;
6110 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
6111 if(!exp->expType)
6112 {
6113 exp->expType = op1->type;
6114 if(op1->type)
6115 op1->type->refCount++;
6116 }
6117 return 0x1;
6118 }
6119
6120 static unsigned int Int64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6121 {
6122 int value2 = op2->i;
6123
6124 exp->type = 2;
6125 exp->string = PrintInt64(value2 ? (op1->i / value2) : 0);
6126 if(!exp->expType)
6127 {
6128 exp->expType = op1->type;
6129 if(op1->type)
6130 op1->type->refCount++;
6131 }
6132 return 0x1;
6133 }
6134
6135 static unsigned int UInt64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6136 {
6137 unsigned int value2 = op2->ui;
6138
6139 exp->type = 2;
6140 exp->string = PrintUInt64(value2 ? (op1->ui / value2) : 0);
6141 if(!exp->expType)
6142 {
6143 exp->expType = op1->type;
6144 if(op1->type)
6145 op1->type->refCount++;
6146 }
6147 return 0x1;
6148 }
6149
6150 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6151 {
6152 short value2 = op2->s;
6153
6154 exp->type = 2;
6155 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
6156 if(!exp->expType)
6157 {
6158 exp->expType = op1->type;
6159 if(op1->type)
6160 op1->type->refCount++;
6161 }
6162 return 0x1;
6163 }
6164
6165 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6166 {
6167 unsigned short value2 = op2->us;
6168
6169 exp->type = 2;
6170 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
6171 if(!exp->expType)
6172 {
6173 exp->expType = op1->type;
6174 if(op1->type)
6175 op1->type->refCount++;
6176 }
6177 return 0x1;
6178 }
6179
6180 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6181 {
6182 char value2 = op2->c;
6183
6184 exp->type = 2;
6185 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
6186 if(!exp->expType)
6187 {
6188 exp->expType = op1->type;
6189 if(op1->type)
6190 op1->type->refCount++;
6191 }
6192 return 0x1;
6193 }
6194
6195 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6196 {
6197 unsigned char value2 = op2->uc;
6198
6199 exp->type = 2;
6200 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
6201 if(!exp->expType)
6202 {
6203 exp->expType = op1->type;
6204 if(op1->type)
6205 op1->type->refCount++;
6206 }
6207 return 0x1;
6208 }
6209
6210 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6211 {
6212 float value2 = op2->f;
6213
6214 exp->type = 2;
6215 exp->string = PrintFloat(value2 ? (op1->f / value2) : 0);
6216 if(!exp->expType)
6217 {
6218 exp->expType = op1->type;
6219 if(op1->type)
6220 op1->type->refCount++;
6221 }
6222 return 0x1;
6223 }
6224
6225 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6226 {
6227 double value2 = op2->d;
6228
6229 exp->type = 2;
6230 exp->string = PrintDouble(value2 ? (op1->d / value2) : 0);
6231 if(!exp->expType)
6232 {
6233 exp->expType = op1->type;
6234 if(op1->type)
6235 op1->type->refCount++;
6236 }
6237 return 0x1;
6238 }
6239
6240 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6241 {
6242 int value2 = op2->i;
6243
6244 exp->type = 2;
6245 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
6246 if(!exp->expType)
6247 {
6248 exp->expType = op1->type;
6249 if(op1->type)
6250 op1->type->refCount++;
6251 }
6252 return 0x1;
6253 }
6254
6255 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6256 {
6257 unsigned int value2 = op2->ui;
6258
6259 exp->type = 2;
6260 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
6261 if(!exp->expType)
6262 {
6263 exp->expType = op1->type;
6264 if(op1->type)
6265 op1->type->refCount++;
6266 }
6267 return 0x1;
6268 }
6269
6270 static unsigned int Int64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6271 {
6272 int value2 = op2->i;
6273
6274 exp->type = 2;
6275 exp->string = PrintInt64(value2 ? (op1->i % value2) : 0);
6276 if(!exp->expType)
6277 {
6278 exp->expType = op1->type;
6279 if(op1->type)
6280 op1->type->refCount++;
6281 }
6282 return 0x1;
6283 }
6284
6285 static unsigned int UInt64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6286 {
6287 unsigned int value2 = op2->ui;
6288
6289 exp->type = 2;
6290 exp->string = PrintUInt64(value2 ? (op1->ui % value2) : 0);
6291 if(!exp->expType)
6292 {
6293 exp->expType = op1->type;
6294 if(op1->type)
6295 op1->type->refCount++;
6296 }
6297 return 0x1;
6298 }
6299
6300 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6301 {
6302 short value2 = op2->s;
6303
6304 exp->type = 2;
6305 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
6306 if(!exp->expType)
6307 {
6308 exp->expType = op1->type;
6309 if(op1->type)
6310 op1->type->refCount++;
6311 }
6312 return 0x1;
6313 }
6314
6315 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6316 {
6317 unsigned short value2 = op2->us;
6318
6319 exp->type = 2;
6320 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
6321 if(!exp->expType)
6322 {
6323 exp->expType = op1->type;
6324 if(op1->type)
6325 op1->type->refCount++;
6326 }
6327 return 0x1;
6328 }
6329
6330 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6331 {
6332 char value2 = op2->c;
6333
6334 exp->type = 2;
6335 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
6336 if(!exp->expType)
6337 {
6338 exp->expType = op1->type;
6339 if(op1->type)
6340 op1->type->refCount++;
6341 }
6342 return 0x1;
6343 }
6344
6345 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6346 {
6347 unsigned char value2 = op2->uc;
6348
6349 exp->type = 2;
6350 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
6351 if(!exp->expType)
6352 {
6353 exp->expType = op1->type;
6354 if(op1->type)
6355 op1->type->refCount++;
6356 }
6357 return 0x1;
6358 }
6359
6360 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6361 {
6362 exp->type = 2;
6363 exp->string = PrintInt((-op1->i));
6364 if(!exp->expType)
6365 {
6366 exp->expType = op1->type;
6367 if(op1->type)
6368 op1->type->refCount++;
6369 }
6370 return 0x1;
6371 }
6372
6373 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6374 {
6375 exp->type = 2;
6376 exp->string = PrintUInt((unsigned int)(-op1->ui));
6377 if(!exp->expType)
6378 {
6379 exp->expType = op1->type;
6380 if(op1->type)
6381 op1->type->refCount++;
6382 }
6383 return 0x1;
6384 }
6385
6386 static unsigned int Int64Neg(struct Expression * exp, struct Operand * op1)
6387 {
6388 exp->type = 2;
6389 exp->string = PrintInt64((-op1->i));
6390 if(!exp->expType)
6391 {
6392 exp->expType = op1->type;
6393 if(op1->type)
6394 op1->type->refCount++;
6395 }
6396 return 0x1;
6397 }
6398
6399 static unsigned int UInt64Neg(struct Expression * exp, struct Operand * op1)
6400 {
6401 exp->type = 2;
6402 exp->string = PrintUInt64((unsigned int)(-op1->ui));
6403 if(!exp->expType)
6404 {
6405 exp->expType = op1->type;
6406 if(op1->type)
6407 op1->type->refCount++;
6408 }
6409 return 0x1;
6410 }
6411
6412 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6413 {
6414 exp->type = 2;
6415 exp->string = PrintShort((-op1->s));
6416 if(!exp->expType)
6417 {
6418 exp->expType = op1->type;
6419 if(op1->type)
6420 op1->type->refCount++;
6421 }
6422 return 0x1;
6423 }
6424
6425 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6426 {
6427 exp->type = 2;
6428 exp->string = PrintUShort((unsigned short)(-op1->us));
6429 if(!exp->expType)
6430 {
6431 exp->expType = op1->type;
6432 if(op1->type)
6433 op1->type->refCount++;
6434 }
6435 return 0x1;
6436 }
6437
6438 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6439 {
6440 exp->type = 2;
6441 exp->string = PrintChar((-op1->c));
6442 if(!exp->expType)
6443 {
6444 exp->expType = op1->type;
6445 if(op1->type)
6446 op1->type->refCount++;
6447 }
6448 return 0x1;
6449 }
6450
6451 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6452 {
6453 exp->type = 2;
6454 exp->string = PrintUChar((unsigned char)(-op1->uc));
6455 if(!exp->expType)
6456 {
6457 exp->expType = op1->type;
6458 if(op1->type)
6459 op1->type->refCount++;
6460 }
6461 return 0x1;
6462 }
6463
6464 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6465 {
6466 exp->type = 2;
6467 exp->string = PrintFloat((float)(-op1->f));
6468 if(!exp->expType)
6469 {
6470 exp->expType = op1->type;
6471 if(op1->type)
6472 op1->type->refCount++;
6473 }
6474 return 0x1;
6475 }
6476
6477 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6478 {
6479 exp->type = 2;
6480 exp->string = PrintDouble((double)(-op1->d));
6481 if(!exp->expType)
6482 {
6483 exp->expType = op1->type;
6484 if(op1->type)
6485 op1->type->refCount++;
6486 }
6487 return 0x1;
6488 }
6489
6490 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6491 {
6492 exp->type = 2;
6493 exp->string = PrintInt((++op1->i));
6494 if(!exp->expType)
6495 {
6496 exp->expType = op1->type;
6497 if(op1->type)
6498 op1->type->refCount++;
6499 }
6500 return 0x1;
6501 }
6502
6503 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6504 {
6505 exp->type = 2;
6506 exp->string = PrintUInt((++op1->ui));
6507 if(!exp->expType)
6508 {
6509 exp->expType = op1->type;
6510 if(op1->type)
6511 op1->type->refCount++;
6512 }
6513 return 0x1;
6514 }
6515
6516 static unsigned int Int64Inc(struct Expression * exp, struct Operand * op1)
6517 {
6518 exp->type = 2;
6519 exp->string = PrintInt64((++op1->i));
6520 if(!exp->expType)
6521 {
6522 exp->expType = op1->type;
6523 if(op1->type)
6524 op1->type->refCount++;
6525 }
6526 return 0x1;
6527 }
6528
6529 static unsigned int UInt64Inc(struct Expression * exp, struct Operand * op1)
6530 {
6531 exp->type = 2;
6532 exp->string = PrintUInt64((++op1->ui));
6533 if(!exp->expType)
6534 {
6535 exp->expType = op1->type;
6536 if(op1->type)
6537 op1->type->refCount++;
6538 }
6539 return 0x1;
6540 }
6541
6542 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6543 {
6544 exp->type = 2;
6545 exp->string = PrintShort((++op1->s));
6546 if(!exp->expType)
6547 {
6548 exp->expType = op1->type;
6549 if(op1->type)
6550 op1->type->refCount++;
6551 }
6552 return 0x1;
6553 }
6554
6555 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6556 {
6557 exp->type = 2;
6558 exp->string = PrintUShort((++op1->us));
6559 if(!exp->expType)
6560 {
6561 exp->expType = op1->type;
6562 if(op1->type)
6563 op1->type->refCount++;
6564 }
6565 return 0x1;
6566 }
6567
6568 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6569 {
6570 exp->type = 2;
6571 exp->string = PrintChar((++op1->c));
6572 if(!exp->expType)
6573 {
6574 exp->expType = op1->type;
6575 if(op1->type)
6576 op1->type->refCount++;
6577 }
6578 return 0x1;
6579 }
6580
6581 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6582 {
6583 exp->type = 2;
6584 exp->string = PrintUChar((++op1->uc));
6585 if(!exp->expType)
6586 {
6587 exp->expType = op1->type;
6588 if(op1->type)
6589 op1->type->refCount++;
6590 }
6591 return 0x1;
6592 }
6593
6594 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6595 {
6596 exp->type = 2;
6597 exp->string = PrintFloat((float)(++op1->f));
6598 if(!exp->expType)
6599 {
6600 exp->expType = op1->type;
6601 if(op1->type)
6602 op1->type->refCount++;
6603 }
6604 return 0x1;
6605 }
6606
6607 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6608 {
6609 exp->type = 2;
6610 exp->string = PrintDouble((double)(++op1->d));
6611 if(!exp->expType)
6612 {
6613 exp->expType = op1->type;
6614 if(op1->type)
6615 op1->type->refCount++;
6616 }
6617 return 0x1;
6618 }
6619
6620 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6621 {
6622 exp->type = 2;
6623 exp->string = PrintInt((--op1->i));
6624 if(!exp->expType)
6625 {
6626 exp->expType = op1->type;
6627 if(op1->type)
6628 op1->type->refCount++;
6629 }
6630 return 0x1;
6631 }
6632
6633 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6634 {
6635 exp->type = 2;
6636 exp->string = PrintUInt((--op1->ui));
6637 if(!exp->expType)
6638 {
6639 exp->expType = op1->type;
6640 if(op1->type)
6641 op1->type->refCount++;
6642 }
6643 return 0x1;
6644 }
6645
6646 static unsigned int Int64Dec(struct Expression * exp, struct Operand * op1)
6647 {
6648 exp->type = 2;
6649 exp->string = PrintInt64((--op1->i));
6650 if(!exp->expType)
6651 {
6652 exp->expType = op1->type;
6653 if(op1->type)
6654 op1->type->refCount++;
6655 }
6656 return 0x1;
6657 }
6658
6659 static unsigned int UInt64Dec(struct Expression * exp, struct Operand * op1)
6660 {
6661 exp->type = 2;
6662 exp->string = PrintUInt64((--op1->ui));
6663 if(!exp->expType)
6664 {
6665 exp->expType = op1->type;
6666 if(op1->type)
6667 op1->type->refCount++;
6668 }
6669 return 0x1;
6670 }
6671
6672 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6673 {
6674 exp->type = 2;
6675 exp->string = PrintShort((--op1->s));
6676 if(!exp->expType)
6677 {
6678 exp->expType = op1->type;
6679 if(op1->type)
6680 op1->type->refCount++;
6681 }
6682 return 0x1;
6683 }
6684
6685 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6686 {
6687 exp->type = 2;
6688 exp->string = PrintUShort((--op1->us));
6689 if(!exp->expType)
6690 {
6691 exp->expType = op1->type;
6692 if(op1->type)
6693 op1->type->refCount++;
6694 }
6695 return 0x1;
6696 }
6697
6698 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6699 {
6700 exp->type = 2;
6701 exp->string = PrintChar((--op1->c));
6702 if(!exp->expType)
6703 {
6704 exp->expType = op1->type;
6705 if(op1->type)
6706 op1->type->refCount++;
6707 }
6708 return 0x1;
6709 }
6710
6711 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6712 {
6713 exp->type = 2;
6714 exp->string = PrintUChar((--op1->uc));
6715 if(!exp->expType)
6716 {
6717 exp->expType = op1->type;
6718 if(op1->type)
6719 op1->type->refCount++;
6720 }
6721 return 0x1;
6722 }
6723
6724 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6725 {
6726 exp->type = 2;
6727 exp->string = PrintFloat((float)(--op1->f));
6728 if(!exp->expType)
6729 {
6730 exp->expType = op1->type;
6731 if(op1->type)
6732 op1->type->refCount++;
6733 }
6734 return 0x1;
6735 }
6736
6737 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6738 {
6739 exp->type = 2;
6740 exp->string = PrintDouble((double)(--op1->d));
6741 if(!exp->expType)
6742 {
6743 exp->expType = op1->type;
6744 if(op1->type)
6745 op1->type->refCount++;
6746 }
6747 return 0x1;
6748 }
6749
6750 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6751 {
6752 int value2 = op2->i;
6753
6754 exp->type = 2;
6755 exp->string = PrintInt(op1->i = value2);
6756 if(!exp->expType)
6757 {
6758 exp->expType = op1->type;
6759 if(op1->type)
6760 op1->type->refCount++;
6761 }
6762 return 0x1;
6763 }
6764
6765 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6766 {
6767 unsigned int value2 = op2->ui;
6768
6769 exp->type = 2;
6770 exp->string = PrintUInt(op1->ui = value2);
6771 if(!exp->expType)
6772 {
6773 exp->expType = op1->type;
6774 if(op1->type)
6775 op1->type->refCount++;
6776 }
6777 return 0x1;
6778 }
6779
6780 static unsigned int Int64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6781 {
6782 int value2 = op2->i;
6783
6784 exp->type = 2;
6785 exp->string = PrintInt64(op1->i = value2);
6786 if(!exp->expType)
6787 {
6788 exp->expType = op1->type;
6789 if(op1->type)
6790 op1->type->refCount++;
6791 }
6792 return 0x1;
6793 }
6794
6795 static unsigned int UInt64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6796 {
6797 unsigned int value2 = op2->ui;
6798
6799 exp->type = 2;
6800 exp->string = PrintUInt64(op1->ui = value2);
6801 if(!exp->expType)
6802 {
6803 exp->expType = op1->type;
6804 if(op1->type)
6805 op1->type->refCount++;
6806 }
6807 return 0x1;
6808 }
6809
6810 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6811 {
6812 short value2 = op2->s;
6813
6814 exp->type = 2;
6815 exp->string = PrintShort(op1->s = value2);
6816 if(!exp->expType)
6817 {
6818 exp->expType = op1->type;
6819 if(op1->type)
6820 op1->type->refCount++;
6821 }
6822 return 0x1;
6823 }
6824
6825 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6826 {
6827 unsigned short value2 = op2->us;
6828
6829 exp->type = 2;
6830 exp->string = PrintUShort(op1->us = value2);
6831 if(!exp->expType)
6832 {
6833 exp->expType = op1->type;
6834 if(op1->type)
6835 op1->type->refCount++;
6836 }
6837 return 0x1;
6838 }
6839
6840 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6841 {
6842 char value2 = op2->c;
6843
6844 exp->type = 2;
6845 exp->string = PrintChar(op1->c = value2);
6846 if(!exp->expType)
6847 {
6848 exp->expType = op1->type;
6849 if(op1->type)
6850 op1->type->refCount++;
6851 }
6852 return 0x1;
6853 }
6854
6855 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6856 {
6857 unsigned char value2 = op2->uc;
6858
6859 exp->type = 2;
6860 exp->string = PrintUChar(op1->uc = value2);
6861 if(!exp->expType)
6862 {
6863 exp->expType = op1->type;
6864 if(op1->type)
6865 op1->type->refCount++;
6866 }
6867 return 0x1;
6868 }
6869
6870 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6871 {
6872 float value2 = op2->f;
6873
6874 exp->type = 2;
6875 exp->string = PrintFloat(op1->f = value2);
6876 if(!exp->expType)
6877 {
6878 exp->expType = op1->type;
6879 if(op1->type)
6880 op1->type->refCount++;
6881 }
6882 return 0x1;
6883 }
6884
6885 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6886 {
6887 double value2 = op2->d;
6888
6889 exp->type = 2;
6890 exp->string = PrintDouble(op1->d = value2);
6891 if(!exp->expType)
6892 {
6893 exp->expType = op1->type;
6894 if(op1->type)
6895 op1->type->refCount++;
6896 }
6897 return 0x1;
6898 }
6899
6900 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6901 {
6902 int value2 = op2->i;
6903
6904 exp->type = 2;
6905 exp->string = PrintInt(op1->i += value2);
6906 if(!exp->expType)
6907 {
6908 exp->expType = op1->type;
6909 if(op1->type)
6910 op1->type->refCount++;
6911 }
6912 return 0x1;
6913 }
6914
6915 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6916 {
6917 unsigned int value2 = op2->ui;
6918
6919 exp->type = 2;
6920 exp->string = PrintUInt(op1->ui += value2);
6921 if(!exp->expType)
6922 {
6923 exp->expType = op1->type;
6924 if(op1->type)
6925 op1->type->refCount++;
6926 }
6927 return 0x1;
6928 }
6929
6930 static unsigned int Int64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6931 {
6932 int value2 = op2->i;
6933
6934 exp->type = 2;
6935 exp->string = PrintInt64(op1->i += value2);
6936 if(!exp->expType)
6937 {
6938 exp->expType = op1->type;
6939 if(op1->type)
6940 op1->type->refCount++;
6941 }
6942 return 0x1;
6943 }
6944
6945 static unsigned int UInt64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6946 {
6947 unsigned int value2 = op2->ui;
6948
6949 exp->type = 2;
6950 exp->string = PrintUInt64(op1->ui += value2);
6951 if(!exp->expType)
6952 {
6953 exp->expType = op1->type;
6954 if(op1->type)
6955 op1->type->refCount++;
6956 }
6957 return 0x1;
6958 }
6959
6960 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6961 {
6962 short value2 = op2->s;
6963
6964 exp->type = 2;
6965 exp->string = PrintShort(op1->s += value2);
6966 if(!exp->expType)
6967 {
6968 exp->expType = op1->type;
6969 if(op1->type)
6970 op1->type->refCount++;
6971 }
6972 return 0x1;
6973 }
6974
6975 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6976 {
6977 unsigned short value2 = op2->us;
6978
6979 exp->type = 2;
6980 exp->string = PrintUShort(op1->us += value2);
6981 if(!exp->expType)
6982 {
6983 exp->expType = op1->type;
6984 if(op1->type)
6985 op1->type->refCount++;
6986 }
6987 return 0x1;
6988 }
6989
6990 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6991 {
6992 char value2 = op2->c;
6993
6994 exp->type = 2;
6995 exp->string = PrintChar(op1->c += value2);
6996 if(!exp->expType)
6997 {
6998 exp->expType = op1->type;
6999 if(op1->type)
7000 op1->type->refCount++;
7001 }
7002 return 0x1;
7003 }
7004
7005 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7006 {
7007 unsigned char value2 = op2->uc;
7008
7009 exp->type = 2;
7010 exp->string = PrintUChar(op1->uc += value2);
7011 if(!exp->expType)
7012 {
7013 exp->expType = op1->type;
7014 if(op1->type)
7015 op1->type->refCount++;
7016 }
7017 return 0x1;
7018 }
7019
7020 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7021 {
7022 float value2 = op2->f;
7023
7024 exp->type = 2;
7025 exp->string = PrintFloat(op1->f += value2);
7026 if(!exp->expType)
7027 {
7028 exp->expType = op1->type;
7029 if(op1->type)
7030 op1->type->refCount++;
7031 }
7032 return 0x1;
7033 }
7034
7035 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7036 {
7037 double value2 = op2->d;
7038
7039 exp->type = 2;
7040 exp->string = PrintDouble(op1->d += value2);
7041 if(!exp->expType)
7042 {
7043 exp->expType = op1->type;
7044 if(op1->type)
7045 op1->type->refCount++;
7046 }
7047 return 0x1;
7048 }
7049
7050 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7051 {
7052 int value2 = op2->i;
7053
7054 exp->type = 2;
7055 exp->string = PrintInt(op1->i -= value2);
7056 if(!exp->expType)
7057 {
7058 exp->expType = op1->type;
7059 if(op1->type)
7060 op1->type->refCount++;
7061 }
7062 return 0x1;
7063 }
7064
7065 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7066 {
7067 unsigned int value2 = op2->ui;
7068
7069 exp->type = 2;
7070 exp->string = PrintUInt(op1->ui -= value2);
7071 if(!exp->expType)
7072 {
7073 exp->expType = op1->type;
7074 if(op1->type)
7075 op1->type->refCount++;
7076 }
7077 return 0x1;
7078 }
7079
7080 static unsigned int Int64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7081 {
7082 int value2 = op2->i;
7083
7084 exp->type = 2;
7085 exp->string = PrintInt64(op1->i -= value2);
7086 if(!exp->expType)
7087 {
7088 exp->expType = op1->type;
7089 if(op1->type)
7090 op1->type->refCount++;
7091 }
7092 return 0x1;
7093 }
7094
7095 static unsigned int UInt64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7096 {
7097 unsigned int value2 = op2->ui;
7098
7099 exp->type = 2;
7100 exp->string = PrintUInt64(op1->ui -= value2);
7101 if(!exp->expType)
7102 {
7103 exp->expType = op1->type;
7104 if(op1->type)
7105 op1->type->refCount++;
7106 }
7107 return 0x1;
7108 }
7109
7110 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7111 {
7112 short value2 = op2->s;
7113
7114 exp->type = 2;
7115 exp->string = PrintShort(op1->s -= value2);
7116 if(!exp->expType)
7117 {
7118 exp->expType = op1->type;
7119 if(op1->type)
7120 op1->type->refCount++;
7121 }
7122 return 0x1;
7123 }
7124
7125 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7126 {
7127 unsigned short value2 = op2->us;
7128
7129 exp->type = 2;
7130 exp->string = PrintUShort(op1->us -= value2);
7131 if(!exp->expType)
7132 {
7133 exp->expType = op1->type;
7134 if(op1->type)
7135 op1->type->refCount++;
7136 }
7137 return 0x1;
7138 }
7139
7140 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7141 {
7142 char value2 = op2->c;
7143
7144 exp->type = 2;
7145 exp->string = PrintChar(op1->c -= value2);
7146 if(!exp->expType)
7147 {
7148 exp->expType = op1->type;
7149 if(op1->type)
7150 op1->type->refCount++;
7151 }
7152 return 0x1;
7153 }
7154
7155 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7156 {
7157 unsigned char value2 = op2->uc;
7158
7159 exp->type = 2;
7160 exp->string = PrintUChar(op1->uc -= value2);
7161 if(!exp->expType)
7162 {
7163 exp->expType = op1->type;
7164 if(op1->type)
7165 op1->type->refCount++;
7166 }
7167 return 0x1;
7168 }
7169
7170 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7171 {
7172 float value2 = op2->f;
7173
7174 exp->type = 2;
7175 exp->string = PrintFloat(op1->f -= value2);
7176 if(!exp->expType)
7177 {
7178 exp->expType = op1->type;
7179 if(op1->type)
7180 op1->type->refCount++;
7181 }
7182 return 0x1;
7183 }
7184
7185 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7186 {
7187 double value2 = op2->d;
7188
7189 exp->type = 2;
7190 exp->string = PrintDouble(op1->d -= value2);
7191 if(!exp->expType)
7192 {
7193 exp->expType = op1->type;
7194 if(op1->type)
7195 op1->type->refCount++;
7196 }
7197 return 0x1;
7198 }
7199
7200 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7201 {
7202 int value2 = op2->i;
7203
7204 exp->type = 2;
7205 exp->string = PrintInt(op1->i *= value2);
7206 if(!exp->expType)
7207 {
7208 exp->expType = op1->type;
7209 if(op1->type)
7210 op1->type->refCount++;
7211 }
7212 return 0x1;
7213 }
7214
7215 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7216 {
7217 unsigned int value2 = op2->ui;
7218
7219 exp->type = 2;
7220 exp->string = PrintUInt(op1->ui *= value2);
7221 if(!exp->expType)
7222 {
7223 exp->expType = op1->type;
7224 if(op1->type)
7225 op1->type->refCount++;
7226 }
7227 return 0x1;
7228 }
7229
7230 static unsigned int Int64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7231 {
7232 int value2 = op2->i;
7233
7234 exp->type = 2;
7235 exp->string = PrintInt64(op1->i *= value2);
7236 if(!exp->expType)
7237 {
7238 exp->expType = op1->type;
7239 if(op1->type)
7240 op1->type->refCount++;
7241 }
7242 return 0x1;
7243 }
7244
7245 static unsigned int UInt64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7246 {
7247 unsigned int value2 = op2->ui;
7248
7249 exp->type = 2;
7250 exp->string = PrintUInt64(op1->ui *= value2);
7251 if(!exp->expType)
7252 {
7253 exp->expType = op1->type;
7254 if(op1->type)
7255 op1->type->refCount++;
7256 }
7257 return 0x1;
7258 }
7259
7260 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7261 {
7262 short value2 = op2->s;
7263
7264 exp->type = 2;
7265 exp->string = PrintShort(op1->s *= value2);
7266 if(!exp->expType)
7267 {
7268 exp->expType = op1->type;
7269 if(op1->type)
7270 op1->type->refCount++;
7271 }
7272 return 0x1;
7273 }
7274
7275 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7276 {
7277 unsigned short value2 = op2->us;
7278
7279 exp->type = 2;
7280 exp->string = PrintUShort(op1->us *= value2);
7281 if(!exp->expType)
7282 {
7283 exp->expType = op1->type;
7284 if(op1->type)
7285 op1->type->refCount++;
7286 }
7287 return 0x1;
7288 }
7289
7290 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7291 {
7292 char value2 = op2->c;
7293
7294 exp->type = 2;
7295 exp->string = PrintChar(op1->c *= value2);
7296 if(!exp->expType)
7297 {
7298 exp->expType = op1->type;
7299 if(op1->type)
7300 op1->type->refCount++;
7301 }
7302 return 0x1;
7303 }
7304
7305 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7306 {
7307 unsigned char value2 = op2->uc;
7308
7309 exp->type = 2;
7310 exp->string = PrintUChar(op1->uc *= value2);
7311 if(!exp->expType)
7312 {
7313 exp->expType = op1->type;
7314 if(op1->type)
7315 op1->type->refCount++;
7316 }
7317 return 0x1;
7318 }
7319
7320 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7321 {
7322 float value2 = op2->f;
7323
7324 exp->type = 2;
7325 exp->string = PrintFloat(op1->f *= value2);
7326 if(!exp->expType)
7327 {
7328 exp->expType = op1->type;
7329 if(op1->type)
7330 op1->type->refCount++;
7331 }
7332 return 0x1;
7333 }
7334
7335 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7336 {
7337 double value2 = op2->d;
7338
7339 exp->type = 2;
7340 exp->string = PrintDouble(op1->d *= value2);
7341 if(!exp->expType)
7342 {
7343 exp->expType = op1->type;
7344 if(op1->type)
7345 op1->type->refCount++;
7346 }
7347 return 0x1;
7348 }
7349
7350 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7351 {
7352 int value2 = op2->i;
7353
7354 exp->type = 2;
7355 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
7356 if(!exp->expType)
7357 {
7358 exp->expType = op1->type;
7359 if(op1->type)
7360 op1->type->refCount++;
7361 }
7362 return 0x1;
7363 }
7364
7365 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7366 {
7367 unsigned int value2 = op2->ui;
7368
7369 exp->type = 2;
7370 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
7371 if(!exp->expType)
7372 {
7373 exp->expType = op1->type;
7374 if(op1->type)
7375 op1->type->refCount++;
7376 }
7377 return 0x1;
7378 }
7379
7380 static unsigned int Int64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7381 {
7382 int value2 = op2->i;
7383
7384 exp->type = 2;
7385 exp->string = PrintInt64(value2 ? (op1->i /= value2) : 0);
7386 if(!exp->expType)
7387 {
7388 exp->expType = op1->type;
7389 if(op1->type)
7390 op1->type->refCount++;
7391 }
7392 return 0x1;
7393 }
7394
7395 static unsigned int UInt64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7396 {
7397 unsigned int value2 = op2->ui;
7398
7399 exp->type = 2;
7400 exp->string = PrintUInt64(value2 ? (op1->ui /= value2) : 0);
7401 if(!exp->expType)
7402 {
7403 exp->expType = op1->type;
7404 if(op1->type)
7405 op1->type->refCount++;
7406 }
7407 return 0x1;
7408 }
7409
7410 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7411 {
7412 short value2 = op2->s;
7413
7414 exp->type = 2;
7415 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
7416 if(!exp->expType)
7417 {
7418 exp->expType = op1->type;
7419 if(op1->type)
7420 op1->type->refCount++;
7421 }
7422 return 0x1;
7423 }
7424
7425 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7426 {
7427 unsigned short value2 = op2->us;
7428
7429 exp->type = 2;
7430 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
7431 if(!exp->expType)
7432 {
7433 exp->expType = op1->type;
7434 if(op1->type)
7435 op1->type->refCount++;
7436 }
7437 return 0x1;
7438 }
7439
7440 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7441 {
7442 char value2 = op2->c;
7443
7444 exp->type = 2;
7445 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
7446 if(!exp->expType)
7447 {
7448 exp->expType = op1->type;
7449 if(op1->type)
7450 op1->type->refCount++;
7451 }
7452 return 0x1;
7453 }
7454
7455 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7456 {
7457 unsigned char value2 = op2->uc;
7458
7459 exp->type = 2;
7460 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
7461 if(!exp->expType)
7462 {
7463 exp->expType = op1->type;
7464 if(op1->type)
7465 op1->type->refCount++;
7466 }
7467 return 0x1;
7468 }
7469
7470 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7471 {
7472 float value2 = op2->f;
7473
7474 exp->type = 2;
7475 exp->string = PrintFloat(value2 ? (op1->f /= value2) : 0);
7476 if(!exp->expType)
7477 {
7478 exp->expType = op1->type;
7479 if(op1->type)
7480 op1->type->refCount++;
7481 }
7482 return 0x1;
7483 }
7484
7485 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7486 {
7487 double value2 = op2->d;
7488
7489 exp->type = 2;
7490 exp->string = PrintDouble(value2 ? (op1->d /= value2) : 0);
7491 if(!exp->expType)
7492 {
7493 exp->expType = op1->type;
7494 if(op1->type)
7495 op1->type->refCount++;
7496 }
7497 return 0x1;
7498 }
7499
7500 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7501 {
7502 int value2 = op2->i;
7503
7504 exp->type = 2;
7505 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
7506 if(!exp->expType)
7507 {
7508 exp->expType = op1->type;
7509 if(op1->type)
7510 op1->type->refCount++;
7511 }
7512 return 0x1;
7513 }
7514
7515 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7516 {
7517 unsigned int value2 = op2->ui;
7518
7519 exp->type = 2;
7520 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
7521 if(!exp->expType)
7522 {
7523 exp->expType = op1->type;
7524 if(op1->type)
7525 op1->type->refCount++;
7526 }
7527 return 0x1;
7528 }
7529
7530 static unsigned int Int64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7531 {
7532 int value2 = op2->i;
7533
7534 exp->type = 2;
7535 exp->string = PrintInt64(value2 ? (op1->i %= value2) : 0);
7536 if(!exp->expType)
7537 {
7538 exp->expType = op1->type;
7539 if(op1->type)
7540 op1->type->refCount++;
7541 }
7542 return 0x1;
7543 }
7544
7545 static unsigned int UInt64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7546 {
7547 unsigned int value2 = op2->ui;
7548
7549 exp->type = 2;
7550 exp->string = PrintUInt64(value2 ? (op1->ui %= value2) : 0);
7551 if(!exp->expType)
7552 {
7553 exp->expType = op1->type;
7554 if(op1->type)
7555 op1->type->refCount++;
7556 }
7557 return 0x1;
7558 }
7559
7560 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7561 {
7562 short value2 = op2->s;
7563
7564 exp->type = 2;
7565 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
7566 if(!exp->expType)
7567 {
7568 exp->expType = op1->type;
7569 if(op1->type)
7570 op1->type->refCount++;
7571 }
7572 return 0x1;
7573 }
7574
7575 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7576 {
7577 unsigned short value2 = op2->us;
7578
7579 exp->type = 2;
7580 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
7581 if(!exp->expType)
7582 {
7583 exp->expType = op1->type;
7584 if(op1->type)
7585 op1->type->refCount++;
7586 }
7587 return 0x1;
7588 }
7589
7590 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7591 {
7592 char value2 = op2->c;
7593
7594 exp->type = 2;
7595 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
7596 if(!exp->expType)
7597 {
7598 exp->expType = op1->type;
7599 if(op1->type)
7600 op1->type->refCount++;
7601 }
7602 return 0x1;
7603 }
7604
7605 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7606 {
7607 unsigned char value2 = op2->uc;
7608
7609 exp->type = 2;
7610 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
7611 if(!exp->expType)
7612 {
7613 exp->expType = op1->type;
7614 if(op1->type)
7615 op1->type->refCount++;
7616 }
7617 return 0x1;
7618 }
7619
7620 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7621 {
7622 int value2 = op2->i;
7623
7624 exp->type = 2;
7625 exp->string = PrintInt(op1->i & value2);
7626 if(!exp->expType)
7627 {
7628 exp->expType = op1->type;
7629 if(op1->type)
7630 op1->type->refCount++;
7631 }
7632 return 0x1;
7633 }
7634
7635 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7636 {
7637 unsigned int value2 = op2->ui;
7638
7639 exp->type = 2;
7640 exp->string = PrintUInt(op1->ui & value2);
7641 if(!exp->expType)
7642 {
7643 exp->expType = op1->type;
7644 if(op1->type)
7645 op1->type->refCount++;
7646 }
7647 return 0x1;
7648 }
7649
7650 static unsigned int Int64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7651 {
7652 int value2 = op2->i;
7653
7654 exp->type = 2;
7655 exp->string = PrintInt64(op1->i & value2);
7656 if(!exp->expType)
7657 {
7658 exp->expType = op1->type;
7659 if(op1->type)
7660 op1->type->refCount++;
7661 }
7662 return 0x1;
7663 }
7664
7665 static unsigned int UInt64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7666 {
7667 unsigned int value2 = op2->ui;
7668
7669 exp->type = 2;
7670 exp->string = PrintUInt64(op1->ui & value2);
7671 if(!exp->expType)
7672 {
7673 exp->expType = op1->type;
7674 if(op1->type)
7675 op1->type->refCount++;
7676 }
7677 return 0x1;
7678 }
7679
7680 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7681 {
7682 short value2 = op2->s;
7683
7684 exp->type = 2;
7685 exp->string = PrintShort(op1->s & value2);
7686 if(!exp->expType)
7687 {
7688 exp->expType = op1->type;
7689 if(op1->type)
7690 op1->type->refCount++;
7691 }
7692 return 0x1;
7693 }
7694
7695 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7696 {
7697 unsigned short value2 = op2->us;
7698
7699 exp->type = 2;
7700 exp->string = PrintUShort(op1->us & value2);
7701 if(!exp->expType)
7702 {
7703 exp->expType = op1->type;
7704 if(op1->type)
7705 op1->type->refCount++;
7706 }
7707 return 0x1;
7708 }
7709
7710 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7711 {
7712 char value2 = op2->c;
7713
7714 exp->type = 2;
7715 exp->string = PrintChar(op1->c & value2);
7716 if(!exp->expType)
7717 {
7718 exp->expType = op1->type;
7719 if(op1->type)
7720 op1->type->refCount++;
7721 }
7722 return 0x1;
7723 }
7724
7725 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7726 {
7727 unsigned char value2 = op2->uc;
7728
7729 exp->type = 2;
7730 exp->string = PrintUChar(op1->uc & value2);
7731 if(!exp->expType)
7732 {
7733 exp->expType = op1->type;
7734 if(op1->type)
7735 op1->type->refCount++;
7736 }
7737 return 0x1;
7738 }
7739
7740 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7741 {
7742 int value2 = op2->i;
7743
7744 exp->type = 2;
7745 exp->string = PrintInt(op1->i | value2);
7746 if(!exp->expType)
7747 {
7748 exp->expType = op1->type;
7749 if(op1->type)
7750 op1->type->refCount++;
7751 }
7752 return 0x1;
7753 }
7754
7755 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7756 {
7757 unsigned int value2 = op2->ui;
7758
7759 exp->type = 2;
7760 exp->string = PrintUInt(op1->ui | value2);
7761 if(!exp->expType)
7762 {
7763 exp->expType = op1->type;
7764 if(op1->type)
7765 op1->type->refCount++;
7766 }
7767 return 0x1;
7768 }
7769
7770 static unsigned int Int64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7771 {
7772 int value2 = op2->i;
7773
7774 exp->type = 2;
7775 exp->string = PrintInt64(op1->i | value2);
7776 if(!exp->expType)
7777 {
7778 exp->expType = op1->type;
7779 if(op1->type)
7780 op1->type->refCount++;
7781 }
7782 return 0x1;
7783 }
7784
7785 static unsigned int UInt64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7786 {
7787 unsigned int value2 = op2->ui;
7788
7789 exp->type = 2;
7790 exp->string = PrintUInt64(op1->ui | value2);
7791 if(!exp->expType)
7792 {
7793 exp->expType = op1->type;
7794 if(op1->type)
7795 op1->type->refCount++;
7796 }
7797 return 0x1;
7798 }
7799
7800 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7801 {
7802 short value2 = op2->s;
7803
7804 exp->type = 2;
7805 exp->string = PrintShort(op1->s | value2);
7806 if(!exp->expType)
7807 {
7808 exp->expType = op1->type;
7809 if(op1->type)
7810 op1->type->refCount++;
7811 }
7812 return 0x1;
7813 }
7814
7815 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7816 {
7817 unsigned short value2 = op2->us;
7818
7819 exp->type = 2;
7820 exp->string = PrintUShort(op1->us | value2);
7821 if(!exp->expType)
7822 {
7823 exp->expType = op1->type;
7824 if(op1->type)
7825 op1->type->refCount++;
7826 }
7827 return 0x1;
7828 }
7829
7830 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7831 {
7832 char value2 = op2->c;
7833
7834 exp->type = 2;
7835 exp->string = PrintChar(op1->c | value2);
7836 if(!exp->expType)
7837 {
7838 exp->expType = op1->type;
7839 if(op1->type)
7840 op1->type->refCount++;
7841 }
7842 return 0x1;
7843 }
7844
7845 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7846 {
7847 unsigned char value2 = op2->uc;
7848
7849 exp->type = 2;
7850 exp->string = PrintUChar(op1->uc | value2);
7851 if(!exp->expType)
7852 {
7853 exp->expType = op1->type;
7854 if(op1->type)
7855 op1->type->refCount++;
7856 }
7857 return 0x1;
7858 }
7859
7860 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7861 {
7862 int value2 = op2->i;
7863
7864 exp->type = 2;
7865 exp->string = PrintInt(op1->i ^ value2);
7866 if(!exp->expType)
7867 {
7868 exp->expType = op1->type;
7869 if(op1->type)
7870 op1->type->refCount++;
7871 }
7872 return 0x1;
7873 }
7874
7875 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7876 {
7877 unsigned int value2 = op2->ui;
7878
7879 exp->type = 2;
7880 exp->string = PrintUInt(op1->ui ^ value2);
7881 if(!exp->expType)
7882 {
7883 exp->expType = op1->type;
7884 if(op1->type)
7885 op1->type->refCount++;
7886 }
7887 return 0x1;
7888 }
7889
7890 static unsigned int Int64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7891 {
7892 int value2 = op2->i;
7893
7894 exp->type = 2;
7895 exp->string = PrintInt64(op1->i ^ value2);
7896 if(!exp->expType)
7897 {
7898 exp->expType = op1->type;
7899 if(op1->type)
7900 op1->type->refCount++;
7901 }
7902 return 0x1;
7903 }
7904
7905 static unsigned int UInt64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7906 {
7907 unsigned int value2 = op2->ui;
7908
7909 exp->type = 2;
7910 exp->string = PrintUInt64(op1->ui ^ value2);
7911 if(!exp->expType)
7912 {
7913 exp->expType = op1->type;
7914 if(op1->type)
7915 op1->type->refCount++;
7916 }
7917 return 0x1;
7918 }
7919
7920 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7921 {
7922 short value2 = op2->s;
7923
7924 exp->type = 2;
7925 exp->string = PrintShort(op1->s ^ value2);
7926 if(!exp->expType)
7927 {
7928 exp->expType = op1->type;
7929 if(op1->type)
7930 op1->type->refCount++;
7931 }
7932 return 0x1;
7933 }
7934
7935 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7936 {
7937 unsigned short value2 = op2->us;
7938
7939 exp->type = 2;
7940 exp->string = PrintUShort(op1->us ^ value2);
7941 if(!exp->expType)
7942 {
7943 exp->expType = op1->type;
7944 if(op1->type)
7945 op1->type->refCount++;
7946 }
7947 return 0x1;
7948 }
7949
7950 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7951 {
7952 char value2 = op2->c;
7953
7954 exp->type = 2;
7955 exp->string = PrintChar(op1->c ^ value2);
7956 if(!exp->expType)
7957 {
7958 exp->expType = op1->type;
7959 if(op1->type)
7960 op1->type->refCount++;
7961 }
7962 return 0x1;
7963 }
7964
7965 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7966 {
7967 unsigned char value2 = op2->uc;
7968
7969 exp->type = 2;
7970 exp->string = PrintUChar(op1->uc ^ value2);
7971 if(!exp->expType)
7972 {
7973 exp->expType = op1->type;
7974 if(op1->type)
7975 op1->type->refCount++;
7976 }
7977 return 0x1;
7978 }
7979
7980 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7981 {
7982 int value2 = op2->i;
7983
7984 exp->type = 2;
7985 exp->string = PrintInt(op1->i << value2);
7986 if(!exp->expType)
7987 {
7988 exp->expType = op1->type;
7989 if(op1->type)
7990 op1->type->refCount++;
7991 }
7992 return 0x1;
7993 }
7994
7995 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7996 {
7997 unsigned int value2 = op2->ui;
7998
7999 exp->type = 2;
8000 exp->string = PrintUInt(op1->ui << value2);
8001 if(!exp->expType)
8002 {
8003 exp->expType = op1->type;
8004 if(op1->type)
8005 op1->type->refCount++;
8006 }
8007 return 0x1;
8008 }
8009
8010 static unsigned int Int64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8011 {
8012 int value2 = op2->i;
8013
8014 exp->type = 2;
8015 exp->string = PrintInt64(op1->i << value2);
8016 if(!exp->expType)
8017 {
8018 exp->expType = op1->type;
8019 if(op1->type)
8020 op1->type->refCount++;
8021 }
8022 return 0x1;
8023 }
8024
8025 static unsigned int UInt64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8026 {
8027 unsigned int value2 = op2->ui;
8028
8029 exp->type = 2;
8030 exp->string = PrintUInt64(op1->ui << value2);
8031 if(!exp->expType)
8032 {
8033 exp->expType = op1->type;
8034 if(op1->type)
8035 op1->type->refCount++;
8036 }
8037 return 0x1;
8038 }
8039
8040 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8041 {
8042 short value2 = op2->s;
8043
8044 exp->type = 2;
8045 exp->string = PrintShort(op1->s << value2);
8046 if(!exp->expType)
8047 {
8048 exp->expType = op1->type;
8049 if(op1->type)
8050 op1->type->refCount++;
8051 }
8052 return 0x1;
8053 }
8054
8055 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8056 {
8057 unsigned short value2 = op2->us;
8058
8059 exp->type = 2;
8060 exp->string = PrintUShort(op1->us << value2);
8061 if(!exp->expType)
8062 {
8063 exp->expType = op1->type;
8064 if(op1->type)
8065 op1->type->refCount++;
8066 }
8067 return 0x1;
8068 }
8069
8070 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8071 {
8072 char value2 = op2->c;
8073
8074 exp->type = 2;
8075 exp->string = PrintChar(op1->c << value2);
8076 if(!exp->expType)
8077 {
8078 exp->expType = op1->type;
8079 if(op1->type)
8080 op1->type->refCount++;
8081 }
8082 return 0x1;
8083 }
8084
8085 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8086 {
8087 unsigned char value2 = op2->uc;
8088
8089 exp->type = 2;
8090 exp->string = PrintUChar(op1->uc << value2);
8091 if(!exp->expType)
8092 {
8093 exp->expType = op1->type;
8094 if(op1->type)
8095 op1->type->refCount++;
8096 }
8097 return 0x1;
8098 }
8099
8100 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8101 {
8102 int value2 = op2->i;
8103
8104 exp->type = 2;
8105 exp->string = PrintInt(op1->i >> value2);
8106 if(!exp->expType)
8107 {
8108 exp->expType = op1->type;
8109 if(op1->type)
8110 op1->type->refCount++;
8111 }
8112 return 0x1;
8113 }
8114
8115 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8116 {
8117 unsigned int value2 = op2->ui;
8118
8119 exp->type = 2;
8120 exp->string = PrintUInt(op1->ui >> value2);
8121 if(!exp->expType)
8122 {
8123 exp->expType = op1->type;
8124 if(op1->type)
8125 op1->type->refCount++;
8126 }
8127 return 0x1;
8128 }
8129
8130 static unsigned int Int64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8131 {
8132 int value2 = op2->i;
8133
8134 exp->type = 2;
8135 exp->string = PrintInt64(op1->i >> value2);
8136 if(!exp->expType)
8137 {
8138 exp->expType = op1->type;
8139 if(op1->type)
8140 op1->type->refCount++;
8141 }
8142 return 0x1;
8143 }
8144
8145 static unsigned int UInt64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8146 {
8147 unsigned int value2 = op2->ui;
8148
8149 exp->type = 2;
8150 exp->string = PrintUInt64(op1->ui >> value2);
8151 if(!exp->expType)
8152 {
8153 exp->expType = op1->type;
8154 if(op1->type)
8155 op1->type->refCount++;
8156 }
8157 return 0x1;
8158 }
8159
8160 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8161 {
8162 short value2 = op2->s;
8163
8164 exp->type = 2;
8165 exp->string = PrintShort(op1->s >> value2);
8166 if(!exp->expType)
8167 {
8168 exp->expType = op1->type;
8169 if(op1->type)
8170 op1->type->refCount++;
8171 }
8172 return 0x1;
8173 }
8174
8175 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8176 {
8177 unsigned short value2 = op2->us;
8178
8179 exp->type = 2;
8180 exp->string = PrintUShort(op1->us >> value2);
8181 if(!exp->expType)
8182 {
8183 exp->expType = op1->type;
8184 if(op1->type)
8185 op1->type->refCount++;
8186 }
8187 return 0x1;
8188 }
8189
8190 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8191 {
8192 char value2 = op2->c;
8193
8194 exp->type = 2;
8195 exp->string = PrintChar(op1->c >> value2);
8196 if(!exp->expType)
8197 {
8198 exp->expType = op1->type;
8199 if(op1->type)
8200 op1->type->refCount++;
8201 }
8202 return 0x1;
8203 }
8204
8205 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8206 {
8207 unsigned char value2 = op2->uc;
8208
8209 exp->type = 2;
8210 exp->string = PrintUChar(op1->uc >> value2);
8211 if(!exp->expType)
8212 {
8213 exp->expType = op1->type;
8214 if(op1->type)
8215 op1->type->refCount++;
8216 }
8217 return 0x1;
8218 }
8219
8220 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
8221 {
8222 exp->type = 2;
8223 exp->string = PrintInt((~op1->i));
8224 if(!exp->expType)
8225 {
8226 exp->expType = op1->type;
8227 if(op1->type)
8228 op1->type->refCount++;
8229 }
8230 return 0x1;
8231 }
8232
8233 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
8234 {
8235 exp->type = 2;
8236 exp->string = PrintUInt((unsigned int)(~op1->ui));
8237 if(!exp->expType)
8238 {
8239 exp->expType = op1->type;
8240 if(op1->type)
8241 op1->type->refCount++;
8242 }
8243 return 0x1;
8244 }
8245
8246 static unsigned int Int64BitNot(struct Expression * exp, struct Operand * op1)
8247 {
8248 exp->type = 2;
8249 exp->string = PrintInt64((~op1->i));
8250 if(!exp->expType)
8251 {
8252 exp->expType = op1->type;
8253 if(op1->type)
8254 op1->type->refCount++;
8255 }
8256 return 0x1;
8257 }
8258
8259 static unsigned int UInt64BitNot(struct Expression * exp, struct Operand * op1)
8260 {
8261 exp->type = 2;
8262 exp->string = PrintUInt64((unsigned int)(~op1->ui));
8263 if(!exp->expType)
8264 {
8265 exp->expType = op1->type;
8266 if(op1->type)
8267 op1->type->refCount++;
8268 }
8269 return 0x1;
8270 }
8271
8272 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
8273 {
8274 exp->type = 2;
8275 exp->string = PrintShort((short)(~op1->s));
8276 if(!exp->expType)
8277 {
8278 exp->expType = op1->type;
8279 if(op1->type)
8280 op1->type->refCount++;
8281 }
8282 return 0x1;
8283 }
8284
8285 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
8286 {
8287 exp->type = 2;
8288 exp->string = PrintUShort((unsigned short)(~op1->us));
8289 if(!exp->expType)
8290 {
8291 exp->expType = op1->type;
8292 if(op1->type)
8293 op1->type->refCount++;
8294 }
8295 return 0x1;
8296 }
8297
8298 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
8299 {
8300 exp->type = 2;
8301 exp->string = PrintChar((char)(~op1->c));
8302 if(!exp->expType)
8303 {
8304 exp->expType = op1->type;
8305 if(op1->type)
8306 op1->type->refCount++;
8307 }
8308 return 0x1;
8309 }
8310
8311 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
8312 {
8313 exp->type = 2;
8314 exp->string = PrintUChar((unsigned char)(~op1->uc));
8315 if(!exp->expType)
8316 {
8317 exp->expType = op1->type;
8318 if(op1->type)
8319 op1->type->refCount++;
8320 }
8321 return 0x1;
8322 }
8323
8324 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8325 {
8326 int value2 = op2->i;
8327
8328 exp->type = 2;
8329 exp->string = PrintInt(op1->i &= value2);
8330 if(!exp->expType)
8331 {
8332 exp->expType = op1->type;
8333 if(op1->type)
8334 op1->type->refCount++;
8335 }
8336 return 0x1;
8337 }
8338
8339 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8340 {
8341 unsigned int value2 = op2->ui;
8342
8343 exp->type = 2;
8344 exp->string = PrintUInt(op1->ui &= value2);
8345 if(!exp->expType)
8346 {
8347 exp->expType = op1->type;
8348 if(op1->type)
8349 op1->type->refCount++;
8350 }
8351 return 0x1;
8352 }
8353
8354 static unsigned int Int64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8355 {
8356 int value2 = op2->i;
8357
8358 exp->type = 2;
8359 exp->string = PrintInt64(op1->i &= value2);
8360 if(!exp->expType)
8361 {
8362 exp->expType = op1->type;
8363 if(op1->type)
8364 op1->type->refCount++;
8365 }
8366 return 0x1;
8367 }
8368
8369 static unsigned int UInt64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8370 {
8371 unsigned int value2 = op2->ui;
8372
8373 exp->type = 2;
8374 exp->string = PrintUInt64(op1->ui &= value2);
8375 if(!exp->expType)
8376 {
8377 exp->expType = op1->type;
8378 if(op1->type)
8379 op1->type->refCount++;
8380 }
8381 return 0x1;
8382 }
8383
8384 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8385 {
8386 short value2 = op2->s;
8387
8388 exp->type = 2;
8389 exp->string = PrintShort(op1->s &= value2);
8390 if(!exp->expType)
8391 {
8392 exp->expType = op1->type;
8393 if(op1->type)
8394 op1->type->refCount++;
8395 }
8396 return 0x1;
8397 }
8398
8399 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8400 {
8401 unsigned short value2 = op2->us;
8402
8403 exp->type = 2;
8404 exp->string = PrintUShort(op1->us &= value2);
8405 if(!exp->expType)
8406 {
8407 exp->expType = op1->type;
8408 if(op1->type)
8409 op1->type->refCount++;
8410 }
8411 return 0x1;
8412 }
8413
8414 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8415 {
8416 char value2 = op2->c;
8417
8418 exp->type = 2;
8419 exp->string = PrintChar(op1->c &= value2);
8420 if(!exp->expType)
8421 {
8422 exp->expType = op1->type;
8423 if(op1->type)
8424 op1->type->refCount++;
8425 }
8426 return 0x1;
8427 }
8428
8429 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8430 {
8431 unsigned char value2 = op2->uc;
8432
8433 exp->type = 2;
8434 exp->string = PrintUChar(op1->uc &= value2);
8435 if(!exp->expType)
8436 {
8437 exp->expType = op1->type;
8438 if(op1->type)
8439 op1->type->refCount++;
8440 }
8441 return 0x1;
8442 }
8443
8444 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8445 {
8446 int value2 = op2->i;
8447
8448 exp->type = 2;
8449 exp->string = PrintInt(op1->i |= value2);
8450 if(!exp->expType)
8451 {
8452 exp->expType = op1->type;
8453 if(op1->type)
8454 op1->type->refCount++;
8455 }
8456 return 0x1;
8457 }
8458
8459 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8460 {
8461 unsigned int value2 = op2->ui;
8462
8463 exp->type = 2;
8464 exp->string = PrintUInt(op1->ui |= value2);
8465 if(!exp->expType)
8466 {
8467 exp->expType = op1->type;
8468 if(op1->type)
8469 op1->type->refCount++;
8470 }
8471 return 0x1;
8472 }
8473
8474 static unsigned int Int64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8475 {
8476 int value2 = op2->i;
8477
8478 exp->type = 2;
8479 exp->string = PrintInt64(op1->i |= value2);
8480 if(!exp->expType)
8481 {
8482 exp->expType = op1->type;
8483 if(op1->type)
8484 op1->type->refCount++;
8485 }
8486 return 0x1;
8487 }
8488
8489 static unsigned int UInt64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8490 {
8491 unsigned int value2 = op2->ui;
8492
8493 exp->type = 2;
8494 exp->string = PrintUInt64(op1->ui |= value2);
8495 if(!exp->expType)
8496 {
8497 exp->expType = op1->type;
8498 if(op1->type)
8499 op1->type->refCount++;
8500 }
8501 return 0x1;
8502 }
8503
8504 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8505 {
8506 short value2 = op2->s;
8507
8508 exp->type = 2;
8509 exp->string = PrintShort(op1->s |= value2);
8510 if(!exp->expType)
8511 {
8512 exp->expType = op1->type;
8513 if(op1->type)
8514 op1->type->refCount++;
8515 }
8516 return 0x1;
8517 }
8518
8519 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8520 {
8521 unsigned short value2 = op2->us;
8522
8523 exp->type = 2;
8524 exp->string = PrintUShort(op1->us |= value2);
8525 if(!exp->expType)
8526 {
8527 exp->expType = op1->type;
8528 if(op1->type)
8529 op1->type->refCount++;
8530 }
8531 return 0x1;
8532 }
8533
8534 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8535 {
8536 char value2 = op2->c;
8537
8538 exp->type = 2;
8539 exp->string = PrintChar(op1->c |= value2);
8540 if(!exp->expType)
8541 {
8542 exp->expType = op1->type;
8543 if(op1->type)
8544 op1->type->refCount++;
8545 }
8546 return 0x1;
8547 }
8548
8549 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8550 {
8551 unsigned char value2 = op2->uc;
8552
8553 exp->type = 2;
8554 exp->string = PrintUChar(op1->uc |= value2);
8555 if(!exp->expType)
8556 {
8557 exp->expType = op1->type;
8558 if(op1->type)
8559 op1->type->refCount++;
8560 }
8561 return 0x1;
8562 }
8563
8564 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8565 {
8566 int value2 = op2->i;
8567
8568 exp->type = 2;
8569 exp->string = PrintInt(op1->i ^= value2);
8570 if(!exp->expType)
8571 {
8572 exp->expType = op1->type;
8573 if(op1->type)
8574 op1->type->refCount++;
8575 }
8576 return 0x1;
8577 }
8578
8579 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8580 {
8581 unsigned int value2 = op2->ui;
8582
8583 exp->type = 2;
8584 exp->string = PrintUInt(op1->ui ^= value2);
8585 if(!exp->expType)
8586 {
8587 exp->expType = op1->type;
8588 if(op1->type)
8589 op1->type->refCount++;
8590 }
8591 return 0x1;
8592 }
8593
8594 static unsigned int Int64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8595 {
8596 int value2 = op2->i;
8597
8598 exp->type = 2;
8599 exp->string = PrintInt64(op1->i ^= value2);
8600 if(!exp->expType)
8601 {
8602 exp->expType = op1->type;
8603 if(op1->type)
8604 op1->type->refCount++;
8605 }
8606 return 0x1;
8607 }
8608
8609 static unsigned int UInt64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8610 {
8611 unsigned int value2 = op2->ui;
8612
8613 exp->type = 2;
8614 exp->string = PrintUInt64(op1->ui ^= value2);
8615 if(!exp->expType)
8616 {
8617 exp->expType = op1->type;
8618 if(op1->type)
8619 op1->type->refCount++;
8620 }
8621 return 0x1;
8622 }
8623
8624 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8625 {
8626 short value2 = op2->s;
8627
8628 exp->type = 2;
8629 exp->string = PrintShort(op1->s ^= value2);
8630 if(!exp->expType)
8631 {
8632 exp->expType = op1->type;
8633 if(op1->type)
8634 op1->type->refCount++;
8635 }
8636 return 0x1;
8637 }
8638
8639 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8640 {
8641 unsigned short value2 = op2->us;
8642
8643 exp->type = 2;
8644 exp->string = PrintUShort(op1->us ^= value2);
8645 if(!exp->expType)
8646 {
8647 exp->expType = op1->type;
8648 if(op1->type)
8649 op1->type->refCount++;
8650 }
8651 return 0x1;
8652 }
8653
8654 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8655 {
8656 char value2 = op2->c;
8657
8658 exp->type = 2;
8659 exp->string = PrintChar(op1->c ^= value2);
8660 if(!exp->expType)
8661 {
8662 exp->expType = op1->type;
8663 if(op1->type)
8664 op1->type->refCount++;
8665 }
8666 return 0x1;
8667 }
8668
8669 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8670 {
8671 unsigned char value2 = op2->uc;
8672
8673 exp->type = 2;
8674 exp->string = PrintUChar(op1->uc ^= value2);
8675 if(!exp->expType)
8676 {
8677 exp->expType = op1->type;
8678 if(op1->type)
8679 op1->type->refCount++;
8680 }
8681 return 0x1;
8682 }
8683
8684 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8685 {
8686 int value2 = op2->i;
8687
8688 exp->type = 2;
8689 exp->string = PrintInt(op1->i <<= value2);
8690 if(!exp->expType)
8691 {
8692 exp->expType = op1->type;
8693 if(op1->type)
8694 op1->type->refCount++;
8695 }
8696 return 0x1;
8697 }
8698
8699 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8700 {
8701 unsigned int value2 = op2->ui;
8702
8703 exp->type = 2;
8704 exp->string = PrintUInt(op1->ui <<= value2);
8705 if(!exp->expType)
8706 {
8707 exp->expType = op1->type;
8708 if(op1->type)
8709 op1->type->refCount++;
8710 }
8711 return 0x1;
8712 }
8713
8714 static unsigned int Int64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8715 {
8716 int value2 = op2->i;
8717
8718 exp->type = 2;
8719 exp->string = PrintInt64(op1->i <<= value2);
8720 if(!exp->expType)
8721 {
8722 exp->expType = op1->type;
8723 if(op1->type)
8724 op1->type->refCount++;
8725 }
8726 return 0x1;
8727 }
8728
8729 static unsigned int UInt64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8730 {
8731 unsigned int value2 = op2->ui;
8732
8733 exp->type = 2;
8734 exp->string = PrintUInt64(op1->ui <<= value2);
8735 if(!exp->expType)
8736 {
8737 exp->expType = op1->type;
8738 if(op1->type)
8739 op1->type->refCount++;
8740 }
8741 return 0x1;
8742 }
8743
8744 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8745 {
8746 short value2 = op2->s;
8747
8748 exp->type = 2;
8749 exp->string = PrintShort(op1->s <<= value2);
8750 if(!exp->expType)
8751 {
8752 exp->expType = op1->type;
8753 if(op1->type)
8754 op1->type->refCount++;
8755 }
8756 return 0x1;
8757 }
8758
8759 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8760 {
8761 unsigned short value2 = op2->us;
8762
8763 exp->type = 2;
8764 exp->string = PrintUShort(op1->us <<= value2);
8765 if(!exp->expType)
8766 {
8767 exp->expType = op1->type;
8768 if(op1->type)
8769 op1->type->refCount++;
8770 }
8771 return 0x1;
8772 }
8773
8774 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8775 {
8776 char value2 = op2->c;
8777
8778 exp->type = 2;
8779 exp->string = PrintChar(op1->c <<= value2);
8780 if(!exp->expType)
8781 {
8782 exp->expType = op1->type;
8783 if(op1->type)
8784 op1->type->refCount++;
8785 }
8786 return 0x1;
8787 }
8788
8789 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8790 {
8791 unsigned char value2 = op2->uc;
8792
8793 exp->type = 2;
8794 exp->string = PrintUChar(op1->uc <<= value2);
8795 if(!exp->expType)
8796 {
8797 exp->expType = op1->type;
8798 if(op1->type)
8799 op1->type->refCount++;
8800 }
8801 return 0x1;
8802 }
8803
8804 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8805 {
8806 int value2 = op2->i;
8807
8808 exp->type = 2;
8809 exp->string = PrintInt(op1->i >>= value2);
8810 if(!exp->expType)
8811 {
8812 exp->expType = op1->type;
8813 if(op1->type)
8814 op1->type->refCount++;
8815 }
8816 return 0x1;
8817 }
8818
8819 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8820 {
8821 unsigned int value2 = op2->ui;
8822
8823 exp->type = 2;
8824 exp->string = PrintUInt(op1->ui >>= value2);
8825 if(!exp->expType)
8826 {
8827 exp->expType = op1->type;
8828 if(op1->type)
8829 op1->type->refCount++;
8830 }
8831 return 0x1;
8832 }
8833
8834 static unsigned int Int64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8835 {
8836 int value2 = op2->i;
8837
8838 exp->type = 2;
8839 exp->string = PrintInt64(op1->i >>= value2);
8840 if(!exp->expType)
8841 {
8842 exp->expType = op1->type;
8843 if(op1->type)
8844 op1->type->refCount++;
8845 }
8846 return 0x1;
8847 }
8848
8849 static unsigned int UInt64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8850 {
8851 unsigned int value2 = op2->ui;
8852
8853 exp->type = 2;
8854 exp->string = PrintUInt64(op1->ui >>= value2);
8855 if(!exp->expType)
8856 {
8857 exp->expType = op1->type;
8858 if(op1->type)
8859 op1->type->refCount++;
8860 }
8861 return 0x1;
8862 }
8863
8864 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8865 {
8866 short value2 = op2->s;
8867
8868 exp->type = 2;
8869 exp->string = PrintShort(op1->s >>= value2);
8870 if(!exp->expType)
8871 {
8872 exp->expType = op1->type;
8873 if(op1->type)
8874 op1->type->refCount++;
8875 }
8876 return 0x1;
8877 }
8878
8879 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8880 {
8881 unsigned short value2 = op2->us;
8882
8883 exp->type = 2;
8884 exp->string = PrintUShort(op1->us >>= value2);
8885 if(!exp->expType)
8886 {
8887 exp->expType = op1->type;
8888 if(op1->type)
8889 op1->type->refCount++;
8890 }
8891 return 0x1;
8892 }
8893
8894 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8895 {
8896 char value2 = op2->c;
8897
8898 exp->type = 2;
8899 exp->string = PrintChar(op1->c >>= value2);
8900 if(!exp->expType)
8901 {
8902 exp->expType = op1->type;
8903 if(op1->type)
8904 op1->type->refCount++;
8905 }
8906 return 0x1;
8907 }
8908
8909 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8910 {
8911 unsigned char value2 = op2->uc;
8912
8913 exp->type = 2;
8914 exp->string = PrintUChar(op1->uc >>= value2);
8915 if(!exp->expType)
8916 {
8917 exp->expType = op1->type;
8918 if(op1->type)
8919 op1->type->refCount++;
8920 }
8921 return 0x1;
8922 }
8923
8924 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
8925 {
8926 exp->type = 2;
8927 exp->string = PrintInt((int)(!op1->i));
8928 if(!exp->expType)
8929 {
8930 exp->expType = op1->type;
8931 if(op1->type)
8932 op1->type->refCount++;
8933 }
8934 return 0x1;
8935 }
8936
8937 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
8938 {
8939 exp->type = 2;
8940 exp->string = PrintUInt((unsigned int)(!op1->ui));
8941 if(!exp->expType)
8942 {
8943 exp->expType = op1->type;
8944 if(op1->type)
8945 op1->type->refCount++;
8946 }
8947 return 0x1;
8948 }
8949
8950 static unsigned int Int64Not(struct Expression * exp, struct Operand * op1)
8951 {
8952 exp->type = 2;
8953 exp->string = PrintInt64((int)(!op1->i));
8954 if(!exp->expType)
8955 {
8956 exp->expType = op1->type;
8957 if(op1->type)
8958 op1->type->refCount++;
8959 }
8960 return 0x1;
8961 }
8962
8963 static unsigned int UInt64Not(struct Expression * exp, struct Operand * op1)
8964 {
8965 exp->type = 2;
8966 exp->string = PrintUInt64((unsigned int)(!op1->ui));
8967 if(!exp->expType)
8968 {
8969 exp->expType = op1->type;
8970 if(op1->type)
8971 op1->type->refCount++;
8972 }
8973 return 0x1;
8974 }
8975
8976 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
8977 {
8978 exp->type = 2;
8979 exp->string = PrintShort((short)(!op1->s));
8980 if(!exp->expType)
8981 {
8982 exp->expType = op1->type;
8983 if(op1->type)
8984 op1->type->refCount++;
8985 }
8986 return 0x1;
8987 }
8988
8989 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
8990 {
8991 exp->type = 2;
8992 exp->string = PrintUShort((unsigned short)(!op1->us));
8993 if(!exp->expType)
8994 {
8995 exp->expType = op1->type;
8996 if(op1->type)
8997 op1->type->refCount++;
8998 }
8999 return 0x1;
9000 }
9001
9002 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
9003 {
9004 exp->type = 2;
9005 exp->string = PrintChar((char)(!op1->c));
9006 if(!exp->expType)
9007 {
9008 exp->expType = op1->type;
9009 if(op1->type)
9010 op1->type->refCount++;
9011 }
9012 return 0x1;
9013 }
9014
9015 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
9016 {
9017 exp->type = 2;
9018 exp->string = PrintUChar((unsigned char)(!op1->uc));
9019 if(!exp->expType)
9020 {
9021 exp->expType = op1->type;
9022 if(op1->type)
9023 op1->type->refCount++;
9024 }
9025 return 0x1;
9026 }
9027
9028 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9029 {
9030 int value2 = op2->i;
9031
9032 exp->type = 2;
9033 exp->string = PrintInt(op1->i == value2);
9034 if(!exp->expType)
9035 {
9036 exp->expType = op1->type;
9037 if(op1->type)
9038 op1->type->refCount++;
9039 }
9040 return 0x1;
9041 }
9042
9043 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9044 {
9045 unsigned int value2 = op2->ui;
9046
9047 exp->type = 2;
9048 exp->string = PrintUInt(op1->ui == value2);
9049 if(!exp->expType)
9050 {
9051 exp->expType = op1->type;
9052 if(op1->type)
9053 op1->type->refCount++;
9054 }
9055 return 0x1;
9056 }
9057
9058 static unsigned int Int64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9059 {
9060 int value2 = op2->i;
9061
9062 exp->type = 2;
9063 exp->string = PrintInt64(op1->i == value2);
9064 if(!exp->expType)
9065 {
9066 exp->expType = op1->type;
9067 if(op1->type)
9068 op1->type->refCount++;
9069 }
9070 return 0x1;
9071 }
9072
9073 static unsigned int UInt64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9074 {
9075 unsigned int value2 = op2->ui;
9076
9077 exp->type = 2;
9078 exp->string = PrintUInt64(op1->ui == value2);
9079 if(!exp->expType)
9080 {
9081 exp->expType = op1->type;
9082 if(op1->type)
9083 op1->type->refCount++;
9084 }
9085 return 0x1;
9086 }
9087
9088 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9089 {
9090 short value2 = op2->s;
9091
9092 exp->type = 2;
9093 exp->string = PrintShort(op1->s == value2);
9094 if(!exp->expType)
9095 {
9096 exp->expType = op1->type;
9097 if(op1->type)
9098 op1->type->refCount++;
9099 }
9100 return 0x1;
9101 }
9102
9103 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9104 {
9105 unsigned short value2 = op2->us;
9106
9107 exp->type = 2;
9108 exp->string = PrintUShort(op1->us == value2);
9109 if(!exp->expType)
9110 {
9111 exp->expType = op1->type;
9112 if(op1->type)
9113 op1->type->refCount++;
9114 }
9115 return 0x1;
9116 }
9117
9118 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9119 {
9120 char value2 = op2->c;
9121
9122 exp->type = 2;
9123 exp->string = PrintChar(op1->c == value2);
9124 if(!exp->expType)
9125 {
9126 exp->expType = op1->type;
9127 if(op1->type)
9128 op1->type->refCount++;
9129 }
9130 return 0x1;
9131 }
9132
9133 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9134 {
9135 unsigned char value2 = op2->uc;
9136
9137 exp->type = 2;
9138 exp->string = PrintUChar(op1->uc == value2);
9139 if(!exp->expType)
9140 {
9141 exp->expType = op1->type;
9142 if(op1->type)
9143 op1->type->refCount++;
9144 }
9145 return 0x1;
9146 }
9147
9148 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9149 {
9150 float value2 = op2->f;
9151
9152 exp->type = 2;
9153 exp->string = PrintFloat(op1->f == value2);
9154 if(!exp->expType)
9155 {
9156 exp->expType = op1->type;
9157 if(op1->type)
9158 op1->type->refCount++;
9159 }
9160 return 0x1;
9161 }
9162
9163 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9164 {
9165 double value2 = op2->d;
9166
9167 exp->type = 2;
9168 exp->string = PrintDouble(op1->d == value2);
9169 if(!exp->expType)
9170 {
9171 exp->expType = op1->type;
9172 if(op1->type)
9173 op1->type->refCount++;
9174 }
9175 return 0x1;
9176 }
9177
9178 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9179 {
9180 int value2 = op2->i;
9181
9182 exp->type = 2;
9183 exp->string = PrintInt(op1->i != value2);
9184 if(!exp->expType)
9185 {
9186 exp->expType = op1->type;
9187 if(op1->type)
9188 op1->type->refCount++;
9189 }
9190 return 0x1;
9191 }
9192
9193 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9194 {
9195 unsigned int value2 = op2->ui;
9196
9197 exp->type = 2;
9198 exp->string = PrintUInt(op1->ui != value2);
9199 if(!exp->expType)
9200 {
9201 exp->expType = op1->type;
9202 if(op1->type)
9203 op1->type->refCount++;
9204 }
9205 return 0x1;
9206 }
9207
9208 static unsigned int Int64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9209 {
9210 int value2 = op2->i;
9211
9212 exp->type = 2;
9213 exp->string = PrintInt64(op1->i != value2);
9214 if(!exp->expType)
9215 {
9216 exp->expType = op1->type;
9217 if(op1->type)
9218 op1->type->refCount++;
9219 }
9220 return 0x1;
9221 }
9222
9223 static unsigned int UInt64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9224 {
9225 unsigned int value2 = op2->ui;
9226
9227 exp->type = 2;
9228 exp->string = PrintUInt64(op1->ui != value2);
9229 if(!exp->expType)
9230 {
9231 exp->expType = op1->type;
9232 if(op1->type)
9233 op1->type->refCount++;
9234 }
9235 return 0x1;
9236 }
9237
9238 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9239 {
9240 short value2 = op2->s;
9241
9242 exp->type = 2;
9243 exp->string = PrintShort(op1->s != value2);
9244 if(!exp->expType)
9245 {
9246 exp->expType = op1->type;
9247 if(op1->type)
9248 op1->type->refCount++;
9249 }
9250 return 0x1;
9251 }
9252
9253 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9254 {
9255 unsigned short value2 = op2->us;
9256
9257 exp->type = 2;
9258 exp->string = PrintUShort(op1->us != value2);
9259 if(!exp->expType)
9260 {
9261 exp->expType = op1->type;
9262 if(op1->type)
9263 op1->type->refCount++;
9264 }
9265 return 0x1;
9266 }
9267
9268 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9269 {
9270 char value2 = op2->c;
9271
9272 exp->type = 2;
9273 exp->string = PrintChar(op1->c != value2);
9274 if(!exp->expType)
9275 {
9276 exp->expType = op1->type;
9277 if(op1->type)
9278 op1->type->refCount++;
9279 }
9280 return 0x1;
9281 }
9282
9283 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9284 {
9285 unsigned char value2 = op2->uc;
9286
9287 exp->type = 2;
9288 exp->string = PrintUChar(op1->uc != value2);
9289 if(!exp->expType)
9290 {
9291 exp->expType = op1->type;
9292 if(op1->type)
9293 op1->type->refCount++;
9294 }
9295 return 0x1;
9296 }
9297
9298 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9299 {
9300 float value2 = op2->f;
9301
9302 exp->type = 2;
9303 exp->string = PrintFloat(op1->f != value2);
9304 if(!exp->expType)
9305 {
9306 exp->expType = op1->type;
9307 if(op1->type)
9308 op1->type->refCount++;
9309 }
9310 return 0x1;
9311 }
9312
9313 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9314 {
9315 double value2 = op2->d;
9316
9317 exp->type = 2;
9318 exp->string = PrintDouble(op1->d != value2);
9319 if(!exp->expType)
9320 {
9321 exp->expType = op1->type;
9322 if(op1->type)
9323 op1->type->refCount++;
9324 }
9325 return 0x1;
9326 }
9327
9328 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9329 {
9330 int value2 = op2->i;
9331
9332 exp->type = 2;
9333 exp->string = PrintInt(op1->i && value2);
9334 if(!exp->expType)
9335 {
9336 exp->expType = op1->type;
9337 if(op1->type)
9338 op1->type->refCount++;
9339 }
9340 return 0x1;
9341 }
9342
9343 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9344 {
9345 unsigned int value2 = op2->ui;
9346
9347 exp->type = 2;
9348 exp->string = PrintUInt(op1->ui && value2);
9349 if(!exp->expType)
9350 {
9351 exp->expType = op1->type;
9352 if(op1->type)
9353 op1->type->refCount++;
9354 }
9355 return 0x1;
9356 }
9357
9358 static unsigned int Int64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9359 {
9360 int value2 = op2->i;
9361
9362 exp->type = 2;
9363 exp->string = PrintInt64(op1->i && value2);
9364 if(!exp->expType)
9365 {
9366 exp->expType = op1->type;
9367 if(op1->type)
9368 op1->type->refCount++;
9369 }
9370 return 0x1;
9371 }
9372
9373 static unsigned int UInt64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9374 {
9375 unsigned int value2 = op2->ui;
9376
9377 exp->type = 2;
9378 exp->string = PrintUInt64(op1->ui && value2);
9379 if(!exp->expType)
9380 {
9381 exp->expType = op1->type;
9382 if(op1->type)
9383 op1->type->refCount++;
9384 }
9385 return 0x1;
9386 }
9387
9388 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9389 {
9390 short value2 = op2->s;
9391
9392 exp->type = 2;
9393 exp->string = PrintShort(op1->s && value2);
9394 if(!exp->expType)
9395 {
9396 exp->expType = op1->type;
9397 if(op1->type)
9398 op1->type->refCount++;
9399 }
9400 return 0x1;
9401 }
9402
9403 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9404 {
9405 unsigned short value2 = op2->us;
9406
9407 exp->type = 2;
9408 exp->string = PrintUShort(op1->us && value2);
9409 if(!exp->expType)
9410 {
9411 exp->expType = op1->type;
9412 if(op1->type)
9413 op1->type->refCount++;
9414 }
9415 return 0x1;
9416 }
9417
9418 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9419 {
9420 char value2 = op2->c;
9421
9422 exp->type = 2;
9423 exp->string = PrintChar(op1->c && value2);
9424 if(!exp->expType)
9425 {
9426 exp->expType = op1->type;
9427 if(op1->type)
9428 op1->type->refCount++;
9429 }
9430 return 0x1;
9431 }
9432
9433 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9434 {
9435 unsigned char value2 = op2->uc;
9436
9437 exp->type = 2;
9438 exp->string = PrintUChar(op1->uc && value2);
9439 if(!exp->expType)
9440 {
9441 exp->expType = op1->type;
9442 if(op1->type)
9443 op1->type->refCount++;
9444 }
9445 return 0x1;
9446 }
9447
9448 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9449 {
9450 float value2 = op2->f;
9451
9452 exp->type = 2;
9453 exp->string = PrintFloat(op1->f && value2);
9454 if(!exp->expType)
9455 {
9456 exp->expType = op1->type;
9457 if(op1->type)
9458 op1->type->refCount++;
9459 }
9460 return 0x1;
9461 }
9462
9463 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9464 {
9465 double value2 = op2->d;
9466
9467 exp->type = 2;
9468 exp->string = PrintDouble(op1->d && value2);
9469 if(!exp->expType)
9470 {
9471 exp->expType = op1->type;
9472 if(op1->type)
9473 op1->type->refCount++;
9474 }
9475 return 0x1;
9476 }
9477
9478 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9479 {
9480 int value2 = op2->i;
9481
9482 exp->type = 2;
9483 exp->string = PrintInt(op1->i || value2);
9484 if(!exp->expType)
9485 {
9486 exp->expType = op1->type;
9487 if(op1->type)
9488 op1->type->refCount++;
9489 }
9490 return 0x1;
9491 }
9492
9493 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9494 {
9495 unsigned int value2 = op2->ui;
9496
9497 exp->type = 2;
9498 exp->string = PrintUInt(op1->ui || value2);
9499 if(!exp->expType)
9500 {
9501 exp->expType = op1->type;
9502 if(op1->type)
9503 op1->type->refCount++;
9504 }
9505 return 0x1;
9506 }
9507
9508 static unsigned int Int64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9509 {
9510 int value2 = op2->i;
9511
9512 exp->type = 2;
9513 exp->string = PrintInt64(op1->i || value2);
9514 if(!exp->expType)
9515 {
9516 exp->expType = op1->type;
9517 if(op1->type)
9518 op1->type->refCount++;
9519 }
9520 return 0x1;
9521 }
9522
9523 static unsigned int UInt64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9524 {
9525 unsigned int value2 = op2->ui;
9526
9527 exp->type = 2;
9528 exp->string = PrintUInt64(op1->ui || value2);
9529 if(!exp->expType)
9530 {
9531 exp->expType = op1->type;
9532 if(op1->type)
9533 op1->type->refCount++;
9534 }
9535 return 0x1;
9536 }
9537
9538 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9539 {
9540 short value2 = op2->s;
9541
9542 exp->type = 2;
9543 exp->string = PrintShort(op1->s || value2);
9544 if(!exp->expType)
9545 {
9546 exp->expType = op1->type;
9547 if(op1->type)
9548 op1->type->refCount++;
9549 }
9550 return 0x1;
9551 }
9552
9553 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9554 {
9555 unsigned short value2 = op2->us;
9556
9557 exp->type = 2;
9558 exp->string = PrintUShort(op1->us || value2);
9559 if(!exp->expType)
9560 {
9561 exp->expType = op1->type;
9562 if(op1->type)
9563 op1->type->refCount++;
9564 }
9565 return 0x1;
9566 }
9567
9568 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9569 {
9570 char value2 = op2->c;
9571
9572 exp->type = 2;
9573 exp->string = PrintChar(op1->c || value2);
9574 if(!exp->expType)
9575 {
9576 exp->expType = op1->type;
9577 if(op1->type)
9578 op1->type->refCount++;
9579 }
9580 return 0x1;
9581 }
9582
9583 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9584 {
9585 unsigned char value2 = op2->uc;
9586
9587 exp->type = 2;
9588 exp->string = PrintUChar(op1->uc || value2);
9589 if(!exp->expType)
9590 {
9591 exp->expType = op1->type;
9592 if(op1->type)
9593 op1->type->refCount++;
9594 }
9595 return 0x1;
9596 }
9597
9598 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9599 {
9600 float value2 = op2->f;
9601
9602 exp->type = 2;
9603 exp->string = PrintFloat(op1->f || value2);
9604 if(!exp->expType)
9605 {
9606 exp->expType = op1->type;
9607 if(op1->type)
9608 op1->type->refCount++;
9609 }
9610 return 0x1;
9611 }
9612
9613 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9614 {
9615 double value2 = op2->d;
9616
9617 exp->type = 2;
9618 exp->string = PrintDouble(op1->d || value2);
9619 if(!exp->expType)
9620 {
9621 exp->expType = op1->type;
9622 if(op1->type)
9623 op1->type->refCount++;
9624 }
9625 return 0x1;
9626 }
9627
9628 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9629 {
9630 int value2 = op2->i;
9631
9632 exp->type = 2;
9633 exp->string = PrintInt(op1->i > value2);
9634 if(!exp->expType)
9635 {
9636 exp->expType = op1->type;
9637 if(op1->type)
9638 op1->type->refCount++;
9639 }
9640 return 0x1;
9641 }
9642
9643 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9644 {
9645 unsigned int value2 = op2->ui;
9646
9647 exp->type = 2;
9648 exp->string = PrintUInt(op1->ui > value2);
9649 if(!exp->expType)
9650 {
9651 exp->expType = op1->type;
9652 if(op1->type)
9653 op1->type->refCount++;
9654 }
9655 return 0x1;
9656 }
9657
9658 static unsigned int Int64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9659 {
9660 int value2 = op2->i;
9661
9662 exp->type = 2;
9663 exp->string = PrintInt64(op1->i > value2);
9664 if(!exp->expType)
9665 {
9666 exp->expType = op1->type;
9667 if(op1->type)
9668 op1->type->refCount++;
9669 }
9670 return 0x1;
9671 }
9672
9673 static unsigned int UInt64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9674 {
9675 unsigned int value2 = op2->ui;
9676
9677 exp->type = 2;
9678 exp->string = PrintUInt64(op1->ui > value2);
9679 if(!exp->expType)
9680 {
9681 exp->expType = op1->type;
9682 if(op1->type)
9683 op1->type->refCount++;
9684 }
9685 return 0x1;
9686 }
9687
9688 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9689 {
9690 short value2 = op2->s;
9691
9692 exp->type = 2;
9693 exp->string = PrintShort(op1->s > value2);
9694 if(!exp->expType)
9695 {
9696 exp->expType = op1->type;
9697 if(op1->type)
9698 op1->type->refCount++;
9699 }
9700 return 0x1;
9701 }
9702
9703 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9704 {
9705 unsigned short value2 = op2->us;
9706
9707 exp->type = 2;
9708 exp->string = PrintUShort(op1->us > value2);
9709 if(!exp->expType)
9710 {
9711 exp->expType = op1->type;
9712 if(op1->type)
9713 op1->type->refCount++;
9714 }
9715 return 0x1;
9716 }
9717
9718 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9719 {
9720 char value2 = op2->c;
9721
9722 exp->type = 2;
9723 exp->string = PrintChar(op1->c > value2);
9724 if(!exp->expType)
9725 {
9726 exp->expType = op1->type;
9727 if(op1->type)
9728 op1->type->refCount++;
9729 }
9730 return 0x1;
9731 }
9732
9733 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9734 {
9735 unsigned char value2 = op2->uc;
9736
9737 exp->type = 2;
9738 exp->string = PrintUChar(op1->uc > value2);
9739 if(!exp->expType)
9740 {
9741 exp->expType = op1->type;
9742 if(op1->type)
9743 op1->type->refCount++;
9744 }
9745 return 0x1;
9746 }
9747
9748 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9749 {
9750 float value2 = op2->f;
9751
9752 exp->type = 2;
9753 exp->string = PrintFloat(op1->f > value2);
9754 if(!exp->expType)
9755 {
9756 exp->expType = op1->type;
9757 if(op1->type)
9758 op1->type->refCount++;
9759 }
9760 return 0x1;
9761 }
9762
9763 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9764 {
9765 double value2 = op2->d;
9766
9767 exp->type = 2;
9768 exp->string = PrintDouble(op1->d > value2);
9769 if(!exp->expType)
9770 {
9771 exp->expType = op1->type;
9772 if(op1->type)
9773 op1->type->refCount++;
9774 }
9775 return 0x1;
9776 }
9777
9778 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9779 {
9780 int value2 = op2->i;
9781
9782 exp->type = 2;
9783 exp->string = PrintInt(op1->i < value2);
9784 if(!exp->expType)
9785 {
9786 exp->expType = op1->type;
9787 if(op1->type)
9788 op1->type->refCount++;
9789 }
9790 return 0x1;
9791 }
9792
9793 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9794 {
9795 unsigned int value2 = op2->ui;
9796
9797 exp->type = 2;
9798 exp->string = PrintUInt(op1->ui < value2);
9799 if(!exp->expType)
9800 {
9801 exp->expType = op1->type;
9802 if(op1->type)
9803 op1->type->refCount++;
9804 }
9805 return 0x1;
9806 }
9807
9808 static unsigned int Int64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9809 {
9810 int value2 = op2->i;
9811
9812 exp->type = 2;
9813 exp->string = PrintInt64(op1->i < value2);
9814 if(!exp->expType)
9815 {
9816 exp->expType = op1->type;
9817 if(op1->type)
9818 op1->type->refCount++;
9819 }
9820 return 0x1;
9821 }
9822
9823 static unsigned int UInt64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9824 {
9825 unsigned int value2 = op2->ui;
9826
9827 exp->type = 2;
9828 exp->string = PrintUInt64(op1->ui < value2);
9829 if(!exp->expType)
9830 {
9831 exp->expType = op1->type;
9832 if(op1->type)
9833 op1->type->refCount++;
9834 }
9835 return 0x1;
9836 }
9837
9838 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9839 {
9840 short value2 = op2->s;
9841
9842 exp->type = 2;
9843 exp->string = PrintShort(op1->s < value2);
9844 if(!exp->expType)
9845 {
9846 exp->expType = op1->type;
9847 if(op1->type)
9848 op1->type->refCount++;
9849 }
9850 return 0x1;
9851 }
9852
9853 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9854 {
9855 unsigned short value2 = op2->us;
9856
9857 exp->type = 2;
9858 exp->string = PrintUShort(op1->us < value2);
9859 if(!exp->expType)
9860 {
9861 exp->expType = op1->type;
9862 if(op1->type)
9863 op1->type->refCount++;
9864 }
9865 return 0x1;
9866 }
9867
9868 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9869 {
9870 char value2 = op2->c;
9871
9872 exp->type = 2;
9873 exp->string = PrintChar(op1->c < value2);
9874 if(!exp->expType)
9875 {
9876 exp->expType = op1->type;
9877 if(op1->type)
9878 op1->type->refCount++;
9879 }
9880 return 0x1;
9881 }
9882
9883 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9884 {
9885 unsigned char value2 = op2->uc;
9886
9887 exp->type = 2;
9888 exp->string = PrintUChar(op1->uc < value2);
9889 if(!exp->expType)
9890 {
9891 exp->expType = op1->type;
9892 if(op1->type)
9893 op1->type->refCount++;
9894 }
9895 return 0x1;
9896 }
9897
9898 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9899 {
9900 float value2 = op2->f;
9901
9902 exp->type = 2;
9903 exp->string = PrintFloat(op1->f < value2);
9904 if(!exp->expType)
9905 {
9906 exp->expType = op1->type;
9907 if(op1->type)
9908 op1->type->refCount++;
9909 }
9910 return 0x1;
9911 }
9912
9913 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9914 {
9915 double value2 = op2->d;
9916
9917 exp->type = 2;
9918 exp->string = PrintDouble(op1->d < value2);
9919 if(!exp->expType)
9920 {
9921 exp->expType = op1->type;
9922 if(op1->type)
9923 op1->type->refCount++;
9924 }
9925 return 0x1;
9926 }
9927
9928 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9929 {
9930 int value2 = op2->i;
9931
9932 exp->type = 2;
9933 exp->string = PrintInt(op1->i >= value2);
9934 if(!exp->expType)
9935 {
9936 exp->expType = op1->type;
9937 if(op1->type)
9938 op1->type->refCount++;
9939 }
9940 return 0x1;
9941 }
9942
9943 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9944 {
9945 unsigned int value2 = op2->ui;
9946
9947 exp->type = 2;
9948 exp->string = PrintUInt(op1->ui >= value2);
9949 if(!exp->expType)
9950 {
9951 exp->expType = op1->type;
9952 if(op1->type)
9953 op1->type->refCount++;
9954 }
9955 return 0x1;
9956 }
9957
9958 static unsigned int Int64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9959 {
9960 int value2 = op2->i;
9961
9962 exp->type = 2;
9963 exp->string = PrintInt64(op1->i >= value2);
9964 if(!exp->expType)
9965 {
9966 exp->expType = op1->type;
9967 if(op1->type)
9968 op1->type->refCount++;
9969 }
9970 return 0x1;
9971 }
9972
9973 static unsigned int UInt64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9974 {
9975 unsigned int value2 = op2->ui;
9976
9977 exp->type = 2;
9978 exp->string = PrintUInt64(op1->ui >= value2);
9979 if(!exp->expType)
9980 {
9981 exp->expType = op1->type;
9982 if(op1->type)
9983 op1->type->refCount++;
9984 }
9985 return 0x1;
9986 }
9987
9988 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9989 {
9990 short value2 = op2->s;
9991
9992 exp->type = 2;
9993 exp->string = PrintShort(op1->s >= value2);
9994 if(!exp->expType)
9995 {
9996 exp->expType = op1->type;
9997 if(op1->type)
9998 op1->type->refCount++;
9999 }
10000 return 0x1;
10001 }
10002
10003 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10004 {
10005 unsigned short value2 = op2->us;
10006
10007 exp->type = 2;
10008 exp->string = PrintUShort(op1->us >= value2);
10009 if(!exp->expType)
10010 {
10011 exp->expType = op1->type;
10012 if(op1->type)
10013 op1->type->refCount++;
10014 }
10015 return 0x1;
10016 }
10017
10018 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10019 {
10020 char value2 = op2->c;
10021
10022 exp->type = 2;
10023 exp->string = PrintChar(op1->c >= value2);
10024 if(!exp->expType)
10025 {
10026 exp->expType = op1->type;
10027 if(op1->type)
10028 op1->type->refCount++;
10029 }
10030 return 0x1;
10031 }
10032
10033 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10034 {
10035 unsigned char value2 = op2->uc;
10036
10037 exp->type = 2;
10038 exp->string = PrintUChar(op1->uc >= value2);
10039 if(!exp->expType)
10040 {
10041 exp->expType = op1->type;
10042 if(op1->type)
10043 op1->type->refCount++;
10044 }
10045 return 0x1;
10046 }
10047
10048 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10049 {
10050 float value2 = op2->f;
10051
10052 exp->type = 2;
10053 exp->string = PrintFloat(op1->f >= value2);
10054 if(!exp->expType)
10055 {
10056 exp->expType = op1->type;
10057 if(op1->type)
10058 op1->type->refCount++;
10059 }
10060 return 0x1;
10061 }
10062
10063 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10064 {
10065 double value2 = op2->d;
10066
10067 exp->type = 2;
10068 exp->string = PrintDouble(op1->d >= value2);
10069 if(!exp->expType)
10070 {
10071 exp->expType = op1->type;
10072 if(op1->type)
10073 op1->type->refCount++;
10074 }
10075 return 0x1;
10076 }
10077
10078 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10079 {
10080 int value2 = op2->i;
10081
10082 exp->type = 2;
10083 exp->string = PrintInt(op1->i <= value2);
10084 if(!exp->expType)
10085 {
10086 exp->expType = op1->type;
10087 if(op1->type)
10088 op1->type->refCount++;
10089 }
10090 return 0x1;
10091 }
10092
10093 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10094 {
10095 unsigned int value2 = op2->ui;
10096
10097 exp->type = 2;
10098 exp->string = PrintUInt(op1->ui <= value2);
10099 if(!exp->expType)
10100 {
10101 exp->expType = op1->type;
10102 if(op1->type)
10103 op1->type->refCount++;
10104 }
10105 return 0x1;
10106 }
10107
10108 static unsigned int Int64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10109 {
10110 int value2 = op2->i;
10111
10112 exp->type = 2;
10113 exp->string = PrintInt64(op1->i <= value2);
10114 if(!exp->expType)
10115 {
10116 exp->expType = op1->type;
10117 if(op1->type)
10118 op1->type->refCount++;
10119 }
10120 return 0x1;
10121 }
10122
10123 static unsigned int UInt64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10124 {
10125 unsigned int value2 = op2->ui;
10126
10127 exp->type = 2;
10128 exp->string = PrintUInt64(op1->ui <= value2);
10129 if(!exp->expType)
10130 {
10131 exp->expType = op1->type;
10132 if(op1->type)
10133 op1->type->refCount++;
10134 }
10135 return 0x1;
10136 }
10137
10138 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10139 {
10140 short value2 = op2->s;
10141
10142 exp->type = 2;
10143 exp->string = PrintShort(op1->s <= value2);
10144 if(!exp->expType)
10145 {
10146 exp->expType = op1->type;
10147 if(op1->type)
10148 op1->type->refCount++;
10149 }
10150 return 0x1;
10151 }
10152
10153 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10154 {
10155 unsigned short value2 = op2->us;
10156
10157 exp->type = 2;
10158 exp->string = PrintUShort(op1->us <= value2);
10159 if(!exp->expType)
10160 {
10161 exp->expType = op1->type;
10162 if(op1->type)
10163 op1->type->refCount++;
10164 }
10165 return 0x1;
10166 }
10167
10168 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10169 {
10170 char value2 = op2->c;
10171
10172 exp->type = 2;
10173 exp->string = PrintChar(op1->c <= value2);
10174 if(!exp->expType)
10175 {
10176 exp->expType = op1->type;
10177 if(op1->type)
10178 op1->type->refCount++;
10179 }
10180 return 0x1;
10181 }
10182
10183 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10184 {
10185 unsigned char value2 = op2->uc;
10186
10187 exp->type = 2;
10188 exp->string = PrintUChar(op1->uc <= value2);
10189 if(!exp->expType)
10190 {
10191 exp->expType = op1->type;
10192 if(op1->type)
10193 op1->type->refCount++;
10194 }
10195 return 0x1;
10196 }
10197
10198 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10199 {
10200 float value2 = op2->f;
10201
10202 exp->type = 2;
10203 exp->string = PrintFloat(op1->f <= value2);
10204 if(!exp->expType)
10205 {
10206 exp->expType = op1->type;
10207 if(op1->type)
10208 op1->type->refCount++;
10209 }
10210 return 0x1;
10211 }
10212
10213 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10214 {
10215 double value2 = op2->d;
10216
10217 exp->type = 2;
10218 exp->string = PrintDouble(op1->d <= value2);
10219 if(!exp->expType)
10220 {
10221 exp->expType = op1->type;
10222 if(op1->type)
10223 op1->type->refCount++;
10224 }
10225 return 0x1;
10226 }
10227
10228 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10229 {
10230 exp->type = 2;
10231 exp->string = PrintInt(op1->i ? op2->i : op3->i);
10232 if(!exp->expType)
10233 {
10234 exp->expType = op1->type;
10235 if(op1->type)
10236 op1->type->refCount++;
10237 }
10238 return 0x1;
10239 }
10240
10241 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10242 {
10243 exp->type = 2;
10244 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
10245 if(!exp->expType)
10246 {
10247 exp->expType = op1->type;
10248 if(op1->type)
10249 op1->type->refCount++;
10250 }
10251 return 0x1;
10252 }
10253
10254 static unsigned int Int64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10255 {
10256 exp->type = 2;
10257 exp->string = PrintInt64(op1->i ? op2->i : op3->i);
10258 if(!exp->expType)
10259 {
10260 exp->expType = op1->type;
10261 if(op1->type)
10262 op1->type->refCount++;
10263 }
10264 return 0x1;
10265 }
10266
10267 static unsigned int UInt64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10268 {
10269 exp->type = 2;
10270 exp->string = PrintUInt64(op1->ui ? op2->ui : op3->ui);
10271 if(!exp->expType)
10272 {
10273 exp->expType = op1->type;
10274 if(op1->type)
10275 op1->type->refCount++;
10276 }
10277 return 0x1;
10278 }
10279
10280 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10281 {
10282 exp->type = 2;
10283 exp->string = PrintShort(op1->s ? op2->s : op3->s);
10284 if(!exp->expType)
10285 {
10286 exp->expType = op1->type;
10287 if(op1->type)
10288 op1->type->refCount++;
10289 }
10290 return 0x1;
10291 }
10292
10293 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10294 {
10295 exp->type = 2;
10296 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
10297 if(!exp->expType)
10298 {
10299 exp->expType = op1->type;
10300 if(op1->type)
10301 op1->type->refCount++;
10302 }
10303 return 0x1;
10304 }
10305
10306 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10307 {
10308 exp->type = 2;
10309 exp->string = PrintChar(op1->c ? op2->c : op3->c);
10310 if(!exp->expType)
10311 {
10312 exp->expType = op1->type;
10313 if(op1->type)
10314 op1->type->refCount++;
10315 }
10316 return 0x1;
10317 }
10318
10319 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10320 {
10321 exp->type = 2;
10322 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
10323 if(!exp->expType)
10324 {
10325 exp->expType = op1->type;
10326 if(op1->type)
10327 op1->type->refCount++;
10328 }
10329 return 0x1;
10330 }
10331
10332 static unsigned int FloatCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10333 {
10334 exp->type = 2;
10335 exp->string = PrintFloat(op1->f ? op2->f : op3->f);
10336 if(!exp->expType)
10337 {
10338 exp->expType = op1->type;
10339 if(op1->type)
10340 op1->type->refCount++;
10341 }
10342 return 0x1;
10343 }
10344
10345 static unsigned int DoubleCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10346 {
10347 exp->type = 2;
10348 exp->string = PrintDouble(op1->d ? op2->d : op3->d);
10349 if(!exp->expType)
10350 {
10351 exp->expType = op1->type;
10352 if(op1->type)
10353 op1->type->refCount++;
10354 }
10355 return 0x1;
10356 }
10357
10358 struct OpTable intOps = 
10359 {
10360 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
10361 };
10362
10363 struct OpTable uintOps = 
10364 {
10365 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
10366 };
10367
10368 struct OpTable int64Ops = 
10369 {
10370 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
10371 };
10372
10373 struct OpTable uint64Ops = 
10374 {
10375 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
10376 };
10377
10378 struct OpTable shortOps = 
10379 {
10380 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
10381 };
10382
10383 struct OpTable ushortOps = 
10384 {
10385 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
10386 };
10387
10388 struct OpTable floatOps = 
10389 {
10390 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
10391 };
10392
10393 struct OpTable doubleOps = 
10394 {
10395 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
10396 };
10397
10398 struct OpTable charOps = 
10399 {
10400 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
10401 };
10402
10403 struct OpTable ucharOps = 
10404 {
10405 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
10406 };
10407
10408 void ReadString(char * output, char * string)
10409 {
10410 int len = strlen(string);
10411 int c, d = 0;
10412 unsigned int quoted = 0x0, escaped = 0x0;
10413
10414 for(c = 0; c < len; c++)
10415 {
10416 char ch = string[c];
10417
10418 if(escaped)
10419 {
10420 switch(ch)
10421 {
10422 case 'n':
10423 output[d] = '\n';
10424 break;
10425 case 't':
10426 output[d] = '\t';
10427 break;
10428 case 'a':
10429 output[d] = '\a';
10430 break;
10431 case 'b':
10432 output[d] = '\b';
10433 break;
10434 case 'f':
10435 output[d] = '\f';
10436 break;
10437 case 'r':
10438 output[d] = '\r';
10439 break;
10440 case 'v':
10441 output[d] = '\v';
10442 break;
10443 case '\\':
10444 output[d] = '\\';
10445 break;
10446 case '\"':
10447 output[d] = '\"';
10448 break;
10449 default:
10450 output[d++] = '\\';
10451 output[d] = ch;
10452 }
10453 d++;
10454 escaped = 0x0;
10455 }
10456 else
10457 {
10458 if(ch == '\"')
10459 quoted ^= 0x1;
10460 else if(quoted)
10461 {
10462 if(ch == '\\')
10463 escaped = 0x1;
10464 else
10465 output[d++] = ch;
10466 }
10467 }
10468 }
10469 output[d] = '\0';
10470 }
10471
10472 extern long long __ecereNameSpace__ecere__com___strtoi64(char *  string, char * *  endString, int base);
10473
10474 extern uint64 __ecereNameSpace__ecere__com___strtoui64(char *  string, char * *  endString, int base);
10475
10476 extern double strtod(char * , char * * );
10477
10478 struct Operand GetOperand(struct Expression * exp)
10479 {
10480 struct Operand op = 
10481 {
10482 0, 0, 0, 0, 
10483 {
10484 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10485 }
10486 };
10487 struct Type * type = exp->expType;
10488
10489 if(type)
10490 {
10491 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
10492 {
10493 if(!type->_class->registered->dataType)
10494 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
10495 type = type->_class->registered->dataType;
10496 }
10497 op.kind = type->kind;
10498 op.type = exp->expType;
10499 if(exp->isConstant && exp->type == 2)
10500 {
10501 switch(op.kind)
10502 {
10503 case 24:
10504 case 1:
10505 {
10506 if(exp->constant[0] == '\'')
10507 op.c = exp->constant[1];
10508 else if(type->isSigned)
10509 {
10510 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
10511 op.ops = charOps;
10512 }
10513 else
10514 {
10515 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
10516 op.ops = ucharOps;
10517 }
10518 break;
10519 }
10520 case 2:
10521 if(type->isSigned)
10522 {
10523 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
10524 op.ops = shortOps;
10525 }
10526 else
10527 {
10528 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
10529 op.ops = ushortOps;
10530 }
10531 break;
10532 case 3:
10533 case 5:
10534 if(type->isSigned)
10535 {
10536 op.i = strtol(exp->constant, (((void *)0)), 0);
10537 op.ops = intOps;
10538 }
10539 else
10540 {
10541 op.ui = strtoul(exp->constant, (((void *)0)), 0);
10542 op.ops = uintOps;
10543 }
10544 op.kind = 3;
10545 break;
10546 case 4:
10547 if(type->isSigned)
10548 {
10549 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10550 op.ops = intOps;
10551 }
10552 else
10553 {
10554 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10555 op.ops = uintOps;
10556 }
10557 op.kind = 4;
10558 break;
10559 case 22:
10560 if(type->isSigned)
10561 {
10562 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10563 op.ops = int64Ops;
10564 }
10565 else
10566 {
10567 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10568 op.ops = uint64Ops;
10569 }
10570 op.kind = 4;
10571 break;
10572 case 23:
10573 if(type->isSigned)
10574 {
10575 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10576 op.ops = int64Ops;
10577 }
10578 else
10579 {
10580 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10581 op.ops = uint64Ops;
10582 }
10583 op.kind = 4;
10584 break;
10585 case 6:
10586 op.f = (float)strtod(exp->constant, (((void *)0)));
10587 op.ops = floatOps;
10588 break;
10589 case 7:
10590 op.d = (double)strtod(exp->constant, (((void *)0)));
10591 op.ops = doubleOps;
10592 break;
10593 case 12:
10594 case 13:
10595 case 8:
10596 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10597 op.kind = 13;
10598 op.ops = uintOps;
10599 break;
10600 }
10601 }
10602 }
10603 return op;
10604 }
10605
10606 int __ecereVMethodID_class_OnGetString;
10607
10608 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
10609
10610 static void UnusedFunction()
10611 {
10612 int a;
10613
10614 ((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);
10615 }
10616
10617 extern int __ecereVMethodID_class_OnGetString;
10618
10619 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
10620 {
10621 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10622
10623 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
10624 {
10625 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
10626 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
10627 else
10628 {
10629 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10630 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
10631 struct Type * type;
10632 void * ptr = inst->data + dataMember->offset + offset;
10633 char * result = (((void *)0));
10634
10635 exp->loc = member->loc = inst->loc;
10636 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
10637 if(!dataMember->dataType)
10638 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
10639 type = dataMember->dataType;
10640 if(type->kind == 8)
10641 {
10642 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10643
10644 if(_class->type == 4)
10645 {
10646 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
10647
10648 if(enumClass)
10649 {
10650 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
10651 struct __ecereNameSpace__ecere__sys__NamedLink * item;
10652
10653 for(item = e->values.first; item; item = item->next)
10654 {
10655 if((int)item->data == *(int *)ptr)
10656 {
10657 result = item->name;
10658 break;
10659 }
10660 }
10661 if(result)
10662 {
10663 exp->identifier = MkIdentifier(result);
10664 exp->type = 0;
10665 exp->destType = MkClassType(_class->fullName);
10666 ProcessExpressionType(exp);
10667 }
10668 }
10669 }
10670 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
10671 {
10672 if(!_class->dataType)
10673 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10674 type = _class->dataType;
10675 }
10676 }
10677 if(!result)
10678 {
10679 switch(type->kind)
10680 {
10681 case 6:
10682 {
10683 FreeExpContents(exp);
10684 exp->constant = PrintFloat(*(float *)ptr);
10685 exp->type = 2;
10686 break;
10687 }
10688 case 7:
10689 {
10690 FreeExpContents(exp);
10691 exp->constant = PrintDouble(*(double *)ptr);
10692 exp->type = 2;
10693 break;
10694 }
10695 case 3:
10696 {
10697 FreeExpContents(exp);
10698 exp->constant = PrintInt(*(int *)ptr);
10699 exp->type = 2;
10700 break;
10701 }
10702 case 4:
10703 {
10704 FreeExpContents(exp);
10705 exp->constant = PrintInt64(*(long long *)ptr);
10706 exp->type = 2;
10707 break;
10708 }
10709 case 22:
10710 {
10711 FreeExpContents(exp);
10712 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
10713 exp->type = 2;
10714 break;
10715 }
10716 case 23:
10717 {
10718 FreeExpContents(exp);
10719 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
10720 exp->type = 2;
10721 break;
10722 }
10723 default:
10724 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
10725 }
10726 }
10727 ListAdd(memberList, member);
10728 }
10729 if(parentDataMember->type == 1)
10730 break;
10731 }
10732 }
10733
10734 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
10735
10736 void PopulateInstance(struct Instantiation * inst)
10737 {
10738 struct Symbol * classSym = inst->_class->symbol;
10739 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
10740 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10741 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
10742
10743 if(!inst->members)
10744 inst->members = MkListOne(MkMembersInitList(memberList));
10745 else
10746 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
10747 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
10748 {
10749 if(!dataMember->isProperty)
10750 {
10751 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
10752 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
10753 else
10754 {
10755 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10756 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
10757 struct Type * type;
10758 void * ptr = inst->data + dataMember->offset;
10759 char * result = (((void *)0));
10760
10761 exp->loc = member->loc = inst->loc;
10762 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
10763 if(!dataMember->dataType)
10764 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
10765 type = dataMember->dataType;
10766 if(type->kind == 8)
10767 {
10768 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10769
10770 if(_class->type == 4)
10771 {
10772 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
10773
10774 if(enumClass)
10775 {
10776 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
10777 struct __ecereNameSpace__ecere__sys__NamedLink * item;
10778
10779 for(item = e->values.first; item; item = item->next)
10780 {
10781 if((int)item->data == *(int *)ptr)
10782 {
10783 result = item->name;
10784 break;
10785 }
10786 }
10787 }
10788 if(result)
10789 {
10790 exp->identifier = MkIdentifier(result);
10791 exp->type = 0;
10792 exp->destType = MkClassType(_class->fullName);
10793 ProcessExpressionType(exp);
10794 }
10795 }
10796 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
10797 {
10798 if(!_class->dataType)
10799 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10800 type = _class->dataType;
10801 }
10802 }
10803 if(!result)
10804 {
10805 switch(type->kind)
10806 {
10807 case 6:
10808 {
10809 exp->constant = PrintFloat(*(float *)ptr);
10810 exp->type = 2;
10811 break;
10812 }
10813 case 7:
10814 {
10815 exp->constant = PrintDouble(*(double *)ptr);
10816 exp->type = 2;
10817 break;
10818 }
10819 case 3:
10820 {
10821 exp->constant = PrintInt(*(int *)ptr);
10822 exp->type = 2;
10823 break;
10824 }
10825 case 4:
10826 {
10827 exp->constant = PrintInt64(*(long long *)ptr);
10828 exp->type = 2;
10829 break;
10830 }
10831 case 22:
10832 {
10833 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
10834 exp->type = 2;
10835 break;
10836 }
10837 default:
10838 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
10839 }
10840 }
10841 ListAdd(memberList, member);
10842 }
10843 }
10844 }
10845 }
10846
10847 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);
10848
10849 extern void FreeInstance(struct Instantiation * inst);
10850
10851 void ComputeInstantiation(struct Expression * exp)
10852 {
10853 struct Instantiation * inst = exp->instance;
10854 struct MembersInit * members;
10855 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
10856 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
10857 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
10858 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
10859 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
10860 int subMemberStackPos = 0;
10861 uint64 bits = 0;
10862
10863 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
10864 {
10865 if(inst->data)
10866 return ;
10867 if(_class->type == 0 || _class->type == 5)
10868 {
10869 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
10870 if(_class->type == 0)
10871 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)inst->data))->_refCount++;
10872 }
10873 else
10874 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10875 }
10876 if(inst->members)
10877 {
10878 for(members = (*inst->members).first; members; members = members->next)
10879 {
10880 switch(members->type)
10881 {
10882 case 0:
10883 {
10884 if(members->dataMembers)
10885 {
10886 struct MemberInit * member;
10887
10888 for(member = (*members->dataMembers).first; member; member = member->next)
10889 {
10890 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
10891 unsigned int found = 0x0;
10892 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
10893 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
10894 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
10895 unsigned int dataMemberOffset;
10896
10897 if(!ident)
10898 {
10899 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
10900 if(curMember)
10901 {
10902 if(curMember->isProperty)
10903 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
10904 else
10905 {
10906 dataMember = curMember;
10907 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
10908 if(_class->type == 0)
10909 dataMemberOffset += _class->base->structSize;
10910 }
10911 found = 0x1;
10912 }
10913 }
10914 else
10915 {
10916 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
10917 if(prop)
10918 {
10919 found = 0x1;
10920 if(prop->memberAccess == 1)
10921 {
10922 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
10923 curClass = prop->_class;
10924 }
10925 }
10926 else
10927 {
10928 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
10929 int _subMemberStackPos = 0;
10930
10931 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
10932 if(dataMember)
10933 {
10934 found = 0x1;
10935 if(dataMember->memberAccess == 1)
10936 {
10937 curMember = dataMember;
10938 curClass = dataMember->_class;
10939 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
10940 subMemberStackPos = _subMemberStackPos;
10941 }
10942 }
10943 }
10944 }
10945 if(found && member->initializer && member->initializer->type == 0)
10946 {
10947 struct Expression * value = member->initializer->exp;
10948 struct Type * type = (((void *)0));
10949 unsigned int deepMember = 0x0;
10950
10951 if(prop)
10952 {
10953 type = prop->dataType;
10954 }
10955 else if(dataMember)
10956 {
10957 if(!dataMember->dataType)
10958 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
10959 type = dataMember->dataType;
10960 }
10961 if(ident && ident->next)
10962 {
10963 deepMember = 0x1;
10964 for(ident = ident->next; ident && type; ident = ident->next)
10965 {
10966 if(type->kind == 8)
10967 {
10968 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
10969 if(prop)
10970 type = prop->dataType;
10971 else
10972 {
10973 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
10974 if(dataMember)
10975 type = dataMember->dataType;
10976 }
10977 }
10978 else if(type->kind == 9 || type->kind == 10)
10979 {
10980 struct Type * memberType;
10981
10982 for(memberType = type->members.first; memberType; memberType = memberType->next)
10983 {
10984 if(!strcmp(memberType->name, ident->string))
10985 {
10986 type = memberType;
10987 break;
10988 }
10989 }
10990 }
10991 }
10992 }
10993 if(value)
10994 {
10995 FreeType(value->destType);
10996 value->destType = type;
10997 if(type)
10998 type->refCount++;
10999 ComputeExpression(value);
11000 }
11001 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11002 {
11003 if(type->kind == 8)
11004 {
11005 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11006
11007 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
11008 {
11009 if(!_class->dataType)
11010 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11011 type = _class->dataType;
11012 }
11013 }
11014 if(dataMember)
11015 {
11016 void * ptr = inst->data + dataMemberOffset;
11017
11018 if(value->type == 2)
11019 {
11020 switch(type->kind)
11021 {
11022 case 3:
11023 {
11024 GetInt(value, (int *)ptr);
11025 break;
11026 }
11027 case 4:
11028 {
11029 GetInt64(value, (long long *)ptr);
11030 break;
11031 }
11032 case 22:
11033 {
11034 GetIntPtr(value, (intptr_t *)ptr);
11035 break;
11036 }
11037 case 23:
11038 {
11039 GetIntSize(value, (ssize_t *)ptr);
11040 break;
11041 }
11042 case 6:
11043 {
11044 GetFloat(value, (float *)ptr);
11045 break;
11046 }
11047 case 7:
11048 {
11049 GetDouble(value, (double *)ptr);
11050 break;
11051 }
11052 }
11053 }
11054 else if(value->type == 1)
11055 {
11056 if(type->kind == 8)
11057 {
11058 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11059
11060 if(_class->type == 1)
11061 {
11062 ComputeTypeSize(type);
11063 if(value->instance->data)
11064 memcpy(ptr, value->instance->data, type->size);
11065 }
11066 }
11067 }
11068 }
11069 else if(prop)
11070 {
11071 if(value->type == 1 && value->instance->data)
11072 {
11073 if(type->kind == 8)
11074 {
11075 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11076
11077 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)))
11078 {
11079 void (* Set)(void *, void *) = (void *)prop->Set;
11080
11081 Set(inst->data, value->instance->data);
11082 PopulateInstance(inst);
11083 }
11084 }
11085 }
11086 else if(value->type == 2)
11087 {
11088 switch(type->kind)
11089 {
11090 case 7:
11091 {
11092 void (* Set)(void *, double) = (void *)prop->Set;
11093
11094 Set(inst->data, strtod(value->constant, (((void *)0))));
11095 break;
11096 }
11097 case 6:
11098 {
11099 void (* Set)(void *, float) = (void *)prop->Set;
11100
11101 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
11102 break;
11103 }
11104 case 3:
11105 {
11106 void (* Set)(void *, int) = (void *)prop->Set;
11107
11108 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
11109 break;
11110 }
11111 case 4:
11112 {
11113 void (* Set)(void *, long long) = (void *)prop->Set;
11114
11115 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11116 break;
11117 }
11118 case 22:
11119 {
11120 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11121
11122 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11123 break;
11124 }
11125 case 23:
11126 {
11127 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11128
11129 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11130 break;
11131 }
11132 }
11133 }
11134 else if(value->type == 3)
11135 {
11136 char temp[1024];
11137
11138 ReadString(temp, value->string);
11139 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
11140 }
11141 }
11142 }
11143 else if(!deepMember && type && _class->type == 3)
11144 {
11145 if(prop)
11146 {
11147 if(value->type == 2)
11148 {
11149 if(type->kind == 8)
11150 {
11151 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11152
11153 if(_class->type == 3)
11154 {
11155 if(!_class->dataType)
11156 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11157 type = _class->dataType;
11158 }
11159 }
11160 switch(type->kind)
11161 {
11162 case 6:
11163 {
11164 float fValue;
11165 float (* Set)(float) = (void *)prop->Set;
11166
11167 GetFloat(member->initializer->exp, &fValue);
11168 exp->constant = PrintFloat(Set(fValue));
11169 exp->type = 2;
11170 break;
11171 }
11172 case 7:
11173 {
11174 double dValue;
11175 double (* Set)(double) = (void *)prop->Set;
11176
11177 GetDouble(member->initializer->exp, &dValue);
11178 exp->constant = PrintDouble(Set(dValue));
11179 exp->type = 2;
11180 break;
11181 }
11182 }
11183 }
11184 }
11185 }
11186 else if(!deepMember && type && _class->type == 2)
11187 {
11188 if(prop)
11189 {
11190 if(value->type == 1 && value->instance->data)
11191 {
11192 unsigned int (* Set)(void *) = (void *)prop->Set;
11193
11194 bits = Set(value->instance->data);
11195 }
11196 else if(value->type == 2)
11197 {
11198 }
11199 }
11200 else if(dataMember)
11201 {
11202 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
11203 struct Type * type;
11204 int part = 0;
11205
11206 GetInt(value, &part);
11207 bits = (bits & ~bitMember->mask);
11208 if(!bitMember->dataType)
11209 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
11210 type = bitMember->dataType;
11211 if(type->kind == 8 && type->_class && type->_class->registered)
11212 {
11213 if(!type->_class->registered->dataType)
11214 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
11215 type = type->_class->registered->dataType;
11216 }
11217 switch(type->kind)
11218 {
11219 case 24:
11220 case 1:
11221 if(type->isSigned)
11222 bits |= ((char)part << bitMember->pos);
11223 else
11224 bits |= ((unsigned char)part << bitMember->pos);
11225 break;
11226 case 2:
11227 if(type->isSigned)
11228 bits |= ((short)part << bitMember->pos);
11229 else
11230 bits |= ((unsigned short)part << bitMember->pos);
11231 break;
11232 case 3:
11233 case 5:
11234 if(type->isSigned)
11235 bits |= (part << bitMember->pos);
11236 else
11237 bits |= ((unsigned int)part << bitMember->pos);
11238 break;
11239 case 4:
11240 if(type->isSigned)
11241 bits |= ((long long)part << bitMember->pos);
11242 else
11243 bits |= ((uint64)part << bitMember->pos);
11244 break;
11245 case 22:
11246 if(type->isSigned)
11247 {
11248 bits |= ((intptr_t)part << bitMember->pos);
11249 }
11250 else
11251 {
11252 bits |= ((uintptr_t)part << bitMember->pos);
11253 }
11254 break;
11255 case 23:
11256 if(type->isSigned)
11257 {
11258 bits |= ((ssize_t)part << bitMember->pos);
11259 }
11260 else
11261 {
11262 bits |= ((size_t)part << bitMember->pos);
11263 }
11264 break;
11265 }
11266 }
11267 }
11268 }
11269 else
11270 {
11271 if(_class && _class->type == 3)
11272 {
11273 ComputeExpression(member->initializer->exp);
11274 exp->constant = member->initializer->exp->constant;
11275 exp->type = 2;
11276 member->initializer->exp->constant = (((void *)0));
11277 }
11278 }
11279 }
11280 }
11281 break;
11282 }
11283 }
11284 }
11285 }
11286 if(_class && _class->type == 2)
11287 {
11288 exp->constant = PrintHexUInt(bits);
11289 exp->type = 2;
11290 }
11291 if(exp->type != 1)
11292 {
11293 FreeInstance(inst);
11294 }
11295 }
11296
11297 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
11298 {
11299 if(exp->op.op == SIZEOF)
11300 {
11301 FreeExpContents(exp);
11302 exp->type = 2;
11303 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
11304 }
11305 else
11306 {
11307 if(!exp->op.exp1)
11308 {
11309 switch(exp->op.op)
11310 {
11311 case '+':
11312 {
11313 struct Expression * exp2 = exp->op.exp2;
11314
11315 exp->op.exp2 = (((void *)0));
11316 FreeExpContents(exp);
11317 FreeType(exp->expType);
11318 FreeType(exp->destType);
11319 *exp = *exp2;
11320 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
11321 break;
11322 }
11323 case '-':
11324 if(op1->ops.Neg)
11325 {
11326 FreeExpContents(exp);
11327 op1->ops.Neg(exp, op1);
11328 }
11329 break;
11330 case '~':
11331 if(op1->ops.BitNot)
11332 {
11333 FreeExpContents(exp);
11334 op1->ops.BitNot(exp, op1);
11335 }
11336 break;
11337 case '!':
11338 if(op1->ops.Not)
11339 {
11340 FreeExpContents(exp);
11341 op1->ops.Not(exp, op1);
11342 }
11343 break;
11344 }
11345 }
11346 else
11347 {
11348 switch(exp->op.op)
11349 {
11350 case '+':
11351 if(op1->ops.Add)
11352 {
11353 FreeExpContents(exp);
11354 op1->ops.Add(exp, op1, op2);
11355 }
11356 break;
11357 case '-':
11358 if(op1->ops.Sub)
11359 {
11360 FreeExpContents(exp);
11361 op1->ops.Sub(exp, op1, op2);
11362 }
11363 break;
11364 case '*':
11365 if(op1->ops.Mul)
11366 {
11367 FreeExpContents(exp);
11368 op1->ops.Mul(exp, op1, op2);
11369 }
11370 break;
11371 case '/':
11372 if(op1->ops.Div)
11373 {
11374 FreeExpContents(exp);
11375 op1->ops.Div(exp, op1, op2);
11376 }
11377 break;
11378 case '%':
11379 if(op1->ops.Mod)
11380 {
11381 FreeExpContents(exp);
11382 op1->ops.Mod(exp, op1, op2);
11383 }
11384 break;
11385 case '&':
11386 if(exp->op.exp2)
11387 {
11388 if(op1->ops.BitAnd)
11389 {
11390 FreeExpContents(exp);
11391 op1->ops.BitAnd(exp, op1, op2);
11392 }
11393 }
11394 break;
11395 case '|':
11396 if(op1->ops.BitOr)
11397 {
11398 FreeExpContents(exp);
11399 op1->ops.BitOr(exp, op1, op2);
11400 }
11401 break;
11402 case '^':
11403 if(op1->ops.BitXor)
11404 {
11405 FreeExpContents(exp);
11406 op1->ops.BitXor(exp, op1, op2);
11407 }
11408 break;
11409 case LEFT_OP:
11410 if(op1->ops.LShift)
11411 {
11412 FreeExpContents(exp);
11413 op1->ops.LShift(exp, op1, op2);
11414 }
11415 break;
11416 case RIGHT_OP:
11417 if(op1->ops.RShift)
11418 {
11419 FreeExpContents(exp);
11420 op1->ops.RShift(exp, op1, op2);
11421 }
11422 break;
11423 case EQ_OP:
11424 if(op1->ops.Equ)
11425 {
11426 FreeExpContents(exp);
11427 op1->ops.Equ(exp, op1, op2);
11428 }
11429 break;
11430 case NE_OP:
11431 if(op1->ops.Nqu)
11432 {
11433 FreeExpContents(exp);
11434 op1->ops.Nqu(exp, op1, op2);
11435 }
11436 break;
11437 case AND_OP:
11438 if(op1->ops.And)
11439 {
11440 FreeExpContents(exp);
11441 op1->ops.And(exp, op1, op2);
11442 }
11443 break;
11444 case OR_OP:
11445 if(op1->ops.Or)
11446 {
11447 FreeExpContents(exp);
11448 op1->ops.Or(exp, op1, op2);
11449 }
11450 break;
11451 case '>':
11452 if(op1->ops.Grt)
11453 {
11454 FreeExpContents(exp);
11455 op1->ops.Grt(exp, op1, op2);
11456 }
11457 break;
11458 case '<':
11459 if(op1->ops.Sma)
11460 {
11461 FreeExpContents(exp);
11462 op1->ops.Sma(exp, op1, op2);
11463 }
11464 break;
11465 case GE_OP:
11466 if(op1->ops.GrtEqu)
11467 {
11468 FreeExpContents(exp);
11469 op1->ops.GrtEqu(exp, op1, op2);
11470 }
11471 break;
11472 case LE_OP:
11473 if(op1->ops.SmaEqu)
11474 {
11475 FreeExpContents(exp);
11476 op1->ops.SmaEqu(exp, op1, op2);
11477 }
11478 break;
11479 }
11480 }
11481 }
11482 }
11483
11484 void PrintTypeNoConst(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
11485
11486 extern struct Expression * MkExpIdentifier(struct Identifier * id);
11487
11488 void ComputeExpression(struct Expression * exp)
11489 {
11490 char expString[10240];
11491
11492 expString[0] = '\0';
11493 switch(exp->type)
11494 {
11495 case 1:
11496 {
11497 ComputeInstantiation(exp);
11498 break;
11499 }
11500 case 4:
11501 {
11502 struct Expression * exp1, * exp2 = (((void *)0));
11503 struct Operand op1 = 
11504 {
11505 0, 0, 0, 0, 
11506 {
11507 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11508 }
11509 };
11510 struct Operand op2 = 
11511 {
11512 0, 0, 0, 0, 
11513 {
11514 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11515 }
11516 };
11517
11518 if(exp->op.exp2)
11519 ComputeExpression(exp->op.exp2);
11520 if(exp->op.exp1)
11521 {
11522 ComputeExpression(exp->op.exp1);
11523 exp1 = exp->op.exp1;
11524 exp2 = exp->op.exp2;
11525 op1 = GetOperand(exp1);
11526 if(op1.type)
11527 op1.type->refCount++;
11528 if(exp2)
11529 {
11530 op2 = GetOperand(exp2);
11531 if(op2.type)
11532 op2.type->refCount++;
11533 }
11534 }
11535 else
11536 {
11537 exp1 = exp->op.exp2;
11538 op1 = GetOperand(exp1);
11539 if(op1.type)
11540 op1.type->refCount++;
11541 }
11542 CallOperator(exp, exp1, exp2, &op1, &op2);
11543 if(op1.type)
11544 FreeType(op1.type);
11545 if(op2.type)
11546 FreeType(op2.type);
11547 break;
11548 }
11549 case 5:
11550 case 34:
11551 {
11552 struct Expression * e, * n;
11553
11554 for(e = (*exp->list).first; e; e = n)
11555 {
11556 n = e->next;
11557 if(!n)
11558 {
11559 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
11560
11561 ComputeExpression(e);
11562 FreeType(exp->expType);
11563 FreeType(exp->destType);
11564 *exp = *e;
11565 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
11566 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
11567 }
11568 else
11569 {
11570 FreeExpression(e);
11571 }
11572 }
11573 break;
11574 }
11575 case 8:
11576 {
11577 struct Expression * memberExp = exp->member.exp;
11578 struct Identifier * memberID = exp->member.member;
11579 struct Type * type;
11580
11581 ComputeExpression(exp->member.exp);
11582 type = exp->member.exp->expType;
11583 if(type)
11584 {
11585 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)));
11586 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11587 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11588 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
11589
11590 if(type->kind == 19 && exp->member.exp->type == 26)
11591 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
11592 if(!_class)
11593 {
11594 char string[256];
11595 struct Symbol * classSym;
11596
11597 string[0] = '\0';
11598 PrintTypeNoConst(type, string, 0x0, 0x1);
11599 classSym = FindClass(string);
11600 _class = classSym ? classSym->registered : (((void *)0));
11601 }
11602 if(exp->member.member)
11603 {
11604 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
11605 if(!prop)
11606 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
11607 }
11608 if(!prop && !member && _class && exp->member.member)
11609 {
11610 struct Symbol * classSym = FindClass(exp->member.member->string);
11611
11612 convertTo = _class;
11613 _class = classSym ? classSym->registered : (((void *)0));
11614 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
11615 }
11616 if(prop)
11617 {
11618 if(prop->compiled)
11619 {
11620 struct Type * type = prop->dataType;
11621
11622 if(_class->type == 3)
11623 {
11624 if(type->kind == 8)
11625 {
11626 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11627
11628 if(_class->type == 3)
11629 {
11630 if(!_class->dataType)
11631 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11632 type = _class->dataType;
11633 }
11634 }
11635 switch(type->kind)
11636 {
11637 case 6:
11638 {
11639 float value;
11640 float (* Get)(float) = (void *)prop->Get;
11641
11642 GetFloat(exp->member.exp, &value);
11643 exp->constant = PrintFloat(Get ? Get(value) : value);
11644 exp->type = 2;
11645 break;
11646 }
11647 case 7:
11648 {
11649 double value;
11650 double (* Get)(double);
11651
11652 GetDouble(exp->member.exp, &value);
11653 if(convertTo)
11654 Get = (void *)prop->Set;
11655 else
11656 Get = (void *)prop->Get;
11657 exp->constant = PrintDouble(Get ? Get(value) : value);
11658 exp->type = 2;
11659 break;
11660 }
11661 }
11662 }
11663 else
11664 {
11665 if(convertTo)
11666 {
11667 struct Expression * value = exp->member.exp;
11668 struct Type * type;
11669
11670 if(!prop->dataType)
11671 ProcessPropertyType(prop);
11672 type = prop->dataType;
11673 if(!type)
11674 {
11675 }
11676 else if(_class->type == 1)
11677 {
11678 switch(type->kind)
11679 {
11680 case 8:
11681 {
11682 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
11683
11684 if(propertyClass->type == 1 && value->type == 1)
11685 {
11686 void (* Set)(void *, void *) = (void *)prop->Set;
11687
11688 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11689 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11690 exp->instance->_class = MkSpecifierName(_class->fullName);
11691 exp->instance->loc = exp->loc;
11692 exp->type = 1;
11693 Set(exp->instance->data, value->instance->data);
11694 PopulateInstance(exp->instance);
11695 }
11696 break;
11697 }
11698 case 3:
11699 {
11700 int intValue;
11701 void (* Set)(void *, int) = (void *)prop->Set;
11702
11703 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11704 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11705 exp->instance->_class = MkSpecifierName(_class->fullName);
11706 exp->instance->loc = exp->loc;
11707 exp->type = 1;
11708 GetInt(value, &intValue);
11709 Set(exp->instance->data, intValue);
11710 PopulateInstance(exp->instance);
11711 break;
11712 }
11713 case 4:
11714 {
11715 long long intValue;
11716 void (* Set)(void *, long long) = (void *)prop->Set;
11717
11718 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11719 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11720 exp->instance->_class = MkSpecifierName(_class->fullName);
11721 exp->instance->loc = exp->loc;
11722 exp->type = 1;
11723 GetInt64(value, &intValue);
11724 Set(exp->instance->data, intValue);
11725 PopulateInstance(exp->instance);
11726 break;
11727 }
11728 case 22:
11729 {
11730 intptr_t intValue;
11731 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11732
11733 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11734 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11735 exp->instance->_class = MkSpecifierName(_class->fullName);
11736 exp->instance->loc = exp->loc;
11737 exp->type = 1;
11738 GetIntPtr(value, &intValue);
11739 Set(exp->instance->data, intValue);
11740 PopulateInstance(exp->instance);
11741 break;
11742 }
11743 case 23:
11744 {
11745 ssize_t intValue;
11746 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11747
11748 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11749 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11750 exp->instance->_class = MkSpecifierName(_class->fullName);
11751 exp->instance->loc = exp->loc;
11752 exp->type = 1;
11753 GetIntSize(value, &intValue);
11754 Set(exp->instance->data, intValue);
11755 PopulateInstance(exp->instance);
11756 break;
11757 }
11758 case 7:
11759 {
11760 double doubleValue;
11761 void (* Set)(void *, double) = (void *)prop->Set;
11762
11763 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11764 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11765 exp->instance->_class = MkSpecifierName(_class->fullName);
11766 exp->instance->loc = exp->loc;
11767 exp->type = 1;
11768 GetDouble(value, &doubleValue);
11769 Set(exp->instance->data, doubleValue);
11770 PopulateInstance(exp->instance);
11771 break;
11772 }
11773 }
11774 }
11775 else if(_class->type == 2)
11776 {
11777 switch(type->kind)
11778 {
11779 case 8:
11780 {
11781 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
11782
11783 if(propertyClass->type == 1 && value->instance->data)
11784 {
11785 unsigned int (* Set)(void *) = (void *)prop->Set;
11786 unsigned int bits = Set(value->instance->data);
11787
11788 exp->constant = PrintHexUInt(bits);
11789 exp->type = 2;
11790 break;
11791 }
11792 else if(_class->type == 2)
11793 {
11794 unsigned int value;
11795 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
11796 unsigned int bits;
11797
11798 GetUInt(exp->member.exp, &value);
11799 bits = Set(value);
11800 exp->constant = PrintHexUInt(bits);
11801 exp->type = 2;
11802 }
11803 }
11804 }
11805 }
11806 }
11807 else
11808 {
11809 if(_class->type == 2)
11810 {
11811 unsigned int value;
11812
11813 GetUInt(exp->member.exp, &value);
11814 switch(type->kind)
11815 {
11816 case 8:
11817 {
11818 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11819
11820 if(_class->type == 1)
11821 {
11822 void (* Get)(unsigned int, void *) = (void *)prop->Get;
11823
11824 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11825 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11826 exp->instance->_class = MkSpecifierName(_class->fullName);
11827 exp->instance->loc = exp->loc;
11828 exp->type = 1;
11829 Get(value, exp->instance->data);
11830 PopulateInstance(exp->instance);
11831 }
11832 else if(_class->type == 2)
11833 {
11834 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
11835 uint64 bits = Get(value);
11836
11837 exp->constant = PrintHexUInt64(bits);
11838 exp->type = 2;
11839 }
11840 break;
11841 }
11842 }
11843 }
11844 else if(_class->type == 1)
11845 {
11846 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
11847
11848 switch(type->kind)
11849 {
11850 case 8:
11851 {
11852 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11853
11854 if(_class->type == 1 && value)
11855 {
11856 void (* Get)(void *, void *) = (void *)prop->Get;
11857
11858 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11859 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11860 exp->instance->_class = MkSpecifierName(_class->fullName);
11861 exp->instance->loc = exp->loc;
11862 exp->type = 1;
11863 Get(value, exp->instance->data);
11864 PopulateInstance(exp->instance);
11865 }
11866 break;
11867 }
11868 }
11869 }
11870 }
11871 }
11872 }
11873 else
11874 {
11875 exp->isConstant = 0x0;
11876 }
11877 }
11878 else if(member)
11879 {
11880 }
11881 }
11882 if(exp->type != 8)
11883 {
11884 FreeExpression(memberExp);
11885 FreeIdentifier(memberID);
11886 }
11887 break;
11888 }
11889 case 10:
11890 {
11891 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
11892
11893 FreeExpContents(exp);
11894 exp->constant = PrintUInt(ComputeTypeSize(type));
11895 exp->type = 2;
11896 FreeType(type);
11897 break;
11898 }
11899 case 15:
11900 {
11901 struct Symbol * classSym = exp->_class->symbol;
11902
11903 if(classSym && classSym->registered)
11904 {
11905 if(classSym->registered->fixed)
11906 {
11907 FreeSpecifier(exp->_class);
11908 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
11909 exp->type = 2;
11910 }
11911 else
11912 {
11913 char className[1024];
11914
11915 strcpy(className, "__ecereClass_");
11916 FullClassNameCat(className, classSym->string, 0x1);
11917 MangleClassName(className);
11918 DeclareClass(classSym, className);
11919 FreeExpContents(exp);
11920 exp->type = 9;
11921 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
11922 exp->member.member = MkIdentifier("structSize");
11923 }
11924 }
11925 break;
11926 }
11927 case 11:
11928 {
11929 struct Type * type;
11930 struct Expression * e = exp;
11931
11932 if(exp->type == 11)
11933 {
11934 if(exp->cast.exp)
11935 ComputeExpression(exp->cast.exp);
11936 e = exp->cast.exp;
11937 }
11938 if(e && exp->expType)
11939 {
11940 type = exp->expType;
11941 if(type->kind == 8)
11942 {
11943 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11944
11945 if(_class && (_class->type == 3 || _class->type == 2))
11946 {
11947 if(!_class->dataType)
11948 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11949 type = _class->dataType;
11950 }
11951 }
11952 switch(type->kind)
11953 {
11954 case 24:
11955 case 1:
11956 if(type->isSigned)
11957 {
11958 char value;
11959
11960 GetChar(e, &value);
11961 FreeExpContents(exp);
11962 exp->constant = PrintChar(value);
11963 exp->type = 2;
11964 }
11965 else
11966 {
11967 unsigned char value;
11968
11969 GetUChar(e, &value);
11970 FreeExpContents(exp);
11971 exp->constant = PrintUChar(value);
11972 exp->type = 2;
11973 }
11974 break;
11975 case 2:
11976 if(type->isSigned)
11977 {
11978 short value;
11979
11980 GetShort(e, &value);
11981 FreeExpContents(exp);
11982 exp->constant = PrintShort(value);
11983 exp->type = 2;
11984 }
11985 else
11986 {
11987 unsigned short value;
11988
11989 GetUShort(e, &value);
11990 FreeExpContents(exp);
11991 exp->constant = PrintUShort(value);
11992 exp->type = 2;
11993 }
11994 break;
11995 case 3:
11996 if(type->isSigned)
11997 {
11998 int value;
11999
12000 GetInt(e, &value);
12001 FreeExpContents(exp);
12002 exp->constant = PrintInt(value);
12003 exp->type = 2;
12004 }
12005 else
12006 {
12007 unsigned int value;
12008
12009 GetUInt(e, &value);
12010 FreeExpContents(exp);
12011 exp->constant = PrintUInt(value);
12012 exp->type = 2;
12013 }
12014 break;
12015 case 4:
12016 if(type->isSigned)
12017 {
12018 long long value;
12019
12020 GetInt64(e, &value);
12021 FreeExpContents(exp);
12022 exp->constant = PrintInt64(value);
12023 exp->type = 2;
12024 }
12025 else
12026 {
12027 uint64 value;
12028
12029 GetUInt64(e, &value);
12030 FreeExpContents(exp);
12031 exp->constant = PrintUInt64(value);
12032 exp->type = 2;
12033 }
12034 break;
12035 case 22:
12036 if(type->isSigned)
12037 {
12038 intptr_t value;
12039
12040 GetIntPtr(e, &value);
12041 FreeExpContents(exp);
12042 exp->constant = PrintInt64((long long)value);
12043 exp->type = 2;
12044 }
12045 else
12046 {
12047 uintptr_t value;
12048
12049 GetUIntPtr(e, &value);
12050 FreeExpContents(exp);
12051 exp->constant = PrintUInt64((uint64)value);
12052 exp->type = 2;
12053 }
12054 break;
12055 case 23:
12056 if(type->isSigned)
12057 {
12058 ssize_t value;
12059
12060 GetIntSize(e, &value);
12061 FreeExpContents(exp);
12062 exp->constant = PrintInt64((long long)value);
12063 exp->type = 2;
12064 }
12065 else
12066 {
12067 size_t value;
12068
12069 GetUIntSize(e, &value);
12070 FreeExpContents(exp);
12071 exp->constant = PrintUInt64((uint64)value);
12072 exp->type = 2;
12073 }
12074 break;
12075 case 6:
12076 {
12077 float value;
12078
12079 GetFloat(e, &value);
12080 FreeExpContents(exp);
12081 exp->constant = PrintFloat(value);
12082 exp->type = 2;
12083 break;
12084 }
12085 case 7:
12086 {
12087 double value;
12088
12089 GetDouble(e, &value);
12090 FreeExpContents(exp);
12091 exp->constant = PrintDouble(value);
12092 exp->type = 2;
12093 break;
12094 }
12095 }
12096 }
12097 break;
12098 }
12099 case 12:
12100 {
12101 struct Operand op1 = 
12102 {
12103 0, 0, 0, 0, 
12104 {
12105 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12106 }
12107 };
12108 struct Operand op2 = 
12109 {
12110 0, 0, 0, 0, 
12111 {
12112 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12113 }
12114 };
12115 struct Operand op3 = 
12116 {
12117 0, 0, 0, 0, 
12118 {
12119 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12120 }
12121 };
12122
12123 if(exp->cond.exp)
12124 ComputeExpression((*exp->cond.exp).last);
12125 if(exp->cond.elseExp)
12126 ComputeExpression(exp->cond.elseExp);
12127 if(exp->cond.cond)
12128 ComputeExpression(exp->cond.cond);
12129 op1 = GetOperand(exp->cond.cond);
12130 if(op1.type)
12131 op1.type->refCount++;
12132 op2 = GetOperand((*exp->cond.exp).last);
12133 if(op2.type)
12134 op2.type->refCount++;
12135 op3 = GetOperand(exp->cond.elseExp);
12136 if(op3.type)
12137 op3.type->refCount++;
12138 if(op1.ops.Cond)
12139 {
12140 FreeExpContents(exp);
12141 op1.ops.Cond(exp, &op1, &op2, &op3);
12142 }
12143 if(op1.type)
12144 FreeType(op1.type);
12145 if(op2.type)
12146 FreeType(op2.type);
12147 if(op3.type)
12148 FreeType(op3.type);
12149 break;
12150 }
12151 }
12152 }
12153
12154 void ApplyAnyObjectLogic(struct Expression * e);
12155
12156 extern void CopyTypeInto(struct Type * type, struct Type * src);
12157
12158 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
12159 {
12160 unsigned int result = 0x1;
12161
12162 if(destType)
12163 {
12164 struct __ecereNameSpace__ecere__sys__OldList converts = 
12165 {
12166 0, 0, 0, 0, 0
12167 };
12168 struct Conversion * convert;
12169
12170 if(destType->kind == 0)
12171 return 0x0;
12172 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
12173 result = 0x0;
12174 if(converts.count)
12175 {
12176 for(convert = converts.first; convert; convert = convert->next)
12177 {
12178 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
12179
12180 if(!empty)
12181 {
12182 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12183 int objectType = exp->expType ? exp->expType->classObjectType : 0;
12184
12185 *newExp = *exp;
12186 newExp->destType = (((void *)0));
12187 if(convert->isGet)
12188 {
12189 exp->type = 8;
12190 exp->addedThis = 0x1;
12191 exp->member.exp = newExp;
12192 FreeType(exp->member.exp->expType);
12193 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
12194 exp->member.exp->expType->classObjectType = objectType;
12195 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
12196 exp->member.memberType = 1;
12197 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12198 exp->needCast = 0x1;
12199 if(exp->expType)
12200 exp->expType->refCount++;
12201 ApplyAnyObjectLogic(exp->member.exp);
12202 }
12203 else
12204 {
12205 {
12206 exp->type = 8;
12207 exp->addedThis = 0x1;
12208 exp->member.exp = newExp;
12209 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
12210 {
12211 newExp->byReference = 0x1;
12212 }
12213 FreeType(exp->member.exp->expType);
12214 exp->member.exp->expType = (((void *)0));
12215 if(convert->convert->dataType)
12216 {
12217 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12218 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
12219 exp->member.exp->expType->refCount = 1;
12220 exp->member.exp->expType->classObjectType = objectType;
12221 ApplyAnyObjectLogic(exp->member.exp);
12222 }
12223 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
12224 exp->member.memberType = 4;
12225 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12226 exp->needCast = 0x1;
12227 if(convert->resultType)
12228 convert->resultType->refCount++;
12229 }
12230 }
12231 }
12232 else
12233 {
12234 FreeType(exp->expType);
12235 if(convert->isGet)
12236 {
12237 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12238 exp->needCast = 0x1;
12239 if(exp->expType)
12240 exp->expType->refCount++;
12241 }
12242 else
12243 {
12244 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12245 exp->needCast = 0x1;
12246 if(convert->resultType)
12247 convert->resultType->refCount++;
12248 }
12249 }
12250 }
12251 if(exp->isConstant && inCompiler)
12252 ComputeExpression(exp);
12253 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
12254 }
12255 if(!result && exp->expType && converts.count)
12256 {
12257 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
12258 }
12259 if(!result && exp->expType && exp->destType)
12260 {
12261 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))
12262 result = 0x1;
12263 }
12264 }
12265 return result;
12266 }
12267
12268 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
12269
12270 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
12271
12272 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
12273
12274 void CheckTemplateTypes(struct Expression * exp)
12275 {
12276 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
12277 {
12278 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12279 struct Statement * compound;
12280 struct Context * context;
12281
12282 *newExp = *exp;
12283 if(exp->destType)
12284 exp->destType->refCount++;
12285 if(exp->expType)
12286 exp->expType->refCount++;
12287 newExp->prev = (((void *)0));
12288 newExp->next = (((void *)0));
12289 switch(exp->expType->kind)
12290 {
12291 case 7:
12292 if(exp->destType->classObjectType)
12293 {
12294 if(exp->destType)
12295 exp->destType->refCount--;
12296 if(exp->expType)
12297 exp->expType->refCount--;
12298 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12299 }
12300 else
12301 {
12302 struct __ecereNameSpace__ecere__sys__OldList * specs;
12303 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12304 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12305
12306 context = PushContext();
12307 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12308 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12309 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12310 exp->type = 25;
12311 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12312 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
12313 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
12314 exp->compound->compound.context = context;
12315 PopContext(context);
12316 }
12317 break;
12318 default:
12319 exp->type = 11;
12320 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
12321 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12322 break;
12323 }
12324 }
12325 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
12326 {
12327 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12328 struct Statement * compound;
12329 struct Context * context;
12330
12331 *newExp = *exp;
12332 if(exp->destType)
12333 exp->destType->refCount++;
12334 if(exp->expType)
12335 exp->expType->refCount++;
12336 newExp->prev = (((void *)0));
12337 newExp->next = (((void *)0));
12338 switch(exp->expType->kind)
12339 {
12340 case 7:
12341 if(exp->destType->classObjectType)
12342 {
12343 if(exp->destType)
12344 exp->destType->refCount--;
12345 if(exp->expType)
12346 exp->expType->refCount--;
12347 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12348 }
12349 else
12350 {
12351 struct __ecereNameSpace__ecere__sys__OldList * specs;
12352 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12353 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12354
12355 context = PushContext();
12356 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12357 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12358 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12359 exp->type = 25;
12360 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12361 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
12362 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
12363 exp->compound->compound.context = context;
12364 PopContext(context);
12365 }
12366 break;
12367 case 8:
12368 {
12369 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
12370 {
12371 exp->type = 5;
12372 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
12373 ProcessExpressionType((*exp->list).first);
12374 break;
12375 }
12376 else
12377 {
12378 exp->type = 5;
12379 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
12380 newExp->needCast = 0x1;
12381 ProcessExpressionType((*exp->list).first);
12382 break;
12383 }
12384 }
12385 default:
12386 {
12387 if(exp->expType->kind == 20)
12388 {
12389 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
12390
12391 if(type)
12392 {
12393 FreeType(exp->destType);
12394 FreeType(exp->expType);
12395 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12396 break;
12397 }
12398 }
12399 if(newExp->type == 8 && newExp->member.memberType == 3)
12400 {
12401 exp->type = 4;
12402 exp->op.op = '*';
12403 exp->op.exp1 = (((void *)0));
12404 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
12405 }
12406 else
12407 {
12408 char typeString[1024];
12409 struct Declarator * decl;
12410 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12411
12412 typeString[0] = '\0';
12413 PrintType(exp->expType, typeString, 0x0, 0x0);
12414 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12415 exp->type = 11;
12416 exp->cast.typeName = MkTypeName(specs, decl);
12417 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12418 exp->cast.exp->needCast = 0x1;
12419 }
12420 break;
12421 }
12422 }
12423 }
12424 }
12425
12426 extern int strncmp(const char * , const char * , size_t n);
12427
12428 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char *  key);
12429
12430 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
12431 {
12432 int nsLen = strlen(nameSpace);
12433 struct Symbol * symbol;
12434
12435 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)))
12436 {
12437 char * s = symbol->string;
12438
12439 if(!strncmp(s, nameSpace, nsLen))
12440 {
12441 int c;
12442 char * namePart;
12443
12444 for(c = strlen(s) - 1; c >= 0; c--)
12445 if(s[c] == ':')
12446 break;
12447 namePart = s + c + 1;
12448 if(!strcmp(namePart, name))
12449 {
12450 return symbol;
12451 }
12452 }
12453 else
12454 break;
12455 }
12456 return (((void *)0));
12457 }
12458
12459 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
12460 {
12461 int c;
12462 char nameSpace[1024];
12463 char * namePart;
12464 unsigned int gotColon = 0x0;
12465
12466 nameSpace[0] = '\0';
12467 for(c = strlen(name) - 1; c >= 0; c--)
12468 if(name[c] == ':')
12469 {
12470 gotColon = 0x1;
12471 break;
12472 }
12473 namePart = name + c + 1;
12474 while(c >= 0 && name[c] == ':')
12475 c--;
12476 if(c >= 0)
12477 {
12478 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
12479
12480 if(symbol)
12481 return symbol;
12482 memcpy(nameSpace, name, c + 1);
12483 nameSpace[c + 1] = (char)0;
12484 return ScanWithNameSpace(tree, nameSpace, namePart);
12485 }
12486 else if(gotColon)
12487 {
12488 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12489
12490 return symbol;
12491 }
12492 else
12493 {
12494 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12495
12496 if(symbol)
12497 return symbol;
12498 return ScanWithNameSpace(tree, "", namePart);
12499 }
12500 return (((void *)0));
12501 }
12502
12503 static void ProcessDeclaration(struct Declaration * decl);
12504
12505 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
12506 {
12507 struct Context * ctx;
12508 struct Symbol * symbol = (((void *)0));
12509
12510 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
12511 {
12512 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
12513 {
12514 symbol = (((void *)0));
12515 if(thisNameSpace)
12516 {
12517 char curName[1024];
12518
12519 strcpy(curName, thisNameSpace);
12520 strcat(curName, "::");
12521 strcat(curName, name);
12522 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
12523 }
12524 if(!symbol)
12525 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
12526 }
12527 else
12528 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
12529 if(symbol || ctx == endContext)
12530 break;
12531 }
12532 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
12533 {
12534 if(symbol->pointerExternal->type == 0)
12535 {
12536 struct FunctionDefinition * function = symbol->pointerExternal->function;
12537 struct Context * tmpContext = curContext;
12538
12539 curContext = (((void *)0));
12540 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
12541 curContext = tmpContext;
12542 symbol->pointerExternal->symbol = symbol;
12543 DeclareType(symbol->type, 0x1, 0x1);
12544 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
12545 symbol->id = curExternal->symbol->idCode;
12546 }
12547 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
12548 {
12549 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
12550 symbol->id = curExternal->symbol->idCode;
12551 }
12552 }
12553 return symbol;
12554 }
12555
12556 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
12557 {
12558 if(!type->isSigned && type->kind != 22 && type->kind != 23)
12559 ListAdd(specs, MkSpecifier(UNSIGNED));
12560 switch(type->kind)
12561 {
12562 case 8:
12563 {
12564 if(type->_class->registered)
12565 {
12566 if(!type->_class->registered->dataType)
12567 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
12568 GetTypeSpecs(type->_class->registered->dataType, specs);
12569 }
12570 break;
12571 }
12572 case 7:
12573 ListAdd(specs, MkSpecifier(DOUBLE));
12574 break;
12575 case 6:
12576 ListAdd(specs, MkSpecifier(FLOAT));
12577 break;
12578 case 1:
12579 ListAdd(specs, MkSpecifier(CHAR));
12580 break;
12581 case 24:
12582 ListAdd(specs, MkSpecifier(_BOOL));
12583 break;
12584 case 2:
12585 ListAdd(specs, MkSpecifier(SHORT));
12586 break;
12587 case 4:
12588 ListAdd(specs, MkSpecifier(INT64));
12589 break;
12590 case 22:
12591 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
12592 break;
12593 case 23:
12594 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
12595 break;
12596 case 3:
12597 default:
12598 ListAdd(specs, MkSpecifier(INT));
12599 break;
12600 }
12601 }
12602
12603 static void PrintArraySize(struct Type * arrayType, char * string)
12604 {
12605 char size[256];
12606
12607 size[0] = '\0';
12608 strcat(size, "[");
12609 if(arrayType->enumClass)
12610 strcat(size, arrayType->enumClass->string);
12611 else if(arrayType->arraySizeExp)
12612 PrintExpression(arrayType->arraySizeExp, size);
12613 strcat(size, "]");
12614 strcat(string, size);
12615 }
12616
12617 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
12618 {
12619 if(type)
12620 {
12621 if(printConst && type->constant)
12622 strcat(string, "const ");
12623 switch(type->kind)
12624 {
12625 case 8:
12626 {
12627 struct Symbol * c = type->_class;
12628
12629 if(type->classObjectType == 2)
12630 strcat(string, "typed_object");
12631 else if(type->classObjectType == 3)
12632 strcat(string, "any_object");
12633 else
12634 {
12635 if(c && c->string)
12636 strcat(string, (fullName || !c->registered) ? c->string : c->registered->name);
12637 }
12638 if(type->byReference)
12639 strcat(string, " &");
12640 break;
12641 }
12642 case 0:
12643 strcat(string, "void");
12644 break;
12645 case 3:
12646 strcat(string, type->isSigned ? "int" : "uint");
12647 break;
12648 case 4:
12649 strcat(string, type->isSigned ? "int64" : "uint64");
12650 break;
12651 case 22:
12652 strcat(string, type->isSigned ? "intptr" : "uintptr");
12653 break;
12654 case 23:
12655 strcat(string, type->isSigned ? "intsize" : "uintsize");
12656 break;
12657 case 1:
12658 strcat(string, type->isSigned ? "char" : "byte");
12659 break;
12660 case 24:
12661 strcat(string, "_Bool");
12662 break;
12663 case 2:
12664 strcat(string, type->isSigned ? "short" : "uint16");
12665 break;
12666 case 6:
12667 strcat(string, "float");
12668 break;
12669 case 7:
12670 strcat(string, "double");
12671 break;
12672 case 9:
12673 if(type->enumName)
12674 {
12675 strcat(string, "struct ");
12676 strcat(string, type->enumName);
12677 }
12678 else if(type->typeName)
12679 strcat(string, type->typeName);
12680 else
12681 {
12682 struct Type * member;
12683
12684 strcat(string, "struct { ");
12685 for(member = type->members.first; member; member = member->next)
12686 {
12687 PrintType(member, string, 0x1, fullName);
12688 strcat(string, "; ");
12689 }
12690 strcat(string, "}");
12691 }
12692 break;
12693 case 10:
12694 if(type->enumName)
12695 {
12696 strcat(string, "union ");
12697 strcat(string, type->enumName);
12698 }
12699 else if(type->typeName)
12700 strcat(string, type->typeName);
12701 else
12702 {
12703 strcat(string, "union ");
12704 strcat(string, "(unnamed)");
12705 }
12706 break;
12707 case 15:
12708 if(type->enumName)
12709 {
12710 strcat(string, "enum ");
12711 strcat(string, type->enumName);
12712 }
12713 else if(type->typeName)
12714 strcat(string, type->typeName);
12715 else
12716 strcat(string, "int");
12717 break;
12718 case 14:
12719 strcat(string, "...");
12720 break;
12721 case 19:
12722 strcat(string, "subclass(");
12723 strcat(string, type->_class ? type->_class->string : "int");
12724 strcat(string, ")");
12725 break;
12726 case 20:
12727 strcat(string, type->templateParameter->identifier->string);
12728 break;
12729 case 21:
12730 strcat(string, "thisclass");
12731 break;
12732 case 17:
12733 strcat(string, "__builtin_va_list");
12734 break;
12735 }
12736 }
12737 }
12738
12739 extern char *  __ecereNameSpace__ecere__sys__RSearchString(char *  buffer, char *  subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
12740
12741 static void PrintName(struct Type * type, char * string, unsigned int fullName)
12742 {
12743 if(type->name && type->name[0])
12744 {
12745 if(fullName)
12746 strcat(string, type->name);
12747 else
12748 {
12749 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
12750
12751 if(name)
12752 name += 2;
12753 else
12754 name = type->name;
12755 strcat(string, name);
12756 }
12757 }
12758 }
12759
12760 static void PrintAttribs(struct Type * type, char * string)
12761 {
12762 if(type)
12763 {
12764 if(type->dllExport)
12765 strcat(string, "dllexport ");
12766 if(type->attrStdcall)
12767 strcat(string, "stdcall ");
12768 }
12769 }
12770
12771 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
12772 {
12773 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
12774 {
12775 struct Type * attrType = (((void *)0));
12776
12777 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
12778 PrintAttribs(type, string);
12779 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
12780 strcat(string, " const");
12781 PrePrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName, type, printConst);
12782 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
12783 strcat(string, " (");
12784 if(type->kind == 13)
12785 {
12786 if(type->type->kind == 11 || type->type->kind == 16)
12787 PrintAttribs(type->type, string);
12788 }
12789 if(type->kind == 13)
12790 {
12791 if(type->type->kind == 11 || type->type->kind == 16 || type->type->kind == 12)
12792 strcat(string, "*");
12793 else
12794 strcat(string, " *");
12795 }
12796 if(printConst && type->constant && type->kind == 13)
12797 strcat(string, " const");
12798 }
12799 else
12800 PrintTypeSpecs(type, string, fullName, printConst);
12801 }
12802
12803 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
12804 {
12805 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
12806 strcat(string, ")");
12807 if(type->kind == 12)
12808 PrintArraySize(type, string);
12809 else if(type->kind == 11)
12810 {
12811 struct Type * param;
12812
12813 strcat(string, "(");
12814 for(param = type->params.first; param; param = param->next)
12815 {
12816 PrintType(param, string, 0x1, fullName);
12817 if(param->next)
12818 strcat(string, ", ");
12819 }
12820 strcat(string, ")");
12821 }
12822 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
12823 PostPrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName);
12824 }
12825
12826 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
12827 {
12828 PrePrintType(type, string, fullName, (((void *)0)), printConst);
12829 if(type->thisClass || (printName && type->name && type->name[0]))
12830 strcat(string, " ");
12831 if((type->thisClass || type->staticMethod))
12832 {
12833 struct Symbol * _class = type->thisClass;
12834
12835 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
12836 {
12837 if(type->classObjectType == 1)
12838 strcat(string, "class");
12839 else
12840 strcat(string, type->byReference ? "typed_object&" : "typed_object");
12841 }
12842 else if(_class && _class->string)
12843 {
12844 char * s = _class->string;
12845
12846 if(fullName)
12847 strcat(string, s);
12848 else
12849 {
12850 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 0x1, 0x0);
12851
12852 if(name)
12853 name += 2;
12854 else
12855 name = s;
12856 strcat(string, name);
12857 }
12858 }
12859 strcat(string, "::");
12860 }
12861 if(printName && type->name)
12862 PrintName(type, string, fullName);
12863 PostPrintType(type, string, fullName);
12864 if(type->bitFieldCount)
12865 {
12866 char count[100];
12867
12868 sprintf(count, ":%d", type->bitFieldCount);
12869 strcat(string, count);
12870 }
12871 }
12872
12873 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
12874 {
12875 _PrintType(type, string, printName, fullName, 0x1);
12876 }
12877
12878 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
12879 {
12880 _PrintType(type, string, printName, fullName, 0x0);
12881 }
12882
12883 static struct Type * FindMember(struct Type * type, char * string)
12884 {
12885 struct Type * memberType;
12886
12887 for(memberType = type->members.first; memberType; memberType = memberType->next)
12888 {
12889 if(!memberType->name)
12890 {
12891 struct Type * subType = FindMember(memberType, string);
12892
12893 if(subType)
12894 return subType;
12895 }
12896 else if(!strcmp(memberType->name, string))
12897 return memberType;
12898 }
12899 return (((void *)0));
12900 }
12901
12902 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
12903 {
12904 struct Type * memberType;
12905
12906 for(memberType = type->members.first; memberType; memberType = memberType->next)
12907 {
12908 if(!memberType->name)
12909 {
12910 struct Type * subType = FindMember(memberType, string);
12911
12912 if(subType)
12913 {
12914 *offset += memberType->offset;
12915 return subType;
12916 }
12917 }
12918 else if(!strcmp(memberType->name, string))
12919 {
12920 *offset += memberType->offset;
12921 return memberType;
12922 }
12923 }
12924 return (((void *)0));
12925 }
12926
12927 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
12928
12929 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
12930
12931 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
12932
12933 struct Expression * ParseExpressionString(char * expression)
12934 {
12935 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
12936 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__extension__ ({
12937 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
12938
12939 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
12940 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
12941 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
12942 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
12943
12944 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
12945 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
12946 echoOn = 0x0;
12947 parsedExpression = (((void *)0));
12948 resetScanner();
12949 expression_yyparse();
12950 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
12951 return parsedExpression;
12952 }
12953
12954 extern char *  QMkString(char *  source);
12955
12956 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
12957 {
12958 struct Identifier * id = exp->identifier;
12959 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
12960 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
12961 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
12962 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
12963
12964 if(_class && _class->type == 4)
12965 {
12966 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
12967 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
12968
12969 if(enumClass)
12970 {
12971 struct __ecereNameSpace__ecere__com__Class * baseClass;
12972
12973 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
12974 {
12975 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
12976
12977 for(value = e->values.first; value; value = value->next)
12978 {
12979 if(!strcmp(value->name, id->string))
12980 break;
12981 }
12982 if(value)
12983 {
12984 char constant[256];
12985
12986 FreeExpContents(exp);
12987 exp->type = 2;
12988 exp->isConstant = 0x1;
12989 if(!strcmp(baseClass->dataTypeString, "int"))
12990 sprintf(constant, "%d", (int)value->data);
12991 else
12992 sprintf(constant, "0x%X", (int)value->data);
12993 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
12994 exp->expType = MkClassType(baseClass->fullName);
12995 break;
12996 }
12997 }
12998 }
12999 if(value)
13000 return 0x1;
13001 }
13002 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
13003 {
13004 ProcessMethodType(method);
13005 exp->expType = __extension__ ({
13006 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13007
13008 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1->methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
13009 });
13010 return 0x1;
13011 }
13012 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
13013 {
13014 if(!prop->dataType)
13015 ProcessPropertyType(prop);
13016 exp->expType = prop->dataType;
13017 if(prop->dataType)
13018 prop->dataType->refCount++;
13019 return 0x1;
13020 }
13021 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
13022 {
13023 if(!member->dataType)
13024 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13025 exp->expType = member->dataType;
13026 if(member->dataType)
13027 member->dataType->refCount++;
13028 return 0x1;
13029 }
13030 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
13031 {
13032 if(!classProp->dataType)
13033 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
13034 if(classProp->constant)
13035 {
13036 FreeExpContents(exp);
13037 exp->isConstant = 0x1;
13038 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
13039 {
13040 exp->type = 3;
13041 exp->constant = QMkString((char *)classProp->Get(_class));
13042 }
13043 else
13044 {
13045 char constant[256];
13046
13047 exp->type = 2;
13048 sprintf(constant, "%d", (int)classProp->Get(_class));
13049 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13050 }
13051 }
13052 else
13053 {
13054 }
13055 exp->expType = classProp->dataType;
13056 if(classProp->dataType)
13057 classProp->dataType->refCount++;
13058 return 0x1;
13059 }
13060 return 0x0;
13061 }
13062
13063 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
13064 {
13065 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
13066 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
13067 struct __ecereNameSpace__ecere__com__NameSpace * child;
13068
13069 if(!data)
13070 {
13071 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)))
13072 {
13073 data = ScanGlobalData(child, name);
13074 if(data)
13075 break;
13076 }
13077 }
13078 return data;
13079 }
13080
13081 extern struct __ecereNameSpace__ecere__com__NameSpace *  globalData;
13082
13083 extern char *  strncpy(char * , const char * , size_t n);
13084
13085 static struct GlobalData * FindGlobalData(char * name)
13086 {
13087 int start = 0, c;
13088 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13089
13090 nameSpace = globalData;
13091 for(c = 0; name[c]; c++)
13092 {
13093 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
13094 {
13095 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
13096 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
13097
13098 strncpy(spaceName, name + start, c - start);
13099 spaceName[c - start] = '\0';
13100 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
13101 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
13102 if(!newSpace)
13103 return (((void *)0));
13104 nameSpace = newSpace;
13105 if(name[c] == ':')
13106 c++;
13107 start = c + 1;
13108 }
13109 }
13110 if(c - start)
13111 {
13112 return ScanGlobalData(nameSpace, name + start);
13113 }
13114 return (((void *)0));
13115 }
13116
13117 static int definedExpStackPos;
13118
13119 static void * definedExpStack[512];
13120
13121 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
13122 {
13123 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
13124
13125 FreeExpContents(checkedExp);
13126 FreeType(checkedExp->expType);
13127 FreeType(checkedExp->destType);
13128 *checkedExp = *newExp;
13129 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13130 checkedExp->prev = prev;
13131 checkedExp->next = next;
13132 }
13133
13134 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
13135
13136 extern int printf(char * , ...);
13137
13138 void __ecereMethod_Expression_Clear();
13139
13140 void ApplyAnyObjectLogic(struct Expression * e)
13141 {
13142 struct Type * destType = e->destType;
13143
13144 if(destType && (destType->classObjectType == 3))
13145 {
13146 if(e && e->expType)
13147 {
13148 struct Type * type = e->expType;
13149 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
13150
13151 if(type->kind == 8 && type->_class && type->_class->registered)
13152 {
13153 _class = type->_class->registered;
13154 }
13155 else if(type->kind == 19)
13156 {
13157 _class = FindClass("ecere::com::Class")->registered;
13158 }
13159 else
13160 {
13161 char string[1024] = "";
13162 struct Symbol * classSym;
13163
13164 PrintTypeNoConst(type, string, 0x0, 0x1);
13165 classSym = FindClass(string);
13166 if(classSym)
13167 _class = classSym->registered;
13168 }
13169 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)))
13170 {
13171 if(!_class || strcmp(_class->fullName, "char *"))
13172 {
13173 struct Expression * checkedExp = e, * newExp;
13174
13175 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
13176 {
13177 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
13178 {
13179 if(checkedExp->type == 25)
13180 {
13181 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13182 }
13183 else
13184 checkedExp = (*checkedExp->list).last;
13185 }
13186 else if(checkedExp->type == 11)
13187 checkedExp = checkedExp->cast.exp;
13188 }
13189 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
13190 {
13191 newExp = checkedExp->op.exp2;
13192 checkedExp->op.exp2 = (((void *)0));
13193 FreeExpContents(checkedExp);
13194 if(e->expType && e->expType->passAsTemplate)
13195 {
13196 char size[100];
13197
13198 ComputeTypeSize(e->expType);
13199 sprintf(size, "%d", e->expType->size);
13200 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))))));
13201 }
13202 ReplaceExpContents(checkedExp, newExp);
13203 e->byReference = 0x1;
13204 }
13205 else if(!e->byReference || (_class && _class->type == 5))
13206 {
13207 struct Expression * checkedExp, * newExp;
13208
13209 {
13210 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;
13211
13212 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
13213 {
13214 struct Context * context = PushContext();
13215 struct Declarator * decl;
13216 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13217 char typeString[1024];
13218 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13219
13220 typeString[0] = '\0';
13221 *newExp = *e;
13222 newExp->prev = (((void *)0));
13223 newExp->next = (((void *)0));
13224 newExp->expType = (((void *)0));
13225 PrintTypeNoConst(e->expType, typeString, 0x0, 0x1);
13226 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13227 newExp->destType = ProcessType(specs, decl);
13228 curContext = context;
13229 if(curCompound)
13230 {
13231 char name[100];
13232 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
13233
13234 e->type = 25;
13235 sprintf(name, "__internalValue%03X", internalValueCounter++);
13236 if(!curCompound->compound.declarations)
13237 curCompound->compound.declarations = MkList();
13238 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
13239 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
13240 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
13241 e->compound = MkCompoundStmt((((void *)0)), stmts);
13242 }
13243 else
13244 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
13245 {
13246 struct Type * type = e->destType;
13247
13248 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13249 CopyTypeInto(e->destType, type);
13250 e->destType->refCount = 1;
13251 e->destType->classObjectType = 0;
13252 FreeType(type);
13253 }
13254 e->compound->compound.context = context;
13255 PopContext(context);
13256 curContext = context->parent;
13257 }
13258 }
13259 checkedExp = e;
13260 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
13261 {
13262 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
13263 {
13264 if(checkedExp->type == 25)
13265 {
13266 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13267 }
13268 else
13269 checkedExp = (*checkedExp->list).last;
13270 }
13271 else if(checkedExp->type == 11)
13272 checkedExp = checkedExp->cast.exp;
13273 }
13274 {
13275 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13276
13277 *operand = *checkedExp;
13278 checkedExp->destType = (((void *)0));
13279 checkedExp->expType = (((void *)0));
13280 __ecereMethod_Expression_Clear(checkedExp);
13281 checkedExp->type = 4;
13282 checkedExp->op.op = '&';
13283 checkedExp->op.exp1 = (((void *)0));
13284 checkedExp->op.exp2 = operand;
13285 }
13286 }
13287 }
13288 }
13289 }
13290 }
13291 {
13292 }
13293 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))))
13294 {
13295 if(e->expType->classObjectType && destType && destType->classObjectType)
13296 {
13297 return ;
13298 }
13299 else
13300 {
13301 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13302
13303 *thisExp = *e;
13304 thisExp->prev = (((void *)0));
13305 thisExp->next = (((void *)0));
13306 __ecereMethod_Expression_Clear(e);
13307 e->type = 5;
13308 e->list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
13309 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
13310 ((struct Expression *)(*e->list).first)->byReference = 0x1;
13311 {
13312 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13313 CopyTypeInto(e->expType, thisExp->expType);
13314 e->expType->byReference = 0x0;
13315 e->expType->refCount = 1;
13316 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))
13317 {
13318 e->expType->classObjectType = 0;
13319 }
13320 }
13321 }
13322 }
13323 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
13324 {
13325 if(destType->kind == 14)
13326 {
13327 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unspecified type\n", (((void *)0))));
13328 }
13329 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
13330 {
13331 unsigned int byReference = e->expType->byReference;
13332 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13333 struct Declarator * decl;
13334 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13335 char typeString[1024];
13336 struct Type * type;
13337 int backupClassObjectType;
13338 unsigned int backupByReference;
13339
13340 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
13341 type = e->expType;
13342 else
13343 type = destType;
13344 backupClassObjectType = type->classObjectType;
13345 backupByReference = type->byReference;
13346 type->classObjectType = 0;
13347 type->byReference = 0x0;
13348 typeString[0] = '\0';
13349 PrintType(type, typeString, 0x0, 0x1);
13350 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13351 type->classObjectType = backupClassObjectType;
13352 type->byReference = backupByReference;
13353 *thisExp = *e;
13354 thisExp->prev = (((void *)0));
13355 thisExp->next = (((void *)0));
13356 __ecereMethod_Expression_Clear(e);
13357 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)))
13358 {
13359 e->type = 4;
13360 e->op.op = '*';
13361 e->op.exp1 = (((void *)0));
13362 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
13363 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13364 CopyTypeInto(e->expType, type);
13365 e->expType->byReference = 0x0;
13366 e->expType->refCount = 1;
13367 }
13368 else
13369 {
13370 e->type = 11;
13371 e->cast.typeName = MkTypeName(specs, decl);
13372 e->cast.exp = thisExp;
13373 e->byReference = 0x1;
13374 e->expType = type;
13375 type->refCount++;
13376 }
13377 e->destType = destType;
13378 destType->refCount++;
13379 }
13380 }
13381 }
13382
13383 extern char *  strstr(const char * , const char * );
13384
13385 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
13386
13387 struct __ecereNameSpace__ecere__com__DefinedExpression
13388 {
13389 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
13390 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
13391 char *  name;
13392 char *  value;
13393 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
13394 } __attribute__ ((gcc_struct));
13395
13396 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
13397
13398 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
13399
13400 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char *  string, int *  numBytes);
13401
13402 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
13403
13404 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
13405
13406 extern struct Expression * CopyExpression(struct Expression * exp);
13407
13408 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
13409
13410 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList *  specifiers, struct Declarator * decl);
13411
13412 static void ProcessStatement(struct Statement * stmt);
13413
13414 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
13415
13416 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
13417
13418 extern char *  __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, void * object, ...);
13419
13420 extern char *  sourceFile;
13421
13422 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
13423
13424 void ProcessExpressionType(struct Expression * exp)
13425 {
13426 unsigned int unresolved = 0x0;
13427 struct Location oldyylloc = yylloc;
13428 unsigned int notByReference = 0x0;
13429
13430 if(!exp || exp->expType)
13431 return ;
13432 yylloc = exp->loc;
13433 switch(exp->type)
13434 {
13435 case 0:
13436 {
13437 struct Identifier * id = exp->identifier;
13438
13439 if(!id)
13440 return ;
13441 if(id->_class && id->_class->name)
13442 {
13443 id->classSym = id->_class->symbol;
13444 }
13445 if(strstr(id->string, "__ecereClass") == id->string)
13446 {
13447 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
13448 break;
13449 }
13450 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
13451 {
13452 ReplaceClassMembers(exp, thisClass);
13453 if(exp->type != 0)
13454 {
13455 ProcessExpressionType(exp);
13456 break;
13457 }
13458 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
13459 break;
13460 }
13461 else
13462 {
13463 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13464
13465 if(!symbol)
13466 {
13467 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
13468 break;
13469 else
13470 {
13471 if(thisClass)
13472 {
13473 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
13474 if(exp->type != 0)
13475 {
13476 ProcessExpressionType(exp);
13477 break;
13478 }
13479 }
13480 else if(currentClass && !id->_class)
13481 {
13482 if(ResolveIdWithClass(exp, currentClass, 0x1))
13483 break;
13484 }
13485 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13486 }
13487 }
13488 if(symbol)
13489 {
13490 struct Type * type = symbol->type;
13491 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
13492
13493 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
13494 {
13495 struct Context * context = SetupTemplatesContext(_class);
13496
13497 type = ReplaceThisClassType(_class);
13498 FinishTemplatesContext(context);
13499 if(type)
13500 type->refCount = 0;
13501 }
13502 FreeSpecifier(id->_class);
13503 id->_class = (((void *)0));
13504 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13505 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
13506 id->classSym = (((void *)0));
13507 exp->expType = type;
13508 if(type)
13509 type->refCount++;
13510 if(type && (type->kind == 15 || (_class && _class->type == 4)))
13511 exp->isConstant = 0x1;
13512 if(symbol->isParam || !strcmp(id->string, "this"))
13513 {
13514 if(_class && _class->type == 1 && !type->declaredWithStruct)
13515 exp->byReference = 0x1;
13516 }
13517 if(symbol->isIterator)
13518 {
13519 if(symbol->isIterator == 3)
13520 {
13521 exp->type = 5;
13522 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
13523 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
13524 exp->expType = (((void *)0));
13525 ProcessExpressionType(exp);
13526 }
13527 else if(symbol->isIterator != 4)
13528 {
13529 exp->type = 8;
13530 exp->member.exp = MkExpIdentifier(exp->identifier);
13531 exp->member.exp->expType = exp->expType;
13532 exp->member.member = MkIdentifier("data");
13533 exp->expType = (((void *)0));
13534 ProcessExpressionType(exp);
13535 }
13536 }
13537 break;
13538 }
13539 else
13540 {
13541 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
13542
13543 if(thisNameSpace && !(id->_class && !id->_class->name))
13544 {
13545 char name[1024];
13546
13547 strcpy(name, thisNameSpace);
13548 strcat(name, "::");
13549 strcat(name, id->string);
13550 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
13551 }
13552 if(!definedExp)
13553 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
13554 if(definedExp)
13555 {
13556 int c;
13557
13558 for(c = 0; c < definedExpStackPos; c++)
13559 if(definedExpStack[c] == definedExp)
13560 break;
13561 if(c == definedExpStackPos && c < sizeof definedExpStack / sizeof(void *))
13562 {
13563 struct Location backupYylloc = yylloc;
13564
13565 definedExpStack[definedExpStackPos++] = definedExp;
13566 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13567 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__extension__ ({
13568 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13569
13570 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13571 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
13572 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13573 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13574
13575 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13576 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13577 echoOn = 0x0;
13578 parsedExpression = (((void *)0));
13579 resetScanner();
13580 expression_yyparse();
13581 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13582 yylloc = backupYylloc;
13583 if(parsedExpression)
13584 {
13585 FreeIdentifier(id);
13586 exp->type = 5;
13587 exp->list = MkListOne(parsedExpression);
13588 parsedExpression->loc = yylloc;
13589 ProcessExpressionType(exp);
13590 definedExpStackPos--;
13591 return ;
13592 }
13593 definedExpStackPos--;
13594 }
13595 else
13596 {
13597 if(inCompiler)
13598 {
13599 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Recursion in defined expression %s\n", (((void *)0))), id->string);
13600 }
13601 }
13602 }
13603 else
13604 {
13605 struct GlobalData * data = (((void *)0));
13606
13607 if(thisNameSpace && !(id->_class && !id->_class->name))
13608 {
13609 char name[1024];
13610
13611 strcpy(name, thisNameSpace);
13612 strcat(name, "::");
13613 strcat(name, id->string);
13614 data = FindGlobalData(name);
13615 }
13616 if(!data)
13617 data = FindGlobalData(id->string);
13618 if(data)
13619 {
13620 DeclareGlobalData(data);
13621 exp->expType = data->dataType;
13622 if(data->dataType)
13623 data->dataType->refCount++;
13624 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13625 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
13626 FreeSpecifier(id->_class);
13627 id->_class = (((void *)0));
13628 break;
13629 }
13630 else
13631 {
13632 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
13633
13634 if(thisNameSpace && !(id->_class && !id->_class->name))
13635 {
13636 char name[1024];
13637
13638 strcpy(name, thisNameSpace);
13639 strcat(name, "::");
13640 strcat(name, id->string);
13641 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
13642 }
13643 if(!function)
13644 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
13645 if(function)
13646 {
13647 char name[1024];
13648
13649 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13650 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
13651 name[0] = (char)0;
13652 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
13653 strcpy(name, "__ecereFunction_");
13654 FullClassNameCat(name, id->string, 0x0);
13655 if(DeclareFunction(function, name))
13656 {
13657 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13658 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
13659 }
13660 exp->expType = function->dataType;
13661 if(function->dataType)
13662 function->dataType->refCount++;
13663 FreeSpecifier(id->_class);
13664 id->_class = (((void *)0));
13665 break;
13666 }
13667 }
13668 }
13669 }
13670 }
13671 unresolved = 0x1;
13672 break;
13673 }
13674 case 1:
13675 {
13676 struct __ecereNameSpace__ecere__com__Class * _class;
13677
13678 if(!exp->instance->_class)
13679 {
13680 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
13681 {
13682 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
13683 }
13684 }
13685 ProcessInstantiationType(exp->instance);
13686 exp->isConstant = exp->instance->isConstant;
13687 if(exp->instance->_class)
13688 {
13689 exp->expType = MkClassType(exp->instance->_class->name);
13690 }
13691 break;
13692 }
13693 case 2:
13694 {
13695 if(!exp->expType)
13696 {
13697 char * constant = exp->constant;
13698 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
13699
13700 exp->expType = type;
13701 if(constant[0] == '\'')
13702 {
13703 if((int)((unsigned char *)constant)[1] > 127)
13704 {
13705 int nb;
13706 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
13707
13708 if(nb < 2)
13709 ch = constant[1];
13710 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
13711 exp->constant = PrintUInt(ch);
13712 type->kind = 8;
13713 type->_class = FindClass("unichar");
13714 type->isSigned = 0x0;
13715 }
13716 else
13717 {
13718 type->kind = 1;
13719 type->isSigned = 0x1;
13720 }
13721 }
13722 else
13723 {
13724 char * dot = strchr(constant, '.');
13725 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
13726 char * exponent;
13727
13728 if(isHex)
13729 {
13730 exponent = strchr(constant, 'p');
13731 if(!exponent)
13732 exponent = strchr(constant, 'P');
13733 }
13734 else
13735 {
13736 exponent = strchr(constant, 'e');
13737 if(!exponent)
13738 exponent = strchr(constant, 'E');
13739 }
13740 if(dot || exponent)
13741 {
13742 if(strchr(constant, 'f') || strchr(constant, 'F'))
13743 type->kind = 6;
13744 else
13745 type->kind = 7;
13746 type->isSigned = 0x1;
13747 }
13748 else
13749 {
13750 unsigned int isSigned = constant[0] == '-';
13751 long long i64 = strtoll(constant, (((void *)0)), 0);
13752 uint64 ui64 = strtoull(constant, (((void *)0)), 0);
13753 unsigned int is64Bit = 0x0;
13754
13755 if(isSigned)
13756 {
13757 if(i64 < (((int)0x80000000)))
13758 is64Bit = 0x1;
13759 }
13760 else
13761 {
13762 if(ui64 > (((int)0x7fffffff)))
13763 {
13764 if(ui64 > (0xffffffff))
13765 {
13766 is64Bit = 0x1;
13767 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
13768 isSigned = 0x1;
13769 }
13770 }
13771 else if(constant[0] != '0' || !constant[1])
13772 isSigned = 0x1;
13773 }
13774 type->kind = is64Bit ? 4 : 3;
13775 type->isSigned = isSigned;
13776 }
13777 }
13778 exp->isConstant = 0x1;
13779 if(exp->destType && exp->destType->kind == 7)
13780 type->kind = 7;
13781 else if(exp->destType && exp->destType->kind == 6)
13782 type->kind = 6;
13783 else if(exp->destType && exp->destType->kind == 4)
13784 type->kind = 4;
13785 }
13786 break;
13787 }
13788 case 3:
13789 {
13790 exp->isConstant = 0x1;
13791 exp->expType = __extension__ ({
13792 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13793
13794 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
13795 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13796
13797 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 1, __ecereInstance1->constant = 0x1, __ecereInstance1->isSigned = 0x1, __ecereInstance1;
13798 }), __ecereInstance2;
13799 });
13800 break;
13801 }
13802 case 13:
13803 case 28:
13804 ProcessExpressionType(exp->_new.size);
13805 exp->expType = __extension__ ({
13806 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13807
13808 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_new.typeName->qualifiers, exp->_new.typeName->declarator), __ecereInstance1;
13809 });
13810 DeclareType(exp->expType->type, 0x0, 0x0);
13811 break;
13812 case 14:
13813 case 29:
13814 ProcessExpressionType(exp->_renew.size);
13815 ProcessExpressionType(exp->_renew.exp);
13816 exp->expType = __extension__ ({
13817 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13818
13819 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_renew.typeName->qualifiers, exp->_renew.typeName->declarator), __ecereInstance1;
13820 });
13821 DeclareType(exp->expType->type, 0x0, 0x0);
13822 break;
13823 case 4:
13824 {
13825 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
13826 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
13827 unsigned int useDestType = 0x0, useSideType = 0x0;
13828 struct Location oldyylloc = yylloc;
13829 unsigned int useSideUnit = 0x0;
13830 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
13831
13832 switch(exp->op.op)
13833 {
13834 case '=':
13835 case MUL_ASSIGN:
13836 case DIV_ASSIGN:
13837 case MOD_ASSIGN:
13838 case ADD_ASSIGN:
13839 case SUB_ASSIGN:
13840 case LEFT_ASSIGN:
13841 case RIGHT_ASSIGN:
13842 case AND_ASSIGN:
13843 case XOR_ASSIGN:
13844 case OR_ASSIGN:
13845 assign = 0x1;
13846 break;
13847 case '!':
13848 break;
13849 case AND_OP:
13850 case OR_OP:
13851 boolOps = 0x1;
13852 boolResult = 0x1;
13853 break;
13854 case EQ_OP:
13855 case '<':
13856 case '>':
13857 case LE_OP:
13858 case GE_OP:
13859 case NE_OP:
13860 boolResult = 0x1;
13861 useSideType = 0x1;
13862 break;
13863 case '+':
13864 case '-':
13865 useSideUnit = 0x1;
13866 case '|':
13867 case '&':
13868 case '^':
13869 case '/':
13870 case '%':
13871 case '*':
13872 if(exp->op.op != '*' || exp->op.exp1)
13873 {
13874 useSideType = 0x1;
13875 useDestType = 0x1;
13876 }
13877 break;
13878 }
13879 if(exp->op.op == '&')
13880 {
13881 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
13882 {
13883 struct Identifier * id = exp->op.exp2->identifier;
13884 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13885
13886 if(symbol && symbol->isIterator == 2)
13887 {
13888 exp->type = 8;
13889 exp->member.exp = exp->op.exp2;
13890 exp->member.member = MkIdentifier("key");
13891 exp->expType = (((void *)0));
13892 exp->op.exp2->expType = symbol->type;
13893 symbol->type->refCount++;
13894 ProcessExpressionType(exp);
13895 FreeType(dummy);
13896 break;
13897 }
13898 }
13899 }
13900 if(exp->op.exp1)
13901 {
13902 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))
13903 {
13904 if(exp->op.exp1->destType)
13905 FreeType(exp->op.exp1->destType);
13906 exp->op.exp1->destType = exp->destType;
13907 if(exp->destType)
13908 exp->destType->refCount++;
13909 }
13910 else if(!assign)
13911 {
13912 if(exp->op.exp1->destType)
13913 FreeType(exp->op.exp1->destType);
13914 exp->op.exp1->destType = dummy;
13915 dummy->refCount++;
13916 }
13917 if(exp->op.exp1->destType && exp->op.op != '=')
13918 exp->op.exp1->destType->count++;
13919 ProcessExpressionType(exp->op.exp1);
13920 if(exp->op.exp1->destType && exp->op.op != '=')
13921 exp->op.exp1->destType->count--;
13922 if(exp->op.exp1->destType == dummy)
13923 {
13924 FreeType(dummy);
13925 exp->op.exp1->destType = (((void *)0));
13926 }
13927 type1 = exp->op.exp1->expType;
13928 }
13929 if(exp->op.exp2)
13930 {
13931 char expString[10240];
13932
13933 expString[0] = '\0';
13934 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
13935 {
13936 if(exp->op.exp1)
13937 {
13938 exp->op.exp2->destType = exp->op.exp1->expType;
13939 if(exp->op.exp1->expType)
13940 exp->op.exp1->expType->refCount++;
13941 }
13942 else
13943 {
13944 exp->op.exp2->destType = exp->destType;
13945 if(exp->destType)
13946 exp->destType->refCount++;
13947 }
13948 if(type1)
13949 type1->refCount++;
13950 exp->expType = type1;
13951 }
13952 else if(assign)
13953 {
13954 if(inCompiler)
13955 PrintExpression(exp->op.exp2, expString);
13956 if(type1 && type1->kind == 13)
13957 {
13958 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)
13959 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
13960 else if(exp->op.op == '=')
13961 {
13962 if(exp->op.exp2->destType)
13963 FreeType(exp->op.exp2->destType);
13964 exp->op.exp2->destType = type1;
13965 if(type1)
13966 type1->refCount++;
13967 }
13968 }
13969 else
13970 {
13971 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)
13972 ;
13973 else
13974 {
13975 if(exp->op.exp2->destType)
13976 FreeType(exp->op.exp2->destType);
13977 exp->op.exp2->destType = type1;
13978 if(type1)
13979 type1->refCount++;
13980 }
13981 }
13982 if(type1)
13983 type1->refCount++;
13984 exp->expType = type1;
13985 }
13986 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)))
13987 {
13988 if(exp->op.exp2->destType)
13989 FreeType(exp->op.exp2->destType);
13990 exp->op.exp2->destType = exp->destType;
13991 if(exp->destType)
13992 exp->destType->refCount++;
13993 }
13994 else
13995 {
13996 if(exp->op.exp2->destType)
13997 FreeType(exp->op.exp2->destType);
13998 exp->op.exp2->destType = dummy;
13999 dummy->refCount++;
14000 }
14001 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
14002 {
14003 FreeType(exp->op.exp2->destType);
14004 exp->op.exp2->destType = type1;
14005 type1->refCount++;
14006 }
14007 if(exp->op.exp2->destType && exp->op.op != '=')
14008 exp->op.exp2->destType->count++;
14009 ProcessExpressionType(exp->op.exp2);
14010 if(exp->op.exp2->destType && exp->op.op != '=')
14011 exp->op.exp2->destType->count--;
14012 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
14013 {
14014 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)
14015 {
14016 if(exp->op.op != '=' && type1->type->kind == 0)
14017 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
14018 }
14019 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)))
14020 {
14021 if(exp->op.op == ADD_ASSIGN)
14022 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
14023 }
14024 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))
14025 {
14026 if(exp->op.op == ADD_ASSIGN)
14027 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
14028 }
14029 else if(inCompiler)
14030 {
14031 char type1String[1024];
14032 char type2String[1024];
14033
14034 type1String[0] = '\0';
14035 type2String[0] = '\0';
14036 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
14037 PrintType(type1, type2String, 0x0, 0x1);
14038 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14039 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
14040 }
14041 }
14042 if(exp->op.exp2->destType == dummy)
14043 {
14044 FreeType(dummy);
14045 exp->op.exp2->destType = (((void *)0));
14046 }
14047 if(exp->op.op == '-' && !exp->op.exp1 && exp->op.exp2->expType && !exp->op.exp2->expType->isSigned)
14048 {
14049 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14050 type2->refCount = 1;
14051 CopyTypeInto(type2, exp->op.exp2->expType);
14052 type2->isSigned = 0x1;
14053 }
14054 else if(exp->op.op == '~' && !exp->op.exp1 && exp->op.exp2->expType && (!exp->op.exp2->expType->isSigned || exp->op.exp2->expType->kind != 3))
14055 {
14056 type2 = __extension__ ({
14057 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14058
14059 __ecereInstance1->kind = 3, __ecereInstance1;
14060 });
14061 type2->refCount = 1;
14062 type2->isSigned = 0x1;
14063 }
14064 else
14065 type2 = exp->op.exp2->expType;
14066 }
14067 dummy->kind = 0;
14068 if(exp->op.op == SIZEOF)
14069 {
14070 exp->expType = __extension__ ({
14071 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14072
14073 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
14074 });
14075 exp->isConstant = 0x1;
14076 }
14077 else if(exp->op.op == '*' && !exp->op.exp1)
14078 {
14079 exp->expType = Dereference(type2);
14080 if(type2 && type2->kind == 8)
14081 notByReference = 0x1;
14082 }
14083 else if(exp->op.op == '&' && !exp->op.exp1)
14084 exp->expType = Reference(type2);
14085 else if(!assign)
14086 {
14087 if(boolOps)
14088 {
14089 if(exp->op.exp1)
14090 {
14091 if(exp->op.exp1->destType)
14092 FreeType(exp->op.exp1->destType);
14093 exp->op.exp1->destType = MkClassType("bool");
14094 exp->op.exp1->destType->truth = 0x1;
14095 if(!exp->op.exp1->expType)
14096 ProcessExpressionType(exp->op.exp1);
14097 else
14098 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14099 FreeType(exp->op.exp1->expType);
14100 exp->op.exp1->expType = MkClassType("bool");
14101 exp->op.exp1->expType->truth = 0x1;
14102 }
14103 if(exp->op.exp2)
14104 {
14105 if(exp->op.exp2->destType)
14106 FreeType(exp->op.exp2->destType);
14107 exp->op.exp2->destType = MkClassType("bool");
14108 exp->op.exp2->destType->truth = 0x1;
14109 if(!exp->op.exp2->expType)
14110 ProcessExpressionType(exp->op.exp2);
14111 else
14112 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14113 FreeType(exp->op.exp2->expType);
14114 exp->op.exp2->expType = MkClassType("bool");
14115 exp->op.exp2->expType->truth = 0x1;
14116 }
14117 }
14118 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")))))
14119 {
14120 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
14121 {
14122 if(exp->op.exp2->destType)
14123 FreeType(exp->op.exp2->destType);
14124 exp->op.exp2->destType = type1;
14125 type1->refCount++;
14126 if(exp->op.exp1->destType)
14127 FreeType(exp->op.exp1->destType);
14128 exp->op.exp1->destType = type2;
14129 type2->refCount++;
14130 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)
14131 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);
14132 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
14133 {
14134 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14135
14136 if(argExp)
14137 {
14138 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14139
14140 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
14141 ProcessExpressionType(exp->op.exp1);
14142 if(type2->kind != 13)
14143 {
14144 ProcessExpressionType(classExp);
14145 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"))))))));
14146 if(!exp->op.exp2->expType)
14147 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
14148 ProcessExpressionType(exp->op.exp2);
14149 }
14150 }
14151 }
14152 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)))
14153 {
14154 if(type1->kind != 8 && type1->type->kind == 0)
14155 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
14156 exp->expType = type1;
14157 if(type1)
14158 type1->refCount++;
14159 }
14160 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)))
14161 {
14162 if(type2->kind != 8 && type2->type->kind == 0)
14163 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
14164 exp->expType = type2;
14165 if(type2)
14166 type2->refCount++;
14167 }
14168 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))
14169 {
14170 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "different levels of indirection\n", (((void *)0))));
14171 }
14172 else
14173 {
14174 unsigned int success = 0x0;
14175
14176 if(type1->kind == 13 && type2->kind == 13)
14177 {
14178 if(exp->op.op == '+')
14179 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
14180 else if(exp->op.op == '-')
14181 {
14182 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
14183 {
14184 exp->expType = __extension__ ({
14185 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14186
14187 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
14188 });
14189 success = 0x1;
14190 if(type1->type->kind == 20)
14191 {
14192 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14193
14194 if(argExp)
14195 {
14196 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14197
14198 ProcessExpressionType(classExp);
14199 exp->type = 5;
14200 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")))))));
14201 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
14202 FreeType(dummy);
14203 return ;
14204 }
14205 }
14206 }
14207 }
14208 }
14209 if(!success && exp->op.exp1->type == 2)
14210 {
14211 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14212 {
14213 if(exp->expType)
14214 FreeType(exp->expType);
14215 exp->expType = exp->op.exp1->destType;
14216 if(exp->op.exp1->destType)
14217 exp->op.exp1->destType->refCount++;
14218 success = 0x1;
14219 }
14220 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14221 {
14222 if(exp->expType)
14223 FreeType(exp->expType);
14224 exp->expType = exp->op.exp2->destType;
14225 if(exp->op.exp2->destType)
14226 exp->op.exp2->destType->refCount++;
14227 success = 0x1;
14228 }
14229 }
14230 else if(!success)
14231 {
14232 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14233 {
14234 if(exp->expType)
14235 FreeType(exp->expType);
14236 exp->expType = exp->op.exp2->destType;
14237 if(exp->op.exp2->destType)
14238 exp->op.exp2->destType->refCount++;
14239 success = 0x1;
14240 }
14241 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14242 {
14243 if(exp->expType)
14244 FreeType(exp->expType);
14245 exp->expType = exp->op.exp1->destType;
14246 if(exp->op.exp1->destType)
14247 exp->op.exp1->destType->refCount++;
14248 success = 0x1;
14249 }
14250 }
14251 if(!success)
14252 {
14253 char expString1[10240];
14254 char expString2[10240];
14255 char type1[1024];
14256 char type2[1024];
14257
14258 expString1[0] = '\0';
14259 expString2[0] = '\0';
14260 type1[0] = '\0';
14261 type2[0] = '\0';
14262 if(inCompiler)
14263 {
14264 PrintExpression(exp->op.exp1, expString1);
14265 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
14266 PrintExpression(exp->op.exp2, expString2);
14267 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
14268 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
14269 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
14270 }
14271 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
14272 }
14273 }
14274 }
14275 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
14276 {
14277 if(exp->op.exp1->destType)
14278 FreeType(exp->op.exp1->destType);
14279 exp->op.exp1->destType = type2->_class->registered->dataType;
14280 if(type2->_class->registered->dataType)
14281 type2->_class->registered->dataType->refCount++;
14282 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14283 exp->expType = type2;
14284 if(type2)
14285 type2->refCount++;
14286 }
14287 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
14288 {
14289 if(exp->op.exp2->destType)
14290 FreeType(exp->op.exp2->destType);
14291 exp->op.exp2->destType = type1->_class->registered->dataType;
14292 if(type1->_class->registered->dataType)
14293 type1->_class->registered->dataType->refCount++;
14294 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14295 exp->expType = type1;
14296 if(type1)
14297 type1->refCount++;
14298 }
14299 else if(type1)
14300 {
14301 unsigned int valid = 0x0;
14302
14303 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
14304 {
14305 if(exp->op.exp2->destType)
14306 FreeType(exp->op.exp2->destType);
14307 if(!type1->_class->registered->dataType)
14308 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
14309 exp->op.exp2->destType = type1->_class->registered->dataType;
14310 exp->op.exp2->destType->refCount++;
14311 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14312 type2 = exp->op.exp2->destType;
14313 exp->expType = type2;
14314 type2->refCount++;
14315 }
14316 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
14317 {
14318 if(exp->op.exp1->destType)
14319 FreeType(exp->op.exp1->destType);
14320 if(!type2->_class->registered->dataType)
14321 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
14322 exp->op.exp1->destType = type2->_class->registered->dataType;
14323 exp->op.exp1->destType->refCount++;
14324 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14325 type1 = exp->op.exp1->destType;
14326 exp->expType = type1;
14327 type1->refCount++;
14328 }
14329 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
14330 {
14331 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
14332 {
14333 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
14334 {
14335 if(exp->expType)
14336 FreeType(exp->expType);
14337 exp->expType = exp->op.exp1->expType;
14338 if(exp->op.exp2->expType)
14339 exp->op.exp1->expType->refCount++;
14340 valid = 0x1;
14341 }
14342 }
14343 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
14344 {
14345 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
14346 {
14347 if(exp->expType)
14348 FreeType(exp->expType);
14349 exp->expType = exp->op.exp2->expType;
14350 if(exp->op.exp2->expType)
14351 exp->op.exp2->expType->refCount++;
14352 valid = 0x1;
14353 }
14354 }
14355 }
14356 if(!valid)
14357 {
14358 if(exp->op.exp2->destType)
14359 FreeType(exp->op.exp2->destType);
14360 exp->op.exp2->destType = type1;
14361 type1->refCount++;
14362 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14363 {
14364 if(exp->expType)
14365 FreeType(exp->expType);
14366 exp->expType = exp->op.exp2->destType;
14367 if(exp->op.exp2->destType)
14368 exp->op.exp2->destType->refCount++;
14369 }
14370 else if(type1 && type2)
14371 {
14372 char expString1[10240];
14373 char expString2[10240];
14374 char type1String[1024];
14375 char type2String[1024];
14376
14377 expString1[0] = '\0';
14378 expString2[0] = '\0';
14379 type1String[0] = '\0';
14380 type2String[0] = '\0';
14381 if(inCompiler)
14382 {
14383 PrintExpression(exp->op.exp1, expString1);
14384 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
14385 PrintExpression(exp->op.exp2, expString2);
14386 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
14387 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
14388 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
14389 }
14390 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
14391 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
14392 {
14393 exp->expType = exp->op.exp1->expType;
14394 if(exp->op.exp1->expType)
14395 exp->op.exp1->expType->refCount++;
14396 }
14397 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
14398 {
14399 exp->expType = exp->op.exp2->expType;
14400 if(exp->op.exp2->expType)
14401 exp->op.exp2->expType->refCount++;
14402 }
14403 }
14404 }
14405 }
14406 else if(type2)
14407 {
14408 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
14409 {
14410 struct Type * oldType = exp->op.exp1->expType;
14411
14412 exp->op.exp1->expType = (((void *)0));
14413 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14414 FreeType(oldType);
14415 else
14416 exp->op.exp1->expType = oldType;
14417 }
14418 if(exp->op.exp1->destType)
14419 FreeType(exp->op.exp1->destType);
14420 exp->op.exp1->destType = type2;
14421 type2->refCount++;
14422 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14423 {
14424 if(exp->expType)
14425 FreeType(exp->expType);
14426 exp->expType = exp->op.exp1->destType;
14427 if(exp->op.exp1->destType)
14428 exp->op.exp1->destType->refCount++;
14429 }
14430 }
14431 }
14432 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
14433 {
14434 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
14435 {
14436 if(exp->op.exp1->destType)
14437 FreeType(exp->op.exp1->destType);
14438 exp->op.exp1->destType = type2->_class->registered->dataType;
14439 if(type2->_class->registered->dataType)
14440 type2->_class->registered->dataType->refCount++;
14441 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14442 }
14443 if(exp->op.op == '!')
14444 {
14445 exp->expType = MkClassType("bool");
14446 exp->expType->truth = 0x1;
14447 }
14448 else
14449 {
14450 exp->expType = type2;
14451 if(type2)
14452 type2->refCount++;
14453 }
14454 }
14455 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
14456 {
14457 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
14458 {
14459 if(exp->op.exp2->destType)
14460 FreeType(exp->op.exp2->destType);
14461 exp->op.exp2->destType = type1->_class->registered->dataType;
14462 if(type1->_class->registered->dataType)
14463 type1->_class->registered->dataType->refCount++;
14464 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14465 }
14466 exp->expType = type1;
14467 if(type1)
14468 type1->refCount++;
14469 }
14470 }
14471 yylloc = exp->loc;
14472 if(exp->op.exp1 && !exp->op.exp1->expType)
14473 {
14474 char expString[10000];
14475
14476 expString[0] = '\0';
14477 if(inCompiler)
14478 {
14479 PrintExpression(exp->op.exp1, expString);
14480 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14481 }
14482 if(expString[0])
14483 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14484 }
14485 if(exp->op.exp2 && !exp->op.exp2->expType)
14486 {
14487 char expString[10240];
14488
14489 expString[0] = '\0';
14490 if(inCompiler)
14491 {
14492 PrintExpression(exp->op.exp2, expString);
14493 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14494 }
14495 if(expString[0])
14496 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14497 }
14498 if(boolResult)
14499 {
14500 FreeType(exp->expType);
14501 exp->expType = MkClassType("bool");
14502 exp->expType->truth = 0x1;
14503 }
14504 if(exp->op.op != SIZEOF)
14505 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
14506 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
14507 {
14508 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
14509 }
14510 yylloc = oldyylloc;
14511 FreeType(dummy);
14512 break;
14513 }
14514 case 5:
14515 case 34:
14516 {
14517 struct Expression * e;
14518
14519 exp->isConstant = 0x1;
14520 for(e = (*exp->list).first; e; e = e->next)
14521 {
14522 unsigned int inced = 0x0;
14523
14524 if(!e->next)
14525 {
14526 FreeType(e->destType);
14527 e->destType = exp->destType;
14528 if(e->destType)
14529 {
14530 exp->destType->refCount++;
14531 e->destType->count++;
14532 inced = 0x1;
14533 }
14534 }
14535 ProcessExpressionType(e);
14536 if(inced)
14537 exp->destType->count--;
14538 if(!exp->expType && !e->next)
14539 {
14540 exp->expType = e->expType;
14541 if(e->expType)
14542 e->expType->refCount++;
14543 }
14544 if(!e->isConstant)
14545 exp->isConstant = 0x0;
14546 }
14547 e = (*exp->list).first;
14548 if(!e->next && e->type == 8)
14549 {
14550 struct Expression * next = exp->next, * prev = exp->prev;
14551
14552 FreeType(exp->expType);
14553 FreeType(exp->destType);
14554 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14555 *exp = *e;
14556 exp->prev = prev;
14557 exp->next = next;
14558 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
14559 ProcessExpressionType(exp);
14560 }
14561 break;
14562 }
14563 case 6:
14564 {
14565 struct Expression * e;
14566
14567 exp->isConstant = 0x1;
14568 ProcessExpressionType(exp->index.exp);
14569 if(!exp->index.exp->isConstant)
14570 exp->isConstant = 0x0;
14571 if(exp->index.exp->expType)
14572 {
14573 struct Type * source = exp->index.exp->expType;
14574
14575 if(source->kind == 8 && source->_class && source->_class->registered)
14576 {
14577 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
14578 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
14579
14580 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
14581 {
14582 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
14583 if(exp->index.index && (*exp->index.index).last)
14584 {
14585 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
14586 }
14587 }
14588 }
14589 }
14590 for(e = (*exp->index.index).first; e; e = e->next)
14591 {
14592 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
14593 {
14594 if(e->destType)
14595 FreeType(e->destType);
14596 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
14597 }
14598 ProcessExpressionType(e);
14599 if(!e->next)
14600 {
14601 }
14602 if(!e->isConstant)
14603 exp->isConstant = 0x0;
14604 }
14605 if(!exp->expType)
14606 exp->expType = Dereference(exp->index.exp->expType);
14607 if(exp->expType)
14608 DeclareType(exp->expType, 0x0, 0x0);
14609 break;
14610 }
14611 case 7:
14612 {
14613 struct Expression * e;
14614 struct Type * functionType;
14615 struct Type * methodType = (((void *)0));
14616 char name[1024];
14617
14618 name[0] = '\0';
14619 if(inCompiler)
14620 {
14621 PrintExpression(exp->call.exp, name);
14622 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
14623 {
14624 PrintExpression(exp->call.exp, name);
14625 }
14626 }
14627 if(exp->call.exp->type == 0)
14628 {
14629 struct Expression * idExp = exp->call.exp;
14630 struct Identifier * id = idExp->identifier;
14631
14632 if(!strcmp(id->string, "__builtin_frame_address"))
14633 {
14634 exp->expType = ProcessTypeString("void *", 0x1);
14635 if(exp->call.arguments && (*exp->call.arguments).first)
14636 ProcessExpressionType((*exp->call.arguments).first);
14637 break;
14638 }
14639 else if(!strcmp(id->string, "__ENDIAN_PAD"))
14640 {
14641 exp->expType = ProcessTypeString("int", 0x1);
14642 if(exp->call.arguments && (*exp->call.arguments).first)
14643 ProcessExpressionType((*exp->call.arguments).first);
14644 break;
14645 }
14646 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
14647 {
14648 struct Expression * a = (((void *)0));
14649 struct Expression * b = (((void *)0));
14650 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
14651
14652 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
14653 {
14654 a = (*exp->call.arguments).first;
14655 b = (*exp->call.arguments).last;
14656 tempExp1 = a;
14657 tempExp2 = b;
14658 }
14659 else if((*exp->call.arguments).count == 1)
14660 {
14661 a = (*exp->call.arguments).first;
14662 tempExp1 = a;
14663 }
14664 if(a)
14665 {
14666 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
14667 idExp->identifier = (((void *)0));
14668 FreeExpContents(exp);
14669 ProcessExpressionType(a);
14670 if(b)
14671 ProcessExpressionType(b);
14672 exp->type = 5;
14673 exp->list = MkList();
14674 if(a->expType && (!b || b->expType))
14675 {
14676 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
14677 {
14678 if(inCompiler)
14679 {
14680 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14681 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
14682 struct Declaration * decl;
14683 char temp1[1024], temp2[1024];
14684
14685 GetTypeSpecs(a->expType, specs);
14686 if(a && !a->isConstant && a->type != 0)
14687 {
14688 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
14689 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
14690 tempExp1 = QMkExpId(temp1);
14691 tempExp1->expType = a->expType;
14692 if(a->expType)
14693 a->expType->refCount++;
14694 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
14695 }
14696 if(b && !b->isConstant && b->type != 0)
14697 {
14698 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
14699 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
14700 tempExp2 = QMkExpId(temp2);
14701 tempExp2->expType = b->expType;
14702 if(b->expType)
14703 b->expType->refCount++;
14704 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
14705 }
14706 decl = MkDeclaration(specs, decls);
14707 if(!curCompound->compound.declarations)
14708 curCompound->compound.declarations = MkList();
14709 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
14710 }
14711 }
14712 }
14713 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
14714 {
14715 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
14716
14717 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
14718 exp->expType = a->expType;
14719 if(a->expType)
14720 a->expType->refCount++;
14721 }
14722 else if(!strcmp(id->string, "Abs"))
14723 {
14724 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
14725 exp->expType = a->expType;
14726 if(a->expType)
14727 a->expType->refCount++;
14728 }
14729 else if(!strcmp(id->string, "Sgn"))
14730 {
14731 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"))))));
14732 exp->expType = ProcessTypeString("int", 0x0);
14733 }
14734 FreeExpression(tempExp1);
14735 if(tempExp2)
14736 FreeExpression(tempExp2);
14737 FreeIdentifier(id);
14738 break;
14739 }
14740 }
14741 }
14742 {
14743 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
14744
14745 if(!exp->call.exp->destType)
14746 {
14747 exp->call.exp->destType = dummy;
14748 dummy->refCount++;
14749 }
14750 ProcessExpressionType(exp->call.exp);
14751 if(exp->call.exp->destType == dummy)
14752 {
14753 FreeType(dummy);
14754 exp->call.exp->destType = (((void *)0));
14755 }
14756 FreeType(dummy);
14757 }
14758 functionType = exp->call.exp->expType;
14759 if(functionType && functionType->kind == 16)
14760 {
14761 methodType = functionType;
14762 functionType = methodType->method->dataType;
14763 if(exp->call.exp->expType->usedClass)
14764 {
14765 char typeString[1024];
14766
14767 typeString[0] = '\0';
14768 {
14769 struct Symbol * back = functionType->thisClass;
14770
14771 functionType->thisClass = (((void *)0));
14772 PrintType(functionType, typeString, 0x1, 0x1);
14773 functionType->thisClass = back;
14774 }
14775 if(strstr(typeString, "thisclass"))
14776 {
14777 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14778 struct Declarator * decl;
14779
14780 {
14781 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
14782
14783 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14784 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
14785 thisClassParams = 0x0;
14786 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
14787 {
14788 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
14789
14790 thisClass = exp->call.exp->expType->usedClass;
14791 ProcessDeclarator(decl);
14792 thisClass = backupThisClass;
14793 }
14794 thisClassParams = 0x1;
14795 functionType = ProcessType(specs, decl);
14796 functionType->refCount = 0;
14797 FinishTemplatesContext(context);
14798 }
14799 FreeList(specs, FreeSpecifier);
14800 FreeDeclarator(decl);
14801 }
14802 }
14803 }
14804 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
14805 {
14806 struct Type * type = functionType->type;
14807
14808 if(!functionType->refCount)
14809 {
14810 functionType->type = (((void *)0));
14811 FreeType(functionType);
14812 }
14813 functionType = type;
14814 }
14815 if(functionType && functionType->kind != 11)
14816 {
14817 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "called object %s is not a function\n", (((void *)0))), name);
14818 }
14819 else if(functionType)
14820 {
14821 unsigned int emptyParams = 0x0, noParams = 0x0;
14822 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
14823 struct Type * type = functionType->params.first;
14824 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
14825 int extra = 0;
14826 struct Location oldyylloc = yylloc;
14827
14828 if(!type)
14829 emptyParams = 0x1;
14830 if(functionType->extraParam && e && functionType->thisClass)
14831 {
14832 e->destType = MkClassType(functionType->thisClass->string);
14833 e = e->next;
14834 }
14835 if(!functionType->staticMethod && !functionType->extraParam)
14836 {
14837 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
14838 {
14839 type = MkClassType(memberExp->member.exp->expType->_class->string);
14840 if(e)
14841 {
14842 e->destType = type;
14843 e = e->next;
14844 type = functionType->params.first;
14845 }
14846 else
14847 type->refCount = 0;
14848 }
14849 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
14850 {
14851 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
14852 type->byReference = functionType->byReference;
14853 type->typedByReference = functionType->typedByReference;
14854 if(e)
14855 {
14856 if(e->next && type->kind == 8 && (functionType && functionType->thisClass) && functionType->classObjectType == 2)
14857 e = e->next;
14858 e->destType = type;
14859 e = e->next;
14860 type = functionType->params.first;
14861 }
14862 else
14863 type->refCount = 0;
14864 }
14865 }
14866 if(type && type->kind == 0)
14867 {
14868 noParams = 0x1;
14869 if(!type->refCount)
14870 FreeType(type);
14871 type = (((void *)0));
14872 }
14873 for(; e; e = e->next)
14874 {
14875 if(!type && !emptyParams)
14876 {
14877 yylloc = e->loc;
14878 if(methodType && methodType->methodClass)
14879 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);
14880 else
14881 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);
14882 break;
14883 }
14884 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
14885 {
14886 struct Type * templatedType = (((void *)0));
14887 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
14888 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
14889 int id = 0;
14890
14891 if(_class && _class->templateArgs)
14892 {
14893 struct __ecereNameSpace__ecere__com__Class * sClass;
14894
14895 for(sClass = _class; sClass; sClass = sClass->base)
14896 {
14897 if(sClass->templateClass)
14898 sClass = sClass->templateClass;
14899 id = 0;
14900 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
14901 {
14902 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
14903 {
14904 struct __ecereNameSpace__ecere__com__Class * nextClass;
14905
14906 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
14907 {
14908 if(nextClass->templateClass)
14909 nextClass = nextClass->templateClass;
14910 id += nextClass->templateParams.count;
14911 }
14912 break;
14913 }
14914 id++;
14915 }
14916 if(curParam)
14917 break;
14918 }
14919 }
14920 if(curParam && _class->templateArgs[id].dataTypeString)
14921 {
14922 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
14923
14924 {
14925 struct Context * context = SetupTemplatesContext(_class);
14926
14927 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
14928 FinishTemplatesContext(context);
14929 }
14930 e->destType = templatedType;
14931 if(templatedType)
14932 {
14933 templatedType->passAsTemplate = 0x1;
14934 }
14935 }
14936 else
14937 {
14938 e->destType = type;
14939 if(type)
14940 type->refCount++;
14941 }
14942 }
14943 else
14944 {
14945 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
14946 {
14947 e->destType = type->prev;
14948 e->destType->refCount++;
14949 }
14950 else
14951 {
14952 e->destType = type;
14953 if(type)
14954 type->refCount++;
14955 }
14956 }
14957 if(type && type->kind != 14)
14958 {
14959 struct Type * next = type->next;
14960
14961 if(!type->refCount)
14962 FreeType(type);
14963 type = next;
14964 }
14965 }
14966 if(type && type->kind != 14)
14967 {
14968 if(methodType && methodType->methodClass)
14969 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);
14970 else
14971 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);
14972 }
14973 yylloc = oldyylloc;
14974 if(type && !type->refCount)
14975 FreeType(type);
14976 }
14977 else
14978 {
14979 functionType = __extension__ ({
14980 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14981
14982 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
14983 });
14984 if(exp->call.exp->type == 0)
14985 {
14986 char * string = exp->call.exp->identifier->string;
14987
14988 if(inCompiler)
14989 {
14990 struct Symbol * symbol;
14991 struct Location oldyylloc = yylloc;
14992
14993 yylloc = exp->call.exp->identifier->loc;
14994 if(strstr(string, "__builtin_") == string)
14995 {
14996 if(exp->destType)
14997 {
14998 functionType->returnType = exp->destType;
14999 exp->destType->refCount++;
15000 }
15001 }
15002 else
15003 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s undefined; assuming extern returning int\n", (((void *)0))), string);
15004 symbol = __extension__ ({
15005 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
15006
15007 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 0x1), __ecereInstance1;
15008 });
15009 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
15010 if(strstr(symbol->string, "::"))
15011 globalContext->hasNameSpace = 0x1;
15012 yylloc = oldyylloc;
15013 }
15014 }
15015 else if(exp->call.exp->type == 8)
15016 {
15017 }
15018 else
15019 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "callable object undefined; extern assuming returning int\n", (((void *)0))));
15020 if(!functionType->returnType)
15021 {
15022 functionType->returnType = __extension__ ({
15023 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15024
15025 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15026 });
15027 }
15028 }
15029 if(functionType && functionType->kind == 11)
15030 {
15031 exp->expType = functionType->returnType;
15032 if(functionType->returnType)
15033 functionType->returnType->refCount++;
15034 if(!functionType->refCount)
15035 FreeType(functionType);
15036 }
15037 if(exp->call.arguments)
15038 {
15039 for(e = (*exp->call.arguments).first; e; e = e->next)
15040 {
15041 struct Type * destType = e->destType;
15042
15043 ProcessExpressionType(e);
15044 }
15045 }
15046 break;
15047 }
15048 case 8:
15049 {
15050 struct Type * type;
15051 struct Location oldyylloc = yylloc;
15052 unsigned int thisPtr;
15053 struct Expression * checkExp = exp->member.exp;
15054
15055 while(checkExp)
15056 {
15057 if(checkExp->type == 11)
15058 checkExp = checkExp->cast.exp;
15059 else if(checkExp->type == 5)
15060 checkExp = checkExp->list ? (*checkExp->list).first : (((void *)0));
15061 else
15062 break;
15063 }
15064 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->identifier->string, "this"));
15065 exp->thisPtr = thisPtr;
15066 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
15067 {
15068 exp->member.member->classSym = exp->member.member->_class->symbol;
15069 }
15070 ProcessExpressionType(exp->member.exp);
15071 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)
15072 {
15073 exp->isConstant = 0x0;
15074 }
15075 else
15076 exp->isConstant = exp->member.exp->isConstant;
15077 type = exp->member.exp->expType;
15078 yylloc = exp->loc;
15079 if(type && (type->kind == 20))
15080 {
15081 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
15082 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
15083
15084 if(_class)
15085 {
15086 for(param = _class->templateParams.first; param; param = param->next)
15087 {
15088 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
15089 break;
15090 }
15091 }
15092 if(param && param->defaultArg.member)
15093 {
15094 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
15095
15096 if(argExp)
15097 {
15098 struct Expression * expMember = exp->member.exp;
15099 struct Declarator * decl;
15100 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15101 char thisClassTypeString[1024];
15102
15103 FreeIdentifier(exp->member.member);
15104 ProcessExpressionType(argExp);
15105 {
15106 char * colon = strstr(param->defaultArg.memberString, "::");
15107
15108 if(colon)
15109 {
15110 char className[1024];
15111 struct __ecereNameSpace__ecere__com__Class * sClass;
15112
15113 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
15114 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
15115 }
15116 else
15117 strcpy(thisClassTypeString, _class->fullName);
15118 }
15119 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
15120 exp->expType = ProcessType(specs, decl);
15121 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
15122 {
15123 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
15124 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
15125 int c;
15126 int paramCount = 0;
15127 int lastParam = -1;
15128 char templateString[1024];
15129 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
15130
15131 sprintf(templateString, "%s<", expClass->templateClass->fullName);
15132 for(cClass = expClass; cClass; cClass = cClass->base)
15133 {
15134 int p = 0;
15135
15136 for(param = cClass->templateParams.first; param; param = param->next)
15137 {
15138 int id = p;
15139 struct __ecereNameSpace__ecere__com__Class * sClass;
15140 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
15141
15142 for(sClass = cClass->base; sClass; sClass = sClass->base)
15143 id += sClass->templateParams.count;
15144 arg = expClass->templateArgs[id];
15145 for(sClass = _class; sClass; sClass = sClass->base)
15146 {
15147 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
15148 int p = 0;
15149 struct __ecereNameSpace__ecere__com__Class * nextClass;
15150
15151 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15152 p += nextClass->templateParams.count;
15153 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
15154 {
15155 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
15156 {
15157 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15158 {
15159 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
15160 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
15161 break;
15162 }
15163 }
15164 }
15165 }
15166 {
15167 char argument[256];
15168
15169 argument[0] = '\0';
15170 switch(param->type)
15171 {
15172 case 2:
15173 {
15174 char expString[1024];
15175 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15176 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
15177 struct Expression * exp;
15178 char * string = PrintHexUInt64(arg.expression.ui64);
15179
15180 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
15181 ProcessExpressionType(exp);
15182 ComputeExpression(exp);
15183 expString[0] = '\0';
15184 PrintExpression(exp, expString);
15185 strcat(argument, expString);
15186 FreeExpression(exp);
15187 break;
15188 }
15189 case 1:
15190 {
15191 strcat(argument, arg.member->name);
15192 break;
15193 }
15194 case 0:
15195 {
15196 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15197 {
15198 if(!strcmp(arg.dataTypeString, "thisclass"))
15199 strcat(argument, thisClassTypeString);
15200 else
15201 strcat(argument, arg.dataTypeString);
15202 }
15203 break;
15204 }
15205 }
15206 if(argument[0])
15207 {
15208 if(paramCount)
15209 strcat(templateString, ", ");
15210 if(lastParam != p - 1)
15211 {
15212 strcat(templateString, param->name);
15213 strcat(templateString, " = ");
15214 }
15215 strcat(templateString, argument);
15216 paramCount++;
15217 lastParam = p;
15218 }
15219 p++;
15220 }
15221 }
15222 }
15223 {
15224 int len = strlen(templateString);
15225
15226 if(templateString[len - 1] == '>')
15227 templateString[len++] = ' ';
15228 templateString[len++] = '>';
15229 templateString[len++] = '\0';
15230 }
15231 {
15232 struct Context * context = SetupTemplatesContext(_class);
15233
15234 FreeType(exp->expType);
15235 exp->expType = ProcessTypeString(templateString, 0x0);
15236 FinishTemplatesContext(context);
15237 }
15238 }
15239 exp->type = 5;
15240 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")))))))));
15241 }
15242 }
15243 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
15244 {
15245 type = ProcessTemplateParameterType(type->templateParameter);
15246 }
15247 }
15248 if(type && (type->kind == 20))
15249 ;
15250 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)))
15251 {
15252 struct Identifier * id = exp->member.member;
15253 int typeKind = type->kind;
15254 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));
15255
15256 if(typeKind == 19 && exp->member.exp->type == 26)
15257 {
15258 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
15259 typeKind = 8;
15260 }
15261 if(id)
15262 {
15263 if(typeKind == 3 || typeKind == 15)
15264 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
15265 else if(!_class)
15266 {
15267 if(type->kind == 8 && type->_class && type->_class->registered)
15268 {
15269 _class = type->_class->registered;
15270 }
15271 else if((type->kind == 12 || type->kind == 13) && type->type && type->type->kind == 1)
15272 {
15273 _class = FindClass("char *")->registered;
15274 }
15275 else if(type->kind == 13)
15276 {
15277 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
15278 FreeType(exp->expType);
15279 exp->expType = ProcessTypeString("uintptr", 0x0);
15280 exp->byReference = 0x1;
15281 }
15282 else
15283 {
15284 char string[1024] = "";
15285 struct Symbol * classSym;
15286
15287 PrintTypeNoConst(type, string, 0x0, 0x1);
15288 classSym = FindClass(string);
15289 if(classSym)
15290 _class = classSym->registered;
15291 }
15292 }
15293 }
15294 if(_class && id)
15295 {
15296 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
15297 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
15298 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
15299 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
15300 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
15301
15302 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
15303 exp->member.memberType = 1;
15304 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
15305 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
15306 if(typeKind != 19)
15307 {
15308 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
15309 {
15310 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
15311 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
15312 {
15313 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15314 if(prop)
15315 member = (((void *)0));
15316 }
15317 if(!member && !prop)
15318 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15319 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
15320 exp->member.thisPtr = 0x1;
15321 }
15322 else
15323 {
15324 if(!id->classSym)
15325 {
15326 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
15327 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
15328 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
15329 }
15330 if(!prop && !member)
15331 {
15332 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
15333 if(!method)
15334 {
15335 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15336 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
15337 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
15338 }
15339 }
15340 if(member && prop)
15341 {
15342 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
15343 prop = (((void *)0));
15344 else
15345 member = (((void *)0));
15346 }
15347 }
15348 }
15349 if(!prop && !member && !method)
15350 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
15351 if(!prop && !member && !method)
15352 {
15353 if(typeKind == 19)
15354 {
15355 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
15356 if(classProp)
15357 {
15358 exp->member.memberType = 5;
15359 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
15360 }
15361 else
15362 {
15363 char structName[1024];
15364 struct Identifier * id = exp->member.member;
15365 struct Expression * classExp = exp->member.exp;
15366
15367 type->refCount++;
15368 FreeType(classExp->expType);
15369 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
15370 strcpy(structName, "__ecereClassData_");
15371 FullClassNameCat(structName, type->_class->string, 0x0);
15372 exp->type = 9;
15373 exp->member.member = id;
15374 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"))))))));
15375 FreeType(type);
15376 ProcessExpressionType(exp);
15377 return ;
15378 }
15379 }
15380 else
15381 {
15382 struct Symbol * classSym = FindClass(id->string);
15383
15384 if(classSym)
15385 {
15386 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
15387
15388 if(convertClass)
15389 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
15390 }
15391 }
15392 }
15393 if(prop)
15394 {
15395 exp->member.memberType = 1;
15396 if(!prop->dataType)
15397 ProcessPropertyType(prop);
15398 exp->expType = prop->dataType;
15399 if(prop->dataType)
15400 prop->dataType->refCount++;
15401 }
15402 else if(member)
15403 {
15404 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
15405 {
15406 FreeExpContents(exp);
15407 exp->type = 0;
15408 exp->identifier = MkIdentifier("class");
15409 ProcessExpressionType(exp);
15410 return ;
15411 }
15412 exp->member.memberType = 3;
15413 DeclareStruct(_class->fullName, 0x0);
15414 if(!member->dataType)
15415 {
15416 struct Context * context = SetupTemplatesContext(_class);
15417
15418 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
15419 FinishTemplatesContext(context);
15420 }
15421 exp->expType = member->dataType;
15422 if(member->dataType)
15423 member->dataType->refCount++;
15424 }
15425 else if(revConvert)
15426 {
15427 exp->member.memberType = 4;
15428 exp->expType = MkClassType(revConvert->_class->fullName);
15429 }
15430 else if(method)
15431 {
15432 {
15433 exp->member.memberType = 2;
15434 }
15435 if(!method->dataType)
15436 ProcessMethodType(method);
15437 exp->expType = __extension__ ({
15438 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15439
15440 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1;
15441 });
15442 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
15443 exp->expType->usedClass = _class;
15444 }
15445 else if(!classProp)
15446 {
15447 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
15448 {
15449 FreeExpContents(exp);
15450 exp->type = 0;
15451 exp->identifier = MkIdentifier("class");
15452 ProcessExpressionType(exp);
15453 return ;
15454 }
15455 yylloc = exp->member.member->loc;
15456 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
15457 if(inCompiler)
15458 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
15459 }
15460 if(_class && exp->expType)
15461 {
15462 struct __ecereNameSpace__ecere__com__Class * tClass;
15463
15464 tClass = _class;
15465 while(tClass && !tClass->templateClass)
15466 tClass = tClass->base;
15467 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
15468 {
15469 int id = 0;
15470 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15471 struct __ecereNameSpace__ecere__com__Class * sClass;
15472
15473 for(sClass = tClass; sClass; sClass = sClass->base)
15474 {
15475 id = 0;
15476 if(sClass->templateClass)
15477 sClass = sClass->templateClass;
15478 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15479 {
15480 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
15481 {
15482 for(sClass = sClass->base; sClass; sClass = sClass->base)
15483 id += sClass->templateParams.count;
15484 break;
15485 }
15486 id++;
15487 }
15488 if(curParam)
15489 break;
15490 }
15491 if(curParam && tClass->templateArgs[id].dataTypeString)
15492 {
15493 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
15494 struct Context * context = SetupTemplatesContext(tClass);
15495
15496 FreeType(exp->expType);
15497 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
15498 if(exp->expType)
15499 {
15500 if(exp->expType->kind == 21)
15501 {
15502 FreeType(exp->expType);
15503 exp->expType = ReplaceThisClassType(_class);
15504 }
15505 if(tClass->templateClass)
15506 exp->expType->passAsTemplate = 0x1;
15507 if(!exp->destType)
15508 {
15509 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
15510 if(exp->destType->kind == 21)
15511 {
15512 FreeType(exp->destType);
15513 exp->destType = ReplaceThisClassType(_class);
15514 }
15515 }
15516 }
15517 FinishTemplatesContext(context);
15518 }
15519 }
15520 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
15521 {
15522 int id = 0;
15523 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15524 struct __ecereNameSpace__ecere__com__Class * sClass;
15525
15526 for(sClass = tClass; sClass; sClass = sClass->base)
15527 {
15528 id = 0;
15529 if(sClass->templateClass)
15530 sClass = sClass->templateClass;
15531 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15532 {
15533 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
15534 {
15535 for(sClass = sClass->base; sClass; sClass = sClass->base)
15536 id += sClass->templateParams.count;
15537 break;
15538 }
15539 id++;
15540 }
15541 if(curParam)
15542 break;
15543 }
15544 if(curParam)
15545 {
15546 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
15547 struct Context * context = SetupTemplatesContext(tClass);
15548 struct Type * basicType;
15549
15550 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
15551 if(basicType)
15552 {
15553 if(basicType->kind == 21)
15554 {
15555 FreeType(basicType);
15556 basicType = ReplaceThisClassType(_class);
15557 }
15558 FreeType(exp->expType);
15559 exp->expType = __extension__ ({
15560 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15561
15562 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = basicType, __ecereInstance1;
15563 });
15564 if(!exp->destType)
15565 {
15566 exp->destType = exp->expType;
15567 exp->destType->refCount++;
15568 }
15569 {
15570 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
15571 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15572 struct Declarator * decl;
15573
15574 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
15575 *newExp = *exp;
15576 if(exp->destType)
15577 exp->destType->refCount++;
15578 if(exp->expType)
15579 exp->expType->refCount++;
15580 exp->type = 11;
15581 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
15582 exp->cast.exp = newExp;
15583 }
15584 }
15585 FinishTemplatesContext(context);
15586 }
15587 }
15588 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
15589 {
15590 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
15591
15592 if(expClass)
15593 {
15594 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
15595 int c;
15596 int p = 0;
15597 int paramCount = 0;
15598 int lastParam = -1;
15599 char templateString[1024];
15600 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
15601
15602 sprintf(templateString, "%s<", expClass->templateClass->fullName);
15603 while(cClass != expClass)
15604 {
15605 struct __ecereNameSpace__ecere__com__Class * sClass;
15606
15607 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
15608 ;
15609 cClass = sClass;
15610 for(param = cClass->templateParams.first; param; param = param->next)
15611 {
15612 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
15613 int c;
15614 int cp = 0;
15615 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
15616 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
15617
15618 while(cClassCur != tClass && !paramCur)
15619 {
15620 struct __ecereNameSpace__ecere__com__Class * sClassCur;
15621
15622 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
15623 ;
15624 cClassCur = sClassCur;
15625 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
15626 {
15627 if(!strcmp(paramCur->name, param->name))
15628 {
15629 break;
15630 }
15631 cp++;
15632 }
15633 }
15634 if(paramCur && paramCur->type == 0)
15635 arg = tClass->templateArgs[cp];
15636 else
15637 arg = expClass->templateArgs[p];
15638 {
15639 char argument[256];
15640
15641 argument[0] = '\0';
15642 switch(param->type)
15643 {
15644 case 2:
15645 {
15646 char expString[1024];
15647 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15648 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
15649 struct Expression * exp;
15650 char * string = PrintHexUInt64(arg.expression.ui64);
15651
15652 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
15653 ProcessExpressionType(exp);
15654 ComputeExpression(exp);
15655 expString[0] = '\0';
15656 PrintExpression(exp, expString);
15657 strcat(argument, expString);
15658 FreeExpression(exp);
15659 break;
15660 }
15661 case 1:
15662 {
15663 strcat(argument, arg.member->name);
15664 break;
15665 }
15666 case 0:
15667 {
15668 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15669 strcat(argument, arg.dataTypeString);
15670 break;
15671 }
15672 }
15673 if(argument[0])
15674 {
15675 if(paramCount)
15676 strcat(templateString, ", ");
15677 if(lastParam != p - 1)
15678 {
15679 strcat(templateString, param->name);
15680 strcat(templateString, " = ");
15681 }
15682 strcat(templateString, argument);
15683 paramCount++;
15684 lastParam = p;
15685 }
15686 }
15687 p++;
15688 }
15689 }
15690 {
15691 int len = strlen(templateString);
15692
15693 if(templateString[len - 1] == '>')
15694 templateString[len++] = ' ';
15695 templateString[len++] = '>';
15696 templateString[len++] = '\0';
15697 }
15698 FreeType(exp->expType);
15699 {
15700 struct Context * context = SetupTemplatesContext(tClass);
15701
15702 exp->expType = ProcessTypeString(templateString, 0x0);
15703 FinishTemplatesContext(context);
15704 }
15705 }
15706 }
15707 }
15708 }
15709 else
15710 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)");
15711 }
15712 else if(type && (type->kind == 9 || type->kind == 10))
15713 {
15714 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
15715
15716 if(memberType)
15717 {
15718 exp->expType = memberType;
15719 if(memberType)
15720 memberType->refCount++;
15721 }
15722 }
15723 else
15724 {
15725 char expString[10240];
15726
15727 expString[0] = '\0';
15728 if(inCompiler)
15729 {
15730 PrintExpression(exp, expString);
15731 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15732 }
15733 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "member operator on non-structure type expression %s\n", (((void *)0))), expString);
15734 }
15735 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
15736 {
15737 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
15738 {
15739 struct Identifier * id = exp->member.member;
15740 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));
15741
15742 if(_class)
15743 {
15744 FreeType(exp->expType);
15745 exp->expType = ReplaceThisClassType(_class);
15746 }
15747 }
15748 }
15749 yylloc = oldyylloc;
15750 break;
15751 }
15752 case 9:
15753 {
15754 struct Type * destType = exp->destType;
15755
15756 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
15757 {
15758 exp->member.member->classSym = exp->member.member->_class->symbol;
15759 }
15760 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
15761 exp->type = 8;
15762 if(destType)
15763 destType->count++;
15764 ProcessExpressionType(exp);
15765 if(destType)
15766 destType->count--;
15767 break;
15768 }
15769 case 15:
15770 {
15771 struct Symbol * classSym = exp->_class->symbol;
15772
15773 if(classSym && classSym->registered)
15774 {
15775 if(classSym->registered->type == 5)
15776 {
15777 char name[1024];
15778
15779 name[0] = '\0';
15780 DeclareStruct(classSym->string, 0x0);
15781 FreeSpecifier(exp->_class);
15782 exp->type = 10;
15783 FullClassNameCat(name, classSym->string, 0x0);
15784 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
15785 }
15786 else
15787 {
15788 if(classSym->registered->fixed)
15789 {
15790 FreeSpecifier(exp->_class);
15791 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
15792 exp->type = 2;
15793 }
15794 else
15795 {
15796 char className[1024];
15797
15798 strcpy(className, "__ecereClass_");
15799 FullClassNameCat(className, classSym->string, 0x1);
15800 MangleClassName(className);
15801 DeclareClass(classSym, className);
15802 FreeExpContents(exp);
15803 exp->type = 9;
15804 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
15805 exp->member.member = MkIdentifier("structSize");
15806 }
15807 }
15808 }
15809 exp->expType = __extension__ ({
15810 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15811
15812 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15813 });
15814 break;
15815 }
15816 case 10:
15817 {
15818 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
15819
15820 exp->expType = __extension__ ({
15821 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15822
15823 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15824 });
15825 exp->isConstant = 0x1;
15826 DeclareType(type, 0x0, 0x0);
15827 FreeType(type);
15828 break;
15829 }
15830 case 11:
15831 {
15832 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
15833
15834 type->count = 1;
15835 FreeType(exp->cast.exp->destType);
15836 exp->cast.exp->destType = type;
15837 type->refCount++;
15838 ProcessExpressionType(exp->cast.exp);
15839 type->count = 0;
15840 exp->expType = type;
15841 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
15842 {
15843 void * prev = exp->prev, * next = exp->next;
15844 struct Type * expType = exp->cast.exp->destType;
15845 struct Expression * castExp = exp->cast.exp;
15846 struct Type * destType = exp->destType;
15847
15848 if(expType)
15849 expType->refCount++;
15850 FreeType(exp->expType);
15851 FreeTypeName(exp->cast.typeName);
15852 *exp = *castExp;
15853 FreeType(exp->expType);
15854 FreeType(exp->destType);
15855 exp->expType = expType;
15856 exp->destType = destType;
15857 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
15858 exp->prev = prev;
15859 exp->next = next;
15860 }
15861 else
15862 {
15863 exp->isConstant = exp->cast.exp->isConstant;
15864 }
15865 break;
15866 }
15867 case 35:
15868 {
15869 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
15870
15871 exp->expType = type;
15872 break;
15873 }
15874 case 36:
15875 {
15876 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
15877
15878 ProcessExpressionType(exp->vaArg.exp);
15879 exp->expType = type;
15880 break;
15881 }
15882 case 12:
15883 {
15884 struct Expression * e;
15885
15886 exp->isConstant = 0x1;
15887 FreeType(exp->cond.cond->destType);
15888 exp->cond.cond->destType = MkClassType("bool");
15889 exp->cond.cond->destType->truth = 0x1;
15890 ProcessExpressionType(exp->cond.cond);
15891 if(!exp->cond.cond->isConstant)
15892 exp->isConstant = 0x0;
15893 for(e = (*exp->cond.exp).first; e; e = e->next)
15894 {
15895 if(!e->next)
15896 {
15897 FreeType(e->destType);
15898 e->destType = exp->destType;
15899 if(e->destType)
15900 e->destType->refCount++;
15901 }
15902 ProcessExpressionType(e);
15903 if(!e->next)
15904 {
15905 exp->expType = e->expType;
15906 if(e->expType)
15907 e->expType->refCount++;
15908 }
15909 if(!e->isConstant)
15910 exp->isConstant = 0x0;
15911 }
15912 FreeType(exp->cond.elseExp->destType);
15913 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
15914 if(exp->cond.elseExp->destType)
15915 exp->cond.elseExp->destType->refCount++;
15916 ProcessExpressionType(exp->cond.elseExp);
15917 if(!exp->cond.elseExp->isConstant)
15918 exp->isConstant = 0x0;
15919 break;
15920 }
15921 case 25:
15922 {
15923 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
15924 {
15925 struct Statement * last = (*exp->compound->compound.statements).last;
15926
15927 if(last->type == 3 && last->expressions && (*last->expressions).last)
15928 {
15929 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
15930 if(exp->destType)
15931 exp->destType->refCount++;
15932 }
15933 ProcessStatement(exp->compound);
15934 exp->expType = (last->expressions && (*last->expressions).last) ? ((struct Expression *)(*last->expressions).last)->expType : (((void *)0));
15935 if(exp->expType)
15936 exp->expType->refCount++;
15937 }
15938 break;
15939 }
15940 case 26:
15941 {
15942 struct Specifier * spec = (*exp->_classExp.specifiers).first;
15943
15944 if(spec && spec->type == 1)
15945 {
15946 exp->expType = MkClassType(spec->name);
15947 exp->expType->kind = 19;
15948 exp->byReference = 0x1;
15949 }
15950 else
15951 {
15952 exp->expType = MkClassType("ecere::com::Class");
15953 exp->byReference = 0x1;
15954 }
15955 break;
15956 }
15957 case 27:
15958 {
15959 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
15960
15961 if(_class)
15962 {
15963 struct Identifier * id = exp->classData.id;
15964 char structName[1024];
15965 struct Expression * classExp;
15966
15967 strcpy(structName, "__ecereClassData_");
15968 FullClassNameCat(structName, _class->fullName, 0x0);
15969 exp->type = 9;
15970 exp->member.member = id;
15971 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
15972 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
15973 else
15974 classExp = MkExpIdentifier(MkIdentifier("class"));
15975 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"))))))));
15976 ProcessExpressionType(exp);
15977 return ;
15978 }
15979 break;
15980 }
15981 case 37:
15982 {
15983 struct Type * type = (((void *)0));
15984 char * typeString = (((void *)0));
15985 char typeStringBuf[1024];
15986
15987 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))
15988 {
15989 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
15990
15991 typeString = templateClass->templateArgs[2].dataTypeString;
15992 }
15993 else if(exp->list)
15994 {
15995 struct Expression * e;
15996
15997 for(e = (*exp->list).first; e; e = e->next)
15998 {
15999 ProcessExpressionType(e);
16000 if(e->expType)
16001 {
16002 if(!type)
16003 {
16004 type = e->expType;
16005 type->refCount++;
16006 }
16007 else
16008 {
16009 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
16010 {
16011 FreeType(type);
16012 type = e->expType;
16013 e->expType = (((void *)0));
16014 e = (*exp->list).first;
16015 ProcessExpressionType(e);
16016 if(e->expType)
16017 {
16018 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
16019 {
16020 FreeType(e->expType);
16021 e->expType = (((void *)0));
16022 FreeType(type);
16023 type = (((void *)0));
16024 break;
16025 }
16026 }
16027 }
16028 }
16029 if(e->expType)
16030 {
16031 FreeType(e->expType);
16032 e->expType = (((void *)0));
16033 }
16034 }
16035 }
16036 if(type)
16037 {
16038 typeStringBuf[0] = '\0';
16039 PrintTypeNoConst(type, typeStringBuf, 0x0, 0x1);
16040 typeString = typeStringBuf;
16041 FreeType(type);
16042 type = (((void *)0));
16043 }
16044 }
16045 if(typeString)
16046 {
16047 char templateString[1024];
16048 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
16049 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
16050 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16051 struct Expression * expExt;
16052 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16053
16054 sprintf(templateString, "Container<%s>", typeString);
16055 if(exp->list)
16056 {
16057 struct Expression * e;
16058
16059 type = ProcessTypeString(typeString, 0x0);
16060 while(e = (*exp->list).first)
16061 {
16062 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
16063 e->destType = type;
16064 type->refCount++;
16065 ProcessExpressionType(e);
16066 ListAdd(initializers, MkInitializerAssignment(e));
16067 }
16068 FreeType(type);
16069 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
16070 }
16071 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
16072 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
16073 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16074 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
16075 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16076 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
16077 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16078 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
16079 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16080 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
16081 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16082
16083 __ecereInstance1->type = 2, __ecereInstance1->constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, (void *)0), __ecereInstance1;
16084 })));
16085 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16086 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
16087 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16088 exp->expType = ProcessTypeString(templateString, 0x0);
16089 exp->type = 5;
16090 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
16091 ProcessExpressionType(expExt);
16092 }
16093 else
16094 {
16095 exp->expType = ProcessTypeString("Container", 0x0);
16096 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
16097 }
16098 break;
16099 }
16100 }
16101 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
16102 {
16103 FreeType(exp->expType);
16104 exp->expType = ReplaceThisClassType(thisClass);
16105 }
16106 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
16107 {
16108 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
16109
16110 if(symbol)
16111 {
16112 if(exp->expType->kind != 15)
16113 {
16114 struct Type * member;
16115 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
16116
16117 FreeType(exp->expType);
16118 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16119 exp->expType->kind = symbol->type->kind;
16120 exp->expType->refCount++;
16121 exp->expType->enumName = enumName;
16122 exp->expType->members = symbol->type->members;
16123 for(member = symbol->type->members.first; member; member = member->next)
16124 member->refCount++;
16125 }
16126 else
16127 {
16128 struct __ecereNameSpace__ecere__sys__NamedLink * member;
16129
16130 for(member = symbol->type->members.first; member; member = member->next)
16131 {
16132 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(structSize_NamedLink), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
16133
16134 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
16135 }
16136 }
16137 }
16138 }
16139 yylloc = exp->loc;
16140 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
16141 ;
16142 else if(exp->destType && !exp->destType->keepCast)
16143 {
16144 if(!CheckExpressionType(exp, exp->destType, 0x0))
16145 {
16146 if(!exp->destType->count || unresolved)
16147 {
16148 if(!exp->expType)
16149 {
16150 yylloc = exp->loc;
16151 if(exp->destType->kind != 14)
16152 {
16153 char type2[1024];
16154
16155 type2[0] = '\0';
16156 if(inCompiler)
16157 {
16158 char expString[10240];
16159
16160 expString[0] = '\0';
16161 PrintType(exp->destType, type2, 0x0, 0x1);
16162 if(inCompiler)
16163 {
16164 PrintExpression(exp, expString);
16165 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16166 }
16167 if(unresolved)
16168 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
16169 else if(exp->type != 16)
16170 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
16171 }
16172 }
16173 else
16174 {
16175 char expString[10240];
16176
16177 expString[0] = '\0';
16178 if(inCompiler)
16179 {
16180 PrintExpression(exp, expString);
16181 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16182 }
16183 if(unresolved)
16184 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), expString);
16185 else if(exp->type != 16)
16186 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
16187 }
16188 }
16189 else
16190 {
16191 char type1[1024];
16192 char type2[1024];
16193
16194 type1[0] = '\0';
16195 type2[0] = '\0';
16196 if(inCompiler)
16197 {
16198 PrintType(exp->expType, type1, 0x0, 0x1);
16199 PrintType(exp->destType, type2, 0x0, 0x1);
16200 }
16201 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)))
16202 ;
16203 else
16204 {
16205 char expString[10240];
16206
16207 expString[0] = '\0';
16208 if(inCompiler)
16209 {
16210 PrintExpression(exp, expString);
16211 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16212 }
16213 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
16214 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
16215 FreeType(exp->expType);
16216 exp->destType->refCount++;
16217 exp->expType = exp->destType;
16218 }
16219 }
16220 }
16221 }
16222 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
16223 {
16224 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16225 char typeString[1024];
16226 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16227 struct Declarator * decl;
16228
16229 typeString[0] = '\0';
16230 *newExp = *exp;
16231 if(exp->expType)
16232 exp->expType->refCount++;
16233 if(exp->expType)
16234 exp->expType->refCount++;
16235 exp->type = 11;
16236 newExp->destType = exp->expType;
16237 PrintType(exp->expType, typeString, 0x0, 0x0);
16238 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16239 exp->cast.typeName = MkTypeName(specs, decl);
16240 exp->cast.exp = newExp;
16241 }
16242 }
16243 else if(unresolved)
16244 {
16245 if(exp->identifier->_class && exp->identifier->_class->name)
16246 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
16247 else if(exp->identifier->string && exp->identifier->string[0])
16248 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
16249 }
16250 else if(!exp->expType && exp->type != 16)
16251 {
16252 char expString[10240];
16253
16254 expString[0] = '\0';
16255 if(inCompiler)
16256 {
16257 PrintExpression(exp, expString);
16258 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16259 }
16260 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
16261 }
16262 if(inCompiler)
16263 ApplyAnyObjectLogic(exp);
16264 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)))
16265 {
16266 exp->byReference = 0x1;
16267 }
16268 yylloc = oldyylloc;
16269 }
16270
16271 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)
16272 {
16273 if(*curMember)
16274 {
16275 *curMember = (*curMember)->next;
16276 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
16277 {
16278 *curMember = subMemberStack[--(*subMemberStackPos)];
16279 *curMember = (*curMember)->next;
16280 }
16281 while((*curMember) && (*curMember)->isProperty)
16282 *curMember = (*curMember)->next;
16283 if(subMemberStackPos)
16284 {
16285 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
16286 {
16287 subMemberStack[(*subMemberStackPos)++] = *curMember;
16288 *curMember = (*curMember)->members.first;
16289 while(*curMember && (*curMember)->isProperty)
16290 *curMember = (*curMember)->next;
16291 }
16292 }
16293 }
16294 while(!*curMember)
16295 {
16296 if(!*curMember)
16297 {
16298 if(subMemberStackPos && *subMemberStackPos)
16299 {
16300 *curMember = subMemberStack[--(*subMemberStackPos)];
16301 *curMember = (*curMember)->next;
16302 }
16303 else
16304 {
16305 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
16306
16307 if(*curClass == _class)
16308 break;
16309 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
16310 ;
16311 *curMember = (*curClass)->membersAndProperties.first;
16312 }
16313 while((*curMember) && (*curMember)->isProperty)
16314 *curMember = (*curMember)->next;
16315 if(subMemberStackPos)
16316 {
16317 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
16318 {
16319 subMemberStack[(*subMemberStackPos)++] = *curMember;
16320 *curMember = (*curMember)->members.first;
16321 while(*curMember && (*curMember)->isProperty)
16322 *curMember = (*curMember)->next;
16323 }
16324 }
16325 }
16326 }
16327 }
16328
16329 static void ProcessInitializer(struct Initializer * init, struct Type * type)
16330 {
16331 switch(init->type)
16332 {
16333 case 0:
16334 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
16335 {
16336 if(init->exp && !init->exp->destType)
16337 {
16338 FreeType(init->exp->destType);
16339 init->exp->destType = type;
16340 if(type)
16341 type->refCount++;
16342 }
16343 if(init->exp)
16344 {
16345 ProcessExpressionType(init->exp);
16346 init->isConstant = init->exp->isConstant;
16347 }
16348 break;
16349 }
16350 else
16351 {
16352 struct Expression * exp = init->exp;
16353 struct Instantiation * inst = exp->instance;
16354 struct MembersInit * members;
16355
16356 init->type = 1;
16357 init->list = MkList();
16358 if(inst->members)
16359 {
16360 for(members = (*inst->members).first; members; members = members->next)
16361 {
16362 if(members->type == 0)
16363 {
16364 struct MemberInit * member;
16365
16366 for(member = (*members->dataMembers).first; member; member = member->next)
16367 {
16368 ListAdd(init->list, member->initializer);
16369 member->initializer = (((void *)0));
16370 }
16371 }
16372 }
16373 }
16374 FreeExpression(exp);
16375 }
16376 case 1:
16377 {
16378 struct Initializer * i;
16379 struct Type * initializerType = (((void *)0));
16380 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
16381 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
16382 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
16383 int subMemberStackPos = 0;
16384
16385 if(type && type->kind == 12)
16386 initializerType = Dereference(type);
16387 else if(type && (type->kind == 9 || type->kind == 10))
16388 initializerType = type->members.first;
16389 for(i = (*init->list).first; i; i = i->next)
16390 {
16391 if(type && type->kind == 8 && type->_class && type->_class->registered)
16392 {
16393 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
16394 if(curMember)
16395 {
16396 if(!curMember->dataType)
16397 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
16398 initializerType = curMember->dataType;
16399 }
16400 }
16401 ProcessInitializer(i, initializerType);
16402 if(initializerType && type && (type->kind == 9 || type->kind == 10))
16403 initializerType = initializerType->next;
16404 if(!i->isConstant)
16405 init->isConstant = 0x0;
16406 }
16407 if(type && type->kind == 12)
16408 FreeType(initializerType);
16409 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
16410 {
16411 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Assigning list initializer to non list\n", (((void *)0))));
16412 }
16413 break;
16414 }
16415 }
16416 }
16417
16418 extern struct Symbol * FindType(struct Context * ctx, char *  name);
16419
16420 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
16421
16422 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
16423 {
16424 switch(spec->type)
16425 {
16426 case 0:
16427 {
16428 if(spec->specifier == THISCLASS)
16429 {
16430 if(thisClass)
16431 {
16432 spec->type = 1;
16433 spec->name = ReplaceThisClass(thisClass);
16434 spec->symbol = FindClass(spec->name);
16435 ProcessSpecifier(spec, declareStruct);
16436 }
16437 }
16438 break;
16439 }
16440 case 1:
16441 {
16442 struct Symbol * symbol = FindType(curContext, spec->name);
16443
16444 if(symbol)
16445 DeclareType(symbol->type, 0x1, 0x1);
16446 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
16447 DeclareStruct(spec->name, 0x0);
16448 break;
16449 }
16450 case 2:
16451 {
16452 struct Enumerator * e;
16453
16454 if(spec->list)
16455 {
16456 for(e = (*spec->list).first; e; e = e->next)
16457 {
16458 if(e->exp)
16459 ProcessExpressionType(e->exp);
16460 }
16461 }
16462 break;
16463 }
16464 case 3:
16465 case 4:
16466 {
16467 if(spec->definitions)
16468 {
16469 struct ClassDef * def;
16470 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
16471
16472 ProcessClass(spec->definitions, symbol);
16473 }
16474 break;
16475 }
16476 }
16477 }
16478
16479 static void ProcessDeclarator(struct Declarator * decl)
16480 {
16481 switch(decl->type)
16482 {
16483 case 1:
16484 if(decl->identifier->classSym)
16485 {
16486 FreeSpecifier(decl->identifier->_class);
16487 decl->identifier->_class = (((void *)0));
16488 }
16489 break;
16490 case 3:
16491 if(decl->array.exp)
16492 ProcessExpressionType(decl->array.exp);
16493 case 0:
16494 case 2:
16495 case 4:
16496 case 5:
16497 case 6:
16498 case 7:
16499 if(decl->declarator)
16500 ProcessDeclarator(decl->declarator);
16501 if(decl->type == 4)
16502 {
16503 struct Identifier * id = GetDeclId(decl);
16504
16505 if(id && id->_class)
16506 {
16507 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
16508
16509 if(!decl->function.parameters)
16510 decl->function.parameters = MkList();
16511 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
16512 id->_class = (((void *)0));
16513 }
16514 if(decl->function.parameters)
16515 {
16516 struct TypeName * param;
16517
16518 for(param = (*decl->function.parameters).first; param; param = param->next)
16519 {
16520 if(param->qualifiers && (*param->qualifiers).first)
16521 {
16522 struct Specifier * spec = (*param->qualifiers).first;
16523
16524 if(spec && spec->specifier == TYPED_OBJECT)
16525 {
16526 struct Declarator * d = param->declarator;
16527 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);
16528
16529 FreeList(param->qualifiers, FreeSpecifier);
16530 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
16531 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
16532 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
16533 param = newParam;
16534 }
16535 else if(spec && spec->specifier == ANY_OBJECT)
16536 {
16537 struct Declarator * d = param->declarator;
16538
16539 FreeList(param->qualifiers, FreeSpecifier);
16540 param->qualifiers = MkListOne(MkSpecifier(VOID));
16541 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
16542 }
16543 else if(spec->specifier == THISCLASS)
16544 {
16545 if(thisClass)
16546 {
16547 spec->type = 1;
16548 spec->name = ReplaceThisClass(thisClass);
16549 spec->symbol = FindClass(spec->name);
16550 ProcessSpecifier(spec, 0x0);
16551 }
16552 }
16553 }
16554 if(param->declarator)
16555 ProcessDeclarator(param->declarator);
16556 }
16557 }
16558 }
16559 break;
16560 }
16561 }
16562
16563 extern struct Identifier * CopyIdentifier(struct Identifier * id);
16564
16565 extern void FreeInitDeclarator(struct InitDeclarator * decl);
16566
16567 static void ProcessDeclaration(struct Declaration * decl)
16568 {
16569 yylloc = decl->loc;
16570 switch(decl->type)
16571 {
16572 case 1:
16573 {
16574 unsigned int declareStruct = 0x0;
16575
16576 if(decl->declarators)
16577 {
16578 struct InitDeclarator * d;
16579
16580 for(d = (*decl->declarators).first; d; d = d->next)
16581 {
16582 struct Type * type, * subType;
16583
16584 ProcessDeclarator(d->declarator);
16585 type = ProcessType(decl->specifiers, d->declarator);
16586 if(d->initializer)
16587 {
16588 ProcessInitializer(d->initializer, type);
16589 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
16590 {
16591 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
16592 {
16593 struct Instantiation * inst = d->initializer->exp->instance;
16594
16595 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
16596 d->initializer->exp->instance = (((void *)0));
16597 if(decl->specifiers)
16598 FreeList(decl->specifiers, FreeSpecifier);
16599 FreeList(decl->declarators, FreeInitDeclarator);
16600 d = (((void *)0));
16601 decl->type = 2;
16602 decl->inst = inst;
16603 }
16604 }
16605 }
16606 for(subType = type; subType; )
16607 {
16608 if(subType->kind == 8)
16609 {
16610 declareStruct = 0x1;
16611 break;
16612 }
16613 else if(subType->kind == 13)
16614 break;
16615 else if(subType->kind == 12)
16616 subType = subType->arrayType;
16617 else
16618 break;
16619 }
16620 FreeType(type);
16621 if(!d)
16622 break;
16623 }
16624 }
16625 if(decl->specifiers)
16626 {
16627 struct Specifier * s;
16628
16629 for(s = (*decl->specifiers).first; s; s = s->next)
16630 {
16631 ProcessSpecifier(s, declareStruct);
16632 }
16633 }
16634 break;
16635 }
16636 case 2:
16637 {
16638 ProcessInstantiationType(decl->inst);
16639 break;
16640 }
16641 case 0:
16642 {
16643 struct Specifier * spec;
16644 struct Declarator * d;
16645 unsigned int declareStruct = 0x0;
16646
16647 if(decl->declarators)
16648 {
16649 for(d = (*decl->declarators).first; d; d = d->next)
16650 {
16651 struct Type * type = ProcessType(decl->specifiers, d->declarator);
16652 struct Type * subType;
16653
16654 ProcessDeclarator(d);
16655 for(subType = type; subType; )
16656 {
16657 if(subType->kind == 8)
16658 {
16659 declareStruct = 0x1;
16660 break;
16661 }
16662 else if(subType->kind == 13)
16663 break;
16664 else if(subType->kind == 12)
16665 subType = subType->arrayType;
16666 else
16667 break;
16668 }
16669 FreeType(type);
16670 }
16671 }
16672 if(decl->specifiers)
16673 {
16674 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
16675 ProcessSpecifier(spec, declareStruct);
16676 }
16677 break;
16678 }
16679 }
16680 }
16681
16682 static struct FunctionDefinition * curFunction;
16683
16684 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
16685 {
16686 char propName[1024], propNameM[1024];
16687 char getName[1024], setName[1024];
16688 struct __ecereNameSpace__ecere__sys__OldList * args;
16689
16690 DeclareProperty(prop, setName, getName);
16691 strcpy(propName, "__ecereProp_");
16692 FullClassNameCat(propName, prop->_class->fullName, 0x0);
16693 strcat(propName, "_");
16694 FullClassNameCat(propName, prop->name, 0x1);
16695 MangleClassName(propName);
16696 strcpy(propNameM, "__ecerePropM_");
16697 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
16698 strcat(propNameM, "_");
16699 FullClassNameCat(propNameM, prop->name, 0x1);
16700 MangleClassName(propNameM);
16701 if(prop->isWatchable)
16702 {
16703 args = MkList();
16704 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
16705 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
16706 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
16707 args = MkList();
16708 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
16709 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
16710 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
16711 }
16712 {
16713 args = MkList();
16714 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
16715 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
16716 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
16717 args = MkList();
16718 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
16719 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
16720 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
16721 }
16722 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
16723 curFunction->propSet->fireWatchersDone = 0x1;
16724 }
16725
16726 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
16727
16728 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
16729
16730 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
16731
16732 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
16733
16734 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
16735
16736 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
16737
16738 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
16739
16740 extern void FreePropertyWatch(struct PropertyWatch * watcher);
16741
16742 static void ProcessStatement(struct Statement * stmt)
16743 {
16744 yylloc = stmt->loc;
16745 switch(stmt->type)
16746 {
16747 case 0:
16748 ProcessStatement(stmt->labeled.stmt);
16749 break;
16750 case 1:
16751 if(stmt->caseStmt.exp)
16752 {
16753 FreeType(stmt->caseStmt.exp->destType);
16754 stmt->caseStmt.exp->destType = curSwitchType;
16755 if(curSwitchType)
16756 curSwitchType->refCount++;
16757 ProcessExpressionType(stmt->caseStmt.exp);
16758 ComputeExpression(stmt->caseStmt.exp);
16759 }
16760 if(stmt->caseStmt.stmt)
16761 ProcessStatement(stmt->caseStmt.stmt);
16762 break;
16763 case 2:
16764 {
16765 if(stmt->compound.context)
16766 {
16767 struct Declaration * decl;
16768 struct Statement * s;
16769 struct Statement * prevCompound = curCompound;
16770 struct Context * prevContext = curContext;
16771
16772 if(!stmt->compound.isSwitch)
16773 curCompound = stmt;
16774 curContext = stmt->compound.context;
16775 if(stmt->compound.declarations)
16776 {
16777 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
16778 ProcessDeclaration(decl);
16779 }
16780 if(stmt->compound.statements)
16781 {
16782 for(s = (*stmt->compound.statements).first; s; s = s->next)
16783 ProcessStatement(s);
16784 }
16785 curContext = prevContext;
16786 curCompound = prevCompound;
16787 }
16788 break;
16789 }
16790 case 3:
16791 {
16792 struct Expression * exp;
16793
16794 if(stmt->expressions)
16795 {
16796 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
16797 ProcessExpressionType(exp);
16798 }
16799 break;
16800 }
16801 case 4:
16802 {
16803 struct Expression * exp;
16804
16805 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
16806 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
16807 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
16808 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
16809 {
16810 ProcessExpressionType(exp);
16811 }
16812 if(stmt->ifStmt.stmt)
16813 ProcessStatement(stmt->ifStmt.stmt);
16814 if(stmt->ifStmt.elseStmt)
16815 ProcessStatement(stmt->ifStmt.elseStmt);
16816 break;
16817 }
16818 case 5:
16819 {
16820 struct Type * oldSwitchType = curSwitchType;
16821
16822 if(stmt->switchStmt.exp)
16823 {
16824 struct Expression * exp;
16825
16826 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
16827 {
16828 if(!exp->next)
16829 {
16830 ProcessExpressionType(exp);
16831 }
16832 if(!exp->next)
16833 curSwitchType = exp->expType;
16834 }
16835 }
16836 ProcessStatement(stmt->switchStmt.stmt);
16837 curSwitchType = oldSwitchType;
16838 break;
16839 }
16840 case 6:
16841 {
16842 if(stmt->whileStmt.exp)
16843 {
16844 struct Expression * exp;
16845
16846 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
16847 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
16848 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
16849 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
16850 {
16851 ProcessExpressionType(exp);
16852 }
16853 }
16854 if(stmt->whileStmt.stmt)
16855 ProcessStatement(stmt->whileStmt.stmt);
16856 break;
16857 }
16858 case 7:
16859 {
16860 if(stmt->doWhile.exp)
16861 {
16862 struct Expression * exp;
16863
16864 if((*stmt->doWhile.exp).last)
16865 {
16866 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
16867 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
16868 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
16869 }
16870 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
16871 {
16872 ProcessExpressionType(exp);
16873 }
16874 }
16875 if(stmt->doWhile.stmt)
16876 ProcessStatement(stmt->doWhile.stmt);
16877 break;
16878 }
16879 case 8:
16880 {
16881 struct Expression * exp;
16882
16883 if(stmt->forStmt.init)
16884 ProcessStatement(stmt->forStmt.init);
16885 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
16886 {
16887 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
16888 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
16889 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
16890 }
16891 if(stmt->forStmt.check)
16892 ProcessStatement(stmt->forStmt.check);
16893 if(stmt->forStmt.increment)
16894 {
16895 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
16896 ProcessExpressionType(exp);
16897 }
16898 if(stmt->forStmt.stmt)
16899 ProcessStatement(stmt->forStmt.stmt);
16900 break;
16901 }
16902 case 18:
16903 {
16904 struct Identifier * id = stmt->forEachStmt.id;
16905 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
16906 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
16907 struct Statement * block = stmt->forEachStmt.stmt;
16908 char iteratorType[1024];
16909 struct Type * source;
16910 struct Expression * e;
16911 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));
16912 struct Expression * arrayExp;
16913 char * typeString = (((void *)0));
16914 int builtinCount = 0;
16915
16916 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
16917 {
16918 if(!e->next)
16919 {
16920 FreeType(e->destType);
16921 e->destType = ProcessTypeString("Container", 0x0);
16922 }
16923 if(!isBuiltin || e->next)
16924 ProcessExpressionType(e);
16925 }
16926 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
16927 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
16928 {
16929 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
16930 struct Symbol * symbol;
16931 struct Expression * expIt = (((void *)0));
16932 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
16933 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
16934 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
16935 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
16936
16937 stmt->type = 2;
16938 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
16939 stmt->compound.context->parent = curContext;
16940 curContext = stmt->compound.context;
16941 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
16942 {
16943 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
16944 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
16945
16946 isCustomAVLTree = 0x1;
16947 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
16948 isAVLTree = 0x1;
16949 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
16950 isMap = 0x1;
16951 }
16952 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
16953 isArray = 0x1;
16954 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
16955 {
16956 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
16957
16958 isLinkList = 0x1;
16959 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
16960 }
16961 if(isArray)
16962 {
16963 struct Declarator * decl;
16964 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16965
16966 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
16967 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
16968 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
16969 }
16970 else if(isBuiltin)
16971 {
16972 struct Type * type = (((void *)0));
16973 char typeStringBuf[1024];
16974
16975 arrayExp = (((struct Expression *)(*exp).last)->type == 37) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
16976 if(((struct Expression *)(*exp).last)->type == 11)
16977 {
16978 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
16979
16980 if(typeName)
16981 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
16982 }
16983 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)
16984 {
16985 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
16986
16987 typeString = templateClass->templateArgs[2].dataTypeString;
16988 }
16989 else if(arrayExp->list)
16990 {
16991 struct Expression * e;
16992
16993 for(e = (*arrayExp->list).first; e; e = e->next)
16994 {
16995 ProcessExpressionType(e);
16996 if(e->expType)
16997 {
16998 if(!type)
16999 {
17000 type = e->expType;
17001 type->refCount++;
17002 }
17003 else
17004 {
17005 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
17006 {
17007 FreeType(type);
17008 type = e->expType;
17009 e->expType = (((void *)0));
17010 e = (*arrayExp->list).first;
17011 ProcessExpressionType(e);
17012 if(e->expType)
17013 {
17014 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
17015 {
17016 FreeType(e->expType);
17017 e->expType = (((void *)0));
17018 FreeType(type);
17019 type = (((void *)0));
17020 break;
17021 }
17022 }
17023 }
17024 }
17025 if(e->expType)
17026 {
17027 FreeType(e->expType);
17028 e->expType = (((void *)0));
17029 }
17030 }
17031 }
17032 if(type)
17033 {
17034 typeStringBuf[0] = '\0';
17035 PrintType(type, typeStringBuf, 0x0, 0x1);
17036 typeString = typeStringBuf;
17037 FreeType(type);
17038 }
17039 }
17040 if(typeString)
17041 {
17042 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
17043 struct Declarator * decl;
17044 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17045
17046 if(arrayExp->list)
17047 {
17048 struct Expression * e;
17049
17050 builtinCount = (*arrayExp->list).count;
17051 type = ProcessTypeString(typeString, 0x0);
17052 while(e = (*arrayExp->list).first)
17053 {
17054 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
17055 e->destType = type;
17056 type->refCount++;
17057 ProcessExpressionType(e);
17058 ListAdd(initializers, MkInitializerAssignment(e));
17059 }
17060 FreeType(type);
17061 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
17062 }
17063 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
17064 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
17065 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
17066 FreeList(exp, FreeExpression);
17067 }
17068 else
17069 {
17070 arrayExp->expType = ProcessTypeString("Container", 0x0);
17071 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
17072 }
17073 }
17074 else if(isLinkList && !isList)
17075 {
17076 struct Declarator * decl;
17077 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17078
17079 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
17080 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17081 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
17082 }
17083 else if(_class->templateArgs)
17084 {
17085 if(isMap)
17086 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
17087 else
17088 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
17089 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
17090 }
17091 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
17092 if(block)
17093 {
17094 switch(block->type)
17095 {
17096 case 2:
17097 if(block->compound.context)
17098 block->compound.context->parent = stmt->compound.context;
17099 break;
17100 case 4:
17101 if(block->ifStmt.stmt && block->ifStmt.stmt->type == 2 && block->ifStmt.stmt->compound.context)
17102 block->ifStmt.stmt->compound.context->parent = stmt->compound.context;
17103 if(block->ifStmt.elseStmt && block->ifStmt.elseStmt->type == 2 && block->ifStmt.elseStmt->compound.context)
17104 block->ifStmt.elseStmt->compound.context->parent = stmt->compound.context;
17105 break;
17106 case 5:
17107 if(block->switchStmt.stmt && block->switchStmt.stmt->type == 2 && block->switchStmt.stmt->compound.context)
17108 block->switchStmt.stmt->compound.context->parent = stmt->compound.context;
17109 break;
17110 case 6:
17111 if(block->whileStmt.stmt && block->whileStmt.stmt->type == 2 && block->whileStmt.stmt->compound.context)
17112 block->whileStmt.stmt->compound.context->parent = stmt->compound.context;
17113 break;
17114 case 7:
17115 if(block->doWhile.stmt && block->doWhile.stmt->type == 2 && block->doWhile.stmt->compound.context)
17116 block->doWhile.stmt->compound.context->parent = stmt->compound.context;
17117 break;
17118 case 8:
17119 if(block->forStmt.stmt && block->forStmt.stmt->type == 2 && block->forStmt.stmt->compound.context)
17120 block->forStmt.stmt->compound.context->parent = stmt->compound.context;
17121 break;
17122 case 18:
17123 if(block->forEachStmt.stmt && block->forEachStmt.stmt->type == 2 && block->forEachStmt.stmt->compound.context)
17124 block->forEachStmt.stmt->compound.context->parent = stmt->compound.context;
17125 break;
17126 }
17127 }
17128 if(filter)
17129 {
17130 block = MkIfStmt(filter, block, (((void *)0)));
17131 }
17132 if(isArray)
17133 {
17134 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));
17135 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17136 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17137 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17138 }
17139 else if(isBuiltin)
17140 {
17141 char count[128];
17142
17143 sprintf(count, "%d", builtinCount);
17144 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));
17145 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17146 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17147 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17148 }
17149 else if(isLinkList && !isList)
17150 {
17151 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
17152 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
17153
17154 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
17155 {
17156 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));
17157 }
17158 else
17159 {
17160 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17161 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
17162
17163 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));
17164 }
17165 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17166 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17167 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17168 }
17169 else
17170 {
17171 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
17172 }
17173 ProcessExpressionType(expIt);
17174 if((*stmt->compound.declarations).first)
17175 ProcessDeclaration((*stmt->compound.declarations).first);
17176 if(symbol)
17177 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
17178 ProcessStatement(stmt);
17179 curContext = stmt->compound.context->parent;
17180 break;
17181 }
17182 else
17183 {
17184 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Expression is not a container\n", (((void *)0))));
17185 }
17186 break;
17187 }
17188 case 9:
17189 break;
17190 case 10:
17191 break;
17192 case 11:
17193 break;
17194 case 12:
17195 {
17196 struct Expression * exp;
17197
17198 if(stmt->expressions)
17199 {
17200 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
17201 {
17202 if(!exp->next)
17203 {
17204 if(curFunction && !curFunction->type)
17205 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
17206 FreeType(exp->destType);
17207 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
17208 if(exp->destType)
17209 exp->destType->refCount++;
17210 }
17211 ProcessExpressionType(exp);
17212 }
17213 }
17214 break;
17215 }
17216 case 14:
17217 {
17218 ProcessDeclaration(stmt->decl);
17219 break;
17220 }
17221 case 13:
17222 {
17223 struct AsmField * field;
17224
17225 if(stmt->asmStmt.inputFields)
17226 {
17227 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
17228 if(field->expression)
17229 ProcessExpressionType(field->expression);
17230 }
17231 if(stmt->asmStmt.outputFields)
17232 {
17233 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
17234 if(field->expression)
17235 ProcessExpressionType(field->expression);
17236 }
17237 if(stmt->asmStmt.clobberedFields)
17238 {
17239 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
17240 {
17241 if(field->expression)
17242 ProcessExpressionType(field->expression);
17243 }
17244 }
17245 break;
17246 }
17247 case 17:
17248 {
17249 struct PropertyWatch * propWatch;
17250 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17251 struct Expression * object = stmt->_watch.object;
17252 struct Expression * watcher = stmt->_watch.watcher;
17253
17254 if(watcher)
17255 ProcessExpressionType(watcher);
17256 if(object)
17257 ProcessExpressionType(object);
17258 if(inCompiler)
17259 {
17260 if(watcher || thisClass)
17261 {
17262 struct External * external = curExternal;
17263 struct Context * context = curContext;
17264
17265 stmt->type = 3;
17266 stmt->expressions = MkList();
17267 curExternal = external->prev;
17268 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
17269 {
17270 struct ClassFunction * func;
17271 char watcherName[1024];
17272 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
17273 struct External * createdExternal;
17274 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
17275
17276 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
17277 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
17278 if(propWatch->deleteWatch)
17279 strcat(watcherName, "_delete");
17280 else
17281 {
17282 struct Identifier * propID;
17283
17284 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
17285 {
17286 strcat(watcherName, "_");
17287 strcat(watcherName, propID->string);
17288 }
17289 }
17290 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
17291 {
17292 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
17293 ProcessClassFunctionBody(func, propWatch->compound);
17294 propWatch->compound = (((void *)0));
17295 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
17296 createdExternal->symbol->idCode = external->symbol->idCode;
17297 curExternal = createdExternal;
17298 ProcessFunction(createdExternal->function);
17299 {
17300 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
17301
17302 externalDecl->declaration = decl;
17303 if(decl->symbol && !decl->symbol->pointerExternal)
17304 decl->symbol->pointerExternal = externalDecl;
17305 }
17306 if(propWatch->deleteWatch)
17307 {
17308 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17309
17310 ListAdd(args, CopyExpression(object));
17311 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17312 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
17313 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
17314 }
17315 else
17316 {
17317 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
17318 struct Identifier * propID;
17319
17320 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
17321 {
17322 char propName[1024];
17323 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17324
17325 if(prop)
17326 {
17327 char getName[1024], setName[1024];
17328 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17329
17330 DeclareProperty(prop, setName, getName);
17331 strcpy(propName, "__ecereProp_");
17332 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17333 strcat(propName, "_");
17334 FullClassNameCat(propName, prop->name, 0x1);
17335 ListAdd(args, CopyExpression(object));
17336 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17337 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17338 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
17339 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
17340 }
17341 else
17342 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
17343 }
17344 }
17345 }
17346 else
17347 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid watched object\n", (((void *)0))));
17348 }
17349 curExternal = external;
17350 curContext = context;
17351 if(watcher)
17352 FreeExpression(watcher);
17353 if(object)
17354 FreeExpression(object);
17355 FreeList(watches, FreePropertyWatch);
17356 }
17357 else
17358 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a _class\n", (((void *)0))));
17359 }
17360 else
17361 {
17362 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
17363 {
17364 ProcessStatement(propWatch->compound);
17365 }
17366 }
17367 break;
17368 }
17369 case 15:
17370 {
17371 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17372 struct Expression * object = stmt->_watch.object;
17373 struct __ecereNameSpace__ecere__com__Class * _class;
17374
17375 if(object)
17376 ProcessExpressionType(object);
17377 if(inCompiler)
17378 {
17379 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
17380 if(_class)
17381 {
17382 struct Identifier * propID;
17383
17384 stmt->type = 3;
17385 stmt->expressions = MkList();
17386 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
17387 {
17388 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
17389 }
17390 else if(!watches)
17391 {
17392 }
17393 if(watches)
17394 {
17395 for(propID = (*watches).first; propID; propID = propID->next)
17396 {
17397 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17398
17399 if(prop)
17400 {
17401 CreateFireWatcher(prop, object, stmt);
17402 }
17403 else
17404 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
17405 }
17406 }
17407 else
17408 {
17409 struct __ecereNameSpace__ecere__com__Property * prop;
17410 struct __ecereNameSpace__ecere__com__Class * base;
17411
17412 for(base = _class; base; base = base->base)
17413 {
17414 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
17415 {
17416 if(prop->isProperty && prop->isWatchable)
17417 {
17418 CreateFireWatcher(prop, object, stmt);
17419 }
17420 }
17421 }
17422 }
17423 if(object)
17424 FreeExpression(object);
17425 FreeList(watches, FreeIdentifier);
17426 }
17427 else
17428 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
17429 }
17430 break;
17431 }
17432 case 16:
17433 {
17434 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17435 struct Expression * object = stmt->_watch.object;
17436 struct Expression * watcher = stmt->_watch.watcher;
17437 struct __ecereNameSpace__ecere__com__Class * _class;
17438
17439 if(object)
17440 ProcessExpressionType(object);
17441 if(watcher)
17442 ProcessExpressionType(watcher);
17443 if(inCompiler)
17444 {
17445 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
17446 if(watcher || thisClass)
17447 {
17448 if(_class)
17449 {
17450 struct Identifier * propID;
17451
17452 stmt->type = 3;
17453 stmt->expressions = MkList();
17454 if(!watches)
17455 {
17456 struct __ecereNameSpace__ecere__sys__OldList * args;
17457
17458 args = MkList();
17459 ListAdd(args, CopyExpression(object));
17460 ListAdd(args, MkExpConstant("0"));
17461 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17462 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
17463 }
17464 else
17465 {
17466 for(propID = (*watches).first; propID; propID = propID->next)
17467 {
17468 char propName[1024];
17469 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17470
17471 if(prop)
17472 {
17473 char getName[1024], setName[1024];
17474 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17475
17476 DeclareProperty(prop, setName, getName);
17477 strcpy(propName, "__ecereProp_");
17478 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17479 strcat(propName, "_");
17480 FullClassNameCat(propName, prop->name, 0x1);
17481 MangleClassName(propName);
17482 ListAdd(args, CopyExpression(object));
17483 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17484 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17485 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
17486 }
17487 else
17488 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
17489 }
17490 }
17491 if(object)
17492 FreeExpression(object);
17493 if(watcher)
17494 FreeExpression(watcher);
17495 FreeList(watches, FreeIdentifier);
17496 }
17497 else
17498 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
17499 }
17500 else
17501 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a class\n", (((void *)0))));
17502 }
17503 break;
17504 }
17505 }
17506 }
17507
17508 extern struct Expression * QBrackets(struct Expression * exp);
17509
17510 extern struct TypeName * QMkType(char *  spec, struct Declarator * decl);
17511
17512 extern struct Declarator * QMkPtrDecl(char *  id);
17513
17514 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
17515
17516 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
17517
17518 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
17519
17520 static void ProcessFunction(struct FunctionDefinition * function)
17521 {
17522 struct Identifier * id = GetDeclId(function->declarator);
17523 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
17524 struct Type * type = symbol ? symbol->type : (((void *)0));
17525 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
17526 struct Context * oldTopContext = topContext;
17527
17528 yylloc = function->loc;
17529 if(type && type->thisClass)
17530 {
17531 struct Symbol * classSym = type->thisClass;
17532 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
17533 char className[1024];
17534 char structName[1024];
17535 struct Declarator * funcDecl;
17536 struct Symbol * thisSymbol;
17537 unsigned int typedObject = 0x0;
17538
17539 if(_class && !_class->base)
17540 {
17541 _class = currentClass;
17542 if(_class && !_class->symbol)
17543 _class->symbol = FindClass(_class->fullName);
17544 classSym = _class ? _class->symbol : (((void *)0));
17545 typedObject = 0x1;
17546 }
17547 thisClass = _class;
17548 if(inCompiler && _class)
17549 {
17550 if(type->kind == 11)
17551 {
17552 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
17553 {
17554 struct Type * param = symbol->type->params.first;
17555
17556 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
17557 FreeType(param);
17558 }
17559 if(type->classObjectType != 1)
17560 {
17561 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
17562 symbol->type->staticMethod = 0x1;
17563 symbol->type->thisClass = (((void *)0));
17564 symbol->type->extraParam = 0x0;
17565 }
17566 }
17567 strcpy(className, "__ecereClass_");
17568 FullClassNameCat(className, _class->fullName, 0x1);
17569 MangleClassName(className);
17570 structName[0] = (char)0;
17571 FullClassNameCat(structName, _class->fullName, 0x0);
17572 funcDecl = GetFuncDecl(function->declarator);
17573 if(funcDecl)
17574 {
17575 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
17576 {
17577 struct TypeName * param = (*funcDecl->function.parameters).first;
17578
17579 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
17580 {
17581 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
17582 FreeTypeName(param);
17583 }
17584 }
17585 if(!function->propertyNoThis)
17586 {
17587 struct TypeName * thisParam;
17588
17589 if(type->classObjectType != 1)
17590 {
17591 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
17592 if(!funcDecl->function.parameters)
17593 funcDecl->function.parameters = MkList();
17594 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
17595 }
17596 if(typedObject)
17597 {
17598 if(type->classObjectType != 1)
17599 {
17600 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
17601 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
17602 }
17603 thisParam = __extension__ ({
17604 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
17605
17606 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
17607 });
17608 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
17609 }
17610 }
17611 }
17612 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
17613 {
17614 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
17615
17616 funcDecl = GetFuncDecl(initDecl->declarator);
17617 if(funcDecl)
17618 {
17619 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
17620 {
17621 struct TypeName * param = (*funcDecl->function.parameters).first;
17622
17623 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
17624 {
17625 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
17626 FreeTypeName(param);
17627 }
17628 }
17629 if(type->classObjectType != 1)
17630 {
17631 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
17632 {
17633 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
17634
17635 if(!funcDecl->function.parameters)
17636 funcDecl->function.parameters = MkList();
17637 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
17638 }
17639 }
17640 }
17641 }
17642 }
17643 if(function->body)
17644 {
17645 if(type->classObjectType != 1)
17646 {
17647 thisSymbol = __extension__ ({
17648 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
17649
17650 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
17651 });
17652 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17653 if(typedObject && thisSymbol->type)
17654 {
17655 thisSymbol->type->classObjectType = 2;
17656 thisSymbol->type->byReference = type->byReference;
17657 thisSymbol->type->typedByReference = type->byReference;
17658 }
17659 }
17660 }
17661 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
17662 {
17663 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
17664
17665 {
17666 struct __ecereNameSpace__ecere__com__Class * base;
17667
17668 for(base = _class; base && base->type != 1000; base = base->next)
17669 {
17670 for(member = base->membersAndProperties.first; member; member = member->next)
17671 if(!member->isProperty)
17672 break;
17673 if(member)
17674 break;
17675 }
17676 }
17677 for(member = _class->membersAndProperties.first; member; member = member->next)
17678 if(!member->isProperty)
17679 break;
17680 if(member)
17681 {
17682 char pointerName[1024];
17683 struct Declaration * decl;
17684 struct Initializer * initializer;
17685 struct Expression * exp, * bytePtr;
17686
17687 strcpy(pointerName, "__ecerePointer_");
17688 FullClassNameCat(pointerName, _class->fullName, 0x0);
17689 {
17690 char className[1024];
17691
17692 strcpy(className, "__ecereClass_");
17693 FullClassNameCat(className, classSym->string, 0x1);
17694 MangleClassName(className);
17695 DeclareClass(classSym, className);
17696 }
17697 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
17698 if(_class->fixed)
17699 {
17700 char string[256];
17701
17702 sprintf(string, "%d", _class->offset);
17703 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
17704 }
17705 else
17706 {
17707 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
17708 }
17709 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
17710 exp->expType = __extension__ ({
17711 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17712
17713 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
17714 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17715
17716 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
17717 }), __ecereInstance2;
17718 });
17719 if(function->body)
17720 {
17721 yylloc = function->body->loc;
17722 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
17723 {
17724 struct Context * prevContext = curContext;
17725
17726 curContext = function->body->compound.context;
17727 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
17728 curContext = prevContext;
17729 }
17730 decl->symbol = (((void *)0));
17731 if(!function->body->compound.declarations)
17732 function->body->compound.declarations = MkList();
17733 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
17734 }
17735 }
17736 }
17737 }
17738 else
17739 thisClass = (((void *)0));
17740 if(id)
17741 {
17742 FreeSpecifier(id->_class);
17743 id->_class = (((void *)0));
17744 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
17745 {
17746 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
17747
17748 id = GetDeclId(initDecl->declarator);
17749 FreeSpecifier(id->_class);
17750 id->_class = (((void *)0));
17751 }
17752 }
17753 if(function->body)
17754 topContext = function->body->compound.context;
17755 {
17756 struct FunctionDefinition * oldFunction = curFunction;
17757
17758 curFunction = function;
17759 if(function->body)
17760 ProcessStatement(function->body);
17761 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
17762 {
17763 struct Statement * prevCompound = curCompound;
17764 struct Context * prevContext = curContext;
17765 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
17766
17767 if(!function->body->compound.statements)
17768 function->body->compound.statements = MkList();
17769 ListAdd(function->body->compound.statements, fireWatchers);
17770 curCompound = function->body;
17771 curContext = function->body->compound.context;
17772 ProcessStatement(fireWatchers);
17773 curContext = prevContext;
17774 curCompound = prevCompound;
17775 }
17776 curFunction = oldFunction;
17777 }
17778 if(function->declarator)
17779 {
17780 ProcessDeclarator(function->declarator);
17781 }
17782 topContext = oldTopContext;
17783 thisClass = oldThisClass;
17784 }
17785
17786 extern void FreeSymbol(struct Symbol * symbol);
17787
17788 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
17789
17790 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
17791 {
17792 struct ClassDef * def;
17793 struct External * external = curExternal;
17794 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
17795
17796 for(def = definitions->first; def; def = def->next)
17797 {
17798 if(def->type == 0)
17799 {
17800 if(def->function->declarator)
17801 curExternal = def->function->declarator->symbol->pointerExternal;
17802 else
17803 curExternal = external;
17804 ProcessFunction((struct FunctionDefinition *)def->function);
17805 }
17806 else if(def->type == 2)
17807 {
17808 if(def->decl->type == 2)
17809 {
17810 thisClass = regClass;
17811 ProcessInstantiationType(def->decl->inst);
17812 thisClass = (((void *)0));
17813 }
17814 else
17815 {
17816 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
17817
17818 if(regClass)
17819 thisClass = regClass;
17820 ProcessDeclaration(def->decl);
17821 thisClass = backThisClass;
17822 }
17823 }
17824 else if(def->type == 1 && def->defProperties)
17825 {
17826 struct MemberInit * defProperty;
17827 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);
17828
17829 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17830 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
17831 {
17832 thisClass = regClass;
17833 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
17834 thisClass = (((void *)0));
17835 }
17836 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17837 FreeSymbol(thisSymbol);
17838 }
17839 else if(def->type == 3 && def->propertyDef)
17840 {
17841 struct PropertyDef * prop = def->propertyDef;
17842
17843 thisClass = regClass;
17844 if(prop->setStmt)
17845 {
17846 if(regClass)
17847 {
17848 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
17849
17850 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17851 }
17852 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
17853 ProcessStatement(prop->setStmt);
17854 }
17855 if(prop->getStmt)
17856 {
17857 if(regClass)
17858 {
17859 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
17860
17861 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17862 }
17863 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
17864 ProcessStatement(prop->getStmt);
17865 }
17866 if(prop->issetStmt)
17867 {
17868 if(regClass)
17869 {
17870 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
17871
17872 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17873 }
17874 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
17875 ProcessStatement(prop->issetStmt);
17876 }
17877 thisClass = (((void *)0));
17878 }
17879 else if(def->type == 4 && def->propertyWatch)
17880 {
17881 struct PropertyWatch * propertyWatch = def->propertyWatch;
17882
17883 thisClass = regClass;
17884 if(propertyWatch->compound)
17885 {
17886 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);
17887
17888 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17889 curExternal = (((void *)0));
17890 ProcessStatement(propertyWatch->compound);
17891 }
17892 thisClass = (((void *)0));
17893 }
17894 }
17895 }
17896
17897 void DeclareFunctionUtil(char * s)
17898 {
17899 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
17900
17901 if(function)
17902 {
17903 char name[1024];
17904
17905 name[0] = (char)0;
17906 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
17907 strcpy(name, "__ecereFunction_");
17908 FullClassNameCat(name, s, 0x0);
17909 DeclareFunction(function, name);
17910 }
17911 }
17912
17913 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
17914
17915 void ComputeDataTypes()
17916 {
17917 struct External * external;
17918 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
17919 struct External * after = (((void *)0));
17920
17921 currentClass = (((void *)0));
17922 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
17923 for(external = (*ast).first; external; external = external->next)
17924 {
17925 if(external->type == 1)
17926 {
17927 struct Declaration * decl = external->declaration;
17928
17929 if(decl)
17930 {
17931 struct __ecereNameSpace__ecere__sys__OldList * decls = decl->declarators;
17932
17933 if(decls)
17934 {
17935 struct InitDeclarator * initDecl = (*decls).first;
17936
17937 if(initDecl)
17938 {
17939 struct Declarator * declarator = initDecl->declarator;
17940
17941 if(declarator && declarator->type == 1)
17942 {
17943 struct Identifier * id = declarator->identifier;
17944
17945 if(id && id->string)
17946 {
17947 if(!strcmp(id->string, "uintptr_t") || !strcmp(id->string, "intptr_t") || !strcmp(id->string, "size_t") || !strcmp(id->string, "ssize_t"))
17948 {
17949 external->symbol->id = -1001, external->symbol->idCode = -1001;
17950 after = external;
17951 }
17952 }
17953 }
17954 }
17955 }
17956 }
17957 }
17958 }
17959 temp->symbol = __extension__ ({
17960 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
17961
17962 __ecereInstance1->id = -1000, __ecereInstance1->idCode = -1000, __ecereInstance1;
17963 });
17964 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
17965 curExternal = temp;
17966 DeclareFunctionUtil("eSystem_New");
17967 DeclareFunctionUtil("eSystem_New0");
17968 DeclareFunctionUtil("eSystem_Renew");
17969 DeclareFunctionUtil("eSystem_Renew0");
17970 DeclareFunctionUtil("eClass_GetProperty");
17971 DeclareStruct("ecere::com::Class", 0x0);
17972 DeclareStruct("ecere::com::Instance", 0x0);
17973 DeclareStruct("ecere::com::Property", 0x0);
17974 DeclareStruct("ecere::com::DataMember", 0x0);
17975 DeclareStruct("ecere::com::Method", 0x0);
17976 DeclareStruct("ecere::com::SerialBuffer", 0x0);
17977 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
17978 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
17979 for(external = (*ast).first; external; external = external->next)
17980 {
17981 afterExternal = curExternal = external;
17982 if(external->type == 0)
17983 {
17984 currentClass = external->function->_class;
17985 ProcessFunction(external->function);
17986 }
17987 else if(external->type == 1)
17988 {
17989 currentClass = (((void *)0));
17990 ProcessDeclaration(external->declaration);
17991 }
17992 else if(external->type == 2)
17993 {
17994 struct ClassDefinition * _class = external->_class;
17995
17996 currentClass = external->symbol->registered;
17997 if(_class->definitions)
17998 {
17999 ProcessClass(_class->definitions, _class->symbol);
18000 }
18001 if(inCompiler)
18002 {
18003 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
18004 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
18005 }
18006 }
18007 else if(external->type == 4)
18008 {
18009 thisNameSpace = external->id->string;
18010 }
18011 }
18012 currentClass = (((void *)0));
18013 thisNameSpace = (((void *)0));
18014 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
18015 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
18016 }
18017
18018 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);
18019
18020 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);
18021
18022 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
18023 {
18024 struct __ecereNameSpace__ecere__com__Class * class;
18025
18026 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
18027 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
18028 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
18029 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
18030 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
18031 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
18032 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
18033 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
18034 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
18035 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
18036 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
18037 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
18038 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
18039 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
18040 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
18041 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
18042 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
18043 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
18044 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
18045 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
18046 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
18047 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
18048 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
18049 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
18050 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
18051 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
18052 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
18053 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
18054 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
18055 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
18056 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
18057 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
18058 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
18059 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
18060 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
18061 __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);
18062 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
18063 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
18064 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
18065 __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);
18066 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
18067 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
18068 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
18069 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
18070 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
18071 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
18072 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
18073 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
18074 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
18075 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
18076 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
18077 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
18078 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
18079 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
18080 __ecereClass_Conversion = class;
18081 __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);
18082 __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);
18083 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
18084 __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);
18085 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
18086 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
18087 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
18088 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
18089 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
18090 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
18091 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
18092 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
18093 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
18094 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
18095 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
18096 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
18097 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
18098 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
18099 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
18100 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
18101 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(String s)", DeclareFunctionUtil, module, 1);
18102 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
18103 }
18104
18105 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
18106 {
18107
18108 }
18109