compiler/libec: (#99) Improved handling of brackets instantiations, using C99 '.membe...
[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 void __ecereNameSpace__ecere__com__eSystem_Delete(void *  memory);
54
55 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BTNode;
56
57 struct __ecereNameSpace__ecere__sys__BTNode;
58
59 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BinaryTree;
60
61 struct __ecereNameSpace__ecere__sys__BinaryTree
62 {
63 struct __ecereNameSpace__ecere__sys__BTNode * root;
64 int count;
65 int (*  CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
66 void (*  FreeKey)(void *  key);
67 } __attribute__ ((gcc_struct));
68
69 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldList;
70
71 struct __ecereNameSpace__ecere__sys__OldList
72 {
73 void *  first;
74 void *  last;
75 int count;
76 unsigned int offset;
77 unsigned int circ;
78 } __attribute__ ((gcc_struct));
79
80 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Method;
81
82 struct __ecereNameSpace__ecere__com__Method
83 {
84 char *  name;
85 struct __ecereNameSpace__ecere__com__Method * parent;
86 struct __ecereNameSpace__ecere__com__Method * left;
87 struct __ecereNameSpace__ecere__com__Method * right;
88 int depth;
89 int (*  function)();
90 int vid;
91 int type;
92 struct __ecereNameSpace__ecere__com__Class * _class;
93 void *  symbol;
94 char *  dataTypeString;
95 struct Type * dataType;
96 int memberAccess;
97 } __attribute__ ((gcc_struct));
98
99 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Property;
100
101 struct __ecereNameSpace__ecere__com__Property
102 {
103 struct __ecereNameSpace__ecere__com__Property * prev;
104 struct __ecereNameSpace__ecere__com__Property * next;
105 char *  name;
106 unsigned int isProperty;
107 int memberAccess;
108 int id;
109 struct __ecereNameSpace__ecere__com__Class * _class;
110 char *  dataTypeString;
111 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
112 struct Type * dataType;
113 void (*  Set)(void * , int);
114 int (*  Get)(void * );
115 unsigned int (*  IsSet)(void * );
116 void *  data;
117 void *  symbol;
118 int vid;
119 unsigned int conversion;
120 unsigned int watcherOffset;
121 char *  category;
122 unsigned int compiled;
123 unsigned int selfWatchable;
124 unsigned int isWatchable;
125 } __attribute__ ((gcc_struct));
126
127 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_CodePosition;
128
129 struct CodePosition
130 {
131 int line;
132 int charPos;
133 int pos;
134 int included;
135 } __attribute__ ((gcc_struct));
136
137 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Location;
138
139 struct Location
140 {
141 struct CodePosition start;
142 struct CodePosition end;
143 } __attribute__ ((gcc_struct));
144
145 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attrib;
146
147 struct Attrib;
148
149 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ExtDecl;
150
151 struct ExtDecl
152 {
153 struct Location loc;
154 int type;
155 union
156 {
157 char * s;
158 struct Attrib * attr;
159 } __attribute__ ((gcc_struct));
160 } __attribute__ ((gcc_struct));
161
162 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDefinition;
163
164 struct ClassDefinition
165 {
166 struct ClassDefinition * prev;
167 struct ClassDefinition * next;
168 struct Location loc;
169 struct Specifier * _class;
170 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
171 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
172 struct Symbol * symbol;
173 struct Location blockStart;
174 struct Location nameLoc;
175 int endid;
176 int declMode;
177 unsigned int deleteWatchable;
178 } __attribute__ ((gcc_struct));
179
180 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
181
182 struct Context
183 {
184 struct Context * parent;
185 struct __ecereNameSpace__ecere__sys__BinaryTree types;
186 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
187 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
188 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
189 int nextID;
190 int simpleID;
191 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
192 struct ClassDefinition * classDef;
193 unsigned int templateTypesOnly;
194 unsigned int hasNameSpace;
195 } __attribute__ ((gcc_struct));
196
197 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
198
199 struct Instantiation
200 {
201 struct Instantiation * prev;
202 struct Instantiation * next;
203 struct Location loc;
204 struct Specifier * _class;
205 struct Expression * exp;
206 struct __ecereNameSpace__ecere__sys__OldList *  members;
207 struct Symbol * symbol;
208 unsigned int fullSet;
209 unsigned int isConstant;
210 unsigned char *  data;
211 struct Location nameLoc;
212 struct Location insideLoc;
213 unsigned int built;
214 } __attribute__ ((gcc_struct));
215
216 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declaration;
217
218 struct Declaration
219 {
220 struct Declaration * prev;
221 struct Declaration * next;
222 struct Location loc;
223 int type;
224 union
225 {
226 struct
227 {
228 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
229 struct __ecereNameSpace__ecere__sys__OldList *  declarators;
230 } __attribute__ ((gcc_struct));
231 struct Instantiation * inst;
232 struct
233 {
234 struct Identifier * id;
235 struct Expression * exp;
236 } __attribute__ ((gcc_struct));
237 } __attribute__ ((gcc_struct));
238 struct Specifier * extStorage;
239 struct Symbol * symbol;
240 int declMode;
241 } __attribute__ ((gcc_struct));
242
243 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Statement;
244
245 struct Statement
246 {
247 struct Statement * prev;
248 struct Statement * next;
249 struct Location loc;
250 int type;
251 union
252 {
253 struct __ecereNameSpace__ecere__sys__OldList *  expressions;
254 struct
255 {
256 struct Identifier * id;
257 struct Statement * stmt;
258 } __attribute__ ((gcc_struct)) labeled;
259 struct
260 {
261 struct Expression * exp;
262 struct Statement * stmt;
263 } __attribute__ ((gcc_struct)) caseStmt;
264 struct
265 {
266 struct __ecereNameSpace__ecere__sys__OldList * declarations;
267 struct __ecereNameSpace__ecere__sys__OldList * statements;
268 struct Context * context;
269 unsigned int isSwitch;
270 } __attribute__ ((gcc_struct)) compound;
271 struct
272 {
273 struct __ecereNameSpace__ecere__sys__OldList * exp;
274 struct Statement * stmt;
275 struct Statement * elseStmt;
276 } __attribute__ ((gcc_struct)) ifStmt;
277 struct
278 {
279 struct __ecereNameSpace__ecere__sys__OldList * exp;
280 struct Statement * stmt;
281 } __attribute__ ((gcc_struct)) switchStmt;
282 struct
283 {
284 struct __ecereNameSpace__ecere__sys__OldList * exp;
285 struct Statement * stmt;
286 } __attribute__ ((gcc_struct)) whileStmt;
287 struct
288 {
289 struct __ecereNameSpace__ecere__sys__OldList * exp;
290 struct Statement * stmt;
291 } __attribute__ ((gcc_struct)) doWhile;
292 struct
293 {
294 struct Statement * init;
295 struct Statement * check;
296 struct __ecereNameSpace__ecere__sys__OldList * increment;
297 struct Statement * stmt;
298 } __attribute__ ((gcc_struct)) forStmt;
299 struct
300 {
301 struct Identifier * id;
302 } __attribute__ ((gcc_struct)) gotoStmt;
303 struct
304 {
305 struct Specifier * spec;
306 char * statements;
307 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
308 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
309 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
310 } __attribute__ ((gcc_struct)) asmStmt;
311 struct
312 {
313 struct Expression * watcher;
314 struct Expression * object;
315 struct __ecereNameSpace__ecere__sys__OldList * watches;
316 } __attribute__ ((gcc_struct)) _watch;
317 struct
318 {
319 struct Identifier * id;
320 struct __ecereNameSpace__ecere__sys__OldList * exp;
321 struct __ecereNameSpace__ecere__sys__OldList * filter;
322 struct Statement * stmt;
323 } __attribute__ ((gcc_struct)) forEachStmt;
324 struct Declaration * decl;
325 } __attribute__ ((gcc_struct));
326 } __attribute__ ((gcc_struct));
327
328 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
329
330 struct TypeName
331 {
332 struct TypeName * prev;
333 struct TypeName * next;
334 struct Location loc;
335 struct __ecereNameSpace__ecere__sys__OldList *  qualifiers;
336 struct Declarator * declarator;
337 int classObjectType;
338 struct Expression * bitCount;
339 } __attribute__ ((gcc_struct));
340
341 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Initializer;
342
343 struct Initializer
344 {
345 struct Initializer * prev;
346 struct Initializer * next;
347 struct Location loc;
348 int type;
349 union
350 {
351 struct Expression * exp;
352 struct __ecereNameSpace__ecere__sys__OldList *  list;
353 } __attribute__ ((gcc_struct));
354 unsigned int isConstant;
355 struct Identifier * id;
356 } __attribute__ ((gcc_struct));
357
358 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
359
360 struct __ecereNameSpace__ecere__com__DataValue
361 {
362 union
363 {
364 char c;
365 unsigned char uc;
366 short s;
367 unsigned short us;
368 int i;
369 unsigned int ui;
370 void *  p;
371 float f;
372 double d;
373 long long i64;
374 uint64 ui64;
375 } __attribute__ ((gcc_struct));
376 } __attribute__ ((gcc_struct));
377
378 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
379
380 struct Expression
381 {
382 struct Expression * prev;
383 struct Expression * next;
384 struct Location loc;
385 int type;
386 union
387 {
388 struct
389 {
390 char *  constant;
391 struct Identifier * identifier;
392 } __attribute__ ((gcc_struct));
393 struct Statement * compound;
394 struct Instantiation * instance;
395 struct
396 {
397 char *  string;
398 unsigned int intlString;
399 } __attribute__ ((gcc_struct));
400 struct __ecereNameSpace__ecere__sys__OldList *  list;
401 struct
402 {
403 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
404 struct Declarator * decl;
405 } __attribute__ ((gcc_struct)) _classExp;
406 struct
407 {
408 struct Identifier * id;
409 } __attribute__ ((gcc_struct)) classData;
410 struct
411 {
412 struct Expression * exp;
413 struct __ecereNameSpace__ecere__sys__OldList * arguments;
414 struct Location argLoc;
415 } __attribute__ ((gcc_struct)) call;
416 struct
417 {
418 struct Expression * exp;
419 struct __ecereNameSpace__ecere__sys__OldList * index;
420 } __attribute__ ((gcc_struct)) index;
421 struct
422 {
423 struct Expression * exp;
424 struct Identifier * member;
425 int memberType;
426 unsigned int thisPtr;
427 } __attribute__ ((gcc_struct)) member;
428 struct
429 {
430 int op;
431 struct Expression * exp1;
432 struct Expression * exp2;
433 } __attribute__ ((gcc_struct)) op;
434 struct TypeName * typeName;
435 struct Specifier * _class;
436 struct
437 {
438 struct TypeName * typeName;
439 struct Expression * exp;
440 } __attribute__ ((gcc_struct)) cast;
441 struct
442 {
443 struct Expression * cond;
444 struct __ecereNameSpace__ecere__sys__OldList * exp;
445 struct Expression * elseExp;
446 } __attribute__ ((gcc_struct)) cond;
447 struct
448 {
449 struct TypeName * typeName;
450 struct Expression * size;
451 } __attribute__ ((gcc_struct)) _new;
452 struct
453 {
454 struct TypeName * typeName;
455 struct Expression * size;
456 struct Expression * exp;
457 } __attribute__ ((gcc_struct)) _renew;
458 struct
459 {
460 char * table;
461 struct Identifier * id;
462 } __attribute__ ((gcc_struct)) db;
463 struct
464 {
465 struct Expression * ds;
466 struct Expression * name;
467 } __attribute__ ((gcc_struct)) dbopen;
468 struct
469 {
470 struct TypeName * typeName;
471 struct Initializer * initializer;
472 } __attribute__ ((gcc_struct)) initializer;
473 struct
474 {
475 struct Expression * exp;
476 struct TypeName * typeName;
477 } __attribute__ ((gcc_struct)) vaArg;
478 } __attribute__ ((gcc_struct));
479 unsigned int debugValue;
480 struct __ecereNameSpace__ecere__com__DataValue val;
481 uint64 address;
482 unsigned int hasAddress;
483 struct Type * expType;
484 struct Type * destType;
485 unsigned int usage;
486 int tempCount;
487 unsigned int byReference;
488 unsigned int isConstant;
489 unsigned int addedThis;
490 unsigned int needCast;
491 unsigned int thisPtr;
492 unsigned int opDestType;
493 } __attribute__ ((gcc_struct));
494
495 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
496
497 struct TemplateDatatype
498 {
499 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
500 struct Declarator * decl;
501 } __attribute__ ((gcc_struct));
502
503 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
504
505 struct TemplateArgument;
506
507 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
508
509 struct TemplateParameter
510 {
511 struct TemplateParameter * prev;
512 struct TemplateParameter * next;
513 struct Location loc;
514 int type;
515 struct Identifier * identifier;
516 union
517 {
518 struct TemplateDatatype * dataType;
519 int memberType;
520 } __attribute__ ((gcc_struct));
521 struct TemplateArgument * defaultArgument;
522 char *  dataTypeString;
523 struct Type * baseType;
524 } __attribute__ ((gcc_struct));
525
526 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
527
528 struct Specifier
529 {
530 struct Specifier * prev;
531 struct Specifier * next;
532 struct Location loc;
533 int type;
534 union
535 {
536 int specifier;
537 struct
538 {
539 struct ExtDecl * extDecl;
540 char *  name;
541 struct Symbol * symbol;
542 struct __ecereNameSpace__ecere__sys__OldList *  templateArgs;
543 } __attribute__ ((gcc_struct));
544 struct
545 {
546 struct Identifier * id;
547 struct __ecereNameSpace__ecere__sys__OldList *  list;
548 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
549 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
550 unsigned int addNameSpace;
551 struct Context * ctx;
552 struct ExtDecl * extDeclStruct;
553 } __attribute__ ((gcc_struct));
554 struct Expression * expression;
555 struct Specifier * _class;
556 struct TemplateParameter * templateParameter;
557 } __attribute__ ((gcc_struct));
558 } __attribute__ ((gcc_struct));
559
560 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
561
562 struct Identifier
563 {
564 struct Identifier * prev;
565 struct Identifier * next;
566 struct Location loc;
567 struct Symbol * classSym;
568 struct Specifier * _class;
569 char *  string;
570 struct Identifier * badID;
571 } __attribute__ ((gcc_struct));
572
573 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Pointer;
574
575 struct Pointer;
576
577 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
578
579 struct Declarator
580 {
581 struct Declarator * prev;
582 struct Declarator * next;
583 struct Location loc;
584 int type;
585 struct Symbol * symbol;
586 struct Declarator * declarator;
587 union
588 {
589 struct Identifier * identifier;
590 struct
591 {
592 struct Expression * exp;
593 struct Expression * posExp;
594 struct Attrib * attrib;
595 } __attribute__ ((gcc_struct)) structDecl;
596 struct
597 {
598 struct Expression * exp;
599 struct Specifier * enumClass;
600 } __attribute__ ((gcc_struct)) array;
601 struct
602 {
603 struct __ecereNameSpace__ecere__sys__OldList * parameters;
604 } __attribute__ ((gcc_struct)) function;
605 struct
606 {
607 struct Pointer * pointer;
608 } __attribute__ ((gcc_struct)) pointer;
609 struct
610 {
611 struct ExtDecl * extended;
612 } __attribute__ ((gcc_struct)) extended;
613 } __attribute__ ((gcc_struct));
614 } __attribute__ ((gcc_struct));
615
616 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
617
618 struct FunctionDefinition
619 {
620 struct FunctionDefinition * prev;
621 struct FunctionDefinition * next;
622 struct Location loc;
623 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
624 struct Declarator * declarator;
625 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
626 struct Statement * body;
627 struct __ecereNameSpace__ecere__com__Class * _class;
628 struct __ecereNameSpace__ecere__sys__OldList attached;
629 int declMode;
630 struct Type * type;
631 struct Symbol * propSet;
632 int tempCount;
633 unsigned int propertyNoThis;
634 } __attribute__ ((gcc_struct));
635
636 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
637
638 struct DBTableDef;
639
640 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
641
642 struct External
643 {
644 struct External * prev;
645 struct External * next;
646 struct Location loc;
647 int type;
648 struct Symbol * symbol;
649 union
650 {
651 struct FunctionDefinition * function;
652 struct ClassDefinition * _class;
653 struct Declaration * declaration;
654 char *  importString;
655 struct Identifier * id;
656 struct DBTableDef * table;
657 } __attribute__ ((gcc_struct));
658 int importType;
659 } __attribute__ ((gcc_struct));
660
661 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
662
663 struct ModuleImport
664 {
665 struct ModuleImport * prev;
666 struct ModuleImport * next;
667 char *  name;
668 struct __ecereNameSpace__ecere__sys__OldList classes;
669 struct __ecereNameSpace__ecere__sys__OldList functions;
670 int importType;
671 int importAccess;
672 } __attribute__ ((gcc_struct));
673
674 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
675
676 struct ClassImport
677 {
678 struct ClassImport * prev;
679 struct ClassImport * next;
680 char *  name;
681 struct __ecereNameSpace__ecere__sys__OldList methods;
682 struct __ecereNameSpace__ecere__sys__OldList properties;
683 unsigned int itself;
684 int isRemote;
685 } __attribute__ ((gcc_struct));
686
687 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
688
689 struct Symbol
690 {
691 char *  string;
692 struct Symbol * parent;
693 struct Symbol * left;
694 struct Symbol * right;
695 int depth;
696 struct Type * type;
697 union
698 {
699 struct __ecereNameSpace__ecere__com__Method * method;
700 struct __ecereNameSpace__ecere__com__Property * _property;
701 struct __ecereNameSpace__ecere__com__Class * registered;
702 } __attribute__ ((gcc_struct));
703 int id;
704 int idCode;
705 union
706 {
707 struct
708 {
709 struct External * pointerExternal;
710 struct External * structExternal;
711 } __attribute__ ((gcc_struct));
712 struct
713 {
714 struct External * externalGet;
715 struct External * externalSet;
716 struct External * externalPtr;
717 struct External * externalIsSet;
718 } __attribute__ ((gcc_struct));
719 struct
720 {
721 struct External * methodExternal;
722 struct External * methodCodeExternal;
723 } __attribute__ ((gcc_struct));
724 } __attribute__ ((gcc_struct));
725 unsigned int imported;
726 unsigned int declaredStructSym;
727 struct __ecereNameSpace__ecere__com__Class * _class;
728 unsigned int declaredStruct;
729 unsigned int needConstructor;
730 unsigned int needDestructor;
731 char *  constructorName;
732 char *  structName;
733 char *  className;
734 char *  destructorName;
735 struct ModuleImport * module;
736 struct ClassImport * _import;
737 struct Location nameLoc;
738 unsigned int isParam;
739 unsigned int isRemote;
740 unsigned int isStruct;
741 unsigned int fireWatchersDone;
742 int declaring;
743 unsigned int classData;
744 unsigned int isStatic;
745 char *  shortName;
746 struct __ecereNameSpace__ecere__sys__OldList *  templateParams;
747 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
748 struct Context * ctx;
749 int isIterator;
750 struct Expression * propCategory;
751 } __attribute__ ((gcc_struct));
752
753 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
754
755 struct Type
756 {
757 struct Type * prev;
758 struct Type * next;
759 int refCount;
760 union
761 {
762 struct Symbol * _class;
763 struct
764 {
765 struct __ecereNameSpace__ecere__sys__OldList members;
766 char *  enumName;
767 } __attribute__ ((gcc_struct));
768 struct
769 {
770 struct Type * returnType;
771 struct __ecereNameSpace__ecere__sys__OldList params;
772 struct Symbol * thisClass;
773 unsigned int staticMethod;
774 struct TemplateParameter * thisClassTemplate;
775 } __attribute__ ((gcc_struct));
776 struct
777 {
778 struct __ecereNameSpace__ecere__com__Method * method;
779 struct __ecereNameSpace__ecere__com__Class * methodClass;
780 struct __ecereNameSpace__ecere__com__Class * usedClass;
781 } __attribute__ ((gcc_struct));
782 struct
783 {
784 struct Type * arrayType;
785 int arraySize;
786 struct Expression * arraySizeExp;
787 unsigned int freeExp;
788 struct Symbol * enumClass;
789 } __attribute__ ((gcc_struct));
790 struct Type * type;
791 struct TemplateParameter * templateParameter;
792 } __attribute__ ((gcc_struct));
793 int kind;
794 unsigned int size;
795 char *  name;
796 char *  typeName;
797 int classObjectType;
798 int alignment;
799 unsigned int offset;
800 int bitFieldCount;
801 int count;
802 unsigned int isSigned : 1;
803 unsigned int constant : 1;
804 unsigned int truth : 1;
805 unsigned int byReference : 1;
806 unsigned int extraParam : 1;
807 unsigned int directClassAccess : 1;
808 unsigned int computing : 1;
809 unsigned int keepCast : 1;
810 unsigned int passAsTemplate : 1;
811 unsigned int dllExport : 1;
812 unsigned int attrStdcall : 1;
813 unsigned int declaredWithStruct : 1;
814 unsigned int typedByReference : 1;
815 } __attribute__ ((gcc_struct));
816
817 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
818
819 struct __ecereNameSpace__ecere__com__Class
820 {
821 struct __ecereNameSpace__ecere__com__Class * prev;
822 struct __ecereNameSpace__ecere__com__Class * next;
823 char *  name;
824 int offset;
825 int structSize;
826 int (* *  _vTbl)();
827 int vTblSize;
828 int (*  Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
829 void (*  Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
830 int offsetClass;
831 int sizeClass;
832 struct __ecereNameSpace__ecere__com__Class * base;
833 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
834 struct __ecereNameSpace__ecere__sys__BinaryTree members;
835 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
836 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
837 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
838 struct __ecereNameSpace__ecere__sys__OldList derivatives;
839 int memberID;
840 int startMemberID;
841 int type;
842 struct __ecereNameSpace__ecere__com__Instance * module;
843 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
844 char *  dataTypeString;
845 struct Type * dataType;
846 int typeSize;
847 int defaultAlignment;
848 void (*  Initialize)();
849 int memberOffset;
850 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
851 char *  designerClass;
852 unsigned int noExpansion;
853 char *  defaultProperty;
854 unsigned int comRedefinition;
855 int count;
856 int isRemote;
857 unsigned int internalDecl;
858 void *  data;
859 unsigned int computeSize;
860 int structAlignment;
861 int destructionWatchOffset;
862 unsigned int fixed;
863 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
864 int inheritanceAccess;
865 char *  fullName;
866 void *  symbol;
867 struct __ecereNameSpace__ecere__sys__OldList conversions;
868 struct __ecereNameSpace__ecere__sys__OldList templateParams;
869 struct __ecereNameSpace__ecere__com__ClassTemplateArgument *  templateArgs;
870 struct __ecereNameSpace__ecere__com__Class * templateClass;
871 struct __ecereNameSpace__ecere__sys__OldList templatized;
872 int numParams;
873 unsigned int isInstanceClass;
874 unsigned int byValueSystemClass;
875 } __attribute__ ((gcc_struct));
876
877 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char *  name);
878
879 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
880
881 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
882
883 struct __ecereNameSpace__ecere__com__Instance
884 {
885 int (* *  _vTbl)();
886 struct __ecereNameSpace__ecere__com__Class * _class;
887 int _refCount;
888 } __attribute__ ((gcc_struct));
889
890 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
891
892 struct __ecereNameSpace__ecere__com__DataMember
893 {
894 struct __ecereNameSpace__ecere__com__DataMember * prev;
895 struct __ecereNameSpace__ecere__com__DataMember * next;
896 char *  name;
897 unsigned int isProperty;
898 int memberAccess;
899 int id;
900 struct __ecereNameSpace__ecere__com__Class * _class;
901 char *  dataTypeString;
902 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
903 struct Type * dataType;
904 int type;
905 int offset;
906 int memberID;
907 struct __ecereNameSpace__ecere__sys__OldList members;
908 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
909 int memberOffset;
910 int structAlignment;
911 } __attribute__ ((gcc_struct));
912
913 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
914
915 struct __ecereNameSpace__ecere__com__SerialBuffer
916 {
917 unsigned char *  _buffer;
918 unsigned int count;
919 unsigned int _size;
920 unsigned int pos;
921 } __attribute__ ((gcc_struct));
922
923 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
924
925 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
926 {
927 union
928 {
929 struct
930 {
931 char *  dataTypeString;
932 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
933 } __attribute__ ((gcc_struct));
934 struct __ecereNameSpace__ecere__com__DataValue expression;
935 struct
936 {
937 char *  memberString;
938 union
939 {
940 struct __ecereNameSpace__ecere__com__DataMember * member;
941 struct __ecereNameSpace__ecere__com__Property * prop;
942 struct __ecereNameSpace__ecere__com__Method * method;
943 } __attribute__ ((gcc_struct));
944 } __attribute__ ((gcc_struct));
945 } __attribute__ ((gcc_struct));
946 } __attribute__ ((gcc_struct));
947
948 void exit(int status);
949
950 void * calloc(size_t nmemb, size_t size);
951
952 void free(void * ptr);
953
954 void * malloc(size_t size);
955
956 void * realloc(void * ptr, size_t size);
957
958 long int strtol(const char * nptr, char ** endptr, int base);
959
960 long long int strtoll(const char * nptr, char ** endptr, int base);
961
962 unsigned long long int strtoull(const char * nptr, char ** endptr, int base);
963
964 enum yytokentype
965 {
966 IDENTIFIER = 258, CONSTANT = 259, STRING_LITERAL = 260, SIZEOF = 261, PTR_OP = 262, INC_OP = 263, DEC_OP = 264, LEFT_OP = 265, RIGHT_OP = 266, LE_OP = 267, GE_OP = 268, EQ_OP = 269, NE_OP = 270, AND_OP = 271, OR_OP = 272, MUL_ASSIGN = 273, DIV_ASSIGN = 274, MOD_ASSIGN = 275, ADD_ASSIGN = 276, SUB_ASSIGN = 277, LEFT_ASSIGN = 278, RIGHT_ASSIGN = 279, AND_ASSIGN = 280, XOR_ASSIGN = 281, OR_ASSIGN = 282, TYPE_NAME = 283, TYPEDEF = 284, EXTERN = 285, STATIC = 286, AUTO = 287, REGISTER = 288, CHAR = 289, SHORT = 290, INT = 291, UINT = 292, INT64 = 293, LONG = 294, SIGNED = 295, UNSIGNED = 296, FLOAT = 297, DOUBLE = 298, CONST = 299, VOLATILE = 300, VOID = 301, VALIST = 302, STRUCT = 303, UNION = 304, ENUM = 305, ELLIPSIS = 306, CASE = 307, DEFAULT = 308, IF = 309, SWITCH = 310, WHILE = 311, DO = 312, FOR = 313, GOTO = 314, CONTINUE = 315, BREAK = 316, RETURN = 317, IFX = 318, ELSE = 319, CLASS = 320, THISCLASS = 321, CLASS_NAME = 322, PROPERTY = 323, SETPROP = 324, GETPROP = 325, NEWOP = 326, RENEW = 327, DELETE = 328, EXT_DECL = 329, EXT_STORAGE = 330, IMPORT = 331, DEFINE = 332, VIRTUAL = 333, ATTRIB = 334, PUBLIC = 335, PRIVATE = 336, TYPED_OBJECT = 337, ANY_OBJECT = 338, _INCREF = 339, EXTENSION = 340, ASM = 341, TYPEOF = 342, WATCH = 343, STOPWATCHING = 344, FIREWATCHERS = 345, WATCHABLE = 346, CLASS_DESIGNER = 347, CLASS_NO_EXPANSION = 348, CLASS_FIXED = 349, ISPROPSET = 350, CLASS_DEFAULT_PROPERTY = 351, PROPERTY_CATEGORY = 352, CLASS_DATA = 353, CLASS_PROPERTY = 354, SUBCLASS = 355, NAMESPACE = 356, NEW0OP = 357, RENEW0 = 358, VAARG = 359, DBTABLE = 360, DBFIELD = 361, DBINDEX = 362, DATABASE_OPEN = 363, ALIGNOF = 364, ATTRIB_DEP = 365, __ATTRIB = 366, BOOL = 367, _BOOL = 368, _COMPLEX = 369, _IMAGINARY = 370, RESTRICT = 371, THREAD = 372
967 };
968
969 typedef union YYSTYPE
970 {
971 int specifierType;
972 int i;
973 int declMode;
974 struct Identifier * id;
975 struct Expression * exp;
976 struct Specifier * specifier;
977 struct __ecereNameSpace__ecere__sys__OldList * list;
978 struct Enumerator * enumerator;
979 struct Declarator * declarator;
980 struct Pointer * pointer;
981 struct Initializer * initializer;
982 struct InitDeclarator * initDeclarator;
983 struct TypeName * typeName;
984 struct Declaration * declaration;
985 struct Statement * stmt;
986 struct FunctionDefinition * function;
987 struct External * external;
988 struct Context * context;
989 struct AsmField * asmField;
990 struct Attrib * attrib;
991 struct ExtDecl * extDecl;
992 struct Attribute * attribute;
993 struct Instantiation * instance;
994 struct MembersInit * membersInit;
995 struct MemberInit * memberInit;
996 struct ClassFunction * classFunction;
997 struct ClassDefinition * _class;
998 struct ClassDef * classDef;
999 struct PropertyDef * prop;
1000 char * string;
1001 struct Symbol * symbol;
1002 struct PropertyWatch * propertyWatch;
1003 struct TemplateParameter * templateParameter;
1004 struct TemplateArgument * templateArgument;
1005 struct TemplateDatatype * templateDatatype;
1006 struct DBTableEntry * dbtableEntry;
1007 struct DBIndexItem * dbindexItem;
1008 struct DBTableDef * dbtableDef;
1009 } __attribute__ ((gcc_struct)) YYSTYPE;
1010
1011 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
1012
1013 struct Enumerator
1014 {
1015 struct Enumerator * prev;
1016 struct Enumerator * next;
1017 struct Location loc;
1018 struct Identifier * id;
1019 struct Expression * exp;
1020 } __attribute__ ((gcc_struct));
1021
1022 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
1023
1024 struct InitDeclarator
1025 {
1026 struct InitDeclarator * prev;
1027 struct InitDeclarator * next;
1028 struct Location loc;
1029 struct Declarator * declarator;
1030 struct Initializer * initializer;
1031 } __attribute__ ((gcc_struct));
1032
1033 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
1034
1035 struct AsmField
1036 {
1037 struct AsmField * prev;
1038 struct AsmField * next;
1039 struct Location loc;
1040 char *  command;
1041 struct Expression * expression;
1042 struct Identifier * symbolic;
1043 } __attribute__ ((gcc_struct));
1044
1045 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attribute;
1046
1047 struct Attribute;
1048
1049 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
1050
1051 struct ClassFunction
1052 {
1053 struct ClassFunction * prev;
1054 struct ClassFunction * next;
1055 struct Location loc;
1056 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1057 struct Declarator * declarator;
1058 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
1059 struct Statement * body;
1060 struct __ecereNameSpace__ecere__com__Class * _class;
1061 struct __ecereNameSpace__ecere__sys__OldList attached;
1062 int declMode;
1063 struct Type * type;
1064 struct Symbol * propSet;
1065 unsigned int isVirtual;
1066 unsigned int isConstructor;
1067 unsigned int isDestructor;
1068 unsigned int dontMangle;
1069 int id;
1070 int idCode;
1071 } __attribute__ ((gcc_struct));
1072
1073 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
1074
1075 struct MembersInit
1076 {
1077 struct MembersInit * prev;
1078 struct MembersInit * next;
1079 struct Location loc;
1080 int type;
1081 union
1082 {
1083 struct __ecereNameSpace__ecere__sys__OldList *  dataMembers;
1084 struct ClassFunction * function;
1085 } __attribute__ ((gcc_struct));
1086 } __attribute__ ((gcc_struct));
1087
1088 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
1089
1090 struct MemberInit
1091 {
1092 struct MemberInit * prev;
1093 struct MemberInit * next;
1094 struct Location loc;
1095 struct Location realLoc;
1096 struct __ecereNameSpace__ecere__sys__OldList *  identifiers;
1097 struct Initializer * initializer;
1098 unsigned int used;
1099 unsigned int variable;
1100 unsigned int takeOutExp;
1101 } __attribute__ ((gcc_struct));
1102
1103 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1104
1105 struct PropertyDef
1106 {
1107 struct PropertyDef * prev;
1108 struct PropertyDef * next;
1109 struct Location loc;
1110 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1111 struct Declarator * declarator;
1112 struct Identifier * id;
1113 struct Statement * getStmt;
1114 struct Statement * setStmt;
1115 struct Statement * issetStmt;
1116 struct Symbol * symbol;
1117 struct Expression * category;
1118 struct
1119 {
1120 unsigned int conversion : 1;
1121 unsigned int isWatchable : 1;
1122 unsigned int isDBProp : 1;
1123 } __attribute__ ((gcc_struct));
1124 } __attribute__ ((gcc_struct));
1125
1126 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1127
1128 struct PropertyWatch
1129 {
1130 struct PropertyWatch * prev;
1131 struct PropertyWatch * next;
1132 struct Location loc;
1133 struct Statement * compound;
1134 struct __ecereNameSpace__ecere__sys__OldList *  properties;
1135 unsigned int deleteWatch;
1136 } __attribute__ ((gcc_struct));
1137
1138 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1139
1140 struct ClassDef
1141 {
1142 struct ClassDef * prev;
1143 struct ClassDef * next;
1144 struct Location loc;
1145 int type;
1146 union
1147 {
1148 struct Declaration * decl;
1149 struct ClassFunction * function;
1150 struct __ecereNameSpace__ecere__sys__OldList *  defProperties;
1151 struct PropertyDef * propertyDef;
1152 struct PropertyWatch * propertyWatch;
1153 char *  designer;
1154 struct Identifier * defaultProperty;
1155 struct
1156 {
1157 struct Identifier * id;
1158 struct Initializer * initializer;
1159 } __attribute__ ((gcc_struct));
1160 } __attribute__ ((gcc_struct));
1161 int memberAccess;
1162 void *  object;
1163 } __attribute__ ((gcc_struct));
1164
1165 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1166
1167 struct DBTableEntry;
1168
1169 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1170
1171 struct DBIndexItem;
1172
1173 extern YYSTYPE yylval;
1174
1175 extern struct Location yylloc;
1176
1177 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1178
1179 extern int returnCode;
1180
1181 extern struct Expression * parsedExpression;
1182
1183 extern unsigned int yydebug;
1184
1185 void SetYydebug(unsigned int b)
1186 {
1187 yydebug = b;
1188 }
1189
1190 extern unsigned int echoOn;
1191
1192 void resetScanner();
1193
1194 int propWatcherID;
1195
1196 int expression_yyparse();
1197
1198 static struct Statement * curCompound;
1199
1200 struct External * curExternal, * afterExternal;
1201
1202 static struct Type * curSwitchType;
1203
1204 static struct __ecereNameSpace__ecere__com__Class * currentClass;
1205
1206 struct __ecereNameSpace__ecere__com__Class * thisClass;
1207
1208 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
1209 {
1210 thisClass = c;
1211 }
1212
1213 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
1214 {
1215 return thisClass;
1216 }
1217
1218 static char * thisNameSpace;
1219
1220 struct __ecereNameSpace__ecere__com__Class * containerClass;
1221
1222 unsigned int thisClassParams = 0x1;
1223
1224 unsigned int internalValueCounter;
1225
1226 extern unsigned int outputLineNumbers;
1227
1228 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
1229
1230 extern size_t strlen(const char * );
1231
1232 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
1233
1234 extern void *  __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1235
1236 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
1237
1238 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
1239
1240 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
1241
1242 void PrintExpression(struct Expression * exp, char * string)
1243 {
1244 {
1245 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
1246 int count;
1247 unsigned int backOutputLineNumbers = outputLineNumbers;
1248
1249 outputLineNumbers = 0x0;
1250 if(exp)
1251 OutputExpression(exp, f);
1252 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
1253 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
1254
1255 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
1256 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
1257 count = strlen(string);
1258 count += ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__extension__ ({
1259 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
1260
1261 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
1262 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Read])(f, string + count, 1, 1023);
1263 string[count] = '\0';
1264 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
1265 outputLineNumbers = backOutputLineNumbers;
1266 }
1267 }
1268
1269 extern struct Type * ProcessTypeString(char *  string, unsigned int staticMethod);
1270
1271 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1272
1273 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1274 {
1275 if(param && param->type == 0 && (param->dataType || param->dataTypeString))
1276 {
1277 if(!param->baseType)
1278 {
1279 if(param->dataTypeString)
1280 param->baseType = ProcessTypeString(param->dataTypeString, 0x0);
1281 else
1282 param->baseType = ProcessType(param->dataType->specifiers, param->dataType->decl);
1283 }
1284 return param->baseType;
1285 }
1286 return (((void *)0));
1287 }
1288
1289 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1290 {
1291 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1292 return 0x1;
1293 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0x0)
1294 {
1295 return 0x0;
1296 }
1297 if(type1->kind == type2->kind)
1298 {
1299 switch(type1->kind)
1300 {
1301 case 24:
1302 case 1:
1303 case 2:
1304 case 3:
1305 case 4:
1306 case 22:
1307 case 23:
1308 if(type1->passAsTemplate && !type2->passAsTemplate)
1309 return 0x1;
1310 return type1->isSigned != type2->isSigned;
1311 case 8:
1312 return type1->_class != type2->_class;
1313 case 13:
1314 return NeedCast(type1->type, type2->type);
1315 default:
1316 return 0x1;
1317 }
1318 }
1319 return 0x1;
1320 }
1321
1322 extern int strcmp(const char * , const char * );
1323
1324 extern struct Context * curContext;
1325
1326 extern struct Context * topContext;
1327
1328 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
1329
1330 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);
1331
1332 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1333
1334 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);
1335
1336 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);
1337
1338 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassProperty;
1339
1340 struct __ecereNameSpace__ecere__com__ClassProperty
1341 {
1342 char *  name;
1343 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1344 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1345 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1346 int depth;
1347 void (*  Set)(struct __ecereNameSpace__ecere__com__Class *, long long);
1348 long long (*  Get)(struct __ecereNameSpace__ecere__com__Class *);
1349 char *  dataTypeString;
1350 struct Type * dataType;
1351 unsigned int constant;
1352 } __attribute__ ((gcc_struct));
1353
1354 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, char *  name);
1355
1356 extern struct Expression * QMkExpId(char *  id);
1357
1358 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateParameter;
1359
1360 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
1361 {
1362 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
1363 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
1364 char *  name;
1365 int type;
1366 union
1367 {
1368 char *  dataTypeString;
1369 int memberType;
1370 } __attribute__ ((gcc_struct));
1371 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
1372 void *  param;
1373 } __attribute__ ((gcc_struct));
1374
1375 extern struct Expression * GetTemplateArgExpByName(char *  paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
1376
1377 extern struct __ecereNameSpace__ecere__sys__OldList *  MkList(void);
1378
1379 extern void FreeIdentifier(struct Identifier * id);
1380
1381 void ProcessExpressionType(struct Expression * exp);
1382
1383 extern struct Declarator * SpecDeclFromString(char *  string, struct __ecereNameSpace__ecere__sys__OldList *  specs, struct Declarator * baseDecl);
1384
1385 extern struct __ecereNameSpace__ecere__sys__OldList *  MkListOne(void *  item);
1386
1387 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1388
1389 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1390
1391 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1392
1393 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1394
1395 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1396
1397 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char *  key);
1398
1399 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
1400 {
1401 if(exp->type == 0 && exp->identifier)
1402 {
1403 struct Identifier * id = exp->identifier;
1404 struct Context * ctx;
1405 struct Symbol * symbol = (((void *)0));
1406
1407 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
1408 {
1409 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
1410 {
1411 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
1412 if(symbol)
1413 break;
1414 }
1415 }
1416 if(!symbol && ((!id->_class || (id->_class->name && !strcmp(id->_class->name, "property"))) || (id->classSym && __ecereNameSpace__ecere__com__eClass_IsDerived(_class, id->classSym->registered))))
1417 {
1418 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
1419 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
1420 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
1421 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
1422
1423 if(!prop)
1424 {
1425 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
1426 }
1427 if(!prop && !method)
1428 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
1429 if(!prop && !method && !member)
1430 {
1431 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
1432 }
1433 if(prop || method || member || classProp)
1434 {
1435 exp->type = 8;
1436 exp->member.member = id;
1437 exp->member.memberType = 0;
1438 exp->member.exp = QMkExpId("this");
1439 exp->addedThis = 0x1;
1440 }
1441 else if(_class && _class->templateParams.first)
1442 {
1443 struct __ecereNameSpace__ecere__com__Class * sClass;
1444
1445 for(sClass = _class; sClass; sClass = sClass->base)
1446 {
1447 if(sClass->templateParams.first)
1448 {
1449 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
1450
1451 for(param = sClass->templateParams.first; param; param = param->next)
1452 {
1453 if(param->type == 2 && !strcmp(param->name, id->string))
1454 {
1455 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
1456
1457 if(argExp)
1458 {
1459 struct Declarator * decl;
1460 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1461
1462 FreeIdentifier(exp->member.member);
1463 ProcessExpressionType(argExp);
1464 decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
1465 exp->expType = ProcessType(specs, decl);
1466 exp->type = 5;
1467 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
1468 }
1469 }
1470 }
1471 }
1472 }
1473 }
1474 }
1475 }
1476 }
1477
1478 extern int sprintf(char * , char * , ...);
1479
1480 extern int __ecereNameSpace__ecere__com__GetRuntimePlatform(void);
1481
1482 extern char *  strcat(char * , const char * );
1483
1484 extern char *  __ecereNameSpace__ecere__sys__CopyString(char *  string);
1485
1486 char * PrintInt(long long result)
1487 {
1488 char temp[100];
1489
1490 if(result > (((int)0x7fffffff)))
1491 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1492 else
1493 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1494 if(result > (((int)0x7fffffff)) || result < (((int)0x80000000)))
1495 strcat(temp, "LL");
1496 return __ecereNameSpace__ecere__sys__CopyString(temp);
1497 }
1498
1499 char * PrintUInt(uint64 result)
1500 {
1501 char temp[100];
1502
1503 if(result > (0xffffffff))
1504 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1505 else if(result > (((int)0x7fffffff)))
1506 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1507 else
1508 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1509 return __ecereNameSpace__ecere__sys__CopyString(temp);
1510 }
1511
1512 char * PrintInt64(long long result)
1513 {
1514 char temp[100];
1515
1516 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1517 return __ecereNameSpace__ecere__sys__CopyString(temp);
1518 }
1519
1520 char * PrintUInt64(uint64 result)
1521 {
1522 char temp[100];
1523
1524 if(result > (((long long)0x7fffffffffffffffLL)))
1525 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1526 else
1527 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1528 return __ecereNameSpace__ecere__sys__CopyString(temp);
1529 }
1530
1531 char * PrintHexUInt(uint64 result)
1532 {
1533 char temp[100];
1534
1535 if(result > (0xffffffff))
1536 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1537 else
1538 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1539 if(result > (0xffffffff))
1540 strcat(temp, "LL");
1541 return __ecereNameSpace__ecere__sys__CopyString(temp);
1542 }
1543
1544 char * PrintHexUInt64(uint64 result)
1545 {
1546 char temp[100];
1547
1548 if(result > (0xffffffff))
1549 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1550 else
1551 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1552 return __ecereNameSpace__ecere__sys__CopyString(temp);
1553 }
1554
1555 char * PrintShort(short result)
1556 {
1557 char temp[100];
1558
1559 sprintf(temp, "%d", (unsigned short)result);
1560 return __ecereNameSpace__ecere__sys__CopyString(temp);
1561 }
1562
1563 char * PrintUShort(unsigned short result)
1564 {
1565 char temp[100];
1566
1567 if(result > (unsigned short)32767)
1568 sprintf(temp, "0x%X", (int)result);
1569 else
1570 sprintf(temp, "%d", (int)result);
1571 return __ecereNameSpace__ecere__sys__CopyString(temp);
1572 }
1573
1574 extern int isprint(int c);
1575
1576 char * PrintChar(char result)
1577 {
1578 char temp[100];
1579
1580 if(result > (char)0 && isprint(result))
1581 sprintf(temp, "'%c'", result);
1582 else if(result < (char)0)
1583 sprintf(temp, "%d", (int)result);
1584 else
1585 sprintf(temp, "0x%X", (unsigned char)result);
1586 return __ecereNameSpace__ecere__sys__CopyString(temp);
1587 }
1588
1589 char * PrintUChar(unsigned char result)
1590 {
1591 char temp[100];
1592
1593 sprintf(temp, "0x%X", result);
1594 return __ecereNameSpace__ecere__sys__CopyString(temp);
1595 }
1596
1597 extern char *  strcpy(char * , const char * );
1598
1599 extern unsigned int (* __ecereProp_float_Get_isInf)(float this);
1600
1601 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_isInf;
1602
1603 extern int (* __ecereProp_float_Get_signBit)(float this);
1604
1605 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_signBit;
1606
1607 extern unsigned int (* __ecereProp_float_Get_isNan)(float this);
1608
1609 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_isNan;
1610
1611 char * PrintFloat(float result)
1612 {
1613 char temp[350];
1614
1615 if(__ecereProp_float_Get_isInf(result))
1616 {
1617 if(__ecereProp_float_Get_signBit(result))
1618 strcpy(temp, "-inf");
1619 else
1620 strcpy(temp, "inf");
1621 }
1622 else if(__ecereProp_float_Get_isNan(result))
1623 {
1624 if(__ecereProp_float_Get_signBit(result))
1625 strcpy(temp, "-nan");
1626 else
1627 strcpy(temp, "nan");
1628 }
1629 else
1630 sprintf(temp, "%.16ff", result);
1631 return __ecereNameSpace__ecere__sys__CopyString(temp);
1632 }
1633
1634 extern unsigned int (* __ecereProp_double_Get_isInf)(double this);
1635
1636 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_isInf;
1637
1638 extern int (* __ecereProp_double_Get_signBit)(double this);
1639
1640 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_signBit;
1641
1642 extern unsigned int (* __ecereProp_double_Get_isNan)(double this);
1643
1644 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_isNan;
1645
1646 char * PrintDouble(double result)
1647 {
1648 char temp[350];
1649
1650 if(__ecereProp_double_Get_isInf(result))
1651 {
1652 if(__ecereProp_double_Get_signBit(result))
1653 strcpy(temp, "-inf");
1654 else
1655 strcpy(temp, "inf");
1656 }
1657 else if(__ecereProp_double_Get_isNan(result))
1658 {
1659 if(__ecereProp_double_Get_signBit(result))
1660 strcpy(temp, "-nan");
1661 else
1662 strcpy(temp, "nan");
1663 }
1664 else
1665 sprintf(temp, "%.16f", result);
1666 return __ecereNameSpace__ecere__sys__CopyString(temp);
1667 }
1668
1669 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1670
1671 struct OpTable
1672 {
1673 unsigned int (*  Add)(struct Expression *, struct Operand *, struct Operand *);
1674 unsigned int (*  Sub)(struct Expression *, struct Operand *, struct Operand *);
1675 unsigned int (*  Mul)(struct Expression *, struct Operand *, struct Operand *);
1676 unsigned int (*  Div)(struct Expression *, struct Operand *, struct Operand *);
1677 unsigned int (*  Mod)(struct Expression *, struct Operand *, struct Operand *);
1678 unsigned int (*  Neg)(struct Expression *, struct Operand *);
1679 unsigned int (*  Inc)(struct Expression *, struct Operand *);
1680 unsigned int (*  Dec)(struct Expression *, struct Operand *);
1681 unsigned int (*  Asign)(struct Expression *, struct Operand *, struct Operand *);
1682 unsigned int (*  AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1683 unsigned int (*  SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1684 unsigned int (*  MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1685 unsigned int (*  DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1686 unsigned int (*  ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1687 unsigned int (*  BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1688 unsigned int (*  BitOr)(struct Expression *, struct Operand *, struct Operand *);
1689 unsigned int (*  BitXor)(struct Expression *, struct Operand *, struct Operand *);
1690 unsigned int (*  LShift)(struct Expression *, struct Operand *, struct Operand *);
1691 unsigned int (*  RShift)(struct Expression *, struct Operand *, struct Operand *);
1692 unsigned int (*  BitNot)(struct Expression *, struct Operand *);
1693 unsigned int (*  AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1694 unsigned int (*  OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1695 unsigned int (*  XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1696 unsigned int (*  LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1697 unsigned int (*  RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1698 unsigned int (*  Not)(struct Expression *, struct Operand *);
1699 unsigned int (*  Equ)(struct Expression *, struct Operand *, struct Operand *);
1700 unsigned int (*  Nqu)(struct Expression *, struct Operand *, struct Operand *);
1701 unsigned int (*  And)(struct Expression *, struct Operand *, struct Operand *);
1702 unsigned int (*  Or)(struct Expression *, struct Operand *, struct Operand *);
1703 unsigned int (*  Grt)(struct Expression *, struct Operand *, struct Operand *);
1704 unsigned int (*  Sma)(struct Expression *, struct Operand *, struct Operand *);
1705 unsigned int (*  GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1706 unsigned int (*  SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1707 unsigned int (*  Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1708 } __attribute__ ((gcc_struct));
1709
1710 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1711
1712 struct Operand
1713 {
1714 int kind;
1715 struct Type * type;
1716 unsigned int ptrSize;
1717 union
1718 {
1719 char c;
1720 unsigned char uc;
1721 short s;
1722 unsigned short us;
1723 int i;
1724 unsigned int ui;
1725 float f;
1726 double d;
1727 long long i64;
1728 uint64 ui64;
1729 } __attribute__ ((gcc_struct));
1730 struct OpTable ops;
1731 } __attribute__ ((gcc_struct));
1732
1733 unsigned int GetOpInt(struct Operand * op2, int * value2)
1734 {
1735 if(op2->kind == 3 && op2->type->isSigned)
1736 *value2 = op2->i;
1737 else if(op2->kind == 3)
1738 *value2 = (int)op2->ui;
1739 else if(op2->kind == 4 && op2->type->isSigned)
1740 *value2 = (int)op2->i64;
1741 else if(op2->kind == 4)
1742 *value2 = (int)op2->ui64;
1743 else if(op2->kind == 23 && op2->type->isSigned)
1744 *value2 = (int)op2->i64;
1745 else if(op2->kind == 23)
1746 *value2 = (int)op2->ui64;
1747 else if(op2->kind == 22 && op2->type->isSigned)
1748 *value2 = (int)op2->i64;
1749 else if(op2->kind == 22)
1750 *value2 = (int)op2->ui64;
1751 else if(op2->kind == 2 && op2->type->isSigned)
1752 *value2 = (int)op2->s;
1753 else if(op2->kind == 2)
1754 *value2 = (int)op2->us;
1755 else if(op2->kind == 1 && op2->type->isSigned)
1756 *value2 = (int)op2->c;
1757 else if(op2->kind == 24 || op2->kind == 1)
1758 *value2 = (int)op2->uc;
1759 else if(op2->kind == 6)
1760 *value2 = (int)op2->f;
1761 else if(op2->kind == 7)
1762 *value2 = (int)op2->d;
1763 else if(op2->kind == 13)
1764 *value2 = (int)op2->ui64;
1765 else
1766 return 0x0;
1767 return 0x1;
1768 }
1769
1770 struct Operand GetOperand(struct Expression * exp);
1771
1772 unsigned int GetInt(struct Expression * exp, int * value2)
1773 {
1774 struct Operand op2 = GetOperand(exp);
1775
1776 return GetOpInt(&op2, value2);
1777 }
1778
1779 unsigned int GetOpUInt(struct Operand * op2, unsigned int * value2)
1780 {
1781 if(op2->kind == 3 && op2->type->isSigned)
1782 *value2 = (unsigned int)op2->i;
1783 else if(op2->kind == 3)
1784 *value2 = op2->ui;
1785 else if(op2->kind == 4 && op2->type->isSigned)
1786 *value2 = (unsigned int)op2->i64;
1787 else if(op2->kind == 4)
1788 *value2 = (unsigned int)op2->ui64;
1789 else if(op2->kind == 23 && op2->type->isSigned)
1790 *value2 = (unsigned int)op2->i64;
1791 else if(op2->kind == 23)
1792 *value2 = (unsigned int)op2->ui64;
1793 else if(op2->kind == 22 && op2->type->isSigned)
1794 *value2 = (unsigned int)op2->i64;
1795 else if(op2->kind == 22)
1796 *value2 = (unsigned int)op2->ui64;
1797 else if(op2->kind == 2 && op2->type->isSigned)
1798 *value2 = (unsigned int)op2->s;
1799 else if(op2->kind == 2)
1800 *value2 = (unsigned int)op2->us;
1801 else if(op2->kind == 1 && op2->type->isSigned)
1802 *value2 = (unsigned int)op2->c;
1803 else if(op2->kind == 24 || op2->kind == 1)
1804 *value2 = (unsigned int)op2->uc;
1805 else if(op2->kind == 6)
1806 *value2 = (unsigned int)op2->f;
1807 else if(op2->kind == 7)
1808 *value2 = (unsigned int)op2->d;
1809 else if(op2->kind == 13)
1810 *value2 = (unsigned int)op2->ui64;
1811 else
1812 return 0x0;
1813 return 0x1;
1814 }
1815
1816 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1817 {
1818 struct Operand op2 = GetOperand(exp);
1819
1820 return GetOpUInt(&op2, value2);
1821 }
1822
1823 unsigned int GetOpInt64(struct Operand * op2, long long * value2)
1824 {
1825 if(op2->kind == 3 && op2->type->isSigned)
1826 *value2 = (long long)op2->i;
1827 else if(op2->kind == 3)
1828 *value2 = (long long)op2->ui;
1829 else if(op2->kind == 4 && op2->type->isSigned)
1830 *value2 = op2->i64;
1831 else if(op2->kind == 4)
1832 *value2 = (long long)op2->ui64;
1833 else if(op2->kind == 23 && op2->type->isSigned)
1834 *value2 = op2->i64;
1835 else if(op2->kind == 23)
1836 *value2 = (long long)op2->ui64;
1837 else if(op2->kind == 22 && op2->type->isSigned)
1838 *value2 = op2->i64;
1839 else if(op2->kind == 22)
1840 *value2 = (long long)op2->ui64;
1841 else if(op2->kind == 2 && op2->type->isSigned)
1842 *value2 = (long long)op2->s;
1843 else if(op2->kind == 2)
1844 *value2 = (long long)op2->us;
1845 else if(op2->kind == 1 && op2->type->isSigned)
1846 *value2 = (long long)op2->c;
1847 else if(op2->kind == 24 || op2->kind == 1)
1848 *value2 = (long long)op2->uc;
1849 else if(op2->kind == 6)
1850 *value2 = (long long)op2->f;
1851 else if(op2->kind == 7)
1852 *value2 = (long long)op2->d;
1853 else if(op2->kind == 13)
1854 *value2 = (long long)op2->ui64;
1855 else
1856 return 0x0;
1857 return 0x1;
1858 }
1859
1860 unsigned int GetInt64(struct Expression * exp, long long * value2)
1861 {
1862 struct Operand op2 = GetOperand(exp);
1863
1864 return GetOpInt64(&op2, value2);
1865 }
1866
1867 unsigned int GetOpUInt64(struct Operand * op2, uint64 * value2)
1868 {
1869 if(op2->kind == 3 && op2->type->isSigned)
1870 *value2 = (uint64)op2->i;
1871 else if(op2->kind == 3)
1872 *value2 = (uint64)op2->ui;
1873 else if(op2->kind == 4 && op2->type->isSigned)
1874 *value2 = (uint64)op2->i64;
1875 else if(op2->kind == 4)
1876 *value2 = op2->ui64;
1877 else if(op2->kind == 23 && op2->type->isSigned)
1878 *value2 = (uint64)op2->i64;
1879 else if(op2->kind == 23)
1880 *value2 = op2->ui64;
1881 else if(op2->kind == 22 && op2->type->isSigned)
1882 *value2 = (uint64)op2->i64;
1883 else if(op2->kind == 22)
1884 *value2 = op2->ui64;
1885 else if(op2->kind == 2 && op2->type->isSigned)
1886 *value2 = (uint64)op2->s;
1887 else if(op2->kind == 2)
1888 *value2 = (uint64)op2->us;
1889 else if(op2->kind == 1 && op2->type->isSigned)
1890 *value2 = (uint64)op2->c;
1891 else if(op2->kind == 24 || op2->kind == 1)
1892 *value2 = (uint64)op2->uc;
1893 else if(op2->kind == 6)
1894 *value2 = (uint64)op2->f;
1895 else if(op2->kind == 7)
1896 *value2 = (uint64)op2->d;
1897 else if(op2->kind == 13)
1898 *value2 = op2->ui64;
1899 else
1900 return 0x0;
1901 return 0x1;
1902 }
1903
1904 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1905 {
1906 struct Operand op2 = GetOperand(exp);
1907
1908 return GetOpUInt64(&op2, value2);
1909 }
1910
1911 unsigned int GetOpIntPtr(struct Operand * op2, intptr_t * value2)
1912 {
1913 if(op2->kind == 3 && op2->type->isSigned)
1914 *value2 = (intptr_t)op2->i;
1915 else if(op2->kind == 3)
1916 *value2 = (intptr_t)op2->ui;
1917 else if(op2->kind == 4 && op2->type->isSigned)
1918 *value2 = (intptr_t)op2->i64;
1919 else if(op2->kind == 4)
1920 *value2 = (intptr_t)op2->ui64;
1921 else if(op2->kind == 23 && op2->type->isSigned)
1922 *value2 = (intptr_t)op2->i64;
1923 else if(op2->kind == 23)
1924 *value2 = (intptr_t)op2->ui64;
1925 else if(op2->kind == 22 && op2->type->isSigned)
1926 *value2 = (intptr_t)op2->i64;
1927 else if(op2->kind == 22)
1928 *value2 = (intptr_t)op2->ui64;
1929 else if(op2->kind == 2 && op2->type->isSigned)
1930 *value2 = (intptr_t)op2->s;
1931 else if(op2->kind == 2)
1932 *value2 = (intptr_t)op2->us;
1933 else if(op2->kind == 1 && op2->type->isSigned)
1934 *value2 = (intptr_t)op2->c;
1935 else if(op2->kind == 24 || op2->kind == 1)
1936 *value2 = (intptr_t)op2->uc;
1937 else if(op2->kind == 6)
1938 *value2 = (intptr_t)op2->f;
1939 else if(op2->kind == 7)
1940 *value2 = (intptr_t)op2->d;
1941 else if(op2->kind == 13)
1942 *value2 = (intptr_t)op2->ui64;
1943 else
1944 return 0x0;
1945 return 0x1;
1946 }
1947
1948 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
1949 {
1950 struct Operand op2 = GetOperand(exp);
1951
1952 return GetOpIntPtr(&op2, value2);
1953 }
1954
1955 unsigned int GetOpUIntPtr(struct Operand * op2, uintptr_t * value2)
1956 {
1957 if(op2->kind == 3 && op2->type->isSigned)
1958 *value2 = (uintptr_t)op2->i;
1959 else if(op2->kind == 3)
1960 *value2 = (uintptr_t)op2->ui;
1961 else if(op2->kind == 4 && op2->type->isSigned)
1962 *value2 = (uintptr_t)op2->i64;
1963 else if(op2->kind == 4)
1964 *value2 = (uintptr_t)op2->ui64;
1965 else if(op2->kind == 23 && op2->type->isSigned)
1966 *value2 = (uintptr_t)op2->i64;
1967 else if(op2->kind == 23)
1968 *value2 = (uintptr_t)op2->ui64;
1969 else if(op2->kind == 22 && op2->type->isSigned)
1970 *value2 = (uintptr_t)op2->i64;
1971 else if(op2->kind == 22)
1972 *value2 = (uintptr_t)op2->ui64;
1973 else if(op2->kind == 2 && op2->type->isSigned)
1974 *value2 = (uintptr_t)op2->s;
1975 else if(op2->kind == 2)
1976 *value2 = (uintptr_t)op2->us;
1977 else if(op2->kind == 1 && op2->type->isSigned)
1978 *value2 = (uintptr_t)op2->c;
1979 else if(op2->kind == 24 || op2->kind == 1)
1980 *value2 = (uintptr_t)op2->uc;
1981 else if(op2->kind == 6)
1982 *value2 = (uintptr_t)op2->f;
1983 else if(op2->kind == 7)
1984 *value2 = (uintptr_t)op2->d;
1985 else if(op2->kind == 13)
1986 *value2 = (uintptr_t)op2->ui64;
1987 else
1988 return 0x0;
1989 return 0x1;
1990 }
1991
1992 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
1993 {
1994 struct Operand op2 = GetOperand(exp);
1995
1996 return GetOpUIntPtr(&op2, value2);
1997 }
1998
1999 unsigned int GetOpIntSize(struct Operand * op2, ssize_t * value2)
2000 {
2001 if(op2->kind == 3 && op2->type->isSigned)
2002 *value2 = (ssize_t)op2->i;
2003 else if(op2->kind == 3)
2004 *value2 = (ssize_t)op2->ui;
2005 else if(op2->kind == 4 && op2->type->isSigned)
2006 *value2 = (ssize_t)op2->i64;
2007 else if(op2->kind == 4)
2008 *value2 = (ssize_t)op2->ui64;
2009 else if(op2->kind == 23 && op2->type->isSigned)
2010 *value2 = (ssize_t)op2->i64;
2011 else if(op2->kind == 23)
2012 *value2 = (ssize_t)op2->ui64;
2013 else if(op2->kind == 22 && op2->type->isSigned)
2014 *value2 = (ssize_t)op2->i64;
2015 else if(op2->kind == 22)
2016 *value2 = (ssize_t)op2->ui64;
2017 else if(op2->kind == 2 && op2->type->isSigned)
2018 *value2 = (ssize_t)op2->s;
2019 else if(op2->kind == 2)
2020 *value2 = (ssize_t)op2->us;
2021 else if(op2->kind == 1 && op2->type->isSigned)
2022 *value2 = (ssize_t)op2->c;
2023 else if(op2->kind == 24 || op2->kind == 1)
2024 *value2 = (ssize_t)op2->uc;
2025 else if(op2->kind == 6)
2026 *value2 = (ssize_t)op2->f;
2027 else if(op2->kind == 7)
2028 *value2 = (ssize_t)op2->d;
2029 else if(op2->kind == 13)
2030 *value2 = (ssize_t)op2->ui64;
2031 else
2032 return 0x0;
2033 return 0x1;
2034 }
2035
2036 unsigned int GetIntSize(struct Expression * exp, ssize_t * value2)
2037 {
2038 struct Operand op2 = GetOperand(exp);
2039
2040 return GetOpIntSize(&op2, value2);
2041 }
2042
2043 unsigned int GetOpUIntSize(struct Operand * op2, size_t * value2)
2044 {
2045 if(op2->kind == 3 && op2->type->isSigned)
2046 *value2 = (size_t)op2->i;
2047 else if(op2->kind == 3)
2048 *value2 = (size_t)op2->ui;
2049 else if(op2->kind == 4 && op2->type->isSigned)
2050 *value2 = (size_t)op2->i64;
2051 else if(op2->kind == 4)
2052 *value2 = (size_t)op2->ui64;
2053 else if(op2->kind == 23 && op2->type->isSigned)
2054 *value2 = (size_t)op2->i64;
2055 else if(op2->kind == 23)
2056 *value2 = (size_t)op2->ui64;
2057 else if(op2->kind == 22 && op2->type->isSigned)
2058 *value2 = (size_t)op2->i64;
2059 else if(op2->kind == 22)
2060 *value2 = (size_t)op2->ui64;
2061 else if(op2->kind == 2 && op2->type->isSigned)
2062 *value2 = (size_t)op2->s;
2063 else if(op2->kind == 2)
2064 *value2 = (size_t)op2->us;
2065 else if(op2->kind == 1 && op2->type->isSigned)
2066 *value2 = (size_t)op2->c;
2067 else if(op2->kind == 24 || op2->kind == 1)
2068 *value2 = (size_t)op2->uc;
2069 else if(op2->kind == 6)
2070 *value2 = (size_t)op2->f;
2071 else if(op2->kind == 7)
2072 *value2 = (size_t)op2->d;
2073 else if(op2->kind == 13)
2074 *value2 = (size_t)op2->ui64;
2075 else
2076 return 0x0;
2077 return 0x1;
2078 }
2079
2080 unsigned int GetUIntSize(struct Expression * exp, size_t * value2)
2081 {
2082 struct Operand op2 = GetOperand(exp);
2083
2084 return GetOpUIntSize(&op2, value2);
2085 }
2086
2087 unsigned int GetOpShort(struct Operand * op2, short * value2)
2088 {
2089 if(op2->kind == 3 && op2->type->isSigned)
2090 *value2 = (short)op2->i;
2091 else if(op2->kind == 3)
2092 *value2 = (short)op2->ui;
2093 else if(op2->kind == 4 && op2->type->isSigned)
2094 *value2 = (short)op2->i64;
2095 else if(op2->kind == 4)
2096 *value2 = (short)op2->ui64;
2097 else if(op2->kind == 23 && op2->type->isSigned)
2098 *value2 = (short)op2->i64;
2099 else if(op2->kind == 23)
2100 *value2 = (short)op2->ui64;
2101 else if(op2->kind == 22 && op2->type->isSigned)
2102 *value2 = (short)op2->i64;
2103 else if(op2->kind == 22)
2104 *value2 = (short)op2->ui64;
2105 else if(op2->kind == 2 && op2->type->isSigned)
2106 *value2 = op2->s;
2107 else if(op2->kind == 2)
2108 *value2 = (short)op2->us;
2109 else if(op2->kind == 1 && op2->type->isSigned)
2110 *value2 = (short)op2->c;
2111 else if(op2->kind == 24 || op2->kind == 1)
2112 *value2 = (short)op2->uc;
2113 else if(op2->kind == 6)
2114 *value2 = (short)op2->f;
2115 else if(op2->kind == 7)
2116 *value2 = (short)op2->d;
2117 else if(op2->kind == 13)
2118 *value2 = (short)op2->ui64;
2119 else
2120 return 0x0;
2121 return 0x1;
2122 }
2123
2124 unsigned int GetShort(struct Expression * exp, short * value2)
2125 {
2126 struct Operand op2 = GetOperand(exp);
2127
2128 return GetOpShort(&op2, value2);
2129 }
2130
2131 unsigned int GetOpUShort(struct Operand * op2, unsigned short * value2)
2132 {
2133 if(op2->kind == 3 && op2->type->isSigned)
2134 *value2 = (unsigned short)op2->i;
2135 else if(op2->kind == 3)
2136 *value2 = (unsigned short)op2->ui;
2137 else if(op2->kind == 4 && op2->type->isSigned)
2138 *value2 = (unsigned short)op2->i64;
2139 else if(op2->kind == 4)
2140 *value2 = (unsigned short)op2->ui64;
2141 else if(op2->kind == 23 && op2->type->isSigned)
2142 *value2 = (unsigned short)op2->i64;
2143 else if(op2->kind == 23)
2144 *value2 = (unsigned short)op2->ui64;
2145 else if(op2->kind == 22 && op2->type->isSigned)
2146 *value2 = (unsigned short)op2->i64;
2147 else if(op2->kind == 22)
2148 *value2 = (unsigned short)op2->ui64;
2149 else if(op2->kind == 2 && op2->type->isSigned)
2150 *value2 = (unsigned short)op2->s;
2151 else if(op2->kind == 2)
2152 *value2 = op2->us;
2153 else if(op2->kind == 1 && op2->type->isSigned)
2154 *value2 = (unsigned short)op2->c;
2155 else if(op2->kind == 24 || op2->kind == 1)
2156 *value2 = (unsigned short)op2->uc;
2157 else if(op2->kind == 6)
2158 *value2 = (unsigned short)op2->f;
2159 else if(op2->kind == 7)
2160 *value2 = (unsigned short)op2->d;
2161 else if(op2->kind == 13)
2162 *value2 = (unsigned short)op2->ui64;
2163 else
2164 return 0x0;
2165 return 0x1;
2166 }
2167
2168 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
2169 {
2170 struct Operand op2 = GetOperand(exp);
2171
2172 return GetOpUShort(&op2, value2);
2173 }
2174
2175 unsigned int GetOpChar(struct Operand * op2, char * value2)
2176 {
2177 if(op2->kind == 3 && op2->type->isSigned)
2178 *value2 = (char)op2->i;
2179 else if(op2->kind == 3)
2180 *value2 = (char)op2->ui;
2181 else if(op2->kind == 4 && op2->type->isSigned)
2182 *value2 = (char)op2->i64;
2183 else if(op2->kind == 4)
2184 *value2 = (char)op2->ui64;
2185 else if(op2->kind == 23 && op2->type->isSigned)
2186 *value2 = (char)op2->i64;
2187 else if(op2->kind == 23)
2188 *value2 = (char)op2->ui64;
2189 else if(op2->kind == 22 && op2->type->isSigned)
2190 *value2 = (char)op2->i64;
2191 else if(op2->kind == 22)
2192 *value2 = (char)op2->ui64;
2193 else if(op2->kind == 2 && op2->type->isSigned)
2194 *value2 = (char)op2->s;
2195 else if(op2->kind == 2)
2196 *value2 = (char)op2->us;
2197 else if(op2->kind == 1 && op2->type->isSigned)
2198 *value2 = op2->c;
2199 else if(op2->kind == 24 || op2->kind == 1)
2200 *value2 = (char)op2->uc;
2201 else if(op2->kind == 6)
2202 *value2 = (char)op2->f;
2203 else if(op2->kind == 7)
2204 *value2 = (char)op2->d;
2205 else if(op2->kind == 13)
2206 *value2 = (char)op2->ui64;
2207 else
2208 return 0x0;
2209 return 0x1;
2210 }
2211
2212 unsigned int GetChar(struct Expression * exp, char * value2)
2213 {
2214 struct Operand op2 = GetOperand(exp);
2215
2216 return GetOpChar(&op2, value2);
2217 }
2218
2219 unsigned int GetOpUChar(struct Operand * op2, unsigned char * value2)
2220 {
2221 if(op2->kind == 3 && op2->type->isSigned)
2222 *value2 = (unsigned char)op2->i;
2223 else if(op2->kind == 3)
2224 *value2 = (unsigned char)op2->ui;
2225 else if(op2->kind == 4 && op2->type->isSigned)
2226 *value2 = (unsigned char)op2->i64;
2227 else if(op2->kind == 4)
2228 *value2 = (unsigned char)op2->ui64;
2229 else if(op2->kind == 23 && op2->type->isSigned)
2230 *value2 = (unsigned char)op2->i64;
2231 else if(op2->kind == 23)
2232 *value2 = (unsigned char)op2->ui64;
2233 else if(op2->kind == 22 && op2->type->isSigned)
2234 *value2 = (unsigned char)op2->i64;
2235 else if(op2->kind == 22)
2236 *value2 = (unsigned char)op2->ui64;
2237 else if(op2->kind == 2 && op2->type->isSigned)
2238 *value2 = (unsigned char)op2->s;
2239 else if(op2->kind == 2)
2240 *value2 = (unsigned char)op2->us;
2241 else if(op2->kind == 1 && op2->type->isSigned)
2242 *value2 = (unsigned char)op2->c;
2243 else if(op2->kind == 24 || op2->kind == 1)
2244 *value2 = op2->uc;
2245 else if(op2->kind == 6)
2246 *value2 = (unsigned char)op2->f;
2247 else if(op2->kind == 7)
2248 *value2 = (unsigned char)op2->d;
2249 else if(op2->kind == 13)
2250 *value2 = (unsigned char)op2->ui64;
2251 else
2252 return 0x0;
2253 return 0x1;
2254 }
2255
2256 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
2257 {
2258 struct Operand op2 = GetOperand(exp);
2259
2260 return GetOpUChar(&op2, value2);
2261 }
2262
2263 unsigned int GetOpFloat(struct Operand * op2, float * value2)
2264 {
2265 if(op2->kind == 3 && op2->type->isSigned)
2266 *value2 = (float)(float)op2->i;
2267 else if(op2->kind == 3)
2268 *value2 = (float)(float)op2->ui;
2269 else if(op2->kind == 4 && op2->type->isSigned)
2270 *value2 = (float)(float)op2->i64;
2271 else if(op2->kind == 4)
2272 *value2 = (float)(float)op2->ui64;
2273 else if(op2->kind == 23 && op2->type->isSigned)
2274 *value2 = (float)(float)op2->i64;
2275 else if(op2->kind == 23)
2276 *value2 = (float)(float)op2->ui64;
2277 else if(op2->kind == 22 && op2->type->isSigned)
2278 *value2 = (float)(float)op2->i64;
2279 else if(op2->kind == 22)
2280 *value2 = (float)(float)op2->ui64;
2281 else if(op2->kind == 2 && op2->type->isSigned)
2282 *value2 = (float)(float)op2->s;
2283 else if(op2->kind == 2)
2284 *value2 = (float)(float)op2->us;
2285 else if(op2->kind == 1 && op2->type->isSigned)
2286 *value2 = (float)(float)op2->c;
2287 else if(op2->kind == 24 || op2->kind == 1)
2288 *value2 = (float)(float)op2->uc;
2289 else if(op2->kind == 6)
2290 *value2 = (float)op2->f;
2291 else if(op2->kind == 7)
2292 *value2 = (float)op2->d;
2293 else if(op2->kind == 13)
2294 *value2 = (float)(float)op2->ui64;
2295 else
2296 return 0x0;
2297 return 0x1;
2298 }
2299
2300 unsigned int GetFloat(struct Expression * exp, float * value2)
2301 {
2302 struct Operand op2 = GetOperand(exp);
2303
2304 return GetOpFloat(&op2, value2);
2305 }
2306
2307 unsigned int GetOpDouble(struct Operand * op2, double * value2)
2308 {
2309 if(op2->kind == 3 && op2->type->isSigned)
2310 *value2 = (double)(double)op2->i;
2311 else if(op2->kind == 3)
2312 *value2 = (double)(double)op2->ui;
2313 else if(op2->kind == 4 && op2->type->isSigned)
2314 *value2 = (double)(double)op2->i64;
2315 else if(op2->kind == 4)
2316 *value2 = (double)(double)op2->ui64;
2317 else if(op2->kind == 23 && op2->type->isSigned)
2318 *value2 = (double)(double)op2->i64;
2319 else if(op2->kind == 23)
2320 *value2 = (double)(double)op2->ui64;
2321 else if(op2->kind == 22 && op2->type->isSigned)
2322 *value2 = (double)(double)op2->i64;
2323 else if(op2->kind == 22)
2324 *value2 = (double)(double)op2->ui64;
2325 else if(op2->kind == 2 && op2->type->isSigned)
2326 *value2 = (double)(double)op2->s;
2327 else if(op2->kind == 2)
2328 *value2 = (double)(double)op2->us;
2329 else if(op2->kind == 1 && op2->type->isSigned)
2330 *value2 = (double)(double)op2->c;
2331 else if(op2->kind == 24 || op2->kind == 1)
2332 *value2 = (double)(double)op2->uc;
2333 else if(op2->kind == 6)
2334 *value2 = (double)op2->f;
2335 else if(op2->kind == 7)
2336 *value2 = (double)op2->d;
2337 else if(op2->kind == 13)
2338 *value2 = (double)(double)op2->ui64;
2339 else
2340 return 0x0;
2341 return 0x1;
2342 }
2343
2344 unsigned int GetDouble(struct Expression * exp, double * value2)
2345 {
2346 struct Operand op2 = GetOperand(exp);
2347
2348 return GetOpDouble(&op2, value2);
2349 }
2350
2351 void ComputeExpression(struct Expression * exp);
2352
2353 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2354
2355 extern int targetBits;
2356
2357 int ComputeTypeSize(struct Type * type);
2358
2359 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2360
2361 struct __ecereNameSpace__ecere__com__BitMember
2362 {
2363 struct __ecereNameSpace__ecere__com__BitMember * prev;
2364 struct __ecereNameSpace__ecere__com__BitMember * next;
2365 char *  name;
2366 unsigned int isProperty;
2367 int memberAccess;
2368 int id;
2369 struct __ecereNameSpace__ecere__com__Class * _class;
2370 char *  dataTypeString;
2371 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2372 struct Type * dataType;
2373 int type;
2374 int size;
2375 int pos;
2376 uint64 mask;
2377 } __attribute__ ((gcc_struct));
2378
2379 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2380
2381 struct __ecereNameSpace__ecere__sys__OldLink
2382 {
2383 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2384 struct __ecereNameSpace__ecere__sys__OldLink * next;
2385 void *  data;
2386 } __attribute__ ((gcc_struct));
2387
2388 void FinishTemplatesContext(struct Context * context);
2389
2390 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2391 {
2392 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2393 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2394
2395 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))
2396 {
2397 int c;
2398 int unionMemberOffset = 0;
2399 int bitFields = 0;
2400
2401 if(member)
2402 {
2403 member->memberOffset = 0;
2404 if(targetBits < sizeof(void *) * 8)
2405 member->structAlignment = 0;
2406 }
2407 else if(targetBits < sizeof(void *) * 8)
2408 _class->structAlignment = 0;
2409 if(!member && ((_class->type == 0 || _class->type == 5) || (_class->type == 1 && _class->memberOffset && _class->memberOffset > _class->base->structSize)))
2410 _class->memberOffset = (_class->base && _class->type == 1) ? _class->base->structSize : 0;
2411 if(!member && _class->destructionWatchOffset)
2412 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2413 {
2414 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2415
2416 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2417 {
2418 if(!dataMember->isProperty)
2419 {
2420 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2421 {
2422 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
2423 }
2424 }
2425 }
2426 }
2427 {
2428 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2429
2430 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2431 {
2432 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2433 {
2434 if(!isMember && _class->type == 2 && dataMember->dataType)
2435 {
2436 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2437 uint64 mask = 0;
2438 int d;
2439
2440 ComputeTypeSize(dataMember->dataType);
2441 if(bitMember->pos == -1)
2442 bitMember->pos = _class->memberOffset;
2443 if(!bitMember->size)
2444 bitMember->size = dataMember->dataType->size * 8;
2445 _class->memberOffset = bitMember->pos + bitMember->size;
2446 for(d = 0; d < bitMember->size; d++)
2447 {
2448 if(d)
2449 mask <<= 1;
2450 mask |= 1;
2451 }
2452 bitMember->mask = mask << bitMember->pos;
2453 }
2454 else if(dataMember->type == 0 && dataMember->dataType)
2455 {
2456 int size;
2457 int alignment = 0;
2458
2459 if(dataMember->dataType->kind != 8 || ((!dataMember->dataType->_class || !dataMember->dataType->_class->registered || dataMember->dataType->_class->registered != _class || _class->type != 1)))
2460 ComputeTypeSize(dataMember->dataType);
2461 if(dataMember->dataType->bitFieldCount)
2462 {
2463 bitFields += dataMember->dataType->bitFieldCount;
2464 size = 0;
2465 }
2466 else
2467 {
2468 if(bitFields)
2469 {
2470 int size = (bitFields + 7) / 8;
2471
2472 if(isMember)
2473 {
2474 int __simpleStruct0;
2475
2476 if(alignment)
2477 {
2478 int __simpleStruct0;
2479
2480 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2481 if(member->memberOffset % alignment)
2482 member->memberOffset += alignment - (member->memberOffset % alignment);
2483 }
2484 dataMember->offset = member->memberOffset;
2485 if(member->type == 1)
2486 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2487 else
2488 {
2489 member->memberOffset += size;
2490 }
2491 }
2492 else
2493 {
2494 if(alignment)
2495 {
2496 int __simpleStruct0;
2497
2498 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2499 if(_class->memberOffset % alignment)
2500 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2501 }
2502 dataMember->offset = _class->memberOffset;
2503 _class->memberOffset += size;
2504 }
2505 bitFields = 0;
2506 }
2507 size = dataMember->dataType->size;
2508 alignment = dataMember->dataType->alignment;
2509 }
2510 if(isMember)
2511 {
2512 int __simpleStruct0;
2513
2514 if(alignment)
2515 {
2516 int __simpleStruct0;
2517
2518 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2519 if(member->memberOffset % alignment)
2520 member->memberOffset += alignment - (member->memberOffset % alignment);
2521 }
2522 dataMember->offset = member->memberOffset;
2523 if(member->type == 1)
2524 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2525 else
2526 {
2527 member->memberOffset += size;
2528 }
2529 }
2530 else
2531 {
2532 if(alignment)
2533 {
2534 int __simpleStruct0;
2535
2536 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2537 if(_class->memberOffset % alignment)
2538 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2539 }
2540 dataMember->offset = _class->memberOffset;
2541 _class->memberOffset += size;
2542 }
2543 }
2544 else
2545 {
2546 int alignment;
2547
2548 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 0x1);
2549 alignment = dataMember->structAlignment;
2550 if(isMember)
2551 {
2552 int __simpleStruct0;
2553
2554 if(alignment)
2555 {
2556 int __simpleStruct0;
2557
2558 if(member->memberOffset % alignment)
2559 member->memberOffset += alignment - (member->memberOffset % alignment);
2560 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2561 }
2562 dataMember->offset = member->memberOffset;
2563 if(member->type == 1)
2564 unionMemberOffset = (__simpleStruct0 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2565 else
2566 member->memberOffset += dataMember->memberOffset;
2567 }
2568 else
2569 {
2570 if(alignment)
2571 {
2572 int __simpleStruct0;
2573
2574 if(_class->memberOffset % alignment)
2575 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2576 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2577 }
2578 dataMember->offset = _class->memberOffset;
2579 _class->memberOffset += dataMember->memberOffset;
2580 }
2581 }
2582 }
2583 }
2584 if(bitFields)
2585 {
2586 int alignment = 0;
2587 int size = (bitFields + 7) / 8;
2588
2589 if(isMember)
2590 {
2591 int __simpleStruct0;
2592
2593 if(alignment)
2594 {
2595 int __simpleStruct0;
2596
2597 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2598 if(member->memberOffset % alignment)
2599 member->memberOffset += alignment - (member->memberOffset % alignment);
2600 }
2601 if(member->type == 1)
2602 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2603 else
2604 {
2605 member->memberOffset += size;
2606 }
2607 }
2608 else
2609 {
2610 if(alignment)
2611 {
2612 int __simpleStruct0;
2613
2614 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2615 if(_class->memberOffset % alignment)
2616 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2617 }
2618 _class->memberOffset += size;
2619 }
2620 bitFields = 0;
2621 }
2622 }
2623 if(member && member->type == 1)
2624 {
2625 member->memberOffset = unionMemberOffset;
2626 }
2627 if(!isMember)
2628 {
2629 if(_class->type != 2)
2630 {
2631 int extra = 0;
2632
2633 if(_class->structAlignment)
2634 {
2635 if(_class->memberOffset % _class->structAlignment)
2636 extra += _class->structAlignment - (_class->memberOffset % _class->structAlignment);
2637 }
2638 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset + extra;
2639 if(!member)
2640 {
2641 struct __ecereNameSpace__ecere__com__Property * prop;
2642
2643 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2644 {
2645 if(prop->isProperty && prop->isWatchable)
2646 {
2647 prop->watcherOffset = _class->structSize;
2648 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2649 }
2650 }
2651 }
2652 {
2653 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2654
2655 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2656 {
2657 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2658
2659 if(deriv->computeSize)
2660 {
2661 deriv->offset = _class->structSize;
2662 deriv->memberOffset = 0;
2663 deriv->structSize = deriv->offset;
2664 ComputeClassMembers(deriv, 0x0);
2665 }
2666 }
2667 }
2668 }
2669 }
2670 }
2671 if(context)
2672 FinishTemplatesContext(context);
2673 }
2674
2675 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2676
2677 struct __ecereNameSpace__ecere__com__NameSpace
2678 {
2679 char *  name;
2680 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
2681 struct __ecereNameSpace__ecere__com__NameSpace *  left;
2682 struct __ecereNameSpace__ecere__com__NameSpace *  right;
2683 int depth;
2684 struct __ecereNameSpace__ecere__com__NameSpace *  parent;
2685 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2686 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2687 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2688 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2689 } __attribute__ ((gcc_struct));
2690
2691 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2692
2693 struct __ecereNameSpace__ecere__com__Module
2694 {
2695 struct __ecereNameSpace__ecere__com__Instance * application;
2696 struct __ecereNameSpace__ecere__sys__OldList classes;
2697 struct __ecereNameSpace__ecere__sys__OldList defines;
2698 struct __ecereNameSpace__ecere__sys__OldList functions;
2699 struct __ecereNameSpace__ecere__sys__OldList modules;
2700 struct __ecereNameSpace__ecere__com__Instance * prev;
2701 struct __ecereNameSpace__ecere__com__Instance * next;
2702 char *  name;
2703 void *  library;
2704 void *  Unload;
2705 int importType;
2706 int origImportType;
2707 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2708 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2709 } __attribute__ ((gcc_struct));
2710
2711 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2712 {
2713 struct __ecereNameSpace__ecere__com__Class * _class;
2714 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2715
2716 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
2717 ComputeModuleClasses(subModule->data);
2718 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->classes.first; _class; _class = _class->next)
2719 ComputeClassMembers(_class, 0x0);
2720 }
2721
2722 extern unsigned int inCompiler;
2723
2724 extern void Compiler_Error(char *  format, ...);
2725
2726 extern char *  __ecereNameSpace__ecere__GetTranslatedString(char * name, char *  string, char *  stringAndContext);
2727
2728 int ComputeTypeSize(struct Type * type)
2729 {
2730 unsigned int size = type ? type->size : 0;
2731
2732 if(!size && type && !type->computing)
2733 {
2734 type->computing = 0x1;
2735 switch(type->kind)
2736 {
2737 case 24:
2738 type->alignment = size = sizeof(char);
2739 break;
2740 case 1:
2741 type->alignment = size = sizeof(char);
2742 break;
2743 case 3:
2744 type->alignment = size = sizeof(int);
2745 break;
2746 case 4:
2747 type->alignment = size = sizeof(long long);
2748 break;
2749 case 22:
2750 type->alignment = size = targetBits / 8;
2751 break;
2752 case 23:
2753 type->alignment = size = targetBits / 8;
2754 break;
2755 case 5:
2756 type->alignment = size = sizeof(long);
2757 break;
2758 case 2:
2759 type->alignment = size = sizeof(short);
2760 break;
2761 case 6:
2762 type->alignment = size = sizeof(float);
2763 break;
2764 case 7:
2765 type->alignment = size = sizeof(double);
2766 break;
2767 case 8:
2768 {
2769 struct __ecereNameSpace__ecere__com__Class * _class = type->_class ? type->_class->registered : (((void *)0));
2770
2771 if(_class && _class->type == 1)
2772 {
2773 ComputeClassMembers(_class, 0x0);
2774 type->alignment = _class->structAlignment;
2775 size = _class->structSize;
2776 if(type->alignment && size % type->alignment)
2777 size += type->alignment - (size % type->alignment);
2778 }
2779 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2780 {
2781 if(!_class->dataType)
2782 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2783 size = type->alignment = ComputeTypeSize(_class->dataType);
2784 }
2785 else
2786 size = type->alignment = targetBits / 8;
2787 break;
2788 }
2789 case 13:
2790 case 19:
2791 size = type->alignment = targetBits / 8;
2792 break;
2793 case 12:
2794 if(type->arraySizeExp)
2795 {
2796 ProcessExpressionType(type->arraySizeExp);
2797 ComputeExpression(type->arraySizeExp);
2798 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)))
2799 {
2800 struct Location oldLoc = yylloc;
2801 char expression[10240];
2802
2803 expression[0] = '\0';
2804 type->arraySizeExp->expType = (((void *)0));
2805 yylloc = type->arraySizeExp->loc;
2806 if(inCompiler)
2807 PrintExpression(type->arraySizeExp, expression);
2808 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Array size not constant int (%s)\n", (((void *)0))), expression);
2809 yylloc = oldLoc;
2810 }
2811 GetInt(type->arraySizeExp, &type->arraySize);
2812 }
2813 else if(type->enumClass)
2814 {
2815 if(type->enumClass && type->enumClass->registered && type->enumClass->registered->type == 4)
2816 {
2817 type->arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->enumClass->registered, "enumSize");
2818 }
2819 else
2820 type->arraySize = 0;
2821 }
2822 else
2823 {
2824 type->arraySize = 0;
2825 }
2826 size = ComputeTypeSize(type->type) * type->arraySize;
2827 if(type->type)
2828 type->alignment = type->type->alignment;
2829 break;
2830 case 9:
2831 {
2832 struct Type * member;
2833
2834 for(member = type->members.first; member; member = member->next)
2835 {
2836 int __simpleStruct0, __simpleStruct1;
2837 unsigned int addSize = ComputeTypeSize(member);
2838
2839 member->offset = size;
2840 if(member->alignment && size % member->alignment)
2841 member->offset += member->alignment - (size % member->alignment);
2842 size = member->offset;
2843 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2844 size += addSize;
2845 }
2846 if(type->alignment && size % type->alignment)
2847 size += type->alignment - (size % type->alignment);
2848 break;
2849 }
2850 case 10:
2851 {
2852 struct Type * member;
2853
2854 for(member = type->members.first; member; member = member->next)
2855 {
2856 int __simpleStruct0, __simpleStruct1;
2857 unsigned int addSize = ComputeTypeSize(member);
2858
2859 member->offset = size;
2860 if(member->alignment && size % member->alignment)
2861 member->offset += member->alignment - (size % member->alignment);
2862 size = member->offset;
2863 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2864 size = ((size > addSize) ? size : addSize);
2865 }
2866 if(type->alignment && size % type->alignment)
2867 size += type->alignment - (size % type->alignment);
2868 break;
2869 }
2870 case 20:
2871 {
2872 struct TemplateParameter * param = type->templateParameter;
2873 struct Type * baseType = ProcessTemplateParameterType(param);
2874
2875 if(baseType)
2876 {
2877 size = ComputeTypeSize(baseType);
2878 type->alignment = baseType->alignment;
2879 }
2880 else
2881 type->alignment = size = sizeof(uint64);
2882 break;
2883 }
2884 case 15:
2885 {
2886 type->alignment = size = sizeof(enum
2887 {
2888 test
2889 });
2890 break;
2891 }
2892 case 21:
2893 {
2894 type->alignment = size = targetBits / 8;
2895 break;
2896 }
2897 }
2898 type->size = size;
2899 type->computing = 0x0;
2900 }
2901 return size;
2902 }
2903
2904 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2905
2906 extern struct Identifier * MkIdentifier(char *  string);
2907
2908 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void *  item);
2909
2910 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2911
2912 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2913
2914 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2915
2916 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2917
2918 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2919
2920 extern void FreeType(struct Type * type);
2921
2922 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2923
2924 extern struct Specifier * MkSpecifier(int specifier);
2925
2926 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2927
2928 extern struct Expression * MkExpConstant(char *  string);
2929
2930 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)
2931 {
2932 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2933 unsigned int totalSize = 0;
2934 unsigned int maxSize = 0;
2935 int alignment, size;
2936 struct __ecereNameSpace__ecere__com__DataMember * member;
2937 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2938
2939 if(addedPadding)
2940 *addedPadding = 0x0;
2941 if(!isMember && _class->base)
2942 {
2943 maxSize = _class->structSize;
2944 {
2945 if(_class->type == 1 || _class->type == 5)
2946 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass, (((void *)0)));
2947 else
2948 {
2949 unsigned int baseSize = _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2950
2951 if(maxSize > baseSize)
2952 maxSize -= baseSize;
2953 else
2954 maxSize = 0;
2955 }
2956 }
2957 }
2958 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2959 {
2960 if(!member->isProperty)
2961 {
2962 switch(member->type)
2963 {
2964 case 0:
2965 {
2966 if(member->dataTypeString)
2967 {
2968 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2969 struct Declarator * decl;
2970
2971 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2972 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2973 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2974 if(!member->dataType)
2975 member->dataType = ProcessType(specs, decl);
2976 ReplaceThisClassSpecifiers(specs, topClass);
2977 {
2978 struct Type * type = ProcessType(specs, decl);
2979
2980 DeclareType(member->dataType, 0x0, 0x0);
2981 FreeType(type);
2982 }
2983 ComputeTypeSize(member->dataType);
2984 size = member->dataType->size;
2985 alignment = member->dataType->alignment;
2986 if(alignment)
2987 {
2988 if(totalSize % alignment)
2989 totalSize += alignment - (totalSize % alignment);
2990 }
2991 totalSize += size;
2992 }
2993 break;
2994 }
2995 case 1:
2996 case 2:
2997 {
2998 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
2999
3000 size = 0;
3001 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass, (((void *)0)));
3002 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
3003 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, (((void *)0)), (((void *)0)))));
3004 alignment = member->structAlignment;
3005 if(alignment)
3006 {
3007 if(totalSize % alignment)
3008 totalSize += alignment - (totalSize % alignment);
3009 }
3010 totalSize += size;
3011 break;
3012 }
3013 }
3014 }
3015 }
3016 if(retSize)
3017 {
3018 unsigned int __simpleStruct0;
3019
3020 if(topMember && topMember->type == 1)
3021 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
3022 else
3023 *retSize += totalSize;
3024 }
3025 else if(totalSize < maxSize && _class->type != 1000)
3026 {
3027 int autoPadding = 0;
3028
3029 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
3030 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
3031 if(totalSize + autoPadding < maxSize)
3032 {
3033 char sizeString[50];
3034
3035 sprintf(sizeString, "%d", maxSize - totalSize);
3036 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
3037 if(addedPadding)
3038 *addedPadding = 0x1;
3039 }
3040 }
3041 if(context)
3042 FinishTemplatesContext(context);
3043 return topMember ? topMember->memberID : _class->memberID;
3044 }
3045
3046 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
3047 {
3048 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
3049 unsigned int totalSize = 0;
3050 struct __ecereNameSpace__ecere__com__DataMember * member;
3051 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
3052
3053 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
3054 DeclareMembers(_class->base, 0x0);
3055 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
3056 {
3057 if(!member->isProperty)
3058 {
3059 switch(member->type)
3060 {
3061 case 0:
3062 {
3063 if(!member->dataType && member->dataTypeString)
3064 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
3065 if(member->dataType)
3066 DeclareType(member->dataType, 0x0, 0x0);
3067 break;
3068 }
3069 case 1:
3070 case 2:
3071 {
3072 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
3073 break;
3074 }
3075 }
3076 }
3077 }
3078 if(context)
3079 FinishTemplatesContext(context);
3080 return topMember ? topMember->memberID : _class->memberID;
3081 }
3082
3083 extern struct Symbol * FindClass(char *  name);
3084
3085 extern char *  strchr(const char * , int);
3086
3087 extern void FullClassNameCat(char *  output, char *  className, unsigned int includeTemplateParams);
3088
3089 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (*  FreeFunction)(void * ));
3090
3091 extern void FreeClassDef(struct ClassDef * def);
3092
3093 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
3094
3095 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
3096
3097 extern void MangleClassName(char *  className);
3098
3099 extern void DeclareClass(struct Symbol * classSym, char *  className);
3100
3101 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item, void *  prevItem);
3102
3103 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void *  prevItem, void *  item);
3104
3105 void DeclareStruct(char * name, unsigned int skipNoHead)
3106 {
3107 struct External * external = (((void *)0));
3108 struct Symbol * classSym = FindClass(name);
3109
3110 if(!inCompiler || !classSym)
3111 return ;
3112 if(classSym->registered && (classSym->registered->type == 2 || classSym->registered->type == 3 || classSym->registered->type == 4))
3113 return ;
3114 if(classSym->registered && classSym->imported && !classSym->declaredStructSym)
3115 {
3116 struct Declaration * decl;
3117 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3118 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
3119 char structName[1024];
3120 struct Specifier * spec = (((void *)0));
3121
3122 external = (classSym->registered && classSym->registered->type == 1) ? classSym->pointerExternal : classSym->structExternal;
3123 classSym->declaring++;
3124 if(strchr(classSym->string, '<'))
3125 {
3126 if(classSym->registered->templateClass)
3127 {
3128 DeclareStruct(classSym->registered->templateClass->fullName, skipNoHead);
3129 classSym->declaring--;
3130 }
3131 return ;
3132 }
3133 DeclareMembers(classSym->registered, 0x0);
3134 structName[0] = (char)0;
3135 FullClassNameCat(structName, name, 0x0);
3136 if(external && external->declaration && external->declaration->specifiers)
3137 {
3138 for(spec = (*external->declaration->specifiers).first; spec; spec = spec->next)
3139 {
3140 if(spec->type == 3 || spec->type == 4)
3141 break;
3142 }
3143 }
3144 if(!skipNoHead && (!spec || !spec->definitions))
3145 {
3146 unsigned int addedPadding = 0x0;
3147
3148 classSym->declaredStructSym = 0x1;
3149 declarations = MkList();
3150 AddMembers(declarations, classSym->registered, 0x0, (((void *)0)), classSym->registered, &addedPadding);
3151 if(!(*declarations).count || ((*declarations).count == 1 && addedPadding))
3152 {
3153 FreeList(declarations, FreeClassDef);
3154 declarations = (((void *)0));
3155 }
3156 }
3157 if(skipNoHead || declarations)
3158 {
3159 if(spec)
3160 {
3161 if(declarations)
3162 spec->definitions = declarations;
3163 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3164 {
3165 if(classSym->structExternal)
3166 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3167 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3168 classSym->id = curExternal->symbol->idCode;
3169 classSym->idCode = curExternal->symbol->idCode;
3170 }
3171 }
3172 else
3173 {
3174 if(!external)
3175 external = MkExternalDeclaration((((void *)0)));
3176 specifiers = MkList();
3177 declarators = MkList();
3178 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
3179 external->declaration = decl = MkDeclaration(specifiers, declarators);
3180 if(decl->symbol && !decl->symbol->pointerExternal)
3181 decl->symbol->pointerExternal = external;
3182 if(classSym->registered && classSym->registered->type == 1)
3183 {
3184 char className[1024];
3185
3186 strcpy(className, "__ecereClass_");
3187 FullClassNameCat(className, classSym->string, 0x1);
3188 MangleClassName(className);
3189 DeclareClass(classSym, className);
3190 external->symbol = classSym;
3191 classSym->pointerExternal = external;
3192 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3193 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3194 }
3195 else
3196 {
3197 char className[1024];
3198
3199 strcpy(className, "__ecereClass_");
3200 FullClassNameCat(className, classSym->string, 0x1);
3201 MangleClassName(className);
3202 classSym->structExternal = external;
3203 DeclareClass(classSym, className);
3204 external->symbol = classSym;
3205 }
3206 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
3207 }
3208 }
3209 classSym->declaring--;
3210 }
3211 else if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3212 {
3213 classSym->declaring++;
3214 {
3215 if(classSym->registered)
3216 DeclareMembers(classSym->registered, 0x0);
3217 }
3218 if(classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 5))
3219 {
3220 if(classSym->structExternal)
3221 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3222 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3223 classSym->id = curExternal->symbol->idCode;
3224 classSym->idCode = curExternal->symbol->idCode;
3225 }
3226 classSym->declaring--;
3227 }
3228 }
3229
3230 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
3231
3232 extern struct ModuleImport * mainModule;
3233
3234 extern struct Specifier * MkSpecifierName(char *  name);
3235
3236 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
3237
3238 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
3239
3240 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
3241
3242 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
3243
3244 extern void FreeDeclarator(struct Declarator * decl);
3245
3246 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
3247
3248 struct PropertyImport
3249 {
3250 struct PropertyImport * prev;
3251 struct PropertyImport * next;
3252 char *  name;
3253 unsigned int isVirtual;
3254 unsigned int hasSet;
3255 unsigned int hasGet;
3256 } __attribute__ ((gcc_struct));
3257
3258 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
3259
3260 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
3261 {
3262 struct Symbol * symbol = prop->symbol;
3263 char propName[1024];
3264
3265 strcpy(setName, "__ecereProp_");
3266 FullClassNameCat(setName, prop->_class->fullName, 0x0);
3267 strcat(setName, "_Set_");
3268 FullClassNameCat(setName, prop->name, 0x1);
3269 strcpy(getName, "__ecereProp_");
3270 FullClassNameCat(getName, prop->_class->fullName, 0x0);
3271 strcat(getName, "_Get_");
3272 FullClassNameCat(getName, prop->name, 0x1);
3273 strcpy(propName, "__ecereProp_");
3274 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3275 strcat(propName, "_");
3276 FullClassNameCat(propName, prop->name, 0x1);
3277 MangleClassName(getName);
3278 MangleClassName(setName);
3279 MangleClassName(propName);
3280 if(prop->_class->type == 1)
3281 DeclareStruct(prop->_class->fullName, 0x0);
3282 if(!symbol || curExternal->symbol->idCode < symbol->id)
3283 {
3284 unsigned int imported = 0x0;
3285 unsigned int dllImport = 0x0;
3286
3287 if(!symbol || symbol->_import)
3288 {
3289 if(!symbol)
3290 {
3291 struct Symbol * classSym;
3292
3293 if(!prop->_class->symbol)
3294 prop->_class->symbol = FindClass(prop->_class->fullName);
3295 classSym = prop->_class->symbol;
3296 if(classSym && !classSym->_import)
3297 {
3298 struct ModuleImport * module;
3299
3300 if(prop->_class->module)
3301 module = FindModule(prop->_class->module);
3302 else
3303 module = mainModule;
3304 classSym->_import = __extension__ ({
3305 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
3306
3307 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
3308 });
3309 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3310 }
3311 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3312 symbol->_import = (struct ClassImport *)__extension__ ({
3313 struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
3314
3315 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0x0, __ecereInstance1->hasSet = prop->Set ? 0x1 : 0x0, __ecereInstance1->hasGet = prop->Get ? 0x1 : 0x0, __ecereInstance1;
3316 });
3317 if(classSym)
3318 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3319 }
3320 imported = 0x1;
3321 if((prop->_class->module != privateModule || !strcmp(prop->_class->name, "float") || !strcmp(prop->_class->name, "double")) && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)prop->_class->module + 24)))->importType != 1)
3322 dllImport = 0x1;
3323 }
3324 if(!symbol->type)
3325 {
3326 struct Context * context = SetupTemplatesContext(prop->_class);
3327
3328 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
3329 FinishTemplatesContext(context);
3330 }
3331 if(prop->Get)
3332 {
3333 if(!symbol->externalGet || symbol->externalGet->type == 0)
3334 {
3335 struct Declaration * decl;
3336 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3337 struct Declarator * d;
3338 struct __ecereNameSpace__ecere__sys__OldList * params;
3339 struct Specifier * spec;
3340 struct External * external;
3341 struct Declarator * typeDecl;
3342 unsigned int simple = 0x0;
3343
3344 specifiers = MkList();
3345 declarators = MkList();
3346 params = MkList();
3347 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3348 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3349 if(dllImport)
3350 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3351 {
3352 struct Context * context = SetupTemplatesContext(prop->_class);
3353
3354 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3355 FinishTemplatesContext(context);
3356 }
3357 for(spec = (*specifiers).first; spec; spec = spec->next)
3358 {
3359 if(spec->type == 1)
3360 {
3361 if((!typeDecl || typeDecl->type == 1))
3362 {
3363 struct Symbol * classSym = spec->symbol;
3364
3365 symbol->_class = classSym->registered;
3366 if(classSym->registered && classSym->registered->type == 1)
3367 {
3368 DeclareStruct(spec->name, 0x0);
3369 simple = 0x1;
3370 }
3371 }
3372 }
3373 }
3374 if(!simple)
3375 d = PlugDeclarator(typeDecl, d);
3376 else
3377 {
3378 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3379 specifiers = MkList();
3380 }
3381 d = MkDeclaratorFunction(d, params);
3382 if(dllImport)
3383 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3384 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3385 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3386 if(simple)
3387 ListAdd(specifiers, MkSpecifier(VOID));
3388 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3389 decl = MkDeclaration(specifiers, declarators);
3390 external = MkExternalDeclaration(decl);
3391 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3392 external->symbol = symbol;
3393 symbol->externalGet = external;
3394 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3395 if(typeDecl)
3396 FreeDeclarator(typeDecl);
3397 }
3398 else
3399 {
3400 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
3401 }
3402 }
3403 if(prop->Set)
3404 {
3405 if(!symbol->externalSet || symbol->externalSet->type == 0)
3406 {
3407 struct Declaration * decl;
3408 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3409 struct Declarator * d;
3410 struct __ecereNameSpace__ecere__sys__OldList * params;
3411 struct Specifier * spec;
3412 struct External * external;
3413 struct Declarator * typeDecl;
3414
3415 declarators = MkList();
3416 params = MkList();
3417 if(!prop->conversion || prop->_class->type == 1)
3418 {
3419 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3420 }
3421 specifiers = MkList();
3422 {
3423 struct Context * context = SetupTemplatesContext(prop->_class);
3424
3425 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3426 FinishTemplatesContext(context);
3427 }
3428 ListAdd(params, MkTypeName(specifiers, d));
3429 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3430 if(dllImport)
3431 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3432 d = MkDeclaratorFunction(d, params);
3433 for(spec = (*specifiers).first; spec; spec = spec->next)
3434 {
3435 if(spec->type == 1)
3436 {
3437 if((!typeDecl || typeDecl->type == 1))
3438 {
3439 struct Symbol * classSym = spec->symbol;
3440
3441 symbol->_class = classSym->registered;
3442 if(classSym->registered && classSym->registered->type == 1)
3443 DeclareStruct(spec->name, 0x0);
3444 }
3445 }
3446 }
3447 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3448 specifiers = MkList();
3449 if(dllImport)
3450 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3451 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3452 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3453 if(!prop->conversion || prop->_class->type == 1)
3454 ListAdd(specifiers, MkSpecifier(VOID));
3455 else
3456 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3457 decl = MkDeclaration(specifiers, declarators);
3458 external = MkExternalDeclaration(decl);
3459 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3460 external->symbol = symbol;
3461 symbol->externalSet = external;
3462 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3463 }
3464 else
3465 {
3466 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3467 }
3468 }
3469 if(!symbol->externalPtr)
3470 {
3471 struct Declaration * decl;
3472 struct External * external;
3473 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3474
3475 if(imported)
3476 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3477 else
3478 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3479 ListAdd(specifiers, MkSpecifierName("Property"));
3480 {
3481 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3482
3483 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3484 if(!imported)
3485 {
3486 strcpy(propName, "__ecerePropM_");
3487 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3488 strcat(propName, "_");
3489 FullClassNameCat(propName, prop->name, 0x1);
3490 MangleClassName(propName);
3491 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3492 }
3493 decl = MkDeclaration(specifiers, list);
3494 }
3495 external = MkExternalDeclaration(decl);
3496 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3497 external->symbol = symbol;
3498 symbol->externalPtr = external;
3499 }
3500 else
3501 {
3502 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3503 }
3504 symbol->id = curExternal->symbol->idCode;
3505 }
3506 }
3507
3508 struct Type * Dereference(struct Type * source)
3509 {
3510 struct Type * type = (((void *)0));
3511
3512 if(source)
3513 {
3514 if(source->kind == 13 || source->kind == 12)
3515 {
3516 type = source->type;
3517 source->type->refCount++;
3518 }
3519 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3520 {
3521 type = __extension__ ({
3522 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3523
3524 __ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
3525 });
3526 }
3527 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3528 {
3529 type = source;
3530 source->refCount++;
3531 }
3532 else
3533 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot dereference type\n", (((void *)0))));
3534 }
3535 return type;
3536 }
3537
3538 static struct Type * Reference(struct Type * source)
3539 {
3540 struct Type * type = (((void *)0));
3541
3542 if(source)
3543 {
3544 type = __extension__ ({
3545 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3546
3547 __ecereInstance1->kind = 13, __ecereInstance1->type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
3548 });
3549 source->refCount++;
3550 }
3551 return type;
3552 }
3553
3554 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);
3555
3556 extern void *  memcpy(void * , const void * , size_t size);
3557
3558 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3559
3560 extern void FreeExpression(struct Expression * exp);
3561
3562 extern void __ecereNameSpace__ecere__sys__ChangeCh(char *  string, char ch1, char ch2);
3563
3564 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);
3565
3566 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3567
3568 extern struct Type * MkClassType(char *  name);
3569
3570 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);
3571
3572 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)
3573 {
3574 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3575 unsigned int found = 0x0;
3576 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3577 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3578 unsigned int freeType = 0x0;
3579
3580 yylloc = member->loc;
3581 if(!ident)
3582 {
3583 if(curMember)
3584 {
3585 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3586 if(*curMember)
3587 {
3588 found = 0x1;
3589 dataMember = *curMember;
3590 }
3591 }
3592 }
3593 else
3594 {
3595 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3596 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3597 int _subMemberStackPos = 0;
3598
3599 if(!thisMember)
3600 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3601 if(thisMember)
3602 {
3603 dataMember = thisMember;
3604 if(curMember && thisMember->memberAccess == 1)
3605 {
3606 *curMember = thisMember;
3607 *curClass = thisMember->_class;
3608 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
3609 *subMemberStackPos = _subMemberStackPos;
3610 }
3611 found = 0x1;
3612 }
3613 else
3614 {
3615 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3616 if(method && method->type == 1)
3617 found = 0x1;
3618 else
3619 method = (((void *)0));
3620 }
3621 }
3622 if(found)
3623 {
3624 struct Type * type = (((void *)0));
3625
3626 if(dataMember)
3627 {
3628 if(!dataMember->dataType && dataMember->dataTypeString)
3629 {
3630 struct Context * context = SetupTemplatesContext(_class);
3631
3632 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3633 FinishTemplatesContext(context);
3634 }
3635 type = dataMember->dataType;
3636 }
3637 else if(method)
3638 {
3639 if(!method->dataType)
3640 ProcessMethodType(method);
3641 type = method->dataType;
3642 }
3643 if(ident && ident->next)
3644 {
3645 for(ident = ident->next; ident && type; ident = ident->next)
3646 {
3647 if(type->kind == 8)
3648 {
3649 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3650 if(!dataMember)
3651 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3652 if(dataMember)
3653 type = dataMember->dataType;
3654 }
3655 else if(type->kind == 9 || type->kind == 10)
3656 {
3657 struct Type * memberType;
3658
3659 for(memberType = type->members.first; memberType; memberType = memberType->next)
3660 {
3661 if(!strcmp(memberType->name, ident->string))
3662 {
3663 type = memberType;
3664 break;
3665 }
3666 }
3667 }
3668 }
3669 }
3670 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3671 {
3672 int id = 0;
3673 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3674 struct __ecereNameSpace__ecere__com__Class * sClass;
3675
3676 for(sClass = _class; sClass; sClass = sClass->base)
3677 {
3678 id = 0;
3679 if(sClass->templateClass)
3680 sClass = sClass->templateClass;
3681 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3682 {
3683 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3684 {
3685 for(sClass = sClass->base; sClass; sClass = sClass->base)
3686 {
3687 if(sClass->templateClass)
3688 sClass = sClass->templateClass;
3689 id += sClass->templateParams.count;
3690 }
3691 break;
3692 }
3693 id++;
3694 }
3695 if(curParam)
3696 break;
3697 }
3698 if(curParam)
3699 {
3700 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3701
3702 if(arg.dataTypeString)
3703 {
3704 type = ProcessTypeString(arg.dataTypeString, 0x0);
3705 freeType = 0x1;
3706 if(type && _class->templateClass)
3707 type->passAsTemplate = 0x1;
3708 if(type)
3709 {
3710 }
3711 }
3712 }
3713 }
3714 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3715 {
3716 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3717 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3718 int c;
3719 int paramCount = 0;
3720 int lastParam = -1;
3721 char templateString[1024];
3722 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3723
3724 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3725 for(cClass = expClass; cClass; cClass = cClass->base)
3726 {
3727 int p = 0;
3728
3729 if(cClass->templateClass)
3730 cClass = cClass->templateClass;
3731 for(param = cClass->templateParams.first; param; param = param->next)
3732 {
3733 int id = p;
3734 struct __ecereNameSpace__ecere__com__Class * sClass;
3735 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3736
3737 for(sClass = cClass->base; sClass; sClass = sClass->base)
3738 {
3739 if(sClass->templateClass)
3740 sClass = sClass->templateClass;
3741 id += sClass->templateParams.count;
3742 }
3743 arg = expClass->templateArgs[id];
3744 for(sClass = _class; sClass; sClass = sClass->base)
3745 {
3746 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3747 int p = 0;
3748 struct __ecereNameSpace__ecere__com__Class * nextClass;
3749
3750 if(sClass->templateClass)
3751 sClass = sClass->templateClass;
3752 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3753 {
3754 if(nextClass->templateClass)
3755 nextClass = nextClass->templateClass;
3756 p += nextClass->templateParams.count;
3757 }
3758 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3759 {
3760 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3761 {
3762 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3763 {
3764 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3765 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3766 break;
3767 }
3768 }
3769 }
3770 }
3771 {
3772 char argument[256];
3773
3774 argument[0] = '\0';
3775 switch(param->type)
3776 {
3777 case 2:
3778 {
3779 char expString[1024];
3780 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3781 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3782 struct Expression * exp;
3783 char * string = PrintHexUInt64(arg.expression.ui64);
3784
3785 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3786 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
3787 ProcessExpressionType(exp);
3788 ComputeExpression(exp);
3789 expString[0] = '\0';
3790 PrintExpression(exp, expString);
3791 strcat(argument, expString);
3792 FreeExpression(exp);
3793 break;
3794 }
3795 case 1:
3796 {
3797 strcat(argument, arg.member->name);
3798 break;
3799 }
3800 case 0:
3801 {
3802 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3803 strcat(argument, arg.dataTypeString);
3804 break;
3805 }
3806 }
3807 if(argument[0])
3808 {
3809 if(paramCount)
3810 strcat(templateString, ", ");
3811 if(lastParam != p - 1)
3812 {
3813 strcat(templateString, param->name);
3814 strcat(templateString, " = ");
3815 }
3816 strcat(templateString, argument);
3817 paramCount++;
3818 lastParam = p;
3819 }
3820 p++;
3821 }
3822 }
3823 }
3824 {
3825 int len = strlen(templateString);
3826
3827 if(templateString[len - 1] == '<')
3828 len--;
3829 else
3830 {
3831 if(templateString[len - 1] == '>')
3832 templateString[len++] = ' ';
3833 templateString[len++] = '>';
3834 }
3835 templateString[len++] = '\0';
3836 }
3837 {
3838 struct Context * context = SetupTemplatesContext(_class);
3839
3840 if(freeType)
3841 FreeType(type);
3842 type = ProcessTypeString(templateString, 0x0);
3843 freeType = 0x1;
3844 FinishTemplatesContext(context);
3845 }
3846 }
3847 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3848 {
3849 ProcessExpressionType(member->initializer->exp);
3850 if(!member->initializer->exp->expType)
3851 {
3852 if(inCompiler)
3853 {
3854 char expString[10240];
3855
3856 expString[0] = '\0';
3857 PrintExpression(member->initializer->exp, expString);
3858 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3859 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3860 }
3861 }
3862 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0))
3863 {
3864 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible instance method %s\n", (((void *)0))), ident->string);
3865 }
3866 }
3867 else if(member->initializer)
3868 {
3869 ProcessInitializer(member->initializer, type);
3870 }
3871 if(freeType)
3872 FreeType(type);
3873 }
3874 else
3875 {
3876 if(_class && _class->type == 3)
3877 {
3878 if(member->initializer)
3879 {
3880 struct Type * type = MkClassType(_class->fullName);
3881
3882 ProcessInitializer(member->initializer, type);
3883 FreeType(type);
3884 }
3885 }
3886 else
3887 {
3888 if(member->initializer)
3889 {
3890 ProcessInitializer(member->initializer, (((void *)0)));
3891 }
3892 if(ident)
3893 {
3894 if(method)
3895 {
3896 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3897 }
3898 else if(_class)
3899 {
3900 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3901 if(inCompiler)
3902 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3903 }
3904 }
3905 else if(_class)
3906 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3907 }
3908 }
3909 }
3910
3911 extern struct Identifier * GetDeclId(struct Declarator * decl);
3912
3913 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);
3914
3915 extern void FreeSpecifier(struct Specifier * spec);
3916
3917 static void ProcessFunction(struct FunctionDefinition * function);
3918
3919 extern struct __ecereNameSpace__ecere__sys__OldList *  CopyList(struct __ecereNameSpace__ecere__sys__OldList *  source, void *  (*  CopyFunction)(void * ));
3920
3921 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3922
3923 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3924
3925 extern void FreeClassFunction(struct ClassFunction * func);
3926
3927 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3928
3929 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3930
3931 void ProcessInstantiationType(struct Instantiation * inst)
3932 {
3933 yylloc = inst->loc;
3934 if(inst->_class)
3935 {
3936 struct MembersInit * members;
3937 struct Symbol * classSym;
3938 struct __ecereNameSpace__ecere__com__Class * _class;
3939
3940 classSym = inst->_class->symbol;
3941 _class = classSym ? classSym->registered : (((void *)0));
3942 if(!_class || _class->type != 5)
3943 DeclareStruct(inst->_class->name, 0x0);
3944 afterExternal = afterExternal ? afterExternal : curExternal;
3945 if(inst->exp)
3946 ProcessExpressionType(inst->exp);
3947 inst->isConstant = 0x1;
3948 if(inst->members)
3949 {
3950 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3951 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3952 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3953 int subMemberStackPos = 0;
3954
3955 for(members = (*inst->members).first; members; members = members->next)
3956 {
3957 switch(members->type)
3958 {
3959 case 1:
3960 {
3961 char name[1024];
3962 static unsigned int instMethodID = 0;
3963 struct External * external = curExternal;
3964 struct Context * context = curContext;
3965 struct Declarator * declarator = members->function->declarator;
3966 struct Identifier * nameID = GetDeclId(declarator);
3967 char * unmangled = nameID ? nameID->string : (((void *)0));
3968 struct Expression * exp;
3969 struct External * createdExternal = (((void *)0));
3970
3971 if(inCompiler)
3972 {
3973 char number[16];
3974
3975 strcpy(name, "__ecereInstMeth_");
3976 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
3977 strcat(name, "_");
3978 strcat(name, nameID->string);
3979 strcat(name, "_");
3980 sprintf(number, "_%08d", instMethodID++);
3981 strcat(name, number);
3982 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
3983 }
3984 if(declarator)
3985 {
3986 struct Symbol * symbol = declarator->symbol;
3987 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
3988
3989 if(method && method->type == 1)
3990 {
3991 symbol->method = method;
3992 ProcessMethodType(method);
3993 if(!symbol->type->thisClass)
3994 {
3995 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
3996 {
3997 if(!currentClass->symbol)
3998 currentClass->symbol = FindClass(currentClass->fullName);
3999 symbol->type->thisClass = currentClass->symbol;
4000 }
4001 else
4002 {
4003 if(!_class->symbol)
4004 _class->symbol = FindClass(_class->fullName);
4005 symbol->type->thisClass = _class->symbol;
4006 }
4007 }
4008 DeclareType(symbol->type, 0x1, 0x1);
4009 }
4010 else if(classSym)
4011 {
4012 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
4013 }
4014 }
4015 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
4016 if(nameID)
4017 {
4018 FreeSpecifier(nameID->_class);
4019 nameID->_class = (((void *)0));
4020 }
4021 if(inCompiler)
4022 {
4023 struct Type * type = declarator->symbol->type;
4024 struct External * oldExternal = curExternal;
4025
4026 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
4027 {
4028 struct External * externalDecl;
4029
4030 externalDecl = MkExternalDeclaration((((void *)0)));
4031 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
4032 if(createdExternal->function)
4033 {
4034 ProcessFunction(createdExternal->function);
4035 {
4036 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
4037
4038 externalDecl->declaration = decl;
4039 if(decl->symbol && !decl->symbol->pointerExternal)
4040 decl->symbol->pointerExternal = externalDecl;
4041 declarator->symbol->pointerExternal = externalDecl;
4042 }
4043 }
4044 }
4045 }
4046 else if(declarator)
4047 {
4048 curExternal = declarator->symbol->pointerExternal;
4049 ProcessFunction((struct FunctionDefinition *)members->function);
4050 }
4051 curExternal = external;
4052 curContext = context;
4053 if(inCompiler)
4054 {
4055 FreeClassFunction(members->function);
4056 exp = QMkExpId(name);
4057 members->type = 0;
4058 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
4059 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
4060 }
4061 break;
4062 }
4063 case 0:
4064 {
4065 if(members->dataMembers && classSym)
4066 {
4067 struct MemberInit * member;
4068 struct Location oldyyloc = yylloc;
4069
4070 for(member = (*members->dataMembers).first; member; member = member->next)
4071 {
4072 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
4073 if(member->initializer && !member->initializer->isConstant)
4074 inst->isConstant = 0x0;
4075 }
4076 yylloc = oldyyloc;
4077 }
4078 break;
4079 }
4080 }
4081 }
4082 }
4083 }
4084 }
4085
4086 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
4087 {
4088 if(inCompiler)
4089 {
4090 if(type->kind == 11)
4091 {
4092 struct Type * param;
4093
4094 if(declareParams)
4095 {
4096 for(param = type->params.first; param; param = param->next)
4097 DeclareType(param, declarePointers, 0x1);
4098 }
4099 DeclareType(type->returnType, declarePointers, 0x1);
4100 }
4101 else if(type->kind == 13 && declarePointers)
4102 DeclareType(type->type, declarePointers, 0x0);
4103 else if(type->kind == 8)
4104 {
4105 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
4106 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
4107 }
4108 else if(type->kind == 9 || type->kind == 10)
4109 {
4110 struct Type * member;
4111
4112 for(member = type->members.first; member; member = member->next)
4113 DeclareType(member, 0x0, 0x0);
4114 }
4115 else if(type->kind == 12)
4116 DeclareType(type->arrayType, declarePointers, 0x0);
4117 }
4118 }
4119
4120 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
4121
4122 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
4123 {
4124 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
4125 int id = 0;
4126 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4127 struct __ecereNameSpace__ecere__com__Class * sClass;
4128
4129 for(sClass = _class; sClass; sClass = sClass->base)
4130 {
4131 id = 0;
4132 if(sClass->templateClass)
4133 sClass = sClass->templateClass;
4134 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4135 {
4136 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
4137 {
4138 for(sClass = sClass->base; sClass; sClass = sClass->base)
4139 {
4140 if(sClass->templateClass)
4141 sClass = sClass->templateClass;
4142 id += sClass->templateParams.count;
4143 }
4144 break;
4145 }
4146 id++;
4147 }
4148 if(curParam)
4149 break;
4150 }
4151 if(curParam)
4152 {
4153 arg = &_class->templateArgs[id];
4154 if(arg && param->type == 0)
4155 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
4156 }
4157 return arg;
4158 }
4159
4160 extern struct Context * PushContext(void);
4161
4162 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
4163
4164 struct TemplatedType
4165 {
4166 uintptr_t key;
4167 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4168 struct __ecereNameSpace__ecere__sys__BTNode * left;
4169 struct __ecereNameSpace__ecere__sys__BTNode * right;
4170 int depth;
4171 struct TemplateParameter * param;
4172 } __attribute__ ((gcc_struct));
4173
4174 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
4175
4176 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
4177 {
4178 struct Context * context = PushContext();
4179
4180 context->templateTypesOnly = 0x1;
4181 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
4182 {
4183 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
4184
4185 for(; param; param = param->next)
4186 {
4187 if(param->type == 0 && param->identifier)
4188 {
4189 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
4190
4191 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4192 }
4193 }
4194 }
4195 else if(_class)
4196 {
4197 struct __ecereNameSpace__ecere__com__Class * sClass;
4198
4199 for(sClass = _class; sClass; sClass = sClass->base)
4200 {
4201 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
4202
4203 for(p = sClass->templateParams.first; p; p = p->next)
4204 {
4205 if(p->type == 0)
4206 {
4207 struct TemplateParameter * param = p->param;
4208 struct TemplatedType * type;
4209
4210 if(!param)
4211 {
4212 p->param = param = __extension__ ({
4213 struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
4214
4215 __ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->dataTypeString, __ecereInstance1;
4216 });
4217 }
4218 type = __extension__ ({
4219 struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
4220
4221 __ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
4222 });
4223 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4224 }
4225 }
4226 }
4227 }
4228 return context;
4229 }
4230
4231 extern void PopContext(struct Context * ctx);
4232
4233 extern void FreeContext(struct Context * context);
4234
4235 void FinishTemplatesContext(struct Context * context)
4236 {
4237 PopContext(context);
4238 FreeContext(context);
4239 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
4240 }
4241
4242 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
4243 {
4244 if(!method->dataType)
4245 {
4246 struct Context * context = SetupTemplatesContext(method->_class);
4247
4248 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4249 FinishTemplatesContext(context);
4250 if(method->type != 1 && method->dataType)
4251 {
4252 if(!method->dataType->thisClass && !method->dataType->staticMethod)
4253 {
4254 if(!method->_class->symbol)
4255 method->_class->symbol = FindClass(method->_class->fullName);
4256 method->dataType->thisClass = method->_class->symbol;
4257 }
4258 }
4259 }
4260 }
4261
4262 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
4263 {
4264 if(!prop->dataType)
4265 {
4266 struct Context * context = SetupTemplatesContext(prop->_class);
4267
4268 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
4269 FinishTemplatesContext(context);
4270 }
4271 }
4272
4273 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4274
4275 extern void FreeTypeName(struct TypeName * typeName);
4276
4277 static void ProcessDeclarator(struct Declarator * decl);
4278
4279 extern struct __ecereNameSpace__ecere__sys__OldList *  excludedSymbols;
4280
4281 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4282
4283 struct MethodImport
4284 {
4285 struct MethodImport * prev;
4286 struct MethodImport * next;
4287 char *  name;
4288 unsigned int isVirtual;
4289 } __attribute__ ((gcc_struct));
4290
4291 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
4292
4293 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
4294 {
4295 struct Symbol * symbol = method->symbol;
4296
4297 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4298 {
4299 unsigned int imported = 0x0;
4300 unsigned int dllImport = 0x0;
4301
4302 if(!method->dataType)
4303 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4304 if(!symbol || symbol->_import || method->type == 1)
4305 {
4306 if(!symbol || method->type == 1)
4307 {
4308 struct Symbol * classSym;
4309
4310 if(!method->_class->symbol)
4311 method->_class->symbol = FindClass(method->_class->fullName);
4312 classSym = method->_class->symbol;
4313 if(!classSym->_import)
4314 {
4315 struct ModuleImport * module;
4316
4317 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->name)
4318 module = FindModule(method->_class->module);
4319 else
4320 module = mainModule;
4321 classSym->_import = __extension__ ({
4322 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
4323
4324 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
4325 });
4326 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4327 }
4328 if(!symbol)
4329 {
4330 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4331 }
4332 if(!symbol->_import)
4333 {
4334 symbol->_import = (struct ClassImport *)__extension__ ({
4335 struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
4336
4337 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
4338 });
4339 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4340 }
4341 if(!symbol)
4342 {
4343 symbol->type = method->dataType;
4344 if(symbol->type)
4345 symbol->type->refCount++;
4346 }
4347 }
4348 if(!method->dataType->dllExport)
4349 {
4350 imported = 0x1;
4351 if((method->_class->module != privateModule || !strcmp(method->_class->name, "float") || !strcmp(method->_class->name, "double")) && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + 24)))->importType != 1)
4352 dllImport = 0x1;
4353 }
4354 }
4355 if(method->type != 1 && method->dataType)
4356 DeclareType(method->dataType, 0x1, 0x1);
4357 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4358 {
4359 struct Declaration * decl;
4360 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4361 struct Declarator * d;
4362 struct Declarator * funcDecl;
4363 struct External * external;
4364
4365 specifiers = MkList();
4366 declarators = MkList();
4367 if(dllImport)
4368 ListAdd(specifiers, MkSpecifier(EXTERN));
4369 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4370 ListAdd(specifiers, MkSpecifier(STATIC));
4371 if(method->type == 1)
4372 {
4373 ListAdd(specifiers, MkSpecifier(INT));
4374 d = MkDeclaratorIdentifier(MkIdentifier(name));
4375 }
4376 else
4377 {
4378 d = MkDeclaratorIdentifier(MkIdentifier(name));
4379 if(dllImport)
4380 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4381 {
4382 struct Context * context = SetupTemplatesContext(method->_class);
4383
4384 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4385 FinishTemplatesContext(context);
4386 }
4387 funcDecl = GetFuncDecl(d);
4388 if(dllImport)
4389 {
4390 struct Specifier * spec, * next;
4391
4392 for(spec = (*specifiers).first; spec; spec = next)
4393 {
4394 next = spec->next;
4395 if(spec->type == 5)
4396 {
4397 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4398 FreeSpecifier(spec);
4399 }
4400 }
4401 }
4402 if(method->dataType && !method->dataType->staticMethod)
4403 {
4404 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
4405 {
4406 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
4407 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")));
4408 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
4409 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4410
4411 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
4412 {
4413 struct TypeName * param = (*funcDecl->function.parameters).first;
4414
4415 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
4416 FreeTypeName(param);
4417 }
4418 if(!funcDecl->function.parameters)
4419 funcDecl->function.parameters = MkList();
4420 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
4421 }
4422 }
4423 }
4424 ProcessDeclarator(d);
4425 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4426 decl = MkDeclaration(specifiers, declarators);
4427 ReplaceThisClassSpecifiers(specifiers, method->_class);
4428 if(symbol->pointerExternal)
4429 {
4430 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4431
4432 {
4433 *functionSymbol = *symbol;
4434 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4435 if(functionSymbol->type)
4436 functionSymbol->type->refCount++;
4437 }
4438 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4439 symbol->pointerExternal->symbol = functionSymbol;
4440 }
4441 external = MkExternalDeclaration(decl);
4442 if(curExternal)
4443 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4444 external->symbol = symbol;
4445 symbol->pointerExternal = external;
4446 }
4447 else if(ast)
4448 {
4449 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4450 }
4451 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4452 }
4453 }
4454
4455 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4456 {
4457 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4458 {
4459 unsigned int first = 0x1;
4460 int p = 0;
4461 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4462 int lastParam = -1;
4463 char className[1024];
4464
4465 strcpy(className, _class->fullName);
4466 for(param = _class->templateParams.first; param; param = param->next)
4467 {
4468 {
4469 if(first)
4470 strcat(className, "<");
4471 if(!first)
4472 strcat(className, ", ");
4473 if(lastParam + 1 != p)
4474 {
4475 strcat(className, param->name);
4476 strcat(className, " = ");
4477 }
4478 strcat(className, param->name);
4479 first = 0x0;
4480 lastParam = p;
4481 }
4482 p++;
4483 }
4484 if(!first)
4485 {
4486 int len = strlen(className);
4487
4488 if(className[len - 1] == '>')
4489 className[len++] = ' ';
4490 className[len++] = '>';
4491 className[len++] = '\0';
4492 }
4493 return __ecereNameSpace__ecere__sys__CopyString(className);
4494 }
4495 else
4496 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4497 }
4498
4499 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4500 {
4501 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4502 {
4503 unsigned int first = 0x1;
4504 int p = 0;
4505 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4506 int lastParam = -1;
4507 char className[1024];
4508
4509 strcpy(className, _class->fullName);
4510 for(param = _class->templateParams.first; param; param = param->next)
4511 {
4512 {
4513 if(first)
4514 strcat(className, "<");
4515 if(!first)
4516 strcat(className, ", ");
4517 if(lastParam + 1 != p)
4518 {
4519 strcat(className, param->name);
4520 strcat(className, " = ");
4521 }
4522 strcat(className, param->name);
4523 first = 0x0;
4524 lastParam = p;
4525 }
4526 p++;
4527 }
4528 if(!first)
4529 {
4530 int len = strlen(className);
4531
4532 if(className[len - 1] == '>')
4533 className[len++] = ' ';
4534 className[len++] = '>';
4535 className[len++] = '\0';
4536 }
4537 return MkClassType(className);
4538 }
4539 else
4540 {
4541 return MkClassType(_class->fullName);
4542 }
4543 }
4544
4545 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4546 {
4547 if(specs != (((void *)0)) && _class)
4548 {
4549 struct Specifier * spec;
4550
4551 for(spec = specs->first; spec; spec = spec->next)
4552 {
4553 if(spec->type == 0 && spec->specifier == THISCLASS)
4554 {
4555 spec->type = 1;
4556 spec->name = ReplaceThisClass(_class);
4557 spec->symbol = FindClass(spec->name);
4558 }
4559 }
4560 }
4561 }
4562
4563 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4564
4565 struct __ecereNameSpace__ecere__com__GlobalFunction
4566 {
4567 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4568 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4569 char *  name;
4570 int (*  function)();
4571 struct __ecereNameSpace__ecere__com__Instance * module;
4572 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
4573 char *  dataTypeString;
4574 struct Type * dataType;
4575 void *  symbol;
4576 } __attribute__ ((gcc_struct));
4577
4578 extern struct Context * globalContext;
4579
4580 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4581
4582 struct FunctionImport
4583 {
4584 struct FunctionImport * prev;
4585 struct FunctionImport * next;
4586 char *  name;
4587 } __attribute__ ((gcc_struct));
4588
4589 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4590 {
4591 struct Symbol * symbol = function->symbol;
4592
4593 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4594 {
4595 unsigned int imported = 0x0;
4596 unsigned int dllImport = 0x0;
4597
4598 if(!function->dataType)
4599 {
4600 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4601 if(!function->dataType->thisClass)
4602 function->dataType->staticMethod = 0x1;
4603 }
4604 if(inCompiler)
4605 {
4606 if(!symbol)
4607 {
4608 struct ModuleImport * module = FindModule(function->module);
4609
4610 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4611 if(module->name)
4612 {
4613 if(!function->dataType->dllExport)
4614 {
4615 symbol->_import = (struct ClassImport *)__extension__ ({
4616 struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
4617
4618 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
4619 });
4620 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4621 }
4622 }
4623 {
4624 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4625 if(!symbol->type->thisClass)
4626 symbol->type->staticMethod = 0x1;
4627 }
4628 }
4629 imported = symbol->_import ? 0x1 : 0x0;
4630 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1)
4631 dllImport = 0x1;
4632 }
4633 DeclareType(function->dataType, 0x1, 0x1);
4634 if(inCompiler)
4635 {
4636 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4637 {
4638 struct Declaration * decl;
4639 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4640 struct Declarator * d;
4641 struct Declarator * funcDecl;
4642 struct External * external;
4643
4644 specifiers = MkList();
4645 declarators = MkList();
4646 ListAdd(specifiers, MkSpecifier(EXTERN));
4647 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4648 if(dllImport)
4649 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4650 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4651 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType == 1)
4652 {
4653 struct Specifier * spec;
4654
4655 for(spec = (*specifiers).first; spec; spec = spec->next)
4656 if(spec->type == 5 && spec->extDecl && spec->extDecl->type == 0 && !strcmp(spec->extDecl->s, "dllexport"))
4657 {
4658 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4659 FreeSpecifier(spec);
4660 break;
4661 }
4662 }
4663 funcDecl = GetFuncDecl(d);
4664 if(funcDecl && !funcDecl->function.parameters)
4665 {
4666 funcDecl->function.parameters = MkList();
4667 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4668 }
4669 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4670 {
4671 struct Context * oldCtx = curContext;
4672
4673 curContext = globalContext;
4674 decl = MkDeclaration(specifiers, declarators);
4675 curContext = oldCtx;
4676 }
4677 if(symbol->pointerExternal)
4678 {
4679 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4680
4681 {
4682 *functionSymbol = *symbol;
4683 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4684 if(functionSymbol->type)
4685 functionSymbol->type->refCount++;
4686 }
4687 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4688 symbol->pointerExternal->symbol = functionSymbol;
4689 }
4690 external = MkExternalDeclaration(decl);
4691 if(curExternal)
4692 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4693 external->symbol = symbol;
4694 symbol->pointerExternal = external;
4695 }
4696 else
4697 {
4698 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4699 }
4700 if(curExternal)
4701 symbol->id = curExternal->symbol->idCode;
4702 }
4703 }
4704 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1) ? 0x1 : 0x0;
4705 }
4706
4707 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4708
4709 struct GlobalData
4710 {
4711 uintptr_t key;
4712 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4713 struct __ecereNameSpace__ecere__sys__BTNode * left;
4714 struct __ecereNameSpace__ecere__sys__BTNode * right;
4715 int depth;
4716 struct __ecereNameSpace__ecere__com__Instance * module;
4717 char *  dataTypeString;
4718 struct Type * dataType;
4719 void *  symbol;
4720 char *  fullName;
4721 } __attribute__ ((gcc_struct));
4722
4723 void DeclareGlobalData(struct GlobalData * data)
4724 {
4725 struct Symbol * symbol = data->symbol;
4726
4727 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4728 {
4729 if(inCompiler)
4730 {
4731 if(!symbol)
4732 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4733 }
4734 if(!data->dataType)
4735 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4736 DeclareType(data->dataType, 0x1, 0x1);
4737 if(inCompiler)
4738 {
4739 if(!symbol->pointerExternal)
4740 {
4741 struct Declaration * decl;
4742 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4743 struct Declarator * d;
4744 struct External * external;
4745
4746 specifiers = MkList();
4747 declarators = MkList();
4748 ListAdd(specifiers, MkSpecifier(EXTERN));
4749 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4750 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4751 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4752 decl = MkDeclaration(specifiers, declarators);
4753 external = MkExternalDeclaration(decl);
4754 if(curExternal)
4755 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4756 external->symbol = symbol;
4757 symbol->pointerExternal = external;
4758 }
4759 else
4760 {
4761 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4762 }
4763 if(curExternal)
4764 symbol->id = curExternal->symbol->idCode;
4765 }
4766 }
4767 }
4768
4769 struct Conversion
4770 {
4771 struct Conversion * prev, * next;
4772 struct __ecereNameSpace__ecere__com__Property * convert;
4773 unsigned int isGet;
4774 struct Type * resultType;
4775 } __attribute__ ((gcc_struct));
4776
4777 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4778
4779 extern void Compiler_Warning(char *  format, ...);
4780
4781 void PrintType(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
4782
4783 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)
4784 {
4785 if(source && dest)
4786 {
4787 if(source->kind == 20 && dest->kind != 20)
4788 {
4789 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4790
4791 if(type)
4792 source = type;
4793 }
4794 if(dest->kind == 20 && source->kind != 20)
4795 {
4796 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4797
4798 if(type)
4799 dest = type;
4800 }
4801 if(dest->classObjectType == 2)
4802 {
4803 if(source->classObjectType != 3)
4804 return 0x1;
4805 else
4806 {
4807 if((dest->_class && strcmp(dest->_class->string, "class")) || (source->_class && strcmp(source->_class->string, "class")))
4808 {
4809 return 0x1;
4810 }
4811 }
4812 }
4813 else
4814 {
4815 if(source->classObjectType == 3)
4816 return 0x1;
4817 if(dest->classObjectType == 3 && source->classObjectType != 2)
4818 return 0x1;
4819 }
4820 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4821 {
4822 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4823 return 0x1;
4824 }
4825 if(dest->kind == 14 && source->kind != 0)
4826 return 0x1;
4827 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))
4828 return 0x1;
4829 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))
4830 return 0x1;
4831 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4832 {
4833 if(source->_class->registered && source->_class->registered->type == 3)
4834 {
4835 if(conversions != (((void *)0)))
4836 {
4837 if(source->_class->registered == dest->_class->registered)
4838 return 0x1;
4839 }
4840 else
4841 {
4842 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4843
4844 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4845 ;
4846 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4847 ;
4848 if(sourceBase == destBase)
4849 return 0x1;
4850 }
4851 }
4852 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))
4853 return 0x1;
4854 else
4855 {
4856 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))
4857 {
4858 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4859 {
4860 return 0x1;
4861 }
4862 }
4863 }
4864 }
4865 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
4866 return 0x1;
4867 if(doConversion)
4868 {
4869 if(source->kind == 8)
4870 {
4871 struct __ecereNameSpace__ecere__com__Class * _class;
4872
4873 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4874 {
4875 struct __ecereNameSpace__ecere__com__Property * convert;
4876
4877 for(convert = _class->conversions.first; convert; convert = convert->next)
4878 {
4879 if(convert->memberAccess == 1 || _class->module == privateModule)
4880 {
4881 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4882
4883 if(!convert->dataType)
4884 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4885 if((!isConversionExploration || convert->dataType->kind == 8 || !strcmp(_class->name, "String")) && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), (convert->dataType->kind == 8 && !strcmp(convert->dataTypeString, "String")) ? 0x1 : 0x0, convert->dataType->kind == 8, 0x0, 0x1))
4886 {
4887 if(!conversions && !convert->Get)
4888 return 0x1;
4889 else if(conversions != (((void *)0)))
4890 {
4891 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))
4892 return 0x1;
4893 else
4894 {
4895 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4896
4897 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4898 return 0x1;
4899 }
4900 }
4901 }
4902 }
4903 }
4904 }
4905 }
4906 if(dest->kind == 8)
4907 {
4908 struct __ecereNameSpace__ecere__com__Class * _class;
4909
4910 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4911 {
4912 struct __ecereNameSpace__ecere__com__Property * convert;
4913
4914 for(convert = _class->conversions.first; convert; convert = convert->next)
4915 {
4916 if(convert->memberAccess == 1 || _class->module == privateModule)
4917 {
4918 if(!convert->dataType)
4919 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4920 if(convert->dataType != dest && MatchTypes(source, convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1))
4921 {
4922 if(!conversions && !convert->Set)
4923 return 0x1;
4924 else if(conversions != (((void *)0)))
4925 {
4926 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))
4927 return 0x1;
4928 else
4929 {
4930 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4931
4932 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4933 return 0x1;
4934 }
4935 }
4936 }
4937 }
4938 }
4939 }
4940 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
4941 {
4942 if(!dest->_class->registered->dataType)
4943 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
4944 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
4945 {
4946 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, dest->_class->registered->dataType->kind == 8, 0x0, 0x0))
4947 {
4948 return 0x1;
4949 }
4950 }
4951 }
4952 }
4953 if(source->kind == 8)
4954 {
4955 struct __ecereNameSpace__ecere__com__Class * _class;
4956
4957 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4958 {
4959 struct __ecereNameSpace__ecere__com__Property * convert;
4960
4961 for(convert = _class->conversions.first; convert; convert = convert->next)
4962 {
4963 if(convert->memberAccess == 1 || _class->module == privateModule)
4964 {
4965 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4966
4967 if(!convert->dataType)
4968 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4969 if(convert->dataType != source && (!isConversionExploration || convert->dataType->kind == 8 || !strcmp(_class->name, "String")) && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), convert->dataType->kind == 8, convert->dataType->kind == 8, 0x0, 0x1))
4970 {
4971 if(!conversions && !convert->Get)
4972 return 0x1;
4973 else if(conversions != (((void *)0)))
4974 {
4975 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))
4976 return 0x1;
4977 else
4978 {
4979 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4980
4981 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4982 return 0x1;
4983 }
4984 }
4985 }
4986 }
4987 }
4988 }
4989 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
4990 {
4991 if(!source->_class->registered->dataType)
4992 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
4993 if(!isConversionExploration || source->_class->registered->dataType->kind == 8 || !strcmp(source->_class->registered->name, "String"))
4994 {
4995 if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), source->_class->registered->dataType->kind == 8, source->_class->registered->dataType->kind == 8, 0x0, 0x0))
4996 return 0x1;
4997 else if(MatchTypes(dest, source->_class->registered->dataType, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
4998 return 0x1;
4999 }
5000 }
5001 }
5002 }
5003 if(source->kind == 8 || source->kind == 19)
5004 ;
5005 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
5006 return 0x1;
5007 else if(dest->kind == 7 && source->kind == 6)
5008 return 0x1;
5009 else if(dest->kind == 2 && (source->kind == 1 || source->kind == 24))
5010 return 0x1;
5011 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 23))
5012 return 0x1;
5013 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 22 || source->kind == 23))
5014 return 0x1;
5015 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 23 || source->kind == 4))
5016 return 0x1;
5017 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 4 || source->kind == 22))
5018 return 0x1;
5019 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))
5020 return 0x1;
5021 else if(dest->kind == 15 && !isConversionExploration && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 5 || source->kind == 4 || source->kind == 22 || source->kind == 23))
5022 return 0x1;
5023 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)))
5024 {
5025 struct Type * paramSource, * paramDest;
5026
5027 if(dest->kind == 16)
5028 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
5029 if(source->kind == 16)
5030 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
5031 if(dest->kind == 13 && dest->type->kind == 11)
5032 dest = dest->type;
5033 if(source->kind == 13 && source->type->kind == 11)
5034 source = source->type;
5035 if(dest->kind == 16)
5036 dest = dest->method->dataType;
5037 if(source->kind == 16)
5038 source = source->method->dataType;
5039 paramSource = source->params.first;
5040 if(paramSource && paramSource->kind == 0)
5041 paramSource = (((void *)0));
5042 paramDest = dest->params.first;
5043 if(paramDest && paramDest->kind == 0)
5044 paramDest = (((void *)0));
5045 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
5046 {
5047 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))))
5048 {
5049 if(paramDest && paramDest->kind == 8)
5050 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), paramDest->_class->string);
5051 else
5052 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class should not take an object\n", (((void *)0))));
5053 return 0x0;
5054 }
5055 paramDest = paramDest->next;
5056 }
5057 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
5058 {
5059 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
5060 {
5061 if(dest->thisClass)
5062 {
5063 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
5064 {
5065 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
5066 return 0x0;
5067 }
5068 }
5069 else
5070 {
5071 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
5072 {
5073 if(owningClassDest)
5074 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
5075 else
5076 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "overriding class expected to be derived from method class\n", (((void *)0))));
5077 return 0x0;
5078 }
5079 }
5080 paramSource = paramSource->next;
5081 }
5082 else
5083 {
5084 if(dest->thisClass)
5085 {
5086 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
5087 {
5088 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
5089 return 0x0;
5090 }
5091 }
5092 else
5093 {
5094 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
5095 {
5096 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), source->thisClass->registered->fullName);
5097 return 0x0;
5098 }
5099 }
5100 }
5101 }
5102 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5103 {
5104 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible return type for function\n", (((void *)0))));
5105 return 0x0;
5106 }
5107 for(; paramDest; paramDest = paramDest->next)
5108 {
5109 if(!paramSource)
5110 {
5111 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "not enough parameters\n", (((void *)0))));
5112 return 0x0;
5113 }
5114 {
5115 struct Type * paramDestType = paramDest;
5116 struct Type * paramSourceType = paramSource;
5117 struct Type * type = paramDestType;
5118
5119 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
5120 {
5121 int id = 0;
5122 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
5123 struct __ecereNameSpace__ecere__com__Class * sClass;
5124
5125 for(sClass = owningClassSource; sClass; sClass = sClass->base)
5126 {
5127 id = 0;
5128 if(sClass->templateClass)
5129 sClass = sClass->templateClass;
5130 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
5131 {
5132 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
5133 {
5134 for(sClass = sClass->base; sClass; sClass = sClass->base)
5135 {
5136 if(sClass->templateClass)
5137 sClass = sClass->templateClass;
5138 id += sClass->templateParams.count;
5139 }
5140 break;
5141 }
5142 id++;
5143 }
5144 if(curParam)
5145 break;
5146 }
5147 if(curParam)
5148 {
5149 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
5150
5151 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
5152 }
5153 }
5154 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)))
5155 {
5156 char type[1024];
5157
5158 type[0] = (char)0;
5159 PrintType(paramDest, type, 0x0, 0x1);
5160 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
5161 if(paramDestType != paramDest)
5162 FreeType(paramDestType);
5163 return 0x0;
5164 }
5165 if(paramDestType != paramDest)
5166 FreeType(paramDestType);
5167 }
5168 paramSource = paramSource->next;
5169 }
5170 if(paramSource)
5171 {
5172 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many parameters\n", (((void *)0))));
5173 return 0x0;
5174 }
5175 return 0x1;
5176 }
5177 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
5178 {
5179 return 0x1;
5180 }
5181 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
5182 {
5183 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5184 return 0x1;
5185 }
5186 }
5187 return 0x0;
5188 }
5189
5190 static void FreeConvert(struct Conversion * convert)
5191 {
5192 if(convert->resultType)
5193 FreeType(convert->resultType);
5194 }
5195
5196 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
5197
5198 struct __ecereNameSpace__ecere__com__BTNamedLink
5199 {
5200 char *  name;
5201 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
5202 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
5203 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
5204 int depth;
5205 void *  data;
5206 } __attribute__ ((gcc_struct));
5207
5208 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
5209
5210 struct __ecereNameSpace__ecere__com__EnumClassData
5211 {
5212 struct __ecereNameSpace__ecere__sys__OldList values;
5213 int largest;
5214 } __attribute__ ((gcc_struct));
5215
5216 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
5217
5218 struct __ecereNameSpace__ecere__sys__NamedLink
5219 {
5220 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
5221 struct __ecereNameSpace__ecere__sys__NamedLink * next;
5222 char *  name;
5223 void *  data;
5224 } __attribute__ ((gcc_struct));
5225
5226 extern void FreeExpContents(struct Expression * exp);
5227
5228 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
5229
5230 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
5231
5232 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
5233
5234 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
5235
5236 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (*  freeFn)(void * ));
5237
5238 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5239 {
5240 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
5241
5242 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)))
5243 {
5244 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
5245
5246 if(_class->type == 4)
5247 {
5248 struct __ecereNameSpace__ecere__sys__OldList converts =
5249 {
5250 0, 0, 0, 0, 0
5251 };
5252 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5253
5254 type->kind = 8;
5255 if(!_class->symbol)
5256 _class->symbol = FindClass(_class->fullName);
5257 type->_class = _class->symbol;
5258 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0))
5259 {
5260 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5261 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5262
5263 if(enumClass)
5264 {
5265 struct __ecereNameSpace__ecere__com__Class * baseClass;
5266
5267 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
5268 {
5269 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
5270
5271 for(value = e->values.first; value; value = value->next)
5272 {
5273 if(!strcmp(value->name, string))
5274 break;
5275 }
5276 if(value)
5277 {
5278 FreeExpContents(sourceExp);
5279 FreeType(sourceExp->expType);
5280 sourceExp->isConstant = 0x1;
5281 sourceExp->expType = MkClassType(baseClass->fullName);
5282 {
5283 char constant[256];
5284
5285 sourceExp->type = 2;
5286 if(!strcmp(baseClass->dataTypeString, "int"))
5287 sprintf(constant, "%d", (int)value->data);
5288 else
5289 sprintf(constant, "0x%X", (int)value->data);
5290 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5291 }
5292 while(converts.first)
5293 {
5294 struct Conversion * convert = converts.first;
5295
5296 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
5297 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5298 }
5299 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5300 return 0x1;
5301 }
5302 }
5303 }
5304 }
5305 if(converts.first)
5306 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
5307 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5308 }
5309 }
5310 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)))
5311 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5312 return 0x1;
5313 return 0x0;
5314 }
5315
5316 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5317
5318 struct __ecereNameSpace__ecere__com__SubModule
5319 {
5320 struct __ecereNameSpace__ecere__com__SubModule * prev;
5321 struct __ecereNameSpace__ecere__com__SubModule * next;
5322 struct __ecereNameSpace__ecere__com__Instance * module;
5323 int importMode;
5324 } __attribute__ ((gcc_struct));
5325
5326 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5327 {
5328 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5329
5330 if(searchFor == searchIn)
5331 return 0x1;
5332 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
5333 {
5334 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->application)
5335 {
5336 if(ModuleVisibility(subModule->module, searchFor))
5337 return 0x1;
5338 }
5339 }
5340 return 0x0;
5341 }
5342
5343 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5344
5345 struct __ecereNameSpace__ecere__com__Application
5346 {
5347 int argc;
5348 char * *  argv;
5349 int exitCode;
5350 unsigned int isGUIApp;
5351 struct __ecereNameSpace__ecere__sys__OldList allModules;
5352 char *  parsedCommand;
5353 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5354 } __attribute__ ((gcc_struct));
5355
5356 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5357 {
5358 struct __ecereNameSpace__ecere__com__Instance * module;
5359
5360 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))
5361 return 0x1;
5362 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))
5363 return 0x1;
5364 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))
5365 return 0x1;
5366 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)
5367 {
5368 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5369 return 0x1;
5370 }
5371 return 0x0;
5372 }
5373
5374 extern struct Expression * CopyExpression(struct Expression * exp);
5375
5376 extern unsigned long strtoul(const char *  nptr, char * *  endptr, int base);
5377
5378 void ReadString(char *  output, char *  string);
5379
5380 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5381
5382 extern struct TypeName * QMkClass(char *  spec, struct Declarator * decl);
5383
5384 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5385
5386 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
5387 {
5388 struct Type * source;
5389 struct Type * realDest = dest;
5390 struct Type * backupSourceExpType = (((void *)0));
5391 struct Expression * computedExp = sourceExp;
5392
5393 dest->refCount++;
5394 if(sourceExp->isConstant && sourceExp->type != 2 && sourceExp->type != 0 && sourceExp->type != 11 && dest->kind == 8 && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5395 {
5396 computedExp = CopyExpression(sourceExp);
5397 ComputeExpression(computedExp);
5398 }
5399 source = sourceExp->expType;
5400 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
5401 {
5402 if(computedExp != sourceExp)
5403 {
5404 FreeExpression(computedExp);
5405 computedExp = sourceExp;
5406 }
5407 FreeType(dest);
5408 return 0x1;
5409 }
5410 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5411 {
5412 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
5413 {
5414 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5415
5416 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5417 ;
5418 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5419 ;
5420 if(sourceBase == destBase)
5421 {
5422 if(computedExp != sourceExp)
5423 {
5424 FreeExpression(computedExp);
5425 computedExp = sourceExp;
5426 }
5427 FreeType(dest);
5428 return 0x1;
5429 }
5430 }
5431 }
5432 if(source)
5433 {
5434 struct __ecereNameSpace__ecere__sys__OldList * specs;
5435 unsigned int flag = 0x0;
5436 long long value = (((int)0x7fffffff));
5437
5438 source->refCount++;
5439 if(computedExp->type == 2)
5440 {
5441 if(source->isSigned)
5442 value = strtoll(computedExp->constant, (((void *)0)), 0);
5443 else
5444 value = strtoull(computedExp->constant, (((void *)0)), 0);
5445 }
5446 else if(computedExp->type == 4 && sourceExp->op.op == '-' && !computedExp->op.exp1 && computedExp->op.exp2 && computedExp->op.exp2->type == 2)
5447 {
5448 if(source->isSigned)
5449 value = -strtoll(computedExp->op.exp2->constant, (((void *)0)), 0);
5450 else
5451 value = -strtoull(computedExp->op.exp2->constant, (((void *)0)), 0);
5452 }
5453 if(computedExp != sourceExp)
5454 {
5455 FreeExpression(computedExp);
5456 computedExp = sourceExp;
5457 }
5458 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
5459 {
5460 FreeType(source);
5461 source = __extension__ ({
5462 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5463
5464 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0x0, __ecereInstance1->refCount = 1, __ecereInstance1;
5465 });
5466 }
5467 if(dest->kind == 8)
5468 {
5469 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5470
5471 if(_class && _class->type == 3)
5472 {
5473 if(source->kind != 8)
5474 {
5475 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5476 struct Type * tempDest, * tempSource;
5477
5478 for(; _class->base->type != 1000; _class = _class->base)
5479 ;
5480 tempSource = dest;
5481 tempDest = tempType;
5482 tempType->kind = 8;
5483 if(!_class->symbol)
5484 _class->symbol = FindClass(_class->fullName);
5485 tempType->_class = _class->symbol;
5486 tempType->truth = dest->truth;
5487 if(tempType->_class)
5488 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5489 backupSourceExpType = sourceExp->expType;
5490 sourceExp->expType = dest;
5491 dest->refCount++;
5492 flag = 0x1;
5493 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5494 }
5495 }
5496 if(_class && _class->type == 2 && source->kind != 8)
5497 {
5498 if(!dest->_class->registered->dataType)
5499 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5500 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5501 {
5502 FreeType(source);
5503 FreeType(sourceExp->expType);
5504 source = sourceExp->expType = MkClassType(dest->_class->string);
5505 source->refCount++;
5506 }
5507 }
5508 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5509 {
5510 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5511 struct Declarator * decl;
5512 char string[1024];
5513
5514 ReadString(string, sourceExp->string);
5515 decl = SpecDeclFromString(string, specs, (((void *)0)));
5516 FreeExpContents(sourceExp);
5517 FreeType(sourceExp->expType);
5518 sourceExp->type = 24;
5519 sourceExp->_classExp.specifiers = specs;
5520 sourceExp->_classExp.decl = decl;
5521 sourceExp->expType = dest;
5522 dest->refCount++;
5523 FreeType(source);
5524 FreeType(dest);
5525 if(backupSourceExpType)
5526 FreeType(backupSourceExpType);
5527 return 0x1;
5528 }
5529 }
5530 else if(source->kind == 8)
5531 {
5532 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5533
5534 if(_class && (_class->type == 3 || _class->type == 2))
5535 {
5536 if(dest->kind != 8)
5537 {
5538 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5539 struct Type * tempDest, * tempSource;
5540
5541 if(!source->_class->registered->dataType)
5542 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5543 for(; _class->base->type != 1000; _class = _class->base)
5544 ;
5545 tempDest = source;
5546 tempSource = tempType;
5547 tempType->kind = 8;
5548 tempType->_class = FindClass(_class->fullName);
5549 tempType->truth = source->truth;
5550 tempType->classObjectType = source->classObjectType;
5551 if(tempType->_class)
5552 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5553 if(conversions->last)
5554 {
5555 ((struct Conversion *)conversions->last)->resultType = dest;
5556 dest->refCount++;
5557 }
5558 FreeType(sourceExp->expType);
5559 sourceExp->expType = MkClassType(_class->fullName);
5560 sourceExp->expType->truth = source->truth;
5561 sourceExp->expType->classObjectType = source->classObjectType;
5562 if(!sourceExp->destType)
5563 {
5564 FreeType(sourceExp->destType);
5565 sourceExp->destType = sourceExp->expType;
5566 if(sourceExp->expType)
5567 sourceExp->expType->refCount++;
5568 }
5569 if(!_class->dataType)
5570 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5571 FreeType(dest);
5572 dest = MkClassType(source->_class->string);
5573 dest->truth = source->truth;
5574 dest->classObjectType = source->classObjectType;
5575 FreeType(source);
5576 source = _class->dataType;
5577 source->refCount++;
5578 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5579 }
5580 }
5581 }
5582 if(!flag)
5583 {
5584 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5585 {
5586 FreeType(source);
5587 FreeType(dest);
5588 return 0x1;
5589 }
5590 }
5591 if(dest->kind == 8)
5592 {
5593 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5594 unsigned int fittingValue = 0x0;
5595
5596 if(_class && _class->type == 4)
5597 {
5598 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5599 struct __ecereNameSpace__ecere__com__EnumClassData * c = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5600
5601 if(c && value >= 0 && value <= c->largest)
5602 fittingValue = 0x1;
5603 }
5604 if(_class && !dest->truth && (_class->type == 3 || fittingValue || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5605 {
5606 if(_class->type == 0 || _class->type == 5)
5607 {
5608 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5609
5610 *newExp = *sourceExp;
5611 if(sourceExp->destType)
5612 sourceExp->destType->refCount++;
5613 if(sourceExp->expType)
5614 sourceExp->expType->refCount++;
5615 sourceExp->type = 11;
5616 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5617 sourceExp->cast.exp = newExp;
5618 FreeType(sourceExp->expType);
5619 sourceExp->expType = (((void *)0));
5620 ProcessExpressionType(sourceExp);
5621 if(!inCompiler)
5622 {
5623 FreeType(sourceExp->expType);
5624 sourceExp->expType = dest;
5625 }
5626 FreeType(source);
5627 if(inCompiler)
5628 FreeType(dest);
5629 if(backupSourceExpType)
5630 FreeType(backupSourceExpType);
5631 return 0x1;
5632 }
5633 if(!_class->dataType)
5634 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5635 FreeType(dest);
5636 dest = _class->dataType;
5637 dest->refCount++;
5638 }
5639 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))
5640 {
5641 specs = MkListOne(MkSpecifier(DOUBLE));
5642 }
5643 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))
5644 {
5645 specs = MkListOne(MkSpecifier(FLOAT));
5646 }
5647 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))
5648 {
5649 specs = MkList();
5650 if(!dest->isSigned)
5651 ListAdd(specs, MkSpecifier(UNSIGNED));
5652 ListAdd(specs, MkSpecifier(INT64));
5653 }
5654 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
5655 {
5656 specs = MkList();
5657 if(!dest->isSigned)
5658 ListAdd(specs, MkSpecifier(UNSIGNED));
5659 ListAdd(specs, MkSpecifier(INT));
5660 }
5661 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5662 {
5663 specs = MkList();
5664 if(!dest->isSigned)
5665 ListAdd(specs, MkSpecifier(UNSIGNED));
5666 ListAdd(specs, MkSpecifier(SHORT));
5667 }
5668 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 24 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5669 {
5670 specs = MkList();
5671 if(!dest->isSigned)
5672 ListAdd(specs, MkSpecifier(UNSIGNED));
5673 ListAdd(specs, MkSpecifier(CHAR));
5674 }
5675 else
5676 {
5677 FreeType(source);
5678 FreeType(dest);
5679 if(backupSourceExpType)
5680 {
5681 if(sourceExp->expType)
5682 FreeType(sourceExp->expType);
5683 sourceExp->expType = backupSourceExpType;
5684 }
5685 return 0x0;
5686 }
5687 }
5688 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))
5689 {
5690 specs = MkListOne(MkSpecifier(DOUBLE));
5691 }
5692 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))
5693 {
5694 specs = MkListOne(MkSpecifier(FLOAT));
5695 }
5696 else if(dest->kind == 24 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (value == 1 || value == 0))
5697 {
5698 specs = MkList();
5699 ListAdd(specs, MkSpecifier(BOOL));
5700 }
5701 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)))
5702 {
5703 specs = MkList();
5704 if(!dest->isSigned)
5705 ListAdd(specs, MkSpecifier(UNSIGNED));
5706 ListAdd(specs, MkSpecifier(CHAR));
5707 }
5708 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)))))
5709 {
5710 specs = MkList();
5711 if(!dest->isSigned)
5712 ListAdd(specs, MkSpecifier(UNSIGNED));
5713 ListAdd(specs, MkSpecifier(SHORT));
5714 }
5715 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3))
5716 {
5717 specs = MkList();
5718 if(!dest->isSigned)
5719 ListAdd(specs, MkSpecifier(UNSIGNED));
5720 ListAdd(specs, MkSpecifier(INT));
5721 }
5722 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5723 {
5724 specs = MkList();
5725 if(!dest->isSigned)
5726 ListAdd(specs, MkSpecifier(UNSIGNED));
5727 ListAdd(specs, MkSpecifier(INT64));
5728 }
5729 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
5730 {
5731 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5732 }
5733 else
5734 {
5735 FreeType(source);
5736 FreeType(dest);
5737 if(backupSourceExpType)
5738 {
5739 if(sourceExp->expType)
5740 FreeType(sourceExp->expType);
5741 sourceExp->expType = backupSourceExpType;
5742 }
5743 return 0x0;
5744 }
5745 if(!flag && !sourceExp->opDestType)
5746 {
5747 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5748
5749 *newExp = *sourceExp;
5750 newExp->prev = (((void *)0));
5751 newExp->next = (((void *)0));
5752 if(sourceExp->destType)
5753 sourceExp->destType->refCount++;
5754 if(sourceExp->expType)
5755 sourceExp->expType->refCount++;
5756 sourceExp->type = 11;
5757 if(realDest->kind == 8)
5758 {
5759 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5760 FreeList(specs, FreeSpecifier);
5761 }
5762 else
5763 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5764 if(newExp->type == 4)
5765 {
5766 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5767 }
5768 else
5769 sourceExp->cast.exp = newExp;
5770 FreeType(sourceExp->expType);
5771 sourceExp->expType = (((void *)0));
5772 ProcessExpressionType(sourceExp);
5773 }
5774 else
5775 FreeList(specs, FreeSpecifier);
5776 FreeType(dest);
5777 FreeType(source);
5778 if(backupSourceExpType)
5779 FreeType(backupSourceExpType);
5780 return 0x1;
5781 }
5782 else
5783 {
5784 if(computedExp != sourceExp)
5785 {
5786 FreeExpression(computedExp);
5787 computedExp = sourceExp;
5788 }
5789 while((sourceExp->type == 5 || sourceExp->type == 32) && sourceExp->list)
5790 sourceExp = (*sourceExp->list).last;
5791 if(sourceExp->type == 0)
5792 {
5793 struct Identifier * id = sourceExp->identifier;
5794
5795 if(dest->kind == 8)
5796 {
5797 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5798 {
5799 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5800 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5801
5802 if(enumClass)
5803 {
5804 for(; _class && _class->type == 4; _class = _class->base)
5805 {
5806 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5807 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5808
5809 for(value = e->values.first; value; value = value->next)
5810 {
5811 if(!strcmp(value->name, id->string))
5812 break;
5813 }
5814 if(value)
5815 {
5816 FreeExpContents(sourceExp);
5817 FreeType(sourceExp->expType);
5818 sourceExp->isConstant = 0x1;
5819 sourceExp->expType = MkClassType(_class->fullName);
5820 {
5821 char constant[256];
5822
5823 sourceExp->type = 2;
5824 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5825 sprintf(constant, "%d", (int)value->data);
5826 else
5827 sprintf(constant, "0x%X", (int)value->data);
5828 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5829 }
5830 FreeType(dest);
5831 return 0x1;
5832 }
5833 }
5834 }
5835 }
5836 }
5837 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5838 {
5839 FreeType(dest);
5840 return 0x1;
5841 }
5842 }
5843 FreeType(dest);
5844 }
5845 return 0x0;
5846 }
5847
5848 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5849 {
5850 int value2 = op2->i;
5851
5852 exp->type = 2;
5853 exp->string = PrintInt((op1->i + value2));
5854 if(!exp->expType)
5855 {
5856 exp->expType = op1->type;
5857 if(op1->type)
5858 op1->type->refCount++;
5859 }
5860 return 0x1;
5861 }
5862
5863 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5864 {
5865 unsigned int value2 = op2->ui;
5866
5867 exp->type = 2;
5868 exp->string = PrintUInt((op1->ui + value2));
5869 if(!exp->expType)
5870 {
5871 exp->expType = op1->type;
5872 if(op1->type)
5873 op1->type->refCount++;
5874 }
5875 return 0x1;
5876 }
5877
5878 static unsigned int Int64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5879 {
5880 long long value2 = op2->i64;
5881
5882 exp->type = 2;
5883 exp->string = PrintInt64((op1->i64 + value2));
5884 if(!exp->expType)
5885 {
5886 exp->expType = op1->type;
5887 if(op1->type)
5888 op1->type->refCount++;
5889 }
5890 return 0x1;
5891 }
5892
5893 static unsigned int UInt64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5894 {
5895 uint64 value2 = op2->ui64;
5896
5897 exp->type = 2;
5898 exp->string = PrintUInt64((op1->ui64 + value2));
5899 if(!exp->expType)
5900 {
5901 exp->expType = op1->type;
5902 if(op1->type)
5903 op1->type->refCount++;
5904 }
5905 return 0x1;
5906 }
5907
5908 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5909 {
5910 short value2 = op2->s;
5911
5912 exp->type = 2;
5913 exp->string = PrintShort((op1->s + value2));
5914 if(!exp->expType)
5915 {
5916 exp->expType = op1->type;
5917 if(op1->type)
5918 op1->type->refCount++;
5919 }
5920 return 0x1;
5921 }
5922
5923 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5924 {
5925 unsigned short value2 = op2->us;
5926
5927 exp->type = 2;
5928 exp->string = PrintUShort((op1->us + value2));
5929 if(!exp->expType)
5930 {
5931 exp->expType = op1->type;
5932 if(op1->type)
5933 op1->type->refCount++;
5934 }
5935 return 0x1;
5936 }
5937
5938 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5939 {
5940 char value2 = op2->c;
5941
5942 exp->type = 2;
5943 exp->string = PrintChar((op1->c + value2));
5944 if(!exp->expType)
5945 {
5946 exp->expType = op1->type;
5947 if(op1->type)
5948 op1->type->refCount++;
5949 }
5950 return 0x1;
5951 }
5952
5953 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5954 {
5955 unsigned char value2 = op2->uc;
5956
5957 exp->type = 2;
5958 exp->string = PrintUChar((op1->uc + value2));
5959 if(!exp->expType)
5960 {
5961 exp->expType = op1->type;
5962 if(op1->type)
5963 op1->type->refCount++;
5964 }
5965 return 0x1;
5966 }
5967
5968 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5969 {
5970 float value2 = op2->f;
5971
5972 exp->type = 2;
5973 exp->string = PrintFloat((float)(op1->f + value2));
5974 if(!exp->expType)
5975 {
5976 exp->expType = op1->type;
5977 if(op1->type)
5978 op1->type->refCount++;
5979 }
5980 return 0x1;
5981 }
5982
5983 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5984 {
5985 double value2 = op2->d;
5986
5987 exp->type = 2;
5988 exp->string = PrintDouble((double)(op1->d + value2));
5989 if(!exp->expType)
5990 {
5991 exp->expType = op1->type;
5992 if(op1->type)
5993 op1->type->refCount++;
5994 }
5995 return 0x1;
5996 }
5997
5998 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5999 {
6000 int value2 = op2->i;
6001
6002 exp->type = 2;
6003 exp->string = PrintInt((op1->i - value2));
6004 if(!exp->expType)
6005 {
6006 exp->expType = op1->type;
6007 if(op1->type)
6008 op1->type->refCount++;
6009 }
6010 return 0x1;
6011 }
6012
6013 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6014 {
6015 unsigned int value2 = op2->ui;
6016
6017 exp->type = 2;
6018 exp->string = PrintUInt((op1->ui - value2));
6019 if(!exp->expType)
6020 {
6021 exp->expType = op1->type;
6022 if(op1->type)
6023 op1->type->refCount++;
6024 }
6025 return 0x1;
6026 }
6027
6028 static unsigned int Int64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6029 {
6030 long long value2 = op2->i64;
6031
6032 exp->type = 2;
6033 exp->string = PrintInt64((op1->i64 - value2));
6034 if(!exp->expType)
6035 {
6036 exp->expType = op1->type;
6037 if(op1->type)
6038 op1->type->refCount++;
6039 }
6040 return 0x1;
6041 }
6042
6043 static unsigned int UInt64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6044 {
6045 uint64 value2 = op2->ui64;
6046
6047 exp->type = 2;
6048 exp->string = PrintUInt64((op1->ui64 - value2));
6049 if(!exp->expType)
6050 {
6051 exp->expType = op1->type;
6052 if(op1->type)
6053 op1->type->refCount++;
6054 }
6055 return 0x1;
6056 }
6057
6058 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6059 {
6060 short value2 = op2->s;
6061
6062 exp->type = 2;
6063 exp->string = PrintShort((op1->s - value2));
6064 if(!exp->expType)
6065 {
6066 exp->expType = op1->type;
6067 if(op1->type)
6068 op1->type->refCount++;
6069 }
6070 return 0x1;
6071 }
6072
6073 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6074 {
6075 unsigned short value2 = op2->us;
6076
6077 exp->type = 2;
6078 exp->string = PrintUShort((op1->us - value2));
6079 if(!exp->expType)
6080 {
6081 exp->expType = op1->type;
6082 if(op1->type)
6083 op1->type->refCount++;
6084 }
6085 return 0x1;
6086 }
6087
6088 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6089 {
6090 char value2 = op2->c;
6091
6092 exp->type = 2;
6093 exp->string = PrintChar((op1->c - value2));
6094 if(!exp->expType)
6095 {
6096 exp->expType = op1->type;
6097 if(op1->type)
6098 op1->type->refCount++;
6099 }
6100 return 0x1;
6101 }
6102
6103 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6104 {
6105 unsigned char value2 = op2->uc;
6106
6107 exp->type = 2;
6108 exp->string = PrintUChar((op1->uc - value2));
6109 if(!exp->expType)
6110 {
6111 exp->expType = op1->type;
6112 if(op1->type)
6113 op1->type->refCount++;
6114 }
6115 return 0x1;
6116 }
6117
6118 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6119 {
6120 float value2 = op2->f;
6121
6122 exp->type = 2;
6123 exp->string = PrintFloat((float)(op1->f - value2));
6124 if(!exp->expType)
6125 {
6126 exp->expType = op1->type;
6127 if(op1->type)
6128 op1->type->refCount++;
6129 }
6130 return 0x1;
6131 }
6132
6133 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6134 {
6135 double value2 = op2->d;
6136
6137 exp->type = 2;
6138 exp->string = PrintDouble((double)(op1->d - value2));
6139 if(!exp->expType)
6140 {
6141 exp->expType = op1->type;
6142 if(op1->type)
6143 op1->type->refCount++;
6144 }
6145 return 0x1;
6146 }
6147
6148 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6149 {
6150 int value2 = op2->i;
6151
6152 exp->type = 2;
6153 exp->string = PrintInt((op1->i * value2));
6154 if(!exp->expType)
6155 {
6156 exp->expType = op1->type;
6157 if(op1->type)
6158 op1->type->refCount++;
6159 }
6160 return 0x1;
6161 }
6162
6163 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6164 {
6165 unsigned int value2 = op2->ui;
6166
6167 exp->type = 2;
6168 exp->string = PrintUInt((op1->ui * value2));
6169 if(!exp->expType)
6170 {
6171 exp->expType = op1->type;
6172 if(op1->type)
6173 op1->type->refCount++;
6174 }
6175 return 0x1;
6176 }
6177
6178 static unsigned int Int64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6179 {
6180 long long value2 = op2->i64;
6181
6182 exp->type = 2;
6183 exp->string = PrintInt64((op1->i64 * value2));
6184 if(!exp->expType)
6185 {
6186 exp->expType = op1->type;
6187 if(op1->type)
6188 op1->type->refCount++;
6189 }
6190 return 0x1;
6191 }
6192
6193 static unsigned int UInt64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6194 {
6195 uint64 value2 = op2->ui64;
6196
6197 exp->type = 2;
6198 exp->string = PrintUInt64((op1->ui64 * value2));
6199 if(!exp->expType)
6200 {
6201 exp->expType = op1->type;
6202 if(op1->type)
6203 op1->type->refCount++;
6204 }
6205 return 0x1;
6206 }
6207
6208 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6209 {
6210 short value2 = op2->s;
6211
6212 exp->type = 2;
6213 exp->string = PrintShort((op1->s * value2));
6214 if(!exp->expType)
6215 {
6216 exp->expType = op1->type;
6217 if(op1->type)
6218 op1->type->refCount++;
6219 }
6220 return 0x1;
6221 }
6222
6223 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6224 {
6225 unsigned short value2 = op2->us;
6226
6227 exp->type = 2;
6228 exp->string = PrintUShort((op1->us * value2));
6229 if(!exp->expType)
6230 {
6231 exp->expType = op1->type;
6232 if(op1->type)
6233 op1->type->refCount++;
6234 }
6235 return 0x1;
6236 }
6237
6238 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6239 {
6240 char value2 = op2->c;
6241
6242 exp->type = 2;
6243 exp->string = PrintChar((op1->c * value2));
6244 if(!exp->expType)
6245 {
6246 exp->expType = op1->type;
6247 if(op1->type)
6248 op1->type->refCount++;
6249 }
6250 return 0x1;
6251 }
6252
6253 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6254 {
6255 unsigned char value2 = op2->uc;
6256
6257 exp->type = 2;
6258 exp->string = PrintUChar((op1->uc * value2));
6259 if(!exp->expType)
6260 {
6261 exp->expType = op1->type;
6262 if(op1->type)
6263 op1->type->refCount++;
6264 }
6265 return 0x1;
6266 }
6267
6268 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6269 {
6270 float value2 = op2->f;
6271
6272 exp->type = 2;
6273 exp->string = PrintFloat((float)(op1->f * value2));
6274 if(!exp->expType)
6275 {
6276 exp->expType = op1->type;
6277 if(op1->type)
6278 op1->type->refCount++;
6279 }
6280 return 0x1;
6281 }
6282
6283 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6284 {
6285 double value2 = op2->d;
6286
6287 exp->type = 2;
6288 exp->string = PrintDouble((double)(op1->d * value2));
6289 if(!exp->expType)
6290 {
6291 exp->expType = op1->type;
6292 if(op1->type)
6293 op1->type->refCount++;
6294 }
6295 return 0x1;
6296 }
6297
6298 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6299 {
6300 int value2 = op2->i;
6301
6302 exp->type = 2;
6303 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
6304 if(!exp->expType)
6305 {
6306 exp->expType = op1->type;
6307 if(op1->type)
6308 op1->type->refCount++;
6309 }
6310 return 0x1;
6311 }
6312
6313 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6314 {
6315 unsigned int value2 = op2->ui;
6316
6317 exp->type = 2;
6318 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
6319 if(!exp->expType)
6320 {
6321 exp->expType = op1->type;
6322 if(op1->type)
6323 op1->type->refCount++;
6324 }
6325 return 0x1;
6326 }
6327
6328 static unsigned int Int64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6329 {
6330 long long value2 = op2->i64;
6331
6332 exp->type = 2;
6333 exp->string = PrintInt64(value2 ? (op1->i64 / value2) : 0);
6334 if(!exp->expType)
6335 {
6336 exp->expType = op1->type;
6337 if(op1->type)
6338 op1->type->refCount++;
6339 }
6340 return 0x1;
6341 }
6342
6343 static unsigned int UInt64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6344 {
6345 uint64 value2 = op2->ui64;
6346
6347 exp->type = 2;
6348 exp->string = PrintUInt64(value2 ? (op1->ui64 / value2) : 0);
6349 if(!exp->expType)
6350 {
6351 exp->expType = op1->type;
6352 if(op1->type)
6353 op1->type->refCount++;
6354 }
6355 return 0x1;
6356 }
6357
6358 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6359 {
6360 short value2 = op2->s;
6361
6362 exp->type = 2;
6363 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
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 UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6374 {
6375 unsigned short value2 = op2->us;
6376
6377 exp->type = 2;
6378 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
6379 if(!exp->expType)
6380 {
6381 exp->expType = op1->type;
6382 if(op1->type)
6383 op1->type->refCount++;
6384 }
6385 return 0x1;
6386 }
6387
6388 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6389 {
6390 char value2 = op2->c;
6391
6392 exp->type = 2;
6393 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
6394 if(!exp->expType)
6395 {
6396 exp->expType = op1->type;
6397 if(op1->type)
6398 op1->type->refCount++;
6399 }
6400 return 0x1;
6401 }
6402
6403 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6404 {
6405 unsigned char value2 = op2->uc;
6406
6407 exp->type = 2;
6408 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
6409 if(!exp->expType)
6410 {
6411 exp->expType = op1->type;
6412 if(op1->type)
6413 op1->type->refCount++;
6414 }
6415 return 0x1;
6416 }
6417
6418 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6419 {
6420 float value2 = op2->f;
6421
6422 exp->type = 2;
6423 exp->string = PrintFloat(op1->f / value2);
6424 if(!exp->expType)
6425 {
6426 exp->expType = op1->type;
6427 if(op1->type)
6428 op1->type->refCount++;
6429 }
6430 return 0x1;
6431 }
6432
6433 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6434 {
6435 double value2 = op2->d;
6436
6437 exp->type = 2;
6438 exp->string = PrintDouble(op1->d / value2);
6439 if(!exp->expType)
6440 {
6441 exp->expType = op1->type;
6442 if(op1->type)
6443 op1->type->refCount++;
6444 }
6445 return 0x1;
6446 }
6447
6448 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6449 {
6450 int value2 = op2->i;
6451
6452 exp->type = 2;
6453 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
6454 if(!exp->expType)
6455 {
6456 exp->expType = op1->type;
6457 if(op1->type)
6458 op1->type->refCount++;
6459 }
6460 return 0x1;
6461 }
6462
6463 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6464 {
6465 unsigned int value2 = op2->ui;
6466
6467 exp->type = 2;
6468 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
6469 if(!exp->expType)
6470 {
6471 exp->expType = op1->type;
6472 if(op1->type)
6473 op1->type->refCount++;
6474 }
6475 return 0x1;
6476 }
6477
6478 static unsigned int Int64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6479 {
6480 long long value2 = op2->i64;
6481
6482 exp->type = 2;
6483 exp->string = PrintInt64(value2 ? (op1->i64 % value2) : 0);
6484 if(!exp->expType)
6485 {
6486 exp->expType = op1->type;
6487 if(op1->type)
6488 op1->type->refCount++;
6489 }
6490 return 0x1;
6491 }
6492
6493 static unsigned int UInt64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6494 {
6495 uint64 value2 = op2->ui64;
6496
6497 exp->type = 2;
6498 exp->string = PrintUInt64(value2 ? (op1->ui64 % value2) : 0);
6499 if(!exp->expType)
6500 {
6501 exp->expType = op1->type;
6502 if(op1->type)
6503 op1->type->refCount++;
6504 }
6505 return 0x1;
6506 }
6507
6508 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6509 {
6510 short value2 = op2->s;
6511
6512 exp->type = 2;
6513 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
6514 if(!exp->expType)
6515 {
6516 exp->expType = op1->type;
6517 if(op1->type)
6518 op1->type->refCount++;
6519 }
6520 return 0x1;
6521 }
6522
6523 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6524 {
6525 unsigned short value2 = op2->us;
6526
6527 exp->type = 2;
6528 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
6529 if(!exp->expType)
6530 {
6531 exp->expType = op1->type;
6532 if(op1->type)
6533 op1->type->refCount++;
6534 }
6535 return 0x1;
6536 }
6537
6538 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6539 {
6540 char value2 = op2->c;
6541
6542 exp->type = 2;
6543 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
6544 if(!exp->expType)
6545 {
6546 exp->expType = op1->type;
6547 if(op1->type)
6548 op1->type->refCount++;
6549 }
6550 return 0x1;
6551 }
6552
6553 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6554 {
6555 unsigned char value2 = op2->uc;
6556
6557 exp->type = 2;
6558 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
6559 if(!exp->expType)
6560 {
6561 exp->expType = op1->type;
6562 if(op1->type)
6563 op1->type->refCount++;
6564 }
6565 return 0x1;
6566 }
6567
6568 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6569 {
6570 exp->type = 2;
6571 exp->string = PrintInt((-op1->i));
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 UIntNeg(struct Expression * exp, struct Operand * op1)
6582 {
6583 exp->type = 2;
6584 exp->string = PrintUInt((unsigned int)(-op1->ui));
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 Int64Neg(struct Expression * exp, struct Operand * op1)
6595 {
6596 exp->type = 2;
6597 exp->string = PrintInt64((-op1->i64));
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 UInt64Neg(struct Expression * exp, struct Operand * op1)
6608 {
6609 exp->type = 2;
6610 exp->string = PrintUInt64((uint64)(-op1->ui64));
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 ShortNeg(struct Expression * exp, struct Operand * op1)
6621 {
6622 exp->type = 2;
6623 exp->string = PrintShort((-op1->s));
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 UShortNeg(struct Expression * exp, struct Operand * op1)
6634 {
6635 exp->type = 2;
6636 exp->string = PrintUShort((unsigned short)(-op1->us));
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 CharNeg(struct Expression * exp, struct Operand * op1)
6647 {
6648 exp->type = 2;
6649 exp->string = PrintChar((-op1->c));
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 UCharNeg(struct Expression * exp, struct Operand * op1)
6660 {
6661 exp->type = 2;
6662 exp->string = PrintUChar((unsigned char)(-op1->uc));
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 FloatNeg(struct Expression * exp, struct Operand * op1)
6673 {
6674 exp->type = 2;
6675 exp->string = PrintFloat((float)(-op1->f));
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 DoubleNeg(struct Expression * exp, struct Operand * op1)
6686 {
6687 exp->type = 2;
6688 exp->string = PrintDouble((double)(-op1->d));
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 IntInc(struct Expression * exp, struct Operand * op1)
6699 {
6700 exp->type = 2;
6701 exp->string = PrintInt((++op1->i));
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 UIntInc(struct Expression * exp, struct Operand * op1)
6712 {
6713 exp->type = 2;
6714 exp->string = PrintUInt((++op1->ui));
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 Int64Inc(struct Expression * exp, struct Operand * op1)
6725 {
6726 exp->type = 2;
6727 exp->string = PrintInt64((++op1->i64));
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 UInt64Inc(struct Expression * exp, struct Operand * op1)
6738 {
6739 exp->type = 2;
6740 exp->string = PrintUInt64((++op1->ui64));
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 ShortInc(struct Expression * exp, struct Operand * op1)
6751 {
6752 exp->type = 2;
6753 exp->string = PrintShort((++op1->s));
6754 if(!exp->expType)
6755 {
6756 exp->expType = op1->type;
6757 if(op1->type)
6758 op1->type->refCount++;
6759 }
6760 return 0x1;
6761 }
6762
6763 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6764 {
6765 exp->type = 2;
6766 exp->string = PrintUShort((++op1->us));
6767 if(!exp->expType)
6768 {
6769 exp->expType = op1->type;
6770 if(op1->type)
6771 op1->type->refCount++;
6772 }
6773 return 0x1;
6774 }
6775
6776 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6777 {
6778 exp->type = 2;
6779 exp->string = PrintChar((++op1->c));
6780 if(!exp->expType)
6781 {
6782 exp->expType = op1->type;
6783 if(op1->type)
6784 op1->type->refCount++;
6785 }
6786 return 0x1;
6787 }
6788
6789 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6790 {
6791 exp->type = 2;
6792 exp->string = PrintUChar((++op1->uc));
6793 if(!exp->expType)
6794 {
6795 exp->expType = op1->type;
6796 if(op1->type)
6797 op1->type->refCount++;
6798 }
6799 return 0x1;
6800 }
6801
6802 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6803 {
6804 exp->type = 2;
6805 exp->string = PrintFloat((float)(++op1->f));
6806 if(!exp->expType)
6807 {
6808 exp->expType = op1->type;
6809 if(op1->type)
6810 op1->type->refCount++;
6811 }
6812 return 0x1;
6813 }
6814
6815 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6816 {
6817 exp->type = 2;
6818 exp->string = PrintDouble((double)(++op1->d));
6819 if(!exp->expType)
6820 {
6821 exp->expType = op1->type;
6822 if(op1->type)
6823 op1->type->refCount++;
6824 }
6825 return 0x1;
6826 }
6827
6828 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6829 {
6830 exp->type = 2;
6831 exp->string = PrintInt((--op1->i));
6832 if(!exp->expType)
6833 {
6834 exp->expType = op1->type;
6835 if(op1->type)
6836 op1->type->refCount++;
6837 }
6838 return 0x1;
6839 }
6840
6841 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6842 {
6843 exp->type = 2;
6844 exp->string = PrintUInt((--op1->ui));
6845 if(!exp->expType)
6846 {
6847 exp->expType = op1->type;
6848 if(op1->type)
6849 op1->type->refCount++;
6850 }
6851 return 0x1;
6852 }
6853
6854 static unsigned int Int64Dec(struct Expression * exp, struct Operand * op1)
6855 {
6856 exp->type = 2;
6857 exp->string = PrintInt64((--op1->i64));
6858 if(!exp->expType)
6859 {
6860 exp->expType = op1->type;
6861 if(op1->type)
6862 op1->type->refCount++;
6863 }
6864 return 0x1;
6865 }
6866
6867 static unsigned int UInt64Dec(struct Expression * exp, struct Operand * op1)
6868 {
6869 exp->type = 2;
6870 exp->string = PrintUInt64((--op1->ui64));
6871 if(!exp->expType)
6872 {
6873 exp->expType = op1->type;
6874 if(op1->type)
6875 op1->type->refCount++;
6876 }
6877 return 0x1;
6878 }
6879
6880 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6881 {
6882 exp->type = 2;
6883 exp->string = PrintShort((--op1->s));
6884 if(!exp->expType)
6885 {
6886 exp->expType = op1->type;
6887 if(op1->type)
6888 op1->type->refCount++;
6889 }
6890 return 0x1;
6891 }
6892
6893 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6894 {
6895 exp->type = 2;
6896 exp->string = PrintUShort((--op1->us));
6897 if(!exp->expType)
6898 {
6899 exp->expType = op1->type;
6900 if(op1->type)
6901 op1->type->refCount++;
6902 }
6903 return 0x1;
6904 }
6905
6906 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6907 {
6908 exp->type = 2;
6909 exp->string = PrintChar((--op1->c));
6910 if(!exp->expType)
6911 {
6912 exp->expType = op1->type;
6913 if(op1->type)
6914 op1->type->refCount++;
6915 }
6916 return 0x1;
6917 }
6918
6919 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6920 {
6921 exp->type = 2;
6922 exp->string = PrintUChar((--op1->uc));
6923 if(!exp->expType)
6924 {
6925 exp->expType = op1->type;
6926 if(op1->type)
6927 op1->type->refCount++;
6928 }
6929 return 0x1;
6930 }
6931
6932 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6933 {
6934 exp->type = 2;
6935 exp->string = PrintFloat((float)(--op1->f));
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 DoubleDec(struct Expression * exp, struct Operand * op1)
6946 {
6947 exp->type = 2;
6948 exp->string = PrintDouble((double)(--op1->d));
6949 if(!exp->expType)
6950 {
6951 exp->expType = op1->type;
6952 if(op1->type)
6953 op1->type->refCount++;
6954 }
6955 return 0x1;
6956 }
6957
6958 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6959 {
6960 int value2 = op2->i;
6961
6962 exp->type = 2;
6963 exp->string = PrintInt((op1->i = value2));
6964 if(!exp->expType)
6965 {
6966 exp->expType = op1->type;
6967 if(op1->type)
6968 op1->type->refCount++;
6969 }
6970 return 0x1;
6971 }
6972
6973 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6974 {
6975 unsigned int value2 = op2->ui;
6976
6977 exp->type = 2;
6978 exp->string = PrintUInt((op1->ui = value2));
6979 if(!exp->expType)
6980 {
6981 exp->expType = op1->type;
6982 if(op1->type)
6983 op1->type->refCount++;
6984 }
6985 return 0x1;
6986 }
6987
6988 static unsigned int Int64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6989 {
6990 long long value2 = op2->i64;
6991
6992 exp->type = 2;
6993 exp->string = PrintInt64((op1->i64 = value2));
6994 if(!exp->expType)
6995 {
6996 exp->expType = op1->type;
6997 if(op1->type)
6998 op1->type->refCount++;
6999 }
7000 return 0x1;
7001 }
7002
7003 static unsigned int UInt64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7004 {
7005 uint64 value2 = op2->ui64;
7006
7007 exp->type = 2;
7008 exp->string = PrintUInt64((op1->ui64 = value2));
7009 if(!exp->expType)
7010 {
7011 exp->expType = op1->type;
7012 if(op1->type)
7013 op1->type->refCount++;
7014 }
7015 return 0x1;
7016 }
7017
7018 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7019 {
7020 short value2 = op2->s;
7021
7022 exp->type = 2;
7023 exp->string = PrintShort((op1->s = value2));
7024 if(!exp->expType)
7025 {
7026 exp->expType = op1->type;
7027 if(op1->type)
7028 op1->type->refCount++;
7029 }
7030 return 0x1;
7031 }
7032
7033 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7034 {
7035 unsigned short value2 = op2->us;
7036
7037 exp->type = 2;
7038 exp->string = PrintUShort((op1->us = value2));
7039 if(!exp->expType)
7040 {
7041 exp->expType = op1->type;
7042 if(op1->type)
7043 op1->type->refCount++;
7044 }
7045 return 0x1;
7046 }
7047
7048 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7049 {
7050 char value2 = op2->c;
7051
7052 exp->type = 2;
7053 exp->string = PrintChar((op1->c = value2));
7054 if(!exp->expType)
7055 {
7056 exp->expType = op1->type;
7057 if(op1->type)
7058 op1->type->refCount++;
7059 }
7060 return 0x1;
7061 }
7062
7063 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7064 {
7065 unsigned char value2 = op2->uc;
7066
7067 exp->type = 2;
7068 exp->string = PrintUChar((op1->uc = value2));
7069 if(!exp->expType)
7070 {
7071 exp->expType = op1->type;
7072 if(op1->type)
7073 op1->type->refCount++;
7074 }
7075 return 0x1;
7076 }
7077
7078 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7079 {
7080 float value2 = op2->f;
7081
7082 exp->type = 2;
7083 exp->string = PrintFloat((float)(op1->f = value2));
7084 if(!exp->expType)
7085 {
7086 exp->expType = op1->type;
7087 if(op1->type)
7088 op1->type->refCount++;
7089 }
7090 return 0x1;
7091 }
7092
7093 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7094 {
7095 double value2 = op2->d;
7096
7097 exp->type = 2;
7098 exp->string = PrintDouble((double)(op1->d = value2));
7099 if(!exp->expType)
7100 {
7101 exp->expType = op1->type;
7102 if(op1->type)
7103 op1->type->refCount++;
7104 }
7105 return 0x1;
7106 }
7107
7108 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7109 {
7110 int value2 = op2->i;
7111
7112 exp->type = 2;
7113 exp->string = PrintInt((op1->i += value2));
7114 if(!exp->expType)
7115 {
7116 exp->expType = op1->type;
7117 if(op1->type)
7118 op1->type->refCount++;
7119 }
7120 return 0x1;
7121 }
7122
7123 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7124 {
7125 unsigned int value2 = op2->ui;
7126
7127 exp->type = 2;
7128 exp->string = PrintUInt((op1->ui += value2));
7129 if(!exp->expType)
7130 {
7131 exp->expType = op1->type;
7132 if(op1->type)
7133 op1->type->refCount++;
7134 }
7135 return 0x1;
7136 }
7137
7138 static unsigned int Int64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7139 {
7140 long long value2 = op2->i64;
7141
7142 exp->type = 2;
7143 exp->string = PrintInt64((op1->i64 += value2));
7144 if(!exp->expType)
7145 {
7146 exp->expType = op1->type;
7147 if(op1->type)
7148 op1->type->refCount++;
7149 }
7150 return 0x1;
7151 }
7152
7153 static unsigned int UInt64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7154 {
7155 uint64 value2 = op2->ui64;
7156
7157 exp->type = 2;
7158 exp->string = PrintUInt64((op1->ui64 += value2));
7159 if(!exp->expType)
7160 {
7161 exp->expType = op1->type;
7162 if(op1->type)
7163 op1->type->refCount++;
7164 }
7165 return 0x1;
7166 }
7167
7168 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7169 {
7170 short value2 = op2->s;
7171
7172 exp->type = 2;
7173 exp->string = PrintShort((op1->s += value2));
7174 if(!exp->expType)
7175 {
7176 exp->expType = op1->type;
7177 if(op1->type)
7178 op1->type->refCount++;
7179 }
7180 return 0x1;
7181 }
7182
7183 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7184 {
7185 unsigned short value2 = op2->us;
7186
7187 exp->type = 2;
7188 exp->string = PrintUShort((op1->us += value2));
7189 if(!exp->expType)
7190 {
7191 exp->expType = op1->type;
7192 if(op1->type)
7193 op1->type->refCount++;
7194 }
7195 return 0x1;
7196 }
7197
7198 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7199 {
7200 char value2 = op2->c;
7201
7202 exp->type = 2;
7203 exp->string = PrintChar((op1->c += value2));
7204 if(!exp->expType)
7205 {
7206 exp->expType = op1->type;
7207 if(op1->type)
7208 op1->type->refCount++;
7209 }
7210 return 0x1;
7211 }
7212
7213 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7214 {
7215 unsigned char value2 = op2->uc;
7216
7217 exp->type = 2;
7218 exp->string = PrintUChar((op1->uc += value2));
7219 if(!exp->expType)
7220 {
7221 exp->expType = op1->type;
7222 if(op1->type)
7223 op1->type->refCount++;
7224 }
7225 return 0x1;
7226 }
7227
7228 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7229 {
7230 float value2 = op2->f;
7231
7232 exp->type = 2;
7233 exp->string = PrintFloat((float)(op1->f += value2));
7234 if(!exp->expType)
7235 {
7236 exp->expType = op1->type;
7237 if(op1->type)
7238 op1->type->refCount++;
7239 }
7240 return 0x1;
7241 }
7242
7243 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7244 {
7245 double value2 = op2->d;
7246
7247 exp->type = 2;
7248 exp->string = PrintDouble((double)(op1->d += value2));
7249 if(!exp->expType)
7250 {
7251 exp->expType = op1->type;
7252 if(op1->type)
7253 op1->type->refCount++;
7254 }
7255 return 0x1;
7256 }
7257
7258 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7259 {
7260 int value2 = op2->i;
7261
7262 exp->type = 2;
7263 exp->string = PrintInt((op1->i -= value2));
7264 if(!exp->expType)
7265 {
7266 exp->expType = op1->type;
7267 if(op1->type)
7268 op1->type->refCount++;
7269 }
7270 return 0x1;
7271 }
7272
7273 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7274 {
7275 unsigned int value2 = op2->ui;
7276
7277 exp->type = 2;
7278 exp->string = PrintUInt((op1->ui -= value2));
7279 if(!exp->expType)
7280 {
7281 exp->expType = op1->type;
7282 if(op1->type)
7283 op1->type->refCount++;
7284 }
7285 return 0x1;
7286 }
7287
7288 static unsigned int Int64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7289 {
7290 long long value2 = op2->i64;
7291
7292 exp->type = 2;
7293 exp->string = PrintInt64((op1->i64 -= value2));
7294 if(!exp->expType)
7295 {
7296 exp->expType = op1->type;
7297 if(op1->type)
7298 op1->type->refCount++;
7299 }
7300 return 0x1;
7301 }
7302
7303 static unsigned int UInt64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7304 {
7305 uint64 value2 = op2->ui64;
7306
7307 exp->type = 2;
7308 exp->string = PrintUInt64((op1->ui64 -= value2));
7309 if(!exp->expType)
7310 {
7311 exp->expType = op1->type;
7312 if(op1->type)
7313 op1->type->refCount++;
7314 }
7315 return 0x1;
7316 }
7317
7318 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7319 {
7320 short value2 = op2->s;
7321
7322 exp->type = 2;
7323 exp->string = PrintShort((op1->s -= value2));
7324 if(!exp->expType)
7325 {
7326 exp->expType = op1->type;
7327 if(op1->type)
7328 op1->type->refCount++;
7329 }
7330 return 0x1;
7331 }
7332
7333 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7334 {
7335 unsigned short value2 = op2->us;
7336
7337 exp->type = 2;
7338 exp->string = PrintUShort((op1->us -= value2));
7339 if(!exp->expType)
7340 {
7341 exp->expType = op1->type;
7342 if(op1->type)
7343 op1->type->refCount++;
7344 }
7345 return 0x1;
7346 }
7347
7348 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7349 {
7350 char value2 = op2->c;
7351
7352 exp->type = 2;
7353 exp->string = PrintChar((op1->c -= value2));
7354 if(!exp->expType)
7355 {
7356 exp->expType = op1->type;
7357 if(op1->type)
7358 op1->type->refCount++;
7359 }
7360 return 0x1;
7361 }
7362
7363 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7364 {
7365 unsigned char value2 = op2->uc;
7366
7367 exp->type = 2;
7368 exp->string = PrintUChar((op1->uc -= value2));
7369 if(!exp->expType)
7370 {
7371 exp->expType = op1->type;
7372 if(op1->type)
7373 op1->type->refCount++;
7374 }
7375 return 0x1;
7376 }
7377
7378 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7379 {
7380 float value2 = op2->f;
7381
7382 exp->type = 2;
7383 exp->string = PrintFloat((float)(op1->f -= value2));
7384 if(!exp->expType)
7385 {
7386 exp->expType = op1->type;
7387 if(op1->type)
7388 op1->type->refCount++;
7389 }
7390 return 0x1;
7391 }
7392
7393 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7394 {
7395 double value2 = op2->d;
7396
7397 exp->type = 2;
7398 exp->string = PrintDouble((double)(op1->d -= value2));
7399 if(!exp->expType)
7400 {
7401 exp->expType = op1->type;
7402 if(op1->type)
7403 op1->type->refCount++;
7404 }
7405 return 0x1;
7406 }
7407
7408 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7409 {
7410 int value2 = op2->i;
7411
7412 exp->type = 2;
7413 exp->string = PrintInt((op1->i *= value2));
7414 if(!exp->expType)
7415 {
7416 exp->expType = op1->type;
7417 if(op1->type)
7418 op1->type->refCount++;
7419 }
7420 return 0x1;
7421 }
7422
7423 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7424 {
7425 unsigned int value2 = op2->ui;
7426
7427 exp->type = 2;
7428 exp->string = PrintUInt((op1->ui *= value2));
7429 if(!exp->expType)
7430 {
7431 exp->expType = op1->type;
7432 if(op1->type)
7433 op1->type->refCount++;
7434 }
7435 return 0x1;
7436 }
7437
7438 static unsigned int Int64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7439 {
7440 long long value2 = op2->i64;
7441
7442 exp->type = 2;
7443 exp->string = PrintInt64((op1->i64 *= value2));
7444 if(!exp->expType)
7445 {
7446 exp->expType = op1->type;
7447 if(op1->type)
7448 op1->type->refCount++;
7449 }
7450 return 0x1;
7451 }
7452
7453 static unsigned int UInt64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7454 {
7455 uint64 value2 = op2->ui64;
7456
7457 exp->type = 2;
7458 exp->string = PrintUInt64((op1->ui64 *= value2));
7459 if(!exp->expType)
7460 {
7461 exp->expType = op1->type;
7462 if(op1->type)
7463 op1->type->refCount++;
7464 }
7465 return 0x1;
7466 }
7467
7468 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7469 {
7470 short value2 = op2->s;
7471
7472 exp->type = 2;
7473 exp->string = PrintShort((op1->s *= value2));
7474 if(!exp->expType)
7475 {
7476 exp->expType = op1->type;
7477 if(op1->type)
7478 op1->type->refCount++;
7479 }
7480 return 0x1;
7481 }
7482
7483 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7484 {
7485 unsigned short value2 = op2->us;
7486
7487 exp->type = 2;
7488 exp->string = PrintUShort((op1->us *= value2));
7489 if(!exp->expType)
7490 {
7491 exp->expType = op1->type;
7492 if(op1->type)
7493 op1->type->refCount++;
7494 }
7495 return 0x1;
7496 }
7497
7498 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7499 {
7500 char value2 = op2->c;
7501
7502 exp->type = 2;
7503 exp->string = PrintChar((op1->c *= value2));
7504 if(!exp->expType)
7505 {
7506 exp->expType = op1->type;
7507 if(op1->type)
7508 op1->type->refCount++;
7509 }
7510 return 0x1;
7511 }
7512
7513 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7514 {
7515 unsigned char value2 = op2->uc;
7516
7517 exp->type = 2;
7518 exp->string = PrintUChar((op1->uc *= value2));
7519 if(!exp->expType)
7520 {
7521 exp->expType = op1->type;
7522 if(op1->type)
7523 op1->type->refCount++;
7524 }
7525 return 0x1;
7526 }
7527
7528 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7529 {
7530 float value2 = op2->f;
7531
7532 exp->type = 2;
7533 exp->string = PrintFloat((float)(op1->f *= value2));
7534 if(!exp->expType)
7535 {
7536 exp->expType = op1->type;
7537 if(op1->type)
7538 op1->type->refCount++;
7539 }
7540 return 0x1;
7541 }
7542
7543 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7544 {
7545 double value2 = op2->d;
7546
7547 exp->type = 2;
7548 exp->string = PrintDouble((double)(op1->d *= value2));
7549 if(!exp->expType)
7550 {
7551 exp->expType = op1->type;
7552 if(op1->type)
7553 op1->type->refCount++;
7554 }
7555 return 0x1;
7556 }
7557
7558 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7559 {
7560 int value2 = op2->i;
7561
7562 exp->type = 2;
7563 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
7564 if(!exp->expType)
7565 {
7566 exp->expType = op1->type;
7567 if(op1->type)
7568 op1->type->refCount++;
7569 }
7570 return 0x1;
7571 }
7572
7573 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7574 {
7575 unsigned int value2 = op2->ui;
7576
7577 exp->type = 2;
7578 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
7579 if(!exp->expType)
7580 {
7581 exp->expType = op1->type;
7582 if(op1->type)
7583 op1->type->refCount++;
7584 }
7585 return 0x1;
7586 }
7587
7588 static unsigned int Int64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7589 {
7590 long long value2 = op2->i64;
7591
7592 exp->type = 2;
7593 exp->string = PrintInt64(value2 ? (op1->i64 /= value2) : 0);
7594 if(!exp->expType)
7595 {
7596 exp->expType = op1->type;
7597 if(op1->type)
7598 op1->type->refCount++;
7599 }
7600 return 0x1;
7601 }
7602
7603 static unsigned int UInt64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7604 {
7605 uint64 value2 = op2->ui64;
7606
7607 exp->type = 2;
7608 exp->string = PrintUInt64(value2 ? (op1->ui64 /= value2) : 0);
7609 if(!exp->expType)
7610 {
7611 exp->expType = op1->type;
7612 if(op1->type)
7613 op1->type->refCount++;
7614 }
7615 return 0x1;
7616 }
7617
7618 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7619 {
7620 short value2 = op2->s;
7621
7622 exp->type = 2;
7623 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
7624 if(!exp->expType)
7625 {
7626 exp->expType = op1->type;
7627 if(op1->type)
7628 op1->type->refCount++;
7629 }
7630 return 0x1;
7631 }
7632
7633 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7634 {
7635 unsigned short value2 = op2->us;
7636
7637 exp->type = 2;
7638 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
7639 if(!exp->expType)
7640 {
7641 exp->expType = op1->type;
7642 if(op1->type)
7643 op1->type->refCount++;
7644 }
7645 return 0x1;
7646 }
7647
7648 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7649 {
7650 char value2 = op2->c;
7651
7652 exp->type = 2;
7653 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
7654 if(!exp->expType)
7655 {
7656 exp->expType = op1->type;
7657 if(op1->type)
7658 op1->type->refCount++;
7659 }
7660 return 0x1;
7661 }
7662
7663 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7664 {
7665 unsigned char value2 = op2->uc;
7666
7667 exp->type = 2;
7668 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
7669 if(!exp->expType)
7670 {
7671 exp->expType = op1->type;
7672 if(op1->type)
7673 op1->type->refCount++;
7674 }
7675 return 0x1;
7676 }
7677
7678 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7679 {
7680 float value2 = op2->f;
7681
7682 exp->type = 2;
7683 exp->string = PrintFloat(op1->f /= value2);
7684 if(!exp->expType)
7685 {
7686 exp->expType = op1->type;
7687 if(op1->type)
7688 op1->type->refCount++;
7689 }
7690 return 0x1;
7691 }
7692
7693 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7694 {
7695 double value2 = op2->d;
7696
7697 exp->type = 2;
7698 exp->string = PrintDouble(op1->d /= value2);
7699 if(!exp->expType)
7700 {
7701 exp->expType = op1->type;
7702 if(op1->type)
7703 op1->type->refCount++;
7704 }
7705 return 0x1;
7706 }
7707
7708 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7709 {
7710 int value2 = op2->i;
7711
7712 exp->type = 2;
7713 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
7714 if(!exp->expType)
7715 {
7716 exp->expType = op1->type;
7717 if(op1->type)
7718 op1->type->refCount++;
7719 }
7720 return 0x1;
7721 }
7722
7723 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7724 {
7725 unsigned int value2 = op2->ui;
7726
7727 exp->type = 2;
7728 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
7729 if(!exp->expType)
7730 {
7731 exp->expType = op1->type;
7732 if(op1->type)
7733 op1->type->refCount++;
7734 }
7735 return 0x1;
7736 }
7737
7738 static unsigned int Int64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7739 {
7740 long long value2 = op2->i64;
7741
7742 exp->type = 2;
7743 exp->string = PrintInt64(value2 ? (op1->i64 %= value2) : 0);
7744 if(!exp->expType)
7745 {
7746 exp->expType = op1->type;
7747 if(op1->type)
7748 op1->type->refCount++;
7749 }
7750 return 0x1;
7751 }
7752
7753 static unsigned int UInt64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7754 {
7755 uint64 value2 = op2->ui64;
7756
7757 exp->type = 2;
7758 exp->string = PrintUInt64(value2 ? (op1->ui64 %= value2) : 0);
7759 if(!exp->expType)
7760 {
7761 exp->expType = op1->type;
7762 if(op1->type)
7763 op1->type->refCount++;
7764 }
7765 return 0x1;
7766 }
7767
7768 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7769 {
7770 short value2 = op2->s;
7771
7772 exp->type = 2;
7773 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
7774 if(!exp->expType)
7775 {
7776 exp->expType = op1->type;
7777 if(op1->type)
7778 op1->type->refCount++;
7779 }
7780 return 0x1;
7781 }
7782
7783 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7784 {
7785 unsigned short value2 = op2->us;
7786
7787 exp->type = 2;
7788 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
7789 if(!exp->expType)
7790 {
7791 exp->expType = op1->type;
7792 if(op1->type)
7793 op1->type->refCount++;
7794 }
7795 return 0x1;
7796 }
7797
7798 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7799 {
7800 char value2 = op2->c;
7801
7802 exp->type = 2;
7803 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
7804 if(!exp->expType)
7805 {
7806 exp->expType = op1->type;
7807 if(op1->type)
7808 op1->type->refCount++;
7809 }
7810 return 0x1;
7811 }
7812
7813 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7814 {
7815 unsigned char value2 = op2->uc;
7816
7817 exp->type = 2;
7818 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
7819 if(!exp->expType)
7820 {
7821 exp->expType = op1->type;
7822 if(op1->type)
7823 op1->type->refCount++;
7824 }
7825 return 0x1;
7826 }
7827
7828 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7829 {
7830 int value2 = op2->i;
7831
7832 exp->type = 2;
7833 exp->string = PrintInt((op1->i & value2));
7834 if(!exp->expType)
7835 {
7836 exp->expType = op1->type;
7837 if(op1->type)
7838 op1->type->refCount++;
7839 }
7840 return 0x1;
7841 }
7842
7843 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7844 {
7845 unsigned int value2 = op2->ui;
7846
7847 exp->type = 2;
7848 exp->string = PrintUInt((op1->ui & value2));
7849 if(!exp->expType)
7850 {
7851 exp->expType = op1->type;
7852 if(op1->type)
7853 op1->type->refCount++;
7854 }
7855 return 0x1;
7856 }
7857
7858 static unsigned int Int64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7859 {
7860 long long value2 = op2->i64;
7861
7862 exp->type = 2;
7863 exp->string = PrintInt64((op1->i64 & value2));
7864 if(!exp->expType)
7865 {
7866 exp->expType = op1->type;
7867 if(op1->type)
7868 op1->type->refCount++;
7869 }
7870 return 0x1;
7871 }
7872
7873 static unsigned int UInt64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7874 {
7875 uint64 value2 = op2->ui64;
7876
7877 exp->type = 2;
7878 exp->string = PrintUInt64((op1->ui64 & value2));
7879 if(!exp->expType)
7880 {
7881 exp->expType = op1->type;
7882 if(op1->type)
7883 op1->type->refCount++;
7884 }
7885 return 0x1;
7886 }
7887
7888 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7889 {
7890 short value2 = op2->s;
7891
7892 exp->type = 2;
7893 exp->string = PrintShort((op1->s & value2));
7894 if(!exp->expType)
7895 {
7896 exp->expType = op1->type;
7897 if(op1->type)
7898 op1->type->refCount++;
7899 }
7900 return 0x1;
7901 }
7902
7903 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7904 {
7905 unsigned short value2 = op2->us;
7906
7907 exp->type = 2;
7908 exp->string = PrintUShort((op1->us & value2));
7909 if(!exp->expType)
7910 {
7911 exp->expType = op1->type;
7912 if(op1->type)
7913 op1->type->refCount++;
7914 }
7915 return 0x1;
7916 }
7917
7918 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7919 {
7920 char value2 = op2->c;
7921
7922 exp->type = 2;
7923 exp->string = PrintChar((op1->c & value2));
7924 if(!exp->expType)
7925 {
7926 exp->expType = op1->type;
7927 if(op1->type)
7928 op1->type->refCount++;
7929 }
7930 return 0x1;
7931 }
7932
7933 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7934 {
7935 unsigned char value2 = op2->uc;
7936
7937 exp->type = 2;
7938 exp->string = PrintUChar((op1->uc & value2));
7939 if(!exp->expType)
7940 {
7941 exp->expType = op1->type;
7942 if(op1->type)
7943 op1->type->refCount++;
7944 }
7945 return 0x1;
7946 }
7947
7948 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7949 {
7950 int value2 = op2->i;
7951
7952 exp->type = 2;
7953 exp->string = PrintInt((op1->i | value2));
7954 if(!exp->expType)
7955 {
7956 exp->expType = op1->type;
7957 if(op1->type)
7958 op1->type->refCount++;
7959 }
7960 return 0x1;
7961 }
7962
7963 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7964 {
7965 unsigned int value2 = op2->ui;
7966
7967 exp->type = 2;
7968 exp->string = PrintUInt((op1->ui | value2));
7969 if(!exp->expType)
7970 {
7971 exp->expType = op1->type;
7972 if(op1->type)
7973 op1->type->refCount++;
7974 }
7975 return 0x1;
7976 }
7977
7978 static unsigned int Int64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7979 {
7980 long long value2 = op2->i64;
7981
7982 exp->type = 2;
7983 exp->string = PrintInt64((op1->i64 | value2));
7984 if(!exp->expType)
7985 {
7986 exp->expType = op1->type;
7987 if(op1->type)
7988 op1->type->refCount++;
7989 }
7990 return 0x1;
7991 }
7992
7993 static unsigned int UInt64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7994 {
7995 uint64 value2 = op2->ui64;
7996
7997 exp->type = 2;
7998 exp->string = PrintUInt64((op1->ui64 | value2));
7999 if(!exp->expType)
8000 {
8001 exp->expType = op1->type;
8002 if(op1->type)
8003 op1->type->refCount++;
8004 }
8005 return 0x1;
8006 }
8007
8008 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8009 {
8010 short value2 = op2->s;
8011
8012 exp->type = 2;
8013 exp->string = PrintShort((op1->s | value2));
8014 if(!exp->expType)
8015 {
8016 exp->expType = op1->type;
8017 if(op1->type)
8018 op1->type->refCount++;
8019 }
8020 return 0x1;
8021 }
8022
8023 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8024 {
8025 unsigned short value2 = op2->us;
8026
8027 exp->type = 2;
8028 exp->string = PrintUShort((op1->us | value2));
8029 if(!exp->expType)
8030 {
8031 exp->expType = op1->type;
8032 if(op1->type)
8033 op1->type->refCount++;
8034 }
8035 return 0x1;
8036 }
8037
8038 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8039 {
8040 char value2 = op2->c;
8041
8042 exp->type = 2;
8043 exp->string = PrintChar((op1->c | value2));
8044 if(!exp->expType)
8045 {
8046 exp->expType = op1->type;
8047 if(op1->type)
8048 op1->type->refCount++;
8049 }
8050 return 0x1;
8051 }
8052
8053 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8054 {
8055 unsigned char value2 = op2->uc;
8056
8057 exp->type = 2;
8058 exp->string = PrintUChar((op1->uc | value2));
8059 if(!exp->expType)
8060 {
8061 exp->expType = op1->type;
8062 if(op1->type)
8063 op1->type->refCount++;
8064 }
8065 return 0x1;
8066 }
8067
8068 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8069 {
8070 int value2 = op2->i;
8071
8072 exp->type = 2;
8073 exp->string = PrintInt((op1->i ^ value2));
8074 if(!exp->expType)
8075 {
8076 exp->expType = op1->type;
8077 if(op1->type)
8078 op1->type->refCount++;
8079 }
8080 return 0x1;
8081 }
8082
8083 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8084 {
8085 unsigned int value2 = op2->ui;
8086
8087 exp->type = 2;
8088 exp->string = PrintUInt((op1->ui ^ value2));
8089 if(!exp->expType)
8090 {
8091 exp->expType = op1->type;
8092 if(op1->type)
8093 op1->type->refCount++;
8094 }
8095 return 0x1;
8096 }
8097
8098 static unsigned int Int64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8099 {
8100 long long value2 = op2->i64;
8101
8102 exp->type = 2;
8103 exp->string = PrintInt64((op1->i64 ^ value2));
8104 if(!exp->expType)
8105 {
8106 exp->expType = op1->type;
8107 if(op1->type)
8108 op1->type->refCount++;
8109 }
8110 return 0x1;
8111 }
8112
8113 static unsigned int UInt64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8114 {
8115 uint64 value2 = op2->ui64;
8116
8117 exp->type = 2;
8118 exp->string = PrintUInt64((op1->ui64 ^ value2));
8119 if(!exp->expType)
8120 {
8121 exp->expType = op1->type;
8122 if(op1->type)
8123 op1->type->refCount++;
8124 }
8125 return 0x1;
8126 }
8127
8128 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8129 {
8130 short value2 = op2->s;
8131
8132 exp->type = 2;
8133 exp->string = PrintShort((op1->s ^ value2));
8134 if(!exp->expType)
8135 {
8136 exp->expType = op1->type;
8137 if(op1->type)
8138 op1->type->refCount++;
8139 }
8140 return 0x1;
8141 }
8142
8143 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8144 {
8145 unsigned short value2 = op2->us;
8146
8147 exp->type = 2;
8148 exp->string = PrintUShort((op1->us ^ value2));
8149 if(!exp->expType)
8150 {
8151 exp->expType = op1->type;
8152 if(op1->type)
8153 op1->type->refCount++;
8154 }
8155 return 0x1;
8156 }
8157
8158 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8159 {
8160 char value2 = op2->c;
8161
8162 exp->type = 2;
8163 exp->string = PrintChar((op1->c ^ value2));
8164 if(!exp->expType)
8165 {
8166 exp->expType = op1->type;
8167 if(op1->type)
8168 op1->type->refCount++;
8169 }
8170 return 0x1;
8171 }
8172
8173 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8174 {
8175 unsigned char value2 = op2->uc;
8176
8177 exp->type = 2;
8178 exp->string = PrintUChar((op1->uc ^ value2));
8179 if(!exp->expType)
8180 {
8181 exp->expType = op1->type;
8182 if(op1->type)
8183 op1->type->refCount++;
8184 }
8185 return 0x1;
8186 }
8187
8188 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8189 {
8190 int value2 = op2->i;
8191
8192 exp->type = 2;
8193 exp->string = PrintInt((op1->i << value2));
8194 if(!exp->expType)
8195 {
8196 exp->expType = op1->type;
8197 if(op1->type)
8198 op1->type->refCount++;
8199 }
8200 return 0x1;
8201 }
8202
8203 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8204 {
8205 unsigned int value2 = op2->ui;
8206
8207 exp->type = 2;
8208 exp->string = PrintUInt((op1->ui << value2));
8209 if(!exp->expType)
8210 {
8211 exp->expType = op1->type;
8212 if(op1->type)
8213 op1->type->refCount++;
8214 }
8215 return 0x1;
8216 }
8217
8218 static unsigned int Int64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8219 {
8220 long long value2 = op2->i64;
8221
8222 exp->type = 2;
8223 exp->string = PrintInt64((op1->i64 << value2));
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 UInt64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8234 {
8235 uint64 value2 = op2->ui64;
8236
8237 exp->type = 2;
8238 exp->string = PrintUInt64((op1->ui64 << value2));
8239 if(!exp->expType)
8240 {
8241 exp->expType = op1->type;
8242 if(op1->type)
8243 op1->type->refCount++;
8244 }
8245 return 0x1;
8246 }
8247
8248 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8249 {
8250 short value2 = op2->s;
8251
8252 exp->type = 2;
8253 exp->string = PrintShort((op1->s << value2));
8254 if(!exp->expType)
8255 {
8256 exp->expType = op1->type;
8257 if(op1->type)
8258 op1->type->refCount++;
8259 }
8260 return 0x1;
8261 }
8262
8263 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8264 {
8265 unsigned short value2 = op2->us;
8266
8267 exp->type = 2;
8268 exp->string = PrintUShort((op1->us << value2));
8269 if(!exp->expType)
8270 {
8271 exp->expType = op1->type;
8272 if(op1->type)
8273 op1->type->refCount++;
8274 }
8275 return 0x1;
8276 }
8277
8278 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8279 {
8280 char value2 = op2->c;
8281
8282 exp->type = 2;
8283 exp->string = PrintChar((op1->c << value2));
8284 if(!exp->expType)
8285 {
8286 exp->expType = op1->type;
8287 if(op1->type)
8288 op1->type->refCount++;
8289 }
8290 return 0x1;
8291 }
8292
8293 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8294 {
8295 unsigned char value2 = op2->uc;
8296
8297 exp->type = 2;
8298 exp->string = PrintUChar((op1->uc << value2));
8299 if(!exp->expType)
8300 {
8301 exp->expType = op1->type;
8302 if(op1->type)
8303 op1->type->refCount++;
8304 }
8305 return 0x1;
8306 }
8307
8308 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8309 {
8310 int value2 = op2->i;
8311
8312 exp->type = 2;
8313 exp->string = PrintInt((op1->i >> value2));
8314 if(!exp->expType)
8315 {
8316 exp->expType = op1->type;
8317 if(op1->type)
8318 op1->type->refCount++;
8319 }
8320 return 0x1;
8321 }
8322
8323 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8324 {
8325 unsigned int value2 = op2->ui;
8326
8327 exp->type = 2;
8328 exp->string = PrintUInt((op1->ui >> value2));
8329 if(!exp->expType)
8330 {
8331 exp->expType = op1->type;
8332 if(op1->type)
8333 op1->type->refCount++;
8334 }
8335 return 0x1;
8336 }
8337
8338 static unsigned int Int64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8339 {
8340 long long value2 = op2->i64;
8341
8342 exp->type = 2;
8343 exp->string = PrintInt64((op1->i64 >> value2));
8344 if(!exp->expType)
8345 {
8346 exp->expType = op1->type;
8347 if(op1->type)
8348 op1->type->refCount++;
8349 }
8350 return 0x1;
8351 }
8352
8353 static unsigned int UInt64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8354 {
8355 uint64 value2 = op2->ui64;
8356
8357 exp->type = 2;
8358 exp->string = PrintUInt64((op1->ui64 >> value2));
8359 if(!exp->expType)
8360 {
8361 exp->expType = op1->type;
8362 if(op1->type)
8363 op1->type->refCount++;
8364 }
8365 return 0x1;
8366 }
8367
8368 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8369 {
8370 short value2 = op2->s;
8371
8372 exp->type = 2;
8373 exp->string = PrintShort((op1->s >> value2));
8374 if(!exp->expType)
8375 {
8376 exp->expType = op1->type;
8377 if(op1->type)
8378 op1->type->refCount++;
8379 }
8380 return 0x1;
8381 }
8382
8383 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8384 {
8385 unsigned short value2 = op2->us;
8386
8387 exp->type = 2;
8388 exp->string = PrintUShort((op1->us >> value2));
8389 if(!exp->expType)
8390 {
8391 exp->expType = op1->type;
8392 if(op1->type)
8393 op1->type->refCount++;
8394 }
8395 return 0x1;
8396 }
8397
8398 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8399 {
8400 char value2 = op2->c;
8401
8402 exp->type = 2;
8403 exp->string = PrintChar((op1->c >> value2));
8404 if(!exp->expType)
8405 {
8406 exp->expType = op1->type;
8407 if(op1->type)
8408 op1->type->refCount++;
8409 }
8410 return 0x1;
8411 }
8412
8413 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8414 {
8415 unsigned char value2 = op2->uc;
8416
8417 exp->type = 2;
8418 exp->string = PrintUChar((op1->uc >> value2));
8419 if(!exp->expType)
8420 {
8421 exp->expType = op1->type;
8422 if(op1->type)
8423 op1->type->refCount++;
8424 }
8425 return 0x1;
8426 }
8427
8428 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
8429 {
8430 exp->type = 2;
8431 exp->string = PrintInt((~op1->i));
8432 if(!exp->expType)
8433 {
8434 exp->expType = op1->type;
8435 if(op1->type)
8436 op1->type->refCount++;
8437 }
8438 return 0x1;
8439 }
8440
8441 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
8442 {
8443 exp->type = 2;
8444 exp->string = PrintUInt((unsigned int)(~op1->ui));
8445 if(!exp->expType)
8446 {
8447 exp->expType = op1->type;
8448 if(op1->type)
8449 op1->type->refCount++;
8450 }
8451 return 0x1;
8452 }
8453
8454 static unsigned int Int64BitNot(struct Expression * exp, struct Operand * op1)
8455 {
8456 exp->type = 2;
8457 exp->string = PrintInt64((long long)(~op1->i64));
8458 if(!exp->expType)
8459 {
8460 exp->expType = op1->type;
8461 if(op1->type)
8462 op1->type->refCount++;
8463 }
8464 return 0x1;
8465 }
8466
8467 static unsigned int UInt64BitNot(struct Expression * exp, struct Operand * op1)
8468 {
8469 exp->type = 2;
8470 exp->string = PrintUInt64((uint64)(~op1->ui64));
8471 if(!exp->expType)
8472 {
8473 exp->expType = op1->type;
8474 if(op1->type)
8475 op1->type->refCount++;
8476 }
8477 return 0x1;
8478 }
8479
8480 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
8481 {
8482 exp->type = 2;
8483 exp->string = PrintShort((short)(~op1->s));
8484 if(!exp->expType)
8485 {
8486 exp->expType = op1->type;
8487 if(op1->type)
8488 op1->type->refCount++;
8489 }
8490 return 0x1;
8491 }
8492
8493 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
8494 {
8495 exp->type = 2;
8496 exp->string = PrintUShort((unsigned short)(~op1->us));
8497 if(!exp->expType)
8498 {
8499 exp->expType = op1->type;
8500 if(op1->type)
8501 op1->type->refCount++;
8502 }
8503 return 0x1;
8504 }
8505
8506 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
8507 {
8508 exp->type = 2;
8509 exp->string = PrintChar((char)(~op1->c));
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 UCharBitNot(struct Expression * exp, struct Operand * op1)
8520 {
8521 exp->type = 2;
8522 exp->string = PrintUChar((unsigned char)(~op1->uc));
8523 if(!exp->expType)
8524 {
8525 exp->expType = op1->type;
8526 if(op1->type)
8527 op1->type->refCount++;
8528 }
8529 return 0x1;
8530 }
8531
8532 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8533 {
8534 int value2 = op2->i;
8535
8536 exp->type = 2;
8537 exp->string = PrintInt((op1->i &= value2));
8538 if(!exp->expType)
8539 {
8540 exp->expType = op1->type;
8541 if(op1->type)
8542 op1->type->refCount++;
8543 }
8544 return 0x1;
8545 }
8546
8547 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8548 {
8549 unsigned int value2 = op2->ui;
8550
8551 exp->type = 2;
8552 exp->string = PrintUInt((op1->ui &= value2));
8553 if(!exp->expType)
8554 {
8555 exp->expType = op1->type;
8556 if(op1->type)
8557 op1->type->refCount++;
8558 }
8559 return 0x1;
8560 }
8561
8562 static unsigned int Int64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8563 {
8564 long long value2 = op2->i64;
8565
8566 exp->type = 2;
8567 exp->string = PrintInt64((op1->i64 &= value2));
8568 if(!exp->expType)
8569 {
8570 exp->expType = op1->type;
8571 if(op1->type)
8572 op1->type->refCount++;
8573 }
8574 return 0x1;
8575 }
8576
8577 static unsigned int UInt64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8578 {
8579 uint64 value2 = op2->ui64;
8580
8581 exp->type = 2;
8582 exp->string = PrintUInt64((op1->ui64 &= value2));
8583 if(!exp->expType)
8584 {
8585 exp->expType = op1->type;
8586 if(op1->type)
8587 op1->type->refCount++;
8588 }
8589 return 0x1;
8590 }
8591
8592 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8593 {
8594 short value2 = op2->s;
8595
8596 exp->type = 2;
8597 exp->string = PrintShort((op1->s &= value2));
8598 if(!exp->expType)
8599 {
8600 exp->expType = op1->type;
8601 if(op1->type)
8602 op1->type->refCount++;
8603 }
8604 return 0x1;
8605 }
8606
8607 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8608 {
8609 unsigned short value2 = op2->us;
8610
8611 exp->type = 2;
8612 exp->string = PrintUShort((op1->us &= value2));
8613 if(!exp->expType)
8614 {
8615 exp->expType = op1->type;
8616 if(op1->type)
8617 op1->type->refCount++;
8618 }
8619 return 0x1;
8620 }
8621
8622 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8623 {
8624 char value2 = op2->c;
8625
8626 exp->type = 2;
8627 exp->string = PrintChar((op1->c &= value2));
8628 if(!exp->expType)
8629 {
8630 exp->expType = op1->type;
8631 if(op1->type)
8632 op1->type->refCount++;
8633 }
8634 return 0x1;
8635 }
8636
8637 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8638 {
8639 unsigned char value2 = op2->uc;
8640
8641 exp->type = 2;
8642 exp->string = PrintUChar((op1->uc &= value2));
8643 if(!exp->expType)
8644 {
8645 exp->expType = op1->type;
8646 if(op1->type)
8647 op1->type->refCount++;
8648 }
8649 return 0x1;
8650 }
8651
8652 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8653 {
8654 int value2 = op2->i;
8655
8656 exp->type = 2;
8657 exp->string = PrintInt((op1->i |= value2));
8658 if(!exp->expType)
8659 {
8660 exp->expType = op1->type;
8661 if(op1->type)
8662 op1->type->refCount++;
8663 }
8664 return 0x1;
8665 }
8666
8667 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8668 {
8669 unsigned int value2 = op2->ui;
8670
8671 exp->type = 2;
8672 exp->string = PrintUInt((op1->ui |= value2));
8673 if(!exp->expType)
8674 {
8675 exp->expType = op1->type;
8676 if(op1->type)
8677 op1->type->refCount++;
8678 }
8679 return 0x1;
8680 }
8681
8682 static unsigned int Int64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8683 {
8684 long long value2 = op2->i64;
8685
8686 exp->type = 2;
8687 exp->string = PrintInt64((op1->i64 |= value2));
8688 if(!exp->expType)
8689 {
8690 exp->expType = op1->type;
8691 if(op1->type)
8692 op1->type->refCount++;
8693 }
8694 return 0x1;
8695 }
8696
8697 static unsigned int UInt64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8698 {
8699 uint64 value2 = op2->ui64;
8700
8701 exp->type = 2;
8702 exp->string = PrintUInt64((op1->ui64 |= value2));
8703 if(!exp->expType)
8704 {
8705 exp->expType = op1->type;
8706 if(op1->type)
8707 op1->type->refCount++;
8708 }
8709 return 0x1;
8710 }
8711
8712 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8713 {
8714 short value2 = op2->s;
8715
8716 exp->type = 2;
8717 exp->string = PrintShort((op1->s |= value2));
8718 if(!exp->expType)
8719 {
8720 exp->expType = op1->type;
8721 if(op1->type)
8722 op1->type->refCount++;
8723 }
8724 return 0x1;
8725 }
8726
8727 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8728 {
8729 unsigned short value2 = op2->us;
8730
8731 exp->type = 2;
8732 exp->string = PrintUShort((op1->us |= value2));
8733 if(!exp->expType)
8734 {
8735 exp->expType = op1->type;
8736 if(op1->type)
8737 op1->type->refCount++;
8738 }
8739 return 0x1;
8740 }
8741
8742 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8743 {
8744 char value2 = op2->c;
8745
8746 exp->type = 2;
8747 exp->string = PrintChar((op1->c |= value2));
8748 if(!exp->expType)
8749 {
8750 exp->expType = op1->type;
8751 if(op1->type)
8752 op1->type->refCount++;
8753 }
8754 return 0x1;
8755 }
8756
8757 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8758 {
8759 unsigned char value2 = op2->uc;
8760
8761 exp->type = 2;
8762 exp->string = PrintUChar((op1->uc |= value2));
8763 if(!exp->expType)
8764 {
8765 exp->expType = op1->type;
8766 if(op1->type)
8767 op1->type->refCount++;
8768 }
8769 return 0x1;
8770 }
8771
8772 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8773 {
8774 int value2 = op2->i;
8775
8776 exp->type = 2;
8777 exp->string = PrintInt((op1->i ^= value2));
8778 if(!exp->expType)
8779 {
8780 exp->expType = op1->type;
8781 if(op1->type)
8782 op1->type->refCount++;
8783 }
8784 return 0x1;
8785 }
8786
8787 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8788 {
8789 unsigned int value2 = op2->ui;
8790
8791 exp->type = 2;
8792 exp->string = PrintUInt((op1->ui ^= value2));
8793 if(!exp->expType)
8794 {
8795 exp->expType = op1->type;
8796 if(op1->type)
8797 op1->type->refCount++;
8798 }
8799 return 0x1;
8800 }
8801
8802 static unsigned int Int64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8803 {
8804 long long value2 = op2->i64;
8805
8806 exp->type = 2;
8807 exp->string = PrintInt64((op1->i64 ^= value2));
8808 if(!exp->expType)
8809 {
8810 exp->expType = op1->type;
8811 if(op1->type)
8812 op1->type->refCount++;
8813 }
8814 return 0x1;
8815 }
8816
8817 static unsigned int UInt64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8818 {
8819 uint64 value2 = op2->ui64;
8820
8821 exp->type = 2;
8822 exp->string = PrintUInt64((op1->ui64 ^= value2));
8823 if(!exp->expType)
8824 {
8825 exp->expType = op1->type;
8826 if(op1->type)
8827 op1->type->refCount++;
8828 }
8829 return 0x1;
8830 }
8831
8832 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8833 {
8834 short value2 = op2->s;
8835
8836 exp->type = 2;
8837 exp->string = PrintShort((op1->s ^= value2));
8838 if(!exp->expType)
8839 {
8840 exp->expType = op1->type;
8841 if(op1->type)
8842 op1->type->refCount++;
8843 }
8844 return 0x1;
8845 }
8846
8847 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8848 {
8849 unsigned short value2 = op2->us;
8850
8851 exp->type = 2;
8852 exp->string = PrintUShort((op1->us ^= value2));
8853 if(!exp->expType)
8854 {
8855 exp->expType = op1->type;
8856 if(op1->type)
8857 op1->type->refCount++;
8858 }
8859 return 0x1;
8860 }
8861
8862 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8863 {
8864 char value2 = op2->c;
8865
8866 exp->type = 2;
8867 exp->string = PrintChar((op1->c ^= value2));
8868 if(!exp->expType)
8869 {
8870 exp->expType = op1->type;
8871 if(op1->type)
8872 op1->type->refCount++;
8873 }
8874 return 0x1;
8875 }
8876
8877 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8878 {
8879 unsigned char value2 = op2->uc;
8880
8881 exp->type = 2;
8882 exp->string = PrintUChar((op1->uc ^= value2));
8883 if(!exp->expType)
8884 {
8885 exp->expType = op1->type;
8886 if(op1->type)
8887 op1->type->refCount++;
8888 }
8889 return 0x1;
8890 }
8891
8892 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8893 {
8894 int value2 = op2->i;
8895
8896 exp->type = 2;
8897 exp->string = PrintInt((op1->i <<= value2));
8898 if(!exp->expType)
8899 {
8900 exp->expType = op1->type;
8901 if(op1->type)
8902 op1->type->refCount++;
8903 }
8904 return 0x1;
8905 }
8906
8907 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8908 {
8909 unsigned int value2 = op2->ui;
8910
8911 exp->type = 2;
8912 exp->string = PrintUInt((op1->ui <<= value2));
8913 if(!exp->expType)
8914 {
8915 exp->expType = op1->type;
8916 if(op1->type)
8917 op1->type->refCount++;
8918 }
8919 return 0x1;
8920 }
8921
8922 static unsigned int Int64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8923 {
8924 long long value2 = op2->i64;
8925
8926 exp->type = 2;
8927 exp->string = PrintInt64((op1->i64 <<= value2));
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 UInt64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8938 {
8939 uint64 value2 = op2->ui64;
8940
8941 exp->type = 2;
8942 exp->string = PrintUInt64((op1->ui64 <<= value2));
8943 if(!exp->expType)
8944 {
8945 exp->expType = op1->type;
8946 if(op1->type)
8947 op1->type->refCount++;
8948 }
8949 return 0x1;
8950 }
8951
8952 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8953 {
8954 short value2 = op2->s;
8955
8956 exp->type = 2;
8957 exp->string = PrintShort((op1->s <<= value2));
8958 if(!exp->expType)
8959 {
8960 exp->expType = op1->type;
8961 if(op1->type)
8962 op1->type->refCount++;
8963 }
8964 return 0x1;
8965 }
8966
8967 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8968 {
8969 unsigned short value2 = op2->us;
8970
8971 exp->type = 2;
8972 exp->string = PrintUShort((op1->us <<= value2));
8973 if(!exp->expType)
8974 {
8975 exp->expType = op1->type;
8976 if(op1->type)
8977 op1->type->refCount++;
8978 }
8979 return 0x1;
8980 }
8981
8982 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8983 {
8984 char value2 = op2->c;
8985
8986 exp->type = 2;
8987 exp->string = PrintChar((op1->c <<= value2));
8988 if(!exp->expType)
8989 {
8990 exp->expType = op1->type;
8991 if(op1->type)
8992 op1->type->refCount++;
8993 }
8994 return 0x1;
8995 }
8996
8997 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8998 {
8999 unsigned char value2 = op2->uc;
9000
9001 exp->type = 2;
9002 exp->string = PrintUChar((op1->uc <<= value2));
9003 if(!exp->expType)
9004 {
9005 exp->expType = op1->type;
9006 if(op1->type)
9007 op1->type->refCount++;
9008 }
9009 return 0x1;
9010 }
9011
9012 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9013 {
9014 int value2 = op2->i;
9015
9016 exp->type = 2;
9017 exp->string = PrintInt((op1->i >>= value2));
9018 if(!exp->expType)
9019 {
9020 exp->expType = op1->type;
9021 if(op1->type)
9022 op1->type->refCount++;
9023 }
9024 return 0x1;
9025 }
9026
9027 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9028 {
9029 unsigned int value2 = op2->ui;
9030
9031 exp->type = 2;
9032 exp->string = PrintUInt((op1->ui >>= value2));
9033 if(!exp->expType)
9034 {
9035 exp->expType = op1->type;
9036 if(op1->type)
9037 op1->type->refCount++;
9038 }
9039 return 0x1;
9040 }
9041
9042 static unsigned int Int64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9043 {
9044 long long value2 = op2->i64;
9045
9046 exp->type = 2;
9047 exp->string = PrintInt64((op1->i64 >>= value2));
9048 if(!exp->expType)
9049 {
9050 exp->expType = op1->type;
9051 if(op1->type)
9052 op1->type->refCount++;
9053 }
9054 return 0x1;
9055 }
9056
9057 static unsigned int UInt64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9058 {
9059 uint64 value2 = op2->ui64;
9060
9061 exp->type = 2;
9062 exp->string = PrintUInt64((op1->ui64 >>= value2));
9063 if(!exp->expType)
9064 {
9065 exp->expType = op1->type;
9066 if(op1->type)
9067 op1->type->refCount++;
9068 }
9069 return 0x1;
9070 }
9071
9072 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9073 {
9074 short value2 = op2->s;
9075
9076 exp->type = 2;
9077 exp->string = PrintShort((op1->s >>= value2));
9078 if(!exp->expType)
9079 {
9080 exp->expType = op1->type;
9081 if(op1->type)
9082 op1->type->refCount++;
9083 }
9084 return 0x1;
9085 }
9086
9087 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9088 {
9089 unsigned short value2 = op2->us;
9090
9091 exp->type = 2;
9092 exp->string = PrintUShort((op1->us >>= value2));
9093 if(!exp->expType)
9094 {
9095 exp->expType = op1->type;
9096 if(op1->type)
9097 op1->type->refCount++;
9098 }
9099 return 0x1;
9100 }
9101
9102 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9103 {
9104 char value2 = op2->c;
9105
9106 exp->type = 2;
9107 exp->string = PrintChar((op1->c >>= value2));
9108 if(!exp->expType)
9109 {
9110 exp->expType = op1->type;
9111 if(op1->type)
9112 op1->type->refCount++;
9113 }
9114 return 0x1;
9115 }
9116
9117 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9118 {
9119 unsigned char value2 = op2->uc;
9120
9121 exp->type = 2;
9122 exp->string = PrintUChar((op1->uc >>= value2));
9123 if(!exp->expType)
9124 {
9125 exp->expType = op1->type;
9126 if(op1->type)
9127 op1->type->refCount++;
9128 }
9129 return 0x1;
9130 }
9131
9132 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
9133 {
9134 exp->type = 2;
9135 exp->string = PrintInt((int)(!op1->i));
9136 if(!exp->expType)
9137 {
9138 exp->expType = op1->type;
9139 if(op1->type)
9140 op1->type->refCount++;
9141 }
9142 return 0x1;
9143 }
9144
9145 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
9146 {
9147 exp->type = 2;
9148 exp->string = PrintUInt((unsigned int)(!op1->ui));
9149 if(!exp->expType)
9150 {
9151 exp->expType = op1->type;
9152 if(op1->type)
9153 op1->type->refCount++;
9154 }
9155 return 0x1;
9156 }
9157
9158 static unsigned int Int64Not(struct Expression * exp, struct Operand * op1)
9159 {
9160 exp->type = 2;
9161 exp->string = PrintInt64((long long)(!op1->i64));
9162 if(!exp->expType)
9163 {
9164 exp->expType = op1->type;
9165 if(op1->type)
9166 op1->type->refCount++;
9167 }
9168 return 0x1;
9169 }
9170
9171 static unsigned int UInt64Not(struct Expression * exp, struct Operand * op1)
9172 {
9173 exp->type = 2;
9174 exp->string = PrintUInt64((uint64)(!op1->ui64));
9175 if(!exp->expType)
9176 {
9177 exp->expType = op1->type;
9178 if(op1->type)
9179 op1->type->refCount++;
9180 }
9181 return 0x1;
9182 }
9183
9184 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
9185 {
9186 exp->type = 2;
9187 exp->string = PrintShort((short)(!op1->s));
9188 if(!exp->expType)
9189 {
9190 exp->expType = op1->type;
9191 if(op1->type)
9192 op1->type->refCount++;
9193 }
9194 return 0x1;
9195 }
9196
9197 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
9198 {
9199 exp->type = 2;
9200 exp->string = PrintUShort((unsigned short)(!op1->us));
9201 if(!exp->expType)
9202 {
9203 exp->expType = op1->type;
9204 if(op1->type)
9205 op1->type->refCount++;
9206 }
9207 return 0x1;
9208 }
9209
9210 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
9211 {
9212 exp->type = 2;
9213 exp->string = PrintChar((char)(!op1->c));
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 UCharNot(struct Expression * exp, struct Operand * op1)
9224 {
9225 exp->type = 2;
9226 exp->string = PrintUChar((unsigned char)(!op1->uc));
9227 if(!exp->expType)
9228 {
9229 exp->expType = op1->type;
9230 if(op1->type)
9231 op1->type->refCount++;
9232 }
9233 return 0x1;
9234 }
9235
9236 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9237 {
9238 int value2 = op2->i;
9239
9240 exp->type = 2;
9241 exp->string = PrintInt((int)(op1->i == value2));
9242 if(!exp->expType)
9243 {
9244 exp->expType = op1->type;
9245 if(op1->type)
9246 op1->type->refCount++;
9247 }
9248 return 0x1;
9249 }
9250
9251 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9252 {
9253 unsigned int value2 = op2->ui;
9254
9255 exp->type = 2;
9256 exp->string = PrintUInt((unsigned int)(op1->ui == value2));
9257 if(!exp->expType)
9258 {
9259 exp->expType = op1->type;
9260 if(op1->type)
9261 op1->type->refCount++;
9262 }
9263 return 0x1;
9264 }
9265
9266 static unsigned int Int64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9267 {
9268 long long value2 = op2->i64;
9269
9270 exp->type = 2;
9271 exp->string = PrintInt64((long long)(op1->i64 == value2));
9272 if(!exp->expType)
9273 {
9274 exp->expType = op1->type;
9275 if(op1->type)
9276 op1->type->refCount++;
9277 }
9278 return 0x1;
9279 }
9280
9281 static unsigned int UInt64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9282 {
9283 uint64 value2 = op2->ui64;
9284
9285 exp->type = 2;
9286 exp->string = PrintUInt64((uint64)(op1->ui64 == value2));
9287 if(!exp->expType)
9288 {
9289 exp->expType = op1->type;
9290 if(op1->type)
9291 op1->type->refCount++;
9292 }
9293 return 0x1;
9294 }
9295
9296 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9297 {
9298 short value2 = op2->s;
9299
9300 exp->type = 2;
9301 exp->string = PrintShort((short)(op1->s == value2));
9302 if(!exp->expType)
9303 {
9304 exp->expType = op1->type;
9305 if(op1->type)
9306 op1->type->refCount++;
9307 }
9308 return 0x1;
9309 }
9310
9311 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9312 {
9313 unsigned short value2 = op2->us;
9314
9315 exp->type = 2;
9316 exp->string = PrintUShort((unsigned short)(op1->us == value2));
9317 if(!exp->expType)
9318 {
9319 exp->expType = op1->type;
9320 if(op1->type)
9321 op1->type->refCount++;
9322 }
9323 return 0x1;
9324 }
9325
9326 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9327 {
9328 char value2 = op2->c;
9329
9330 exp->type = 2;
9331 exp->string = PrintChar((char)(op1->c == value2));
9332 if(!exp->expType)
9333 {
9334 exp->expType = op1->type;
9335 if(op1->type)
9336 op1->type->refCount++;
9337 }
9338 return 0x1;
9339 }
9340
9341 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9342 {
9343 unsigned char value2 = op2->uc;
9344
9345 exp->type = 2;
9346 exp->string = PrintUChar((unsigned char)(op1->uc == value2));
9347 if(!exp->expType)
9348 {
9349 exp->expType = op1->type;
9350 if(op1->type)
9351 op1->type->refCount++;
9352 }
9353 return 0x1;
9354 }
9355
9356 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9357 {
9358 float value2 = op2->f;
9359
9360 exp->type = 2;
9361 exp->string = PrintFloat((float)(op1->f == value2));
9362 if(!exp->expType)
9363 {
9364 exp->expType = op1->type;
9365 if(op1->type)
9366 op1->type->refCount++;
9367 }
9368 return 0x1;
9369 }
9370
9371 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9372 {
9373 double value2 = op2->d;
9374
9375 exp->type = 2;
9376 exp->string = PrintDouble((double)(op1->d == value2));
9377 if(!exp->expType)
9378 {
9379 exp->expType = op1->type;
9380 if(op1->type)
9381 op1->type->refCount++;
9382 }
9383 return 0x1;
9384 }
9385
9386 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9387 {
9388 int value2 = op2->i;
9389
9390 exp->type = 2;
9391 exp->string = PrintInt((int)(op1->i != value2));
9392 if(!exp->expType)
9393 {
9394 exp->expType = op1->type;
9395 if(op1->type)
9396 op1->type->refCount++;
9397 }
9398 return 0x1;
9399 }
9400
9401 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9402 {
9403 unsigned int value2 = op2->ui;
9404
9405 exp->type = 2;
9406 exp->string = PrintUInt((unsigned int)(op1->ui != value2));
9407 if(!exp->expType)
9408 {
9409 exp->expType = op1->type;
9410 if(op1->type)
9411 op1->type->refCount++;
9412 }
9413 return 0x1;
9414 }
9415
9416 static unsigned int Int64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9417 {
9418 long long value2 = op2->i64;
9419
9420 exp->type = 2;
9421 exp->string = PrintInt64((long long)(op1->i64 != value2));
9422 if(!exp->expType)
9423 {
9424 exp->expType = op1->type;
9425 if(op1->type)
9426 op1->type->refCount++;
9427 }
9428 return 0x1;
9429 }
9430
9431 static unsigned int UInt64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9432 {
9433 uint64 value2 = op2->ui64;
9434
9435 exp->type = 2;
9436 exp->string = PrintUInt64((uint64)(op1->ui64 != value2));
9437 if(!exp->expType)
9438 {
9439 exp->expType = op1->type;
9440 if(op1->type)
9441 op1->type->refCount++;
9442 }
9443 return 0x1;
9444 }
9445
9446 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9447 {
9448 short value2 = op2->s;
9449
9450 exp->type = 2;
9451 exp->string = PrintShort((short)(op1->s != value2));
9452 if(!exp->expType)
9453 {
9454 exp->expType = op1->type;
9455 if(op1->type)
9456 op1->type->refCount++;
9457 }
9458 return 0x1;
9459 }
9460
9461 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9462 {
9463 unsigned short value2 = op2->us;
9464
9465 exp->type = 2;
9466 exp->string = PrintUShort((unsigned short)(op1->us != value2));
9467 if(!exp->expType)
9468 {
9469 exp->expType = op1->type;
9470 if(op1->type)
9471 op1->type->refCount++;
9472 }
9473 return 0x1;
9474 }
9475
9476 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9477 {
9478 char value2 = op2->c;
9479
9480 exp->type = 2;
9481 exp->string = PrintChar((char)(op1->c != value2));
9482 if(!exp->expType)
9483 {
9484 exp->expType = op1->type;
9485 if(op1->type)
9486 op1->type->refCount++;
9487 }
9488 return 0x1;
9489 }
9490
9491 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9492 {
9493 unsigned char value2 = op2->uc;
9494
9495 exp->type = 2;
9496 exp->string = PrintUChar((unsigned char)(op1->uc != value2));
9497 if(!exp->expType)
9498 {
9499 exp->expType = op1->type;
9500 if(op1->type)
9501 op1->type->refCount++;
9502 }
9503 return 0x1;
9504 }
9505
9506 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9507 {
9508 float value2 = op2->f;
9509
9510 exp->type = 2;
9511 exp->string = PrintFloat((float)(op1->f != value2));
9512 if(!exp->expType)
9513 {
9514 exp->expType = op1->type;
9515 if(op1->type)
9516 op1->type->refCount++;
9517 }
9518 return 0x1;
9519 }
9520
9521 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9522 {
9523 double value2 = op2->d;
9524
9525 exp->type = 2;
9526 exp->string = PrintDouble((double)(op1->d != value2));
9527 if(!exp->expType)
9528 {
9529 exp->expType = op1->type;
9530 if(op1->type)
9531 op1->type->refCount++;
9532 }
9533 return 0x1;
9534 }
9535
9536 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9537 {
9538 int value2 = op2->i;
9539
9540 exp->type = 2;
9541 exp->string = PrintInt((int)(op1->i && value2));
9542 if(!exp->expType)
9543 {
9544 exp->expType = op1->type;
9545 if(op1->type)
9546 op1->type->refCount++;
9547 }
9548 return 0x1;
9549 }
9550
9551 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9552 {
9553 unsigned int value2 = op2->ui;
9554
9555 exp->type = 2;
9556 exp->string = PrintUInt((unsigned int)(op1->ui && value2));
9557 if(!exp->expType)
9558 {
9559 exp->expType = op1->type;
9560 if(op1->type)
9561 op1->type->refCount++;
9562 }
9563 return 0x1;
9564 }
9565
9566 static unsigned int Int64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9567 {
9568 long long value2 = op2->i64;
9569
9570 exp->type = 2;
9571 exp->string = PrintInt64((long long)(op1->i64 && value2));
9572 if(!exp->expType)
9573 {
9574 exp->expType = op1->type;
9575 if(op1->type)
9576 op1->type->refCount++;
9577 }
9578 return 0x1;
9579 }
9580
9581 static unsigned int UInt64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9582 {
9583 uint64 value2 = op2->ui64;
9584
9585 exp->type = 2;
9586 exp->string = PrintUInt64((uint64)(op1->ui64 && value2));
9587 if(!exp->expType)
9588 {
9589 exp->expType = op1->type;
9590 if(op1->type)
9591 op1->type->refCount++;
9592 }
9593 return 0x1;
9594 }
9595
9596 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9597 {
9598 short value2 = op2->s;
9599
9600 exp->type = 2;
9601 exp->string = PrintShort((short)(op1->s && value2));
9602 if(!exp->expType)
9603 {
9604 exp->expType = op1->type;
9605 if(op1->type)
9606 op1->type->refCount++;
9607 }
9608 return 0x1;
9609 }
9610
9611 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9612 {
9613 unsigned short value2 = op2->us;
9614
9615 exp->type = 2;
9616 exp->string = PrintUShort((unsigned short)(op1->us && value2));
9617 if(!exp->expType)
9618 {
9619 exp->expType = op1->type;
9620 if(op1->type)
9621 op1->type->refCount++;
9622 }
9623 return 0x1;
9624 }
9625
9626 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9627 {
9628 char value2 = op2->c;
9629
9630 exp->type = 2;
9631 exp->string = PrintChar((char)(op1->c && value2));
9632 if(!exp->expType)
9633 {
9634 exp->expType = op1->type;
9635 if(op1->type)
9636 op1->type->refCount++;
9637 }
9638 return 0x1;
9639 }
9640
9641 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9642 {
9643 unsigned char value2 = op2->uc;
9644
9645 exp->type = 2;
9646 exp->string = PrintUChar((unsigned char)(op1->uc && value2));
9647 if(!exp->expType)
9648 {
9649 exp->expType = op1->type;
9650 if(op1->type)
9651 op1->type->refCount++;
9652 }
9653 return 0x1;
9654 }
9655
9656 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9657 {
9658 float value2 = op2->f;
9659
9660 exp->type = 2;
9661 exp->string = PrintFloat((float)(op1->f && value2));
9662 if(!exp->expType)
9663 {
9664 exp->expType = op1->type;
9665 if(op1->type)
9666 op1->type->refCount++;
9667 }
9668 return 0x1;
9669 }
9670
9671 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9672 {
9673 double value2 = op2->d;
9674
9675 exp->type = 2;
9676 exp->string = PrintDouble((double)(op1->d && value2));
9677 if(!exp->expType)
9678 {
9679 exp->expType = op1->type;
9680 if(op1->type)
9681 op1->type->refCount++;
9682 }
9683 return 0x1;
9684 }
9685
9686 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9687 {
9688 int value2 = op2->i;
9689
9690 exp->type = 2;
9691 exp->string = PrintInt((int)(op1->i || value2));
9692 if(!exp->expType)
9693 {
9694 exp->expType = op1->type;
9695 if(op1->type)
9696 op1->type->refCount++;
9697 }
9698 return 0x1;
9699 }
9700
9701 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9702 {
9703 unsigned int value2 = op2->ui;
9704
9705 exp->type = 2;
9706 exp->string = PrintUInt((unsigned int)(op1->ui || value2));
9707 if(!exp->expType)
9708 {
9709 exp->expType = op1->type;
9710 if(op1->type)
9711 op1->type->refCount++;
9712 }
9713 return 0x1;
9714 }
9715
9716 static unsigned int Int64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9717 {
9718 long long value2 = op2->i64;
9719
9720 exp->type = 2;
9721 exp->string = PrintInt64((long long)(op1->i64 || value2));
9722 if(!exp->expType)
9723 {
9724 exp->expType = op1->type;
9725 if(op1->type)
9726 op1->type->refCount++;
9727 }
9728 return 0x1;
9729 }
9730
9731 static unsigned int UInt64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9732 {
9733 uint64 value2 = op2->ui64;
9734
9735 exp->type = 2;
9736 exp->string = PrintUInt64((uint64)(op1->ui64 || value2));
9737 if(!exp->expType)
9738 {
9739 exp->expType = op1->type;
9740 if(op1->type)
9741 op1->type->refCount++;
9742 }
9743 return 0x1;
9744 }
9745
9746 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9747 {
9748 short value2 = op2->s;
9749
9750 exp->type = 2;
9751 exp->string = PrintShort((short)(op1->s || value2));
9752 if(!exp->expType)
9753 {
9754 exp->expType = op1->type;
9755 if(op1->type)
9756 op1->type->refCount++;
9757 }
9758 return 0x1;
9759 }
9760
9761 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9762 {
9763 unsigned short value2 = op2->us;
9764
9765 exp->type = 2;
9766 exp->string = PrintUShort((unsigned short)(op1->us || value2));
9767 if(!exp->expType)
9768 {
9769 exp->expType = op1->type;
9770 if(op1->type)
9771 op1->type->refCount++;
9772 }
9773 return 0x1;
9774 }
9775
9776 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9777 {
9778 char value2 = op2->c;
9779
9780 exp->type = 2;
9781 exp->string = PrintChar((char)(op1->c || value2));
9782 if(!exp->expType)
9783 {
9784 exp->expType = op1->type;
9785 if(op1->type)
9786 op1->type->refCount++;
9787 }
9788 return 0x1;
9789 }
9790
9791 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9792 {
9793 unsigned char value2 = op2->uc;
9794
9795 exp->type = 2;
9796 exp->string = PrintUChar((unsigned char)(op1->uc || value2));
9797 if(!exp->expType)
9798 {
9799 exp->expType = op1->type;
9800 if(op1->type)
9801 op1->type->refCount++;
9802 }
9803 return 0x1;
9804 }
9805
9806 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9807 {
9808 float value2 = op2->f;
9809
9810 exp->type = 2;
9811 exp->string = PrintFloat((float)(op1->f || value2));
9812 if(!exp->expType)
9813 {
9814 exp->expType = op1->type;
9815 if(op1->type)
9816 op1->type->refCount++;
9817 }
9818 return 0x1;
9819 }
9820
9821 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9822 {
9823 double value2 = op2->d;
9824
9825 exp->type = 2;
9826 exp->string = PrintDouble((double)(op1->d || value2));
9827 if(!exp->expType)
9828 {
9829 exp->expType = op1->type;
9830 if(op1->type)
9831 op1->type->refCount++;
9832 }
9833 return 0x1;
9834 }
9835
9836 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9837 {
9838 int value2 = op2->i;
9839
9840 exp->type = 2;
9841 exp->string = PrintInt((int)(op1->i > value2));
9842 if(!exp->expType)
9843 {
9844 exp->expType = op1->type;
9845 if(op1->type)
9846 op1->type->refCount++;
9847 }
9848 return 0x1;
9849 }
9850
9851 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9852 {
9853 unsigned int value2 = op2->ui;
9854
9855 exp->type = 2;
9856 exp->string = PrintUInt((unsigned int)(op1->ui > value2));
9857 if(!exp->expType)
9858 {
9859 exp->expType = op1->type;
9860 if(op1->type)
9861 op1->type->refCount++;
9862 }
9863 return 0x1;
9864 }
9865
9866 static unsigned int Int64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9867 {
9868 long long value2 = op2->i64;
9869
9870 exp->type = 2;
9871 exp->string = PrintInt64((long long)(op1->i64 > value2));
9872 if(!exp->expType)
9873 {
9874 exp->expType = op1->type;
9875 if(op1->type)
9876 op1->type->refCount++;
9877 }
9878 return 0x1;
9879 }
9880
9881 static unsigned int UInt64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9882 {
9883 uint64 value2 = op2->ui64;
9884
9885 exp->type = 2;
9886 exp->string = PrintUInt64((uint64)(op1->ui64 > value2));
9887 if(!exp->expType)
9888 {
9889 exp->expType = op1->type;
9890 if(op1->type)
9891 op1->type->refCount++;
9892 }
9893 return 0x1;
9894 }
9895
9896 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9897 {
9898 short value2 = op2->s;
9899
9900 exp->type = 2;
9901 exp->string = PrintShort((short)(op1->s > value2));
9902 if(!exp->expType)
9903 {
9904 exp->expType = op1->type;
9905 if(op1->type)
9906 op1->type->refCount++;
9907 }
9908 return 0x1;
9909 }
9910
9911 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9912 {
9913 unsigned short value2 = op2->us;
9914
9915 exp->type = 2;
9916 exp->string = PrintUShort((unsigned short)(op1->us > value2));
9917 if(!exp->expType)
9918 {
9919 exp->expType = op1->type;
9920 if(op1->type)
9921 op1->type->refCount++;
9922 }
9923 return 0x1;
9924 }
9925
9926 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9927 {
9928 char value2 = op2->c;
9929
9930 exp->type = 2;
9931 exp->string = PrintChar((char)(op1->c > value2));
9932 if(!exp->expType)
9933 {
9934 exp->expType = op1->type;
9935 if(op1->type)
9936 op1->type->refCount++;
9937 }
9938 return 0x1;
9939 }
9940
9941 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9942 {
9943 unsigned char value2 = op2->uc;
9944
9945 exp->type = 2;
9946 exp->string = PrintUChar((unsigned char)(op1->uc > value2));
9947 if(!exp->expType)
9948 {
9949 exp->expType = op1->type;
9950 if(op1->type)
9951 op1->type->refCount++;
9952 }
9953 return 0x1;
9954 }
9955
9956 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9957 {
9958 float value2 = op2->f;
9959
9960 exp->type = 2;
9961 exp->string = PrintFloat((float)(op1->f > value2));
9962 if(!exp->expType)
9963 {
9964 exp->expType = op1->type;
9965 if(op1->type)
9966 op1->type->refCount++;
9967 }
9968 return 0x1;
9969 }
9970
9971 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9972 {
9973 double value2 = op2->d;
9974
9975 exp->type = 2;
9976 exp->string = PrintDouble((double)(op1->d > value2));
9977 if(!exp->expType)
9978 {
9979 exp->expType = op1->type;
9980 if(op1->type)
9981 op1->type->refCount++;
9982 }
9983 return 0x1;
9984 }
9985
9986 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9987 {
9988 int value2 = op2->i;
9989
9990 exp->type = 2;
9991 exp->string = PrintInt((int)(op1->i < value2));
9992 if(!exp->expType)
9993 {
9994 exp->expType = op1->type;
9995 if(op1->type)
9996 op1->type->refCount++;
9997 }
9998 return 0x1;
9999 }
10000
10001 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10002 {
10003 unsigned int value2 = op2->ui;
10004
10005 exp->type = 2;
10006 exp->string = PrintUInt((unsigned int)(op1->ui < value2));
10007 if(!exp->expType)
10008 {
10009 exp->expType = op1->type;
10010 if(op1->type)
10011 op1->type->refCount++;
10012 }
10013 return 0x1;
10014 }
10015
10016 static unsigned int Int64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10017 {
10018 long long value2 = op2->i64;
10019
10020 exp->type = 2;
10021 exp->string = PrintInt64((long long)(op1->i64 < value2));
10022 if(!exp->expType)
10023 {
10024 exp->expType = op1->type;
10025 if(op1->type)
10026 op1->type->refCount++;
10027 }
10028 return 0x1;
10029 }
10030
10031 static unsigned int UInt64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10032 {
10033 uint64 value2 = op2->ui64;
10034
10035 exp->type = 2;
10036 exp->string = PrintUInt64((uint64)(op1->ui64 < value2));
10037 if(!exp->expType)
10038 {
10039 exp->expType = op1->type;
10040 if(op1->type)
10041 op1->type->refCount++;
10042 }
10043 return 0x1;
10044 }
10045
10046 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10047 {
10048 short value2 = op2->s;
10049
10050 exp->type = 2;
10051 exp->string = PrintShort((short)(op1->s < value2));
10052 if(!exp->expType)
10053 {
10054 exp->expType = op1->type;
10055 if(op1->type)
10056 op1->type->refCount++;
10057 }
10058 return 0x1;
10059 }
10060
10061 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10062 {
10063 unsigned short value2 = op2->us;
10064
10065 exp->type = 2;
10066 exp->string = PrintUShort((unsigned short)(op1->us < value2));
10067 if(!exp->expType)
10068 {
10069 exp->expType = op1->type;
10070 if(op1->type)
10071 op1->type->refCount++;
10072 }
10073 return 0x1;
10074 }
10075
10076 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10077 {
10078 char value2 = op2->c;
10079
10080 exp->type = 2;
10081 exp->string = PrintChar((char)(op1->c < value2));
10082 if(!exp->expType)
10083 {
10084 exp->expType = op1->type;
10085 if(op1->type)
10086 op1->type->refCount++;
10087 }
10088 return 0x1;
10089 }
10090
10091 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10092 {
10093 unsigned char value2 = op2->uc;
10094
10095 exp->type = 2;
10096 exp->string = PrintUChar((unsigned char)(op1->uc < value2));
10097 if(!exp->expType)
10098 {
10099 exp->expType = op1->type;
10100 if(op1->type)
10101 op1->type->refCount++;
10102 }
10103 return 0x1;
10104 }
10105
10106 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10107 {
10108 float value2 = op2->f;
10109
10110 exp->type = 2;
10111 exp->string = PrintFloat((float)(op1->f < value2));
10112 if(!exp->expType)
10113 {
10114 exp->expType = op1->type;
10115 if(op1->type)
10116 op1->type->refCount++;
10117 }
10118 return 0x1;
10119 }
10120
10121 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10122 {
10123 double value2 = op2->d;
10124
10125 exp->type = 2;
10126 exp->string = PrintDouble((double)(op1->d < value2));
10127 if(!exp->expType)
10128 {
10129 exp->expType = op1->type;
10130 if(op1->type)
10131 op1->type->refCount++;
10132 }
10133 return 0x1;
10134 }
10135
10136 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10137 {
10138 int value2 = op2->i;
10139
10140 exp->type = 2;
10141 exp->string = PrintInt((int)(op1->i >= value2));
10142 if(!exp->expType)
10143 {
10144 exp->expType = op1->type;
10145 if(op1->type)
10146 op1->type->refCount++;
10147 }
10148 return 0x1;
10149 }
10150
10151 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10152 {
10153 unsigned int value2 = op2->ui;
10154
10155 exp->type = 2;
10156 exp->string = PrintUInt((unsigned int)(op1->ui >= value2));
10157 if(!exp->expType)
10158 {
10159 exp->expType = op1->type;
10160 if(op1->type)
10161 op1->type->refCount++;
10162 }
10163 return 0x1;
10164 }
10165
10166 static unsigned int Int64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10167 {
10168 long long value2 = op2->i64;
10169
10170 exp->type = 2;
10171 exp->string = PrintInt64((long long)(op1->i64 >= value2));
10172 if(!exp->expType)
10173 {
10174 exp->expType = op1->type;
10175 if(op1->type)
10176 op1->type->refCount++;
10177 }
10178 return 0x1;
10179 }
10180
10181 static unsigned int UInt64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10182 {
10183 uint64 value2 = op2->ui64;
10184
10185 exp->type = 2;
10186 exp->string = PrintUInt64((uint64)(op1->ui64 >= value2));
10187 if(!exp->expType)
10188 {
10189 exp->expType = op1->type;
10190 if(op1->type)
10191 op1->type->refCount++;
10192 }
10193 return 0x1;
10194 }
10195
10196 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10197 {
10198 short value2 = op2->s;
10199
10200 exp->type = 2;
10201 exp->string = PrintShort((short)(op1->s >= value2));
10202 if(!exp->expType)
10203 {
10204 exp->expType = op1->type;
10205 if(op1->type)
10206 op1->type->refCount++;
10207 }
10208 return 0x1;
10209 }
10210
10211 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10212 {
10213 unsigned short value2 = op2->us;
10214
10215 exp->type = 2;
10216 exp->string = PrintUShort((unsigned short)(op1->us >= value2));
10217 if(!exp->expType)
10218 {
10219 exp->expType = op1->type;
10220 if(op1->type)
10221 op1->type->refCount++;
10222 }
10223 return 0x1;
10224 }
10225
10226 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10227 {
10228 char value2 = op2->c;
10229
10230 exp->type = 2;
10231 exp->string = PrintChar((char)(op1->c >= value2));
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 UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10242 {
10243 unsigned char value2 = op2->uc;
10244
10245 exp->type = 2;
10246 exp->string = PrintUChar((unsigned char)(op1->uc >= value2));
10247 if(!exp->expType)
10248 {
10249 exp->expType = op1->type;
10250 if(op1->type)
10251 op1->type->refCount++;
10252 }
10253 return 0x1;
10254 }
10255
10256 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10257 {
10258 float value2 = op2->f;
10259
10260 exp->type = 2;
10261 exp->string = PrintFloat((float)(op1->f >= value2));
10262 if(!exp->expType)
10263 {
10264 exp->expType = op1->type;
10265 if(op1->type)
10266 op1->type->refCount++;
10267 }
10268 return 0x1;
10269 }
10270
10271 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10272 {
10273 double value2 = op2->d;
10274
10275 exp->type = 2;
10276 exp->string = PrintDouble((double)(op1->d >= value2));
10277 if(!exp->expType)
10278 {
10279 exp->expType = op1->type;
10280 if(op1->type)
10281 op1->type->refCount++;
10282 }
10283 return 0x1;
10284 }
10285
10286 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10287 {
10288 int value2 = op2->i;
10289
10290 exp->type = 2;
10291 exp->string = PrintInt((int)(op1->i <= value2));
10292 if(!exp->expType)
10293 {
10294 exp->expType = op1->type;
10295 if(op1->type)
10296 op1->type->refCount++;
10297 }
10298 return 0x1;
10299 }
10300
10301 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10302 {
10303 unsigned int value2 = op2->ui;
10304
10305 exp->type = 2;
10306 exp->string = PrintUInt((unsigned int)(op1->ui <= value2));
10307 if(!exp->expType)
10308 {
10309 exp->expType = op1->type;
10310 if(op1->type)
10311 op1->type->refCount++;
10312 }
10313 return 0x1;
10314 }
10315
10316 static unsigned int Int64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10317 {
10318 long long value2 = op2->i64;
10319
10320 exp->type = 2;
10321 exp->string = PrintInt64((long long)(op1->i64 <= value2));
10322 if(!exp->expType)
10323 {
10324 exp->expType = op1->type;
10325 if(op1->type)
10326 op1->type->refCount++;
10327 }
10328 return 0x1;
10329 }
10330
10331 static unsigned int UInt64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10332 {
10333 uint64 value2 = op2->ui64;
10334
10335 exp->type = 2;
10336 exp->string = PrintUInt64((uint64)(op1->ui64 <= value2));
10337 if(!exp->expType)
10338 {
10339 exp->expType = op1->type;
10340 if(op1->type)
10341 op1->type->refCount++;
10342 }
10343 return 0x1;
10344 }
10345
10346 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10347 {
10348 short value2 = op2->s;
10349
10350 exp->type = 2;
10351 exp->string = PrintShort((short)(op1->s <= value2));
10352 if(!exp->expType)
10353 {
10354 exp->expType = op1->type;
10355 if(op1->type)
10356 op1->type->refCount++;
10357 }
10358 return 0x1;
10359 }
10360
10361 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10362 {
10363 unsigned short value2 = op2->us;
10364
10365 exp->type = 2;
10366 exp->string = PrintUShort((unsigned short)(op1->us <= value2));
10367 if(!exp->expType)
10368 {
10369 exp->expType = op1->type;
10370 if(op1->type)
10371 op1->type->refCount++;
10372 }
10373 return 0x1;
10374 }
10375
10376 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10377 {
10378 char value2 = op2->c;
10379
10380 exp->type = 2;
10381 exp->string = PrintChar((char)(op1->c <= value2));
10382 if(!exp->expType)
10383 {
10384 exp->expType = op1->type;
10385 if(op1->type)
10386 op1->type->refCount++;
10387 }
10388 return 0x1;
10389 }
10390
10391 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10392 {
10393 unsigned char value2 = op2->uc;
10394
10395 exp->type = 2;
10396 exp->string = PrintUChar((unsigned char)(op1->uc <= value2));
10397 if(!exp->expType)
10398 {
10399 exp->expType = op1->type;
10400 if(op1->type)
10401 op1->type->refCount++;
10402 }
10403 return 0x1;
10404 }
10405
10406 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10407 {
10408 float value2 = op2->f;
10409
10410 exp->type = 2;
10411 exp->string = PrintFloat((float)(op1->f <= value2));
10412 if(!exp->expType)
10413 {
10414 exp->expType = op1->type;
10415 if(op1->type)
10416 op1->type->refCount++;
10417 }
10418 return 0x1;
10419 }
10420
10421 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10422 {
10423 double value2 = op2->d;
10424
10425 exp->type = 2;
10426 exp->string = PrintDouble((double)(op1->d <= value2));
10427 if(!exp->expType)
10428 {
10429 exp->expType = op1->type;
10430 if(op1->type)
10431 op1->type->refCount++;
10432 }
10433 return 0x1;
10434 }
10435
10436 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10437 {
10438 exp->type = 2;
10439 exp->string = PrintInt(op1->i ? op2->i : op3->i);
10440 if(!exp->expType)
10441 {
10442 exp->expType = op1->type;
10443 if(op1->type)
10444 op1->type->refCount++;
10445 }
10446 return 0x1;
10447 }
10448
10449 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10450 {
10451 exp->type = 2;
10452 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
10453 if(!exp->expType)
10454 {
10455 exp->expType = op1->type;
10456 if(op1->type)
10457 op1->type->refCount++;
10458 }
10459 return 0x1;
10460 }
10461
10462 static unsigned int Int64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10463 {
10464 exp->type = 2;
10465 exp->string = PrintInt64(op1->i64 ? op2->i64 : op3->i64);
10466 if(!exp->expType)
10467 {
10468 exp->expType = op1->type;
10469 if(op1->type)
10470 op1->type->refCount++;
10471 }
10472 return 0x1;
10473 }
10474
10475 static unsigned int UInt64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10476 {
10477 exp->type = 2;
10478 exp->string = PrintUInt64(op1->ui64 ? op2->ui64 : op3->ui64);
10479 if(!exp->expType)
10480 {
10481 exp->expType = op1->type;
10482 if(op1->type)
10483 op1->type->refCount++;
10484 }
10485 return 0x1;
10486 }
10487
10488 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10489 {
10490 exp->type = 2;
10491 exp->string = PrintShort(op1->s ? op2->s : op3->s);
10492 if(!exp->expType)
10493 {
10494 exp->expType = op1->type;
10495 if(op1->type)
10496 op1->type->refCount++;
10497 }
10498 return 0x1;
10499 }
10500
10501 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10502 {
10503 exp->type = 2;
10504 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
10505 if(!exp->expType)
10506 {
10507 exp->expType = op1->type;
10508 if(op1->type)
10509 op1->type->refCount++;
10510 }
10511 return 0x1;
10512 }
10513
10514 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10515 {
10516 exp->type = 2;
10517 exp->string = PrintChar(op1->c ? op2->c : op3->c);
10518 if(!exp->expType)
10519 {
10520 exp->expType = op1->type;
10521 if(op1->type)
10522 op1->type->refCount++;
10523 }
10524 return 0x1;
10525 }
10526
10527 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10528 {
10529 exp->type = 2;
10530 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
10531 if(!exp->expType)
10532 {
10533 exp->expType = op1->type;
10534 if(op1->type)
10535 op1->type->refCount++;
10536 }
10537 return 0x1;
10538 }
10539
10540 struct OpTable intOps =
10541 {
10542 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
10543 };
10544
10545 struct OpTable uintOps =
10546 {
10547 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
10548 };
10549
10550 struct OpTable int64Ops =
10551 {
10552 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
10553 };
10554
10555 struct OpTable uint64Ops =
10556 {
10557 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
10558 };
10559
10560 struct OpTable shortOps =
10561 {
10562 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
10563 };
10564
10565 struct OpTable ushortOps =
10566 {
10567 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
10568 };
10569
10570 struct OpTable floatOps =
10571 {
10572 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
10573 };
10574
10575 struct OpTable doubleOps =
10576 {
10577 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
10578 };
10579
10580 struct OpTable charOps =
10581 {
10582 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
10583 };
10584
10585 struct OpTable ucharOps =
10586 {
10587 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
10588 };
10589
10590 void ReadString(char * output, char * string)
10591 {
10592 int len = strlen(string);
10593 int c, d = 0;
10594 unsigned int quoted = 0x0, escaped = 0x0;
10595
10596 for(c = 0; c < len; c++)
10597 {
10598 char ch = string[c];
10599
10600 if(escaped)
10601 {
10602 switch(ch)
10603 {
10604 case 'n':
10605 output[d] = '\n';
10606 break;
10607 case 't':
10608 output[d] = '\t';
10609 break;
10610 case 'a':
10611 output[d] = '\a';
10612 break;
10613 case 'b':
10614 output[d] = '\b';
10615 break;
10616 case 'f':
10617 output[d] = '\f';
10618 break;
10619 case 'r':
10620 output[d] = '\r';
10621 break;
10622 case 'v':
10623 output[d] = '\v';
10624 break;
10625 case '\\':
10626 output[d] = '\\';
10627 break;
10628 case '\"':
10629 output[d] = '\"';
10630 break;
10631 case '\'':
10632 output[d] = '\'';
10633 break;
10634 default:
10635 output[d] = ch;
10636 }
10637 d++;
10638 escaped = 0x0;
10639 }
10640 else
10641 {
10642 if(ch == '\"')
10643 quoted ^= 0x1;
10644 else if(quoted)
10645 {
10646 if(ch == '\\')
10647 escaped = 0x1;
10648 else
10649 output[d++] = ch;
10650 }
10651 }
10652 }
10653 output[d] = '\0';
10654 }
10655
10656 int UnescapeString(char * d, char * s, int len)
10657 {
10658 int j = 0, k = 0;
10659 char ch;
10660
10661 while(j < len && (ch = s[j]))
10662 {
10663 switch(ch)
10664 {
10665 case '\\':
10666 switch((ch = s[++j]))
10667 {
10668 case 'n':
10669 d[k] = '\n';
10670 break;
10671 case 't':
10672 d[k] = '\t';
10673 break;
10674 case 'a':
10675 d[k] = '\a';
10676 break;
10677 case 'b':
10678 d[k] = '\b';
10679 break;
10680 case 'f':
10681 d[k] = '\f';
10682 break;
10683 case 'r':
10684 d[k] = '\r';
10685 break;
10686 case 'v':
10687 d[k] = '\v';
10688 break;
10689 case '\\':
10690 d[k] = '\\';
10691 break;
10692 case '\"':
10693 d[k] = '\"';
10694 break;
10695 case '\'':
10696 d[k] = '\'';
10697 break;
10698 default:
10699 d[k] = '\\';
10700 d[k] = ch;
10701 }
10702 break;
10703 default:
10704 d[k] = ch;
10705 }
10706 j++, k++;
10707 }
10708 d[k] = '\0';
10709 return k;
10710 }
10711
10712 char * OffsetEscapedString(char * s, int len, int offset)
10713 {
10714 char ch;
10715 int j = 0, k = 0;
10716
10717 while(j < len && k < offset && (ch = s[j]))
10718 {
10719 if(ch == '\\')
10720 ++j;
10721 j++, k++;
10722 }
10723 return (k == offset) ? s + j : (((void *)0));
10724 }
10725
10726 extern long long __ecereNameSpace__ecere__com___strtoi64(char *  string, char * *  endString, int base);
10727
10728 extern uint64 __ecereNameSpace__ecere__com___strtoui64(char *  string, char * *  endString, int base);
10729
10730 extern double strtod(char * , char * * );
10731
10732 extern float (* __ecereMethod_float_inf)(void);
10733
10734 extern float (* __ecereMethod_float_nan)(void);
10735
10736 extern double (* __ecereMethod_double_inf)(void);
10737
10738 extern double (* __ecereMethod_double_nan)(void);
10739
10740 struct Operand GetOperand(struct Expression * exp)
10741 {
10742 struct Operand op =
10743 {
10744 0, 0, 0, .c = 0,
10745 {
10746 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10747 }
10748 };
10749 struct Type * type = exp->expType;
10750
10751 if(type)
10752 {
10753 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
10754 {
10755 if(!type->_class->registered->dataType)
10756 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
10757 type = type->_class->registered->dataType;
10758 }
10759 if(exp->type == 3 && op.kind == 13)
10760 {
10761 op.ui64 = (uint64)exp->string;
10762 op.kind = 13;
10763 op.ops = uint64Ops;
10764 }
10765 else if(exp->isConstant && exp->type == 2)
10766 {
10767 op.kind = type->kind;
10768 op.type = exp->expType;
10769 switch(op.kind)
10770 {
10771 case 24:
10772 case 1:
10773 {
10774 if(exp->constant[0] == '\'')
10775 {
10776 op.c = exp->constant[1];
10777 op.ops = charOps;
10778 }
10779 else if(type->isSigned)
10780 {
10781 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
10782 op.ops = charOps;
10783 }
10784 else
10785 {
10786 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
10787 op.ops = ucharOps;
10788 }
10789 break;
10790 }
10791 case 2:
10792 if(type->isSigned)
10793 {
10794 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
10795 op.ops = shortOps;
10796 }
10797 else
10798 {
10799 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
10800 op.ops = ushortOps;
10801 }
10802 break;
10803 case 3:
10804 case 5:
10805 if(type->isSigned)
10806 {
10807 op.i = strtol(exp->constant, (((void *)0)), 0);
10808 op.ops = intOps;
10809 }
10810 else
10811 {
10812 op.ui = strtoul(exp->constant, (((void *)0)), 0);
10813 op.ops = uintOps;
10814 }
10815 op.kind = 3;
10816 break;
10817 case 4:
10818 if(type->isSigned)
10819 {
10820 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10821 op.ops = int64Ops;
10822 }
10823 else
10824 {
10825 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10826 op.ops = uint64Ops;
10827 }
10828 op.kind = 4;
10829 break;
10830 case 22:
10831 if(type->isSigned)
10832 {
10833 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10834 op.ops = int64Ops;
10835 }
10836 else
10837 {
10838 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10839 op.ops = uint64Ops;
10840 }
10841 op.kind = 4;
10842 break;
10843 case 23:
10844 if(type->isSigned)
10845 {
10846 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10847 op.ops = int64Ops;
10848 }
10849 else
10850 {
10851 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10852 op.ops = uint64Ops;
10853 }
10854 op.kind = 4;
10855 break;
10856 case 6:
10857 if(!strcmp(exp->constant, "inf"))
10858 op.f = __ecereMethod_float_inf();
10859 else if(!strcmp(exp->constant, "-inf"))
10860 op.f = -__ecereMethod_float_inf();
10861 else if(!strcmp(exp->constant, "nan"))
10862 op.f = __ecereMethod_float_nan();
10863 else if(!strcmp(exp->constant, "-nan"))
10864 op.f = -__ecereMethod_float_nan();
10865 else
10866 op.f = (float)strtod(exp->constant, (((void *)0)));
10867 op.ops = floatOps;
10868 break;
10869 case 7:
10870 if(!strcmp(exp->constant, "inf"))
10871 op.d = __ecereMethod_double_inf();
10872 else if(!strcmp(exp->constant, "-inf"))
10873 op.d = -__ecereMethod_double_inf();
10874 else if(!strcmp(exp->constant, "nan"))
10875 op.d = __ecereMethod_double_nan();
10876 else if(!strcmp(exp->constant, "-nan"))
10877 op.d = -__ecereMethod_double_nan();
10878 else
10879 op.d = (double)strtod(exp->constant, (((void *)0)));
10880 op.ops = doubleOps;
10881 break;
10882 case 12:
10883 case 13:
10884 case 8:
10885 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10886 op.kind = 13;
10887 op.ops = uint64Ops;
10888 break;
10889 }
10890 }
10891 }
10892 return op;
10893 }
10894
10895 int __ecereVMethodID_class_OnGetString;
10896
10897 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
10898
10899 static void UnusedFunction()
10900 {
10901 int a;
10902
10903 ((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);
10904 }
10905
10906 extern int __ecereVMethodID_class_OnGetString;
10907
10908 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
10909 {
10910 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10911
10912 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
10913 {
10914 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
10915 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
10916 else
10917 {
10918 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10919 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
10920 struct Type * type;
10921 void * ptr = inst->data + dataMember->offset + offset;
10922 char * result = (((void *)0));
10923
10924 exp->loc = member->loc = inst->loc;
10925 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
10926 if(!dataMember->dataType)
10927 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
10928 type = dataMember->dataType;
10929 if(type->kind == 8)
10930 {
10931 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10932
10933 if(_class->type == 4)
10934 {
10935 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
10936
10937 if(enumClass)
10938 {
10939 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
10940 struct __ecereNameSpace__ecere__sys__NamedLink * item;
10941
10942 for(item = e->values.first; item; item = item->next)
10943 {
10944 if((int)item->data == *(int *)ptr)
10945 {
10946 result = item->name;
10947 break;
10948 }
10949 }
10950 if(result)
10951 {
10952 exp->identifier = MkIdentifier(result);
10953 exp->type = 0;
10954 exp->destType = MkClassType(_class->fullName);
10955 ProcessExpressionType(exp);
10956 }
10957 }
10958 }
10959 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
10960 {
10961 if(!_class->dataType)
10962 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10963 type = _class->dataType;
10964 }
10965 }
10966 if(!result)
10967 {
10968 switch(type->kind)
10969 {
10970 case 6:
10971 {
10972 FreeExpContents(exp);
10973 exp->constant = PrintFloat(*(float *)ptr);
10974 exp->type = 2;
10975 break;
10976 }
10977 case 7:
10978 {
10979 FreeExpContents(exp);
10980 exp->constant = PrintDouble(*(double *)ptr);
10981 exp->type = 2;
10982 break;
10983 }
10984 case 3:
10985 {
10986 FreeExpContents(exp);
10987 exp->constant = PrintInt(*(int *)ptr);
10988 exp->type = 2;
10989 break;
10990 }
10991 case 4:
10992 {
10993 FreeExpContents(exp);
10994 exp->constant = PrintInt64(*(long long *)ptr);
10995 exp->type = 2;
10996 break;
10997 }
10998 case 22:
10999 {
11000 FreeExpContents(exp);
11001 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
11002 exp->type = 2;
11003 break;
11004 }
11005 case 23:
11006 {
11007 FreeExpContents(exp);
11008 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
11009 exp->type = 2;
11010 break;
11011 }
11012 default:
11013 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
11014 }
11015 }
11016 ListAdd(memberList, member);
11017 }
11018 if(parentDataMember->type == 1)
11019 break;
11020 }
11021 }
11022
11023 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
11024
11025 void PopulateInstance(struct Instantiation * inst)
11026 {
11027 struct Symbol * classSym = inst->_class->symbol;
11028 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
11029 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
11030 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
11031
11032 if(!inst->members)
11033 inst->members = MkListOne(MkMembersInitList(memberList));
11034 else
11035 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
11036 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
11037 {
11038 if(!dataMember->isProperty)
11039 {
11040 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
11041 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
11042 else
11043 {
11044 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11045 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
11046 struct Type * type;
11047 void * ptr = inst->data + dataMember->offset;
11048 char * result = (((void *)0));
11049
11050 exp->loc = member->loc = inst->loc;
11051 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
11052 if(!dataMember->dataType)
11053 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
11054 type = dataMember->dataType;
11055 if(type->kind == 8)
11056 {
11057 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11058
11059 if(_class->type == 4)
11060 {
11061 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11062
11063 if(enumClass)
11064 {
11065 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
11066 struct __ecereNameSpace__ecere__sys__NamedLink * item;
11067
11068 for(item = e->values.first; item; item = item->next)
11069 {
11070 if((int)item->data == *(int *)ptr)
11071 {
11072 result = item->name;
11073 break;
11074 }
11075 }
11076 }
11077 if(result)
11078 {
11079 exp->identifier = MkIdentifier(result);
11080 exp->type = 0;
11081 exp->destType = MkClassType(_class->fullName);
11082 ProcessExpressionType(exp);
11083 }
11084 }
11085 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
11086 {
11087 if(!_class->dataType)
11088 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11089 type = _class->dataType;
11090 }
11091 }
11092 if(!result)
11093 {
11094 switch(type->kind)
11095 {
11096 case 6:
11097 {
11098 exp->constant = PrintFloat(*(float *)ptr);
11099 exp->type = 2;
11100 break;
11101 }
11102 case 7:
11103 {
11104 exp->constant = PrintDouble(*(double *)ptr);
11105 exp->type = 2;
11106 break;
11107 }
11108 case 3:
11109 {
11110 exp->constant = PrintInt(*(int *)ptr);
11111 exp->type = 2;
11112 break;
11113 }
11114 case 4:
11115 {
11116 exp->constant = PrintInt64(*(long long *)ptr);
11117 exp->type = 2;
11118 break;
11119 }
11120 case 22:
11121 {
11122 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
11123 exp->type = 2;
11124 break;
11125 }
11126 default:
11127 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
11128 }
11129 }
11130 ListAdd(memberList, member);
11131 }
11132 }
11133 }
11134 }
11135
11136 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);
11137
11138 extern void FreeInstance(struct Instantiation * inst);
11139
11140 void ComputeInstantiation(struct Expression * exp)
11141 {
11142 struct Instantiation * inst = exp->instance;
11143 struct MembersInit * members;
11144 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
11145 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
11146 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
11147 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
11148 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
11149 int subMemberStackPos = 0;
11150 uint64 bits = 0;
11151
11152 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11153 {
11154 if(inst->data)
11155 return ;
11156 if(_class->type == 0 || _class->type == 5)
11157 {
11158 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
11159 if(_class->type == 0)
11160 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)inst->data))->_refCount++;
11161 }
11162 else
11163 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11164 }
11165 if(inst->members)
11166 {
11167 for(members = (*inst->members).first; members; members = members->next)
11168 {
11169 switch(members->type)
11170 {
11171 case 0:
11172 {
11173 if(members->dataMembers)
11174 {
11175 struct MemberInit * member;
11176
11177 for(member = (*members->dataMembers).first; member; member = member->next)
11178 {
11179 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
11180 unsigned int found = 0x0;
11181 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11182 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
11183 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
11184 unsigned int dataMemberOffset;
11185
11186 if(!ident)
11187 {
11188 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
11189 if(curMember)
11190 {
11191 if(curMember->isProperty)
11192 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
11193 else
11194 {
11195 dataMember = curMember;
11196 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11197 if(_class->type == 0)
11198 dataMemberOffset += _class->base->structSize;
11199 }
11200 found = 0x1;
11201 }
11202 }
11203 else
11204 {
11205 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
11206 if(prop)
11207 {
11208 found = 0x1;
11209 if(prop->memberAccess == 1)
11210 {
11211 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
11212 curClass = prop->_class;
11213 }
11214 }
11215 else
11216 {
11217 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
11218 int _subMemberStackPos = 0;
11219
11220 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
11221 if(dataMember)
11222 {
11223 found = 0x1;
11224 if(dataMember->memberAccess == 1)
11225 {
11226 curMember = dataMember;
11227 curClass = dataMember->_class;
11228 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
11229 subMemberStackPos = _subMemberStackPos;
11230 }
11231 }
11232 }
11233 }
11234 if(found && member->initializer && member->initializer->type == 0)
11235 {
11236 struct Expression * value = member->initializer->exp;
11237 struct Type * type = (((void *)0));
11238 unsigned int deepMember = 0x0;
11239
11240 if(prop)
11241 {
11242 type = prop->dataType;
11243 }
11244 else if(dataMember)
11245 {
11246 if(!dataMember->dataType)
11247 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
11248 type = dataMember->dataType;
11249 }
11250 if(ident && ident->next)
11251 {
11252 deepMember = 0x1;
11253 for(ident = ident->next; ident && type; ident = ident->next)
11254 {
11255 if(type->kind == 8)
11256 {
11257 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
11258 if(prop)
11259 type = prop->dataType;
11260 else
11261 {
11262 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11263 if(dataMember)
11264 type = dataMember->dataType;
11265 }
11266 }
11267 else if(type->kind == 9 || type->kind == 10)
11268 {
11269 struct Type * memberType;
11270
11271 for(memberType = type->members.first; memberType; memberType = memberType->next)
11272 {
11273 if(!strcmp(memberType->name, ident->string))
11274 {
11275 type = memberType;
11276 break;
11277 }
11278 }
11279 }
11280 }
11281 }
11282 if(value)
11283 {
11284 FreeType(value->destType);
11285 value->destType = type;
11286 if(type)
11287 type->refCount++;
11288 ComputeExpression(value);
11289 }
11290 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11291 {
11292 if(type->kind == 8)
11293 {
11294 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11295
11296 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
11297 {
11298 if(!_class->dataType)
11299 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11300 type = _class->dataType;
11301 }
11302 }
11303 if(dataMember)
11304 {
11305 void * ptr = inst->data + dataMemberOffset;
11306
11307 if(value->type == 2)
11308 {
11309 switch(type->kind)
11310 {
11311 case 3:
11312 {
11313 GetInt(value, (int *)ptr);
11314 break;
11315 }
11316 case 4:
11317 {
11318 GetInt64(value, (long long *)ptr);
11319 break;
11320 }
11321 case 22:
11322 {
11323 GetIntPtr(value, (intptr_t *)ptr);
11324 break;
11325 }
11326 case 23:
11327 {
11328 GetIntSize(value, (ssize_t *)ptr);
11329 break;
11330 }
11331 case 6:
11332 {
11333 GetFloat(value, (float *)ptr);
11334 break;
11335 }
11336 case 7:
11337 {
11338 GetDouble(value, (double *)ptr);
11339 break;
11340 }
11341 }
11342 }
11343 else if(value->type == 1)
11344 {
11345 if(type->kind == 8)
11346 {
11347 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11348
11349 if(_class->type == 1)
11350 {
11351 ComputeTypeSize(type);
11352 if(value->instance->data)
11353 memcpy(ptr, value->instance->data, type->size);
11354 }
11355 }
11356 }
11357 }
11358 else if(prop)
11359 {
11360 if(value->type == 1 && value->instance->data)
11361 {
11362 if(type->kind == 8)
11363 {
11364 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11365
11366 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)))
11367 {
11368 void (* Set)(void *, void *) = (void *)prop->Set;
11369
11370 Set(inst->data, value->instance->data);
11371 PopulateInstance(inst);
11372 }
11373 }
11374 }
11375 else if(value->type == 2)
11376 {
11377 switch(type->kind)
11378 {
11379 case 7:
11380 {
11381 void (* Set)(void *, double) = (void *)prop->Set;
11382
11383 Set(inst->data, strtod(value->constant, (((void *)0))));
11384 break;
11385 }
11386 case 6:
11387 {
11388 void (* Set)(void *, float) = (void *)prop->Set;
11389
11390 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
11391 break;
11392 }
11393 case 3:
11394 {
11395 void (* Set)(void *, int) = (void *)prop->Set;
11396
11397 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
11398 break;
11399 }
11400 case 4:
11401 {
11402 void (* Set)(void *, long long) = (void *)prop->Set;
11403
11404 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11405 break;
11406 }
11407 case 22:
11408 {
11409 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11410
11411 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11412 break;
11413 }
11414 case 23:
11415 {
11416 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11417
11418 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11419 break;
11420 }
11421 }
11422 }
11423 else if(value->type == 3)
11424 {
11425 char temp[1024];
11426
11427 ReadString(temp, value->string);
11428 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
11429 }
11430 }
11431 }
11432 else if(!deepMember && type && _class->type == 3)
11433 {
11434 if(prop)
11435 {
11436 if(value->type == 2)
11437 {
11438 if(type->kind == 8)
11439 {
11440 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11441
11442 if(_class->type == 3)
11443 {
11444 if(!_class->dataType)
11445 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11446 type = _class->dataType;
11447 }
11448 }
11449 switch(type->kind)
11450 {
11451 case 6:
11452 {
11453 float fValue;
11454 float (* Set)(float) = (void *)prop->Set;
11455
11456 GetFloat(member->initializer->exp, &fValue);
11457 exp->constant = PrintFloat(Set(fValue));
11458 exp->type = 2;
11459 break;
11460 }
11461 case 7:
11462 {
11463 double dValue;
11464 double (* Set)(double) = (void *)prop->Set;
11465
11466 GetDouble(member->initializer->exp, &dValue);
11467 exp->constant = PrintDouble(Set(dValue));
11468 exp->type = 2;
11469 break;
11470 }
11471 }
11472 }
11473 }
11474 }
11475 else if(!deepMember && type && _class->type == 2)
11476 {
11477 if(prop)
11478 {
11479 if(value->type == 1 && value->instance->data)
11480 {
11481 unsigned int (* Set)(void *) = (void *)prop->Set;
11482
11483 bits = Set(value->instance->data);
11484 }
11485 else if(value->type == 2)
11486 {
11487 }
11488 }
11489 else if(dataMember)
11490 {
11491 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
11492 struct Type * type;
11493 uint64 part;
11494
11495 bits = (bits & ~bitMember->mask);
11496 if(!bitMember->dataType)
11497 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
11498 type = bitMember->dataType;
11499 if(type->kind == 8 && type->_class && type->_class->registered)
11500 {
11501 if(!type->_class->registered->dataType)
11502 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
11503 type = type->_class->registered->dataType;
11504 }
11505 switch(type->kind)
11506 {
11507 case 24:
11508 case 1:
11509 {
11510 unsigned char v;
11511
11512 type->isSigned ? GetChar(value, &v) : GetUChar(value, &v);
11513 part = (uint64)v;
11514 break;
11515 }
11516 case 2:
11517 {
11518 unsigned short v;
11519
11520 type->isSigned ? GetShort(value, &v) : GetUShort(value, &v);
11521 part = (uint64)v;
11522 break;
11523 }
11524 case 3:
11525 case 5:
11526 {
11527 unsigned int v;
11528
11529 type->isSigned ? GetInt(value, &v) : GetUInt(value, &v);
11530 part = (uint64)v;
11531 break;
11532 }
11533 case 4:
11534 {
11535 uint64 v;
11536
11537 type->isSigned ? GetInt64(value, &v) : GetUInt64(value, &v);
11538 part = v;
11539 break;
11540 }
11541 case 22:
11542 {
11543 intptr_t v;
11544
11545 type->isSigned ? GetIntPtr(value, &v) : GetUIntPtr(value, &v);
11546 part = (uint64)v;
11547 break;
11548 }
11549 case 23:
11550 {
11551 ssize_t v;
11552
11553 type->isSigned ? GetIntSize(value, &v) : GetUIntSize(value, &v);
11554 part = (uint64)v;
11555 break;
11556 }
11557 }
11558 bits |= part << bitMember->pos;
11559 }
11560 }
11561 }
11562 else
11563 {
11564 if(_class && _class->type == 3)
11565 {
11566 ComputeExpression(member->initializer->exp);
11567 exp->constant = member->initializer->exp->constant;
11568 exp->type = 2;
11569 member->initializer->exp->constant = (((void *)0));
11570 }
11571 }
11572 }
11573 }
11574 break;
11575 }
11576 }
11577 }
11578 }
11579 if(_class && _class->type == 2)
11580 {
11581 exp->constant = PrintHexUInt(bits);
11582 exp->type = 2;
11583 }
11584 if(exp->type != 1)
11585 {
11586 FreeInstance(inst);
11587 }
11588 }
11589
11590 static unsigned int Promote(struct Operand * op, int kind, unsigned int isSigned)
11591 {
11592 unsigned int result = 0x0;
11593
11594 switch(kind)
11595 {
11596 case 2:
11597 if(op->kind == 1 || op->kind == 15 || op->kind == 24)
11598 result = isSigned ? GetOpShort(op, &op->s) : GetOpUShort(op, &op->us);
11599 break;
11600 case 3:
11601 case 5:
11602 if(op->kind == 1 || op->kind == 2 || op->kind == 15 || op->kind == 24)
11603 result = isSigned ? GetOpInt(op, &op->i) : GetOpUInt(op, &op->ui);
11604 break;
11605 case 4:
11606 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 4 || op->kind == 5 || op->kind == 6 || op->kind == 7 || op->kind == 13 || op->kind == 15 || op->kind == 22 || op->kind == 23 || op->kind == 24)
11607 result = isSigned ? GetOpInt64(op, &op->i64) : GetOpUInt64(op, &op->ui64);
11608 break;
11609 case 6:
11610 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 4 || op->kind == 5 || op->kind == 15 || op->kind == 22 || op->kind == 23 || op->kind == 24)
11611 result = GetOpFloat(op, &op->f);
11612 break;
11613 case 7:
11614 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 4 || op->kind == 5 || op->kind == 6 || op->kind == 15 || op->kind == 22 || op->kind == 23 || op->kind == 24)
11615 result = GetOpDouble(op, &op->d);
11616 break;
11617 case 13:
11618 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 4 || op->kind == 5 || op->kind == 6 || op->kind == 7 || op->kind == 13 || op->kind == 15 || op->kind == 22 || op->kind == 23 || op->kind == 24)
11619 result = GetOpUIntPtr(op, &op->ui64);
11620 break;
11621 case 15:
11622 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 4 || op->kind == 5 || op->kind == 6 || op->kind == 7 || op->kind == 13 || op->kind == 15 || op->kind == 22 || op->kind == 23 || op->kind == 24)
11623 result = isSigned ? GetOpInt(op, &op->i) : GetOpUInt(op, &op->ui);
11624 break;
11625 case 22:
11626 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11627 result = isSigned ? GetOpIntPtr(op, &op->i64) : GetOpUIntPtr(op, &op->i64);
11628 break;
11629 case 23:
11630 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11631 result = isSigned ? GetOpIntSize(op, &op->ui64) : GetOpUIntSize(op, &op->ui64);
11632 break;
11633 }
11634 return result;
11635 }
11636
11637 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
11638 {
11639 if(exp->op.op == SIZEOF)
11640 {
11641 FreeExpContents(exp);
11642 exp->type = 2;
11643 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
11644 }
11645 else
11646 {
11647 if(!exp->op.exp1)
11648 {
11649 switch(exp->op.op)
11650 {
11651 case '+':
11652 {
11653 struct Expression * exp2 = exp->op.exp2;
11654
11655 exp->op.exp2 = (((void *)0));
11656 FreeExpContents(exp);
11657 FreeType(exp->expType);
11658 FreeType(exp->destType);
11659 *exp = *exp2;
11660 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
11661 break;
11662 }
11663 case '-':
11664 if(op1->ops.Neg)
11665 {
11666 FreeExpContents(exp);
11667 op1->ops.Neg(exp, op1);
11668 }
11669 break;
11670 case '~':
11671 if(op1->ops.BitNot)
11672 {
11673 FreeExpContents(exp);
11674 op1->ops.BitNot(exp, op1);
11675 }
11676 break;
11677 case '!':
11678 if(op1->ops.Not)
11679 {
11680 FreeExpContents(exp);
11681 op1->ops.Not(exp, op1);
11682 }
11683 break;
11684 }
11685 }
11686 else
11687 {
11688 if(op1 && op2 && op1->type && op2->type && op1->kind != op2->kind)
11689 {
11690 if(Promote(op2, op1->kind, op1->type->isSigned))
11691 op2->kind = op1->kind, op2->ops = op1->ops;
11692 else if(Promote(op1, op2->kind, op2->type->isSigned))
11693 op1->kind = op2->kind, op1->ops = op2->ops;
11694 }
11695 switch(exp->op.op)
11696 {
11697 case '+':
11698 if(op1->ops.Add)
11699 {
11700 FreeExpContents(exp);
11701 op1->ops.Add(exp, op1, op2);
11702 }
11703 break;
11704 case '-':
11705 if(op1->ops.Sub)
11706 {
11707 FreeExpContents(exp);
11708 op1->ops.Sub(exp, op1, op2);
11709 }
11710 break;
11711 case '*':
11712 if(op1->ops.Mul)
11713 {
11714 FreeExpContents(exp);
11715 op1->ops.Mul(exp, op1, op2);
11716 }
11717 break;
11718 case '/':
11719 if(op1->ops.Div)
11720 {
11721 FreeExpContents(exp);
11722 op1->ops.Div(exp, op1, op2);
11723 }
11724 break;
11725 case '%':
11726 if(op1->ops.Mod)
11727 {
11728 FreeExpContents(exp);
11729 op1->ops.Mod(exp, op1, op2);
11730 }
11731 break;
11732 case '&':
11733 if(exp->op.exp2)
11734 {
11735 if(op1->ops.BitAnd)
11736 {
11737 FreeExpContents(exp);
11738 op1->ops.BitAnd(exp, op1, op2);
11739 }
11740 }
11741 break;
11742 case '|':
11743 if(op1->ops.BitOr)
11744 {
11745 FreeExpContents(exp);
11746 op1->ops.BitOr(exp, op1, op2);
11747 }
11748 break;
11749 case '^':
11750 if(op1->ops.BitXor)
11751 {
11752 FreeExpContents(exp);
11753 op1->ops.BitXor(exp, op1, op2);
11754 }
11755 break;
11756 case LEFT_OP:
11757 if(op1->ops.LShift)
11758 {
11759 FreeExpContents(exp);
11760 op1->ops.LShift(exp, op1, op2);
11761 }
11762 break;
11763 case RIGHT_OP:
11764 if(op1->ops.RShift)
11765 {
11766 FreeExpContents(exp);
11767 op1->ops.RShift(exp, op1, op2);
11768 }
11769 break;
11770 case EQ_OP:
11771 if(op1->ops.Equ)
11772 {
11773 FreeExpContents(exp);
11774 op1->ops.Equ(exp, op1, op2);
11775 }
11776 break;
11777 case NE_OP:
11778 if(op1->ops.Nqu)
11779 {
11780 FreeExpContents(exp);
11781 op1->ops.Nqu(exp, op1, op2);
11782 }
11783 break;
11784 case AND_OP:
11785 if(op1->ops.And)
11786 {
11787 FreeExpContents(exp);
11788 op1->ops.And(exp, op1, op2);
11789 }
11790 break;
11791 case OR_OP:
11792 if(op1->ops.Or)
11793 {
11794 FreeExpContents(exp);
11795 op1->ops.Or(exp, op1, op2);
11796 }
11797 break;
11798 case '>':
11799 if(op1->ops.Grt)
11800 {
11801 FreeExpContents(exp);
11802 op1->ops.Grt(exp, op1, op2);
11803 }
11804 break;
11805 case '<':
11806 if(op1->ops.Sma)
11807 {
11808 FreeExpContents(exp);
11809 op1->ops.Sma(exp, op1, op2);
11810 }
11811 break;
11812 case GE_OP:
11813 if(op1->ops.GrtEqu)
11814 {
11815 FreeExpContents(exp);
11816 op1->ops.GrtEqu(exp, op1, op2);
11817 }
11818 break;
11819 case LE_OP:
11820 if(op1->ops.SmaEqu)
11821 {
11822 FreeExpContents(exp);
11823 op1->ops.SmaEqu(exp, op1, op2);
11824 }
11825 break;
11826 }
11827 }
11828 }
11829 }
11830
11831 void PrintTypeNoConst(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
11832
11833 extern struct Expression * MkExpIdentifier(struct Identifier * id);
11834
11835 void ComputeExpression(struct Expression * exp)
11836 {
11837 char expString[10240];
11838
11839 expString[0] = '\0';
11840 switch(exp->type)
11841 {
11842 case 1:
11843 {
11844 ComputeInstantiation(exp);
11845 break;
11846 }
11847 case 4:
11848 {
11849 struct Expression * exp1, * exp2 = (((void *)0));
11850 struct Operand op1 =
11851 {
11852 0, 0, 0, .c = 0,
11853 {
11854 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11855 }
11856 };
11857 struct Operand op2 =
11858 {
11859 0, 0, 0, .c = 0,
11860 {
11861 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11862 }
11863 };
11864
11865 if(exp->op.exp2)
11866 {
11867 struct Expression * e = exp->op.exp2;
11868
11869 while((e->type == 5 || e->type == 32 || e->type == 23) && e->list)
11870 {
11871 if(e->type == 5 || e->type == 32 || e->type == 23)
11872 {
11873 if(e->type == 23)
11874 e = (*((struct Statement *)(*e->compound->compound.statements).last)->expressions).last;
11875 else
11876 e = (*e->list).last;
11877 }
11878 }
11879 if(exp->op.op == 261 && e && e->expType)
11880 {
11881 if(e->type == 3 && e->string)
11882 {
11883 char * string = e->string;
11884 int len = strlen(string);
11885 char * tmp = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (len - 2 + 1));
11886
11887 len = UnescapeString(tmp, string + 1, len - 2);
11888 (__ecereNameSpace__ecere__com__eSystem_Delete(tmp), tmp = 0);
11889 FreeExpContents(exp);
11890 exp->type = 2;
11891 exp->constant = PrintUInt(len + 1);
11892 }
11893 else
11894 {
11895 struct Type * type = e->expType;
11896
11897 type->refCount++;
11898 FreeExpContents(exp);
11899 exp->type = 2;
11900 exp->constant = PrintUInt(ComputeTypeSize(type));
11901 FreeType(type);
11902 }
11903 break;
11904 }
11905 else
11906 ComputeExpression(exp->op.exp2);
11907 }
11908 if(exp->op.exp1)
11909 {
11910 ComputeExpression(exp->op.exp1);
11911 exp1 = exp->op.exp1;
11912 exp2 = exp->op.exp2;
11913 op1 = GetOperand(exp1);
11914 if(op1.type)
11915 op1.type->refCount++;
11916 if(exp2)
11917 {
11918 op2 = GetOperand(exp2);
11919 if(op2.type)
11920 op2.type->refCount++;
11921 }
11922 }
11923 else
11924 {
11925 exp1 = exp->op.exp2;
11926 op1 = GetOperand(exp1);
11927 if(op1.type)
11928 op1.type->refCount++;
11929 }
11930 CallOperator(exp, exp1, exp2, &op1, &op2);
11931 if(op1.type)
11932 FreeType(op1.type);
11933 if(op2.type)
11934 FreeType(op2.type);
11935 break;
11936 }
11937 case 5:
11938 case 32:
11939 {
11940 struct Expression * e, * n;
11941
11942 for(e = (*exp->list).first; e; e = n)
11943 {
11944 n = e->next;
11945 if(!n)
11946 {
11947 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
11948 struct Expression * prev = exp->prev;
11949 struct Expression * next = exp->next;
11950
11951 ComputeExpression(e);
11952 FreeType(exp->expType);
11953 FreeType(exp->destType);
11954 *exp = *e;
11955 exp->prev = prev;
11956 exp->next = next;
11957 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
11958 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
11959 }
11960 else
11961 {
11962 FreeExpression(e);
11963 }
11964 }
11965 break;
11966 }
11967 case 8:
11968 {
11969 struct Expression * memberExp = exp->member.exp;
11970 struct Identifier * memberID = exp->member.member;
11971 struct Type * type;
11972
11973 ComputeExpression(exp->member.exp);
11974 type = exp->member.exp->expType;
11975 if(type)
11976 {
11977 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)));
11978 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11979 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11980 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
11981
11982 if(type->kind == 19 && exp->member.exp->type == 24)
11983 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
11984 if(!_class)
11985 {
11986 char string[256];
11987 struct Symbol * classSym;
11988
11989 string[0] = '\0';
11990 PrintTypeNoConst(type, string, 0x0, 0x1);
11991 classSym = FindClass(string);
11992 _class = classSym ? classSym->registered : (((void *)0));
11993 }
11994 if(exp->member.member)
11995 {
11996 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
11997 if(!prop)
11998 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
11999 }
12000 if(!prop && !member && _class && exp->member.member)
12001 {
12002 struct Symbol * classSym = FindClass(exp->member.member->string);
12003
12004 convertTo = _class;
12005 _class = classSym ? classSym->registered : (((void *)0));
12006 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
12007 }
12008 if(prop)
12009 {
12010 if(prop->compiled)
12011 {
12012 struct Type * type = prop->dataType;
12013
12014 if(_class->type == 3)
12015 {
12016 if(type->kind == 8)
12017 {
12018 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12019
12020 if(_class->type == 3)
12021 {
12022 if(!_class->dataType)
12023 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
12024 type = _class->dataType;
12025 }
12026 }
12027 switch(type->kind)
12028 {
12029 case 6:
12030 {
12031 float value;
12032 float (* Get)(float) = (void *)prop->Get;
12033
12034 GetFloat(exp->member.exp, &value);
12035 exp->constant = PrintFloat(Get ? Get(value) : value);
12036 exp->type = 2;
12037 break;
12038 }
12039 case 7:
12040 {
12041 double value;
12042 double (* Get)(double);
12043
12044 GetDouble(exp->member.exp, &value);
12045 if(convertTo)
12046 Get = (void *)prop->Set;
12047 else
12048 Get = (void *)prop->Get;
12049 exp->constant = PrintDouble(Get ? Get(value) : value);
12050 exp->type = 2;
12051 break;
12052 }
12053 }
12054 }
12055 else
12056 {
12057 if(convertTo)
12058 {
12059 struct Expression * value = exp->member.exp;
12060 struct Type * type;
12061
12062 if(!prop->dataType)
12063 ProcessPropertyType(prop);
12064 type = prop->dataType;
12065 if(!type)
12066 {
12067 }
12068 else if(_class->type == 1)
12069 {
12070 switch(type->kind)
12071 {
12072 case 8:
12073 {
12074 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
12075
12076 if(propertyClass->type == 1 && value->type == 1)
12077 {
12078 void (* Set)(void *, void *) = (void *)prop->Set;
12079
12080 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12081 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12082 exp->instance->_class = MkSpecifierName(_class->fullName);
12083 exp->instance->loc = exp->loc;
12084 exp->type = 1;
12085 Set(exp->instance->data, value->instance->data);
12086 PopulateInstance(exp->instance);
12087 }
12088 break;
12089 }
12090 case 3:
12091 {
12092 int intValue;
12093 void (* Set)(void *, int) = (void *)prop->Set;
12094
12095 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12096 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12097 exp->instance->_class = MkSpecifierName(_class->fullName);
12098 exp->instance->loc = exp->loc;
12099 exp->type = 1;
12100 GetInt(value, &intValue);
12101 Set(exp->instance->data, intValue);
12102 PopulateInstance(exp->instance);
12103 break;
12104 }
12105 case 4:
12106 {
12107 long long intValue;
12108 void (* Set)(void *, long long) = (void *)prop->Set;
12109
12110 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12111 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12112 exp->instance->_class = MkSpecifierName(_class->fullName);
12113 exp->instance->loc = exp->loc;
12114 exp->type = 1;
12115 GetInt64(value, &intValue);
12116 Set(exp->instance->data, intValue);
12117 PopulateInstance(exp->instance);
12118 break;
12119 }
12120 case 22:
12121 {
12122 intptr_t intValue;
12123 void (* Set)(void *, intptr_t) = (void *)prop->Set;
12124
12125 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12126 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12127 exp->instance->_class = MkSpecifierName(_class->fullName);
12128 exp->instance->loc = exp->loc;
12129 exp->type = 1;
12130 GetIntPtr(value, &intValue);
12131 Set(exp->instance->data, intValue);
12132 PopulateInstance(exp->instance);
12133 break;
12134 }
12135 case 23:
12136 {
12137 ssize_t intValue;
12138 void (* Set)(void *, ssize_t) = (void *)prop->Set;
12139
12140 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12141 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12142 exp->instance->_class = MkSpecifierName(_class->fullName);
12143 exp->instance->loc = exp->loc;
12144 exp->type = 1;
12145 GetIntSize(value, &intValue);
12146 Set(exp->instance->data, intValue);
12147 PopulateInstance(exp->instance);
12148 break;
12149 }
12150 case 6:
12151 {
12152 float floatValue;
12153 void (* Set)(void *, float) = (void *)prop->Set;
12154
12155 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12156 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12157 exp->instance->_class = MkSpecifierName(_class->fullName);
12158 exp->instance->loc = exp->loc;
12159 exp->type = 1;
12160 GetFloat(value, &floatValue);
12161 Set(exp->instance->data, floatValue);
12162 PopulateInstance(exp->instance);
12163 break;
12164 }
12165 case 7:
12166 {
12167 double doubleValue;
12168 void (* Set)(void *, double) = (void *)prop->Set;
12169
12170 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12171 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12172 exp->instance->_class = MkSpecifierName(_class->fullName);
12173 exp->instance->loc = exp->loc;
12174 exp->type = 1;
12175 GetDouble(value, &doubleValue);
12176 Set(exp->instance->data, doubleValue);
12177 PopulateInstance(exp->instance);
12178 break;
12179 }
12180 }
12181 }
12182 else if(_class->type == 2)
12183 {
12184 switch(type->kind)
12185 {
12186 case 8:
12187 {
12188 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
12189
12190 if(propertyClass->type == 1 && value->instance->data)
12191 {
12192 unsigned int (* Set)(void *) = (void *)prop->Set;
12193 unsigned int bits = Set(value->instance->data);
12194
12195 exp->constant = PrintHexUInt(bits);
12196 exp->type = 2;
12197 break;
12198 }
12199 else if(_class->type == 2)
12200 {
12201 unsigned int value;
12202 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
12203 unsigned int bits;
12204
12205 GetUInt(exp->member.exp, &value);
12206 bits = Set(value);
12207 exp->constant = PrintHexUInt(bits);
12208 exp->type = 2;
12209 }
12210 }
12211 }
12212 }
12213 }
12214 else
12215 {
12216 if(_class->type == 2)
12217 {
12218 unsigned int value;
12219
12220 GetUInt(exp->member.exp, &value);
12221 switch(type->kind)
12222 {
12223 case 8:
12224 {
12225 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12226
12227 if(_class->type == 1)
12228 {
12229 void (* Get)(unsigned int, void *) = (void *)prop->Get;
12230
12231 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12232 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12233 exp->instance->_class = MkSpecifierName(_class->fullName);
12234 exp->instance->loc = exp->loc;
12235 exp->type = 1;
12236 Get(value, exp->instance->data);
12237 PopulateInstance(exp->instance);
12238 }
12239 else if(_class->type == 2)
12240 {
12241 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
12242 uint64 bits = Get(value);
12243
12244 exp->constant = PrintHexUInt64(bits);
12245 exp->type = 2;
12246 }
12247 break;
12248 }
12249 }
12250 }
12251 else if(_class->type == 1)
12252 {
12253 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
12254
12255 switch(type->kind)
12256 {
12257 case 8:
12258 {
12259 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12260
12261 if(_class->type == 1 && value)
12262 {
12263 void (* Get)(void *, void *) = (void *)prop->Get;
12264
12265 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12266 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12267 exp->instance->_class = MkSpecifierName(_class->fullName);
12268 exp->instance->loc = exp->loc;
12269 exp->type = 1;
12270 Get(value, exp->instance->data);
12271 PopulateInstance(exp->instance);
12272 }
12273 break;
12274 }
12275 }
12276 }
12277 }
12278 }
12279 }
12280 else
12281 {
12282 exp->isConstant = 0x0;
12283 }
12284 }
12285 else if(member)
12286 {
12287 }
12288 }
12289 if(exp->type != 8)
12290 {
12291 FreeExpression(memberExp);
12292 FreeIdentifier(memberID);
12293 }
12294 break;
12295 }
12296 case 10:
12297 {
12298 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
12299
12300 FreeExpContents(exp);
12301 exp->constant = PrintUInt(ComputeTypeSize(type));
12302 exp->type = 2;
12303 FreeType(type);
12304 break;
12305 }
12306 case 15:
12307 {
12308 struct Symbol * classSym = exp->_class->symbol;
12309
12310 if(classSym && classSym->registered)
12311 {
12312 if(classSym->registered->fixed)
12313 {
12314 FreeSpecifier(exp->_class);
12315 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
12316 exp->type = 2;
12317 }
12318 else
12319 {
12320 char className[1024];
12321
12322 strcpy(className, "__ecereClass_");
12323 FullClassNameCat(className, classSym->string, 0x1);
12324 MangleClassName(className);
12325 DeclareClass(classSym, className);
12326 FreeExpContents(exp);
12327 exp->type = 9;
12328 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
12329 exp->member.member = MkIdentifier("structSize");
12330 }
12331 }
12332 break;
12333 }
12334 case 11:
12335 {
12336 struct Type * type;
12337 struct Expression * e = exp;
12338
12339 if(exp->type == 11)
12340 {
12341 if(exp->cast.exp)
12342 ComputeExpression(exp->cast.exp);
12343 e = exp->cast.exp;
12344 }
12345 if(e && exp->expType)
12346 {
12347 type = exp->expType;
12348 if(type->kind == 8)
12349 {
12350 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12351
12352 if(_class && (_class->type == 3 || _class->type == 2))
12353 {
12354 if(!_class->dataType)
12355 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
12356 type = _class->dataType;
12357 }
12358 }
12359 switch(type->kind)
12360 {
12361 case 24:
12362 case 1:
12363 if(type->isSigned)
12364 {
12365 char value = (char)0;
12366
12367 if(GetChar(e, &value))
12368 {
12369 FreeExpContents(exp);
12370 exp->constant = PrintChar(value);
12371 exp->type = 2;
12372 }
12373 }
12374 else
12375 {
12376 unsigned char value = (unsigned char)0;
12377
12378 if(GetUChar(e, &value))
12379 {
12380 FreeExpContents(exp);
12381 exp->constant = PrintUChar(value);
12382 exp->type = 2;
12383 }
12384 }
12385 break;
12386 case 2:
12387 if(type->isSigned)
12388 {
12389 short value = (short)0;
12390
12391 if(GetShort(e, &value))
12392 {
12393 FreeExpContents(exp);
12394 exp->constant = PrintShort(value);
12395 exp->type = 2;
12396 }
12397 }
12398 else
12399 {
12400 unsigned short value = (unsigned short)0;
12401
12402 if(GetUShort(e, &value))
12403 {
12404 FreeExpContents(exp);
12405 exp->constant = PrintUShort(value);
12406 exp->type = 2;
12407 }
12408 }
12409 break;
12410 case 3:
12411 if(type->isSigned)
12412 {
12413 int value = 0;
12414
12415 if(GetInt(e, &value))
12416 {
12417 FreeExpContents(exp);
12418 exp->constant = PrintInt(value);
12419 exp->type = 2;
12420 }
12421 }
12422 else
12423 {
12424 unsigned int value = 0;
12425
12426 if(GetUInt(e, &value))
12427 {
12428 FreeExpContents(exp);
12429 exp->constant = PrintUInt(value);
12430 exp->type = 2;
12431 }
12432 }
12433 break;
12434 case 4:
12435 if(type->isSigned)
12436 {
12437 long long value = 0;
12438
12439 if(GetInt64(e, &value))
12440 {
12441 FreeExpContents(exp);
12442 exp->constant = PrintInt64(value);
12443 exp->type = 2;
12444 }
12445 }
12446 else
12447 {
12448 uint64 value = 0;
12449
12450 if(GetUInt64(e, &value))
12451 {
12452 FreeExpContents(exp);
12453 exp->constant = PrintUInt64(value);
12454 exp->type = 2;
12455 }
12456 }
12457 break;
12458 case 22:
12459 if(type->isSigned)
12460 {
12461 intptr_t value = 0;
12462
12463 if(GetIntPtr(e, &value))
12464 {
12465 FreeExpContents(exp);
12466 exp->constant = PrintInt64((long long)value);
12467 exp->type = 2;
12468 }
12469 }
12470 else
12471 {
12472 uintptr_t value = 0;
12473
12474 if(GetUIntPtr(e, &value))
12475 {
12476 FreeExpContents(exp);
12477 exp->constant = PrintUInt64((uint64)value);
12478 exp->type = 2;
12479 }
12480 }
12481 break;
12482 case 23:
12483 if(type->isSigned)
12484 {
12485 ssize_t value = 0;
12486
12487 if(GetIntSize(e, &value))
12488 {
12489 FreeExpContents(exp);
12490 exp->constant = PrintInt64((long long)value);
12491 exp->type = 2;
12492 }
12493 }
12494 else
12495 {
12496 size_t value = 0;
12497
12498 if(GetUIntSize(e, &value))
12499 {
12500 FreeExpContents(exp);
12501 exp->constant = PrintUInt64((uint64)value);
12502 exp->type = 2;
12503 }
12504 }
12505 break;
12506 case 6:
12507 {
12508 float value = 0;
12509
12510 if(GetFloat(e, &value))
12511 {
12512 FreeExpContents(exp);
12513 exp->constant = PrintFloat(value);
12514 exp->type = 2;
12515 }
12516 break;
12517 }
12518 case 7:
12519 {
12520 double value = 0;
12521
12522 if(GetDouble(e, &value))
12523 {
12524 FreeExpContents(exp);
12525 exp->constant = PrintDouble(value);
12526 exp->type = 2;
12527 }
12528 break;
12529 }
12530 }
12531 }
12532 break;
12533 }
12534 case 12:
12535 {
12536 struct Operand op1 =
12537 {
12538 0, 0, 0, .c = 0,
12539 {
12540 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12541 }
12542 };
12543 struct Operand op2 =
12544 {
12545 0, 0, 0, .c = 0,
12546 {
12547 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12548 }
12549 };
12550 struct Operand op3 =
12551 {
12552 0, 0, 0, .c = 0,
12553 {
12554 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12555 }
12556 };
12557
12558 if(exp->cond.exp)
12559 ComputeExpression((*exp->cond.exp).last);
12560 if(exp->cond.elseExp)
12561 ComputeExpression(exp->cond.elseExp);
12562 if(exp->cond.cond)
12563 ComputeExpression(exp->cond.cond);
12564 op1 = GetOperand(exp->cond.cond);
12565 if(op1.type)
12566 op1.type->refCount++;
12567 op2 = GetOperand((*exp->cond.exp).last);
12568 if(op2.type)
12569 op2.type->refCount++;
12570 op3 = GetOperand(exp->cond.elseExp);
12571 if(op3.type)
12572 op3.type->refCount++;
12573 if(op1.ops.Cond)
12574 {
12575 FreeExpContents(exp);
12576 op1.ops.Cond(exp, &op1, &op2, &op3);
12577 }
12578 if(op1.type)
12579 FreeType(op1.type);
12580 if(op2.type)
12581 FreeType(op2.type);
12582 if(op3.type)
12583 FreeType(op3.type);
12584 break;
12585 }
12586 }
12587 }
12588
12589 void ApplyAnyObjectLogic(struct Expression * e);
12590
12591 extern void CopyTypeInto(struct Type * type, struct Type * src);
12592
12593 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
12594 {
12595 unsigned int result = 0x1;
12596
12597 if(destType)
12598 {
12599 struct __ecereNameSpace__ecere__sys__OldList converts =
12600 {
12601 0, 0, 0, 0, 0
12602 };
12603 struct Conversion * convert;
12604
12605 if(destType->kind == 0)
12606 return 0x0;
12607 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
12608 result = 0x0;
12609 if(converts.count)
12610 {
12611 for(convert = converts.first; convert; convert = convert->next)
12612 {
12613 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
12614
12615 if(!empty)
12616 {
12617 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12618 int objectType = exp->expType ? exp->expType->classObjectType : 0;
12619
12620 *newExp = *exp;
12621 newExp->prev = (((void *)0));
12622 newExp->next = (((void *)0));
12623 newExp->destType = (((void *)0));
12624 if(convert->isGet)
12625 {
12626 exp->type = 8;
12627 exp->addedThis = 0x1;
12628 exp->member.exp = newExp;
12629 FreeType(exp->member.exp->expType);
12630 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
12631 exp->member.exp->expType->classObjectType = objectType;
12632 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
12633 exp->member.memberType = 1;
12634 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12635 exp->needCast = 0x1;
12636 if(exp->expType)
12637 exp->expType->refCount++;
12638 ApplyAnyObjectLogic(exp->member.exp);
12639 }
12640 else
12641 {
12642 {
12643 exp->type = 8;
12644 exp->addedThis = 0x1;
12645 exp->member.exp = newExp;
12646 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
12647 {
12648 newExp->byReference = 0x1;
12649 }
12650 FreeType(exp->member.exp->expType);
12651 exp->member.exp->expType = (((void *)0));
12652 if(convert->convert->dataType)
12653 {
12654 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12655 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
12656 exp->member.exp->expType->refCount = 1;
12657 exp->member.exp->expType->classObjectType = objectType;
12658 ApplyAnyObjectLogic(exp->member.exp);
12659 }
12660 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
12661 exp->member.memberType = 4;
12662 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12663 exp->needCast = 0x1;
12664 if(convert->resultType)
12665 convert->resultType->refCount++;
12666 }
12667 }
12668 }
12669 else
12670 {
12671 FreeType(exp->expType);
12672 if(convert->isGet)
12673 {
12674 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12675 exp->needCast = 0x1;
12676 if(exp->expType)
12677 exp->expType->refCount++;
12678 }
12679 else
12680 {
12681 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12682 exp->needCast = 0x1;
12683 if(convert->resultType)
12684 convert->resultType->refCount++;
12685 }
12686 }
12687 }
12688 if(exp->isConstant && inCompiler)
12689 ComputeExpression(exp);
12690 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
12691 }
12692 if(!result && exp->expType && converts.count)
12693 {
12694 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
12695 }
12696 if(!result && exp->expType && exp->destType)
12697 {
12698 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))
12699 result = 0x1;
12700 }
12701 }
12702 return result;
12703 }
12704
12705 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
12706
12707 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
12708
12709 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
12710
12711 void CheckTemplateTypes(struct Expression * exp)
12712 {
12713 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
12714 {
12715 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12716 struct Statement * compound;
12717 struct Context * context;
12718
12719 *newExp = *exp;
12720 if(exp->destType)
12721 exp->destType->refCount++;
12722 if(exp->expType)
12723 exp->expType->refCount++;
12724 newExp->prev = (((void *)0));
12725 newExp->next = (((void *)0));
12726 switch(exp->expType->kind)
12727 {
12728 case 7:
12729 if(exp->destType->classObjectType)
12730 {
12731 if(exp->destType)
12732 exp->destType->refCount--;
12733 if(exp->expType)
12734 exp->expType->refCount--;
12735 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12736 }
12737 else
12738 {
12739 struct __ecereNameSpace__ecere__sys__OldList * specs;
12740 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12741 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12742
12743 context = PushContext();
12744 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12745 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12746 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12747 exp->type = 23;
12748 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12749 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
12750 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
12751 exp->compound->compound.context = context;
12752 PopContext(context);
12753 }
12754 break;
12755 default:
12756 exp->type = 11;
12757 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
12758 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12759 break;
12760 }
12761 }
12762 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
12763 {
12764 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12765 struct Statement * compound;
12766 struct Context * context;
12767
12768 *newExp = *exp;
12769 if(exp->destType)
12770 exp->destType->refCount++;
12771 if(exp->expType)
12772 exp->expType->refCount++;
12773 newExp->prev = (((void *)0));
12774 newExp->next = (((void *)0));
12775 switch(exp->expType->kind)
12776 {
12777 case 7:
12778 if(exp->destType->classObjectType)
12779 {
12780 if(exp->destType)
12781 exp->destType->refCount--;
12782 if(exp->expType)
12783 exp->expType->refCount--;
12784 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12785 }
12786 else
12787 {
12788 struct __ecereNameSpace__ecere__sys__OldList * specs;
12789 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12790 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12791
12792 context = PushContext();
12793 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12794 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12795 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12796 exp->type = 23;
12797 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12798 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
12799 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
12800 exp->compound->compound.context = context;
12801 PopContext(context);
12802 }
12803 break;
12804 case 8:
12805 {
12806 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
12807 {
12808 exp->type = 5;
12809 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
12810 ProcessExpressionType((*exp->list).first);
12811 break;
12812 }
12813 else
12814 {
12815 exp->type = 5;
12816 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
12817 newExp->needCast = 0x1;
12818 ProcessExpressionType((*exp->list).first);
12819 break;
12820 }
12821 }
12822 default:
12823 {
12824 if(exp->expType->kind == 20)
12825 {
12826 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
12827
12828 if(type)
12829 {
12830 FreeType(exp->destType);
12831 FreeType(exp->expType);
12832 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12833 break;
12834 }
12835 }
12836 if(newExp->type == 8 && newExp->member.memberType == 3)
12837 {
12838 exp->type = 4;
12839 exp->op.op = '*';
12840 exp->op.exp1 = (((void *)0));
12841 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
12842 }
12843 else
12844 {
12845 char typeString[1024];
12846 struct Declarator * decl;
12847 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12848
12849 typeString[0] = '\0';
12850 PrintType(exp->expType, typeString, 0x0, 0x0);
12851 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12852 exp->type = 11;
12853 exp->cast.typeName = MkTypeName(specs, decl);
12854 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12855 exp->cast.exp->needCast = 0x1;
12856 }
12857 break;
12858 }
12859 }
12860 }
12861 }
12862
12863 extern int strncmp(const char * , const char * , size_t n);
12864
12865 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char *  key);
12866
12867 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
12868 {
12869 int nsLen = strlen(nameSpace);
12870 struct Symbol * symbol;
12871
12872 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)))
12873 {
12874 char * s = symbol->string;
12875
12876 if(!strncmp(s, nameSpace, nsLen))
12877 {
12878 int c;
12879 char * namePart;
12880
12881 for(c = strlen(s) - 1; c >= 0; c--)
12882 if(s[c] == ':')
12883 break;
12884 namePart = s + c + 1;
12885 if(!strcmp(namePart, name))
12886 {
12887 return symbol;
12888 }
12889 }
12890 else
12891 break;
12892 }
12893 return (((void *)0));
12894 }
12895
12896 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
12897 {
12898 int c;
12899 char nameSpace[1024];
12900 char * namePart;
12901 unsigned int gotColon = 0x0;
12902
12903 nameSpace[0] = '\0';
12904 for(c = strlen(name) - 1; c >= 0; c--)
12905 if(name[c] == ':')
12906 {
12907 gotColon = 0x1;
12908 break;
12909 }
12910 namePart = name + c + 1;
12911 while(c >= 0 && name[c] == ':')
12912 c--;
12913 if(c >= 0)
12914 {
12915 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
12916
12917 if(symbol)
12918 return symbol;
12919 memcpy(nameSpace, name, c + 1);
12920 nameSpace[c + 1] = (char)0;
12921 return ScanWithNameSpace(tree, nameSpace, namePart);
12922 }
12923 else if(gotColon)
12924 {
12925 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12926
12927 return symbol;
12928 }
12929 else
12930 {
12931 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12932
12933 if(symbol)
12934 return symbol;
12935 return ScanWithNameSpace(tree, "", namePart);
12936 }
12937 return (((void *)0));
12938 }
12939
12940 static void ProcessDeclaration(struct Declaration * decl);
12941
12942 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
12943 {
12944 struct Context * ctx;
12945 struct Symbol * symbol = (((void *)0));
12946
12947 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
12948 {
12949 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
12950 {
12951 symbol = (((void *)0));
12952 if(thisNameSpace)
12953 {
12954 char curName[1024];
12955
12956 strcpy(curName, thisNameSpace);
12957 strcat(curName, "::");
12958 strcat(curName, name);
12959 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
12960 }
12961 if(!symbol)
12962 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
12963 }
12964 else
12965 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
12966 if(symbol || ctx == endContext)
12967 break;
12968 }
12969 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
12970 {
12971 if(symbol->pointerExternal->type == 0)
12972 {
12973 struct FunctionDefinition * function = symbol->pointerExternal->function;
12974 struct Context * tmpContext = curContext;
12975
12976 curContext = (((void *)0));
12977 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
12978 curContext = tmpContext;
12979 symbol->pointerExternal->symbol = symbol;
12980 DeclareType(symbol->type, 0x1, 0x1);
12981 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
12982 symbol->id = curExternal->symbol->idCode;
12983 }
12984 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
12985 {
12986 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
12987 symbol->id = curExternal->symbol->idCode;
12988 }
12989 }
12990 return symbol;
12991 }
12992
12993 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
12994 {
12995 if(!type->isSigned && type->kind != 22 && type->kind != 23)
12996 ListAdd(specs, MkSpecifier(UNSIGNED));
12997 switch(type->kind)
12998 {
12999 case 8:
13000 {
13001 if(type->_class->registered)
13002 {
13003 if(!type->_class->registered->dataType)
13004 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
13005 GetTypeSpecs(type->_class->registered->dataType, specs);
13006 }
13007 break;
13008 }
13009 case 7:
13010 ListAdd(specs, MkSpecifier(DOUBLE));
13011 break;
13012 case 6:
13013 ListAdd(specs, MkSpecifier(FLOAT));
13014 break;
13015 case 1:
13016 ListAdd(specs, MkSpecifier(CHAR));
13017 break;
13018 case 24:
13019 ListAdd(specs, MkSpecifier(_BOOL));
13020 break;
13021 case 2:
13022 ListAdd(specs, MkSpecifier(SHORT));
13023 break;
13024 case 4:
13025 ListAdd(specs, MkSpecifier(INT64));
13026 break;
13027 case 22:
13028 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
13029 break;
13030 case 23:
13031 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
13032 break;
13033 case 3:
13034 default:
13035 ListAdd(specs, MkSpecifier(INT));
13036 break;
13037 }
13038 }
13039
13040 static void PrintArraySize(struct Type * arrayType, char * string)
13041 {
13042 char size[256];
13043
13044 size[0] = '\0';
13045 strcat(size, "[");
13046 if(arrayType->enumClass)
13047 strcat(size, arrayType->enumClass->string);
13048 else if(arrayType->arraySizeExp)
13049 PrintExpression(arrayType->arraySizeExp, size);
13050 strcat(size, "]");
13051 strcat(string, size);
13052 }
13053
13054 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
13055 {
13056 if(type)
13057 {
13058 if(printConst && type->constant)
13059 strcat(string, "const ");
13060 switch(type->kind)
13061 {
13062 case 8:
13063 {
13064 struct Symbol * c = type->_class;
13065
13066 if(type->classObjectType == 2)
13067 strcat(string, "typed_object");
13068 else if(type->classObjectType == 3)
13069 strcat(string, "any_object");
13070 else
13071 {
13072 if(c && c->string)
13073 strcat(string, (fullName || !c->registered) ? c->string : c->registered->name);
13074 }
13075 if(type->byReference)
13076 strcat(string, " &");
13077 break;
13078 }
13079 case 0:
13080 strcat(string, "void");
13081 break;
13082 case 3:
13083 strcat(string, type->isSigned ? "int" : "uint");
13084 break;
13085 case 4:
13086 strcat(string, type->isSigned ? "int64" : "uint64");
13087 break;
13088 case 22:
13089 strcat(string, type->isSigned ? "intptr" : "uintptr");
13090 break;
13091 case 23:
13092 strcat(string, type->isSigned ? "intsize" : "uintsize");
13093 break;
13094 case 1:
13095 strcat(string, type->isSigned ? "char" : "byte");
13096 break;
13097 case 24:
13098 strcat(string, "_Bool");
13099 break;
13100 case 2:
13101 strcat(string, type->isSigned ? "short" : "uint16");
13102 break;
13103 case 6:
13104 strcat(string, "float");
13105 break;
13106 case 7:
13107 strcat(string, "double");
13108 break;
13109 case 9:
13110 if(type->enumName)
13111 {
13112 strcat(string, "struct ");
13113 strcat(string, type->enumName);
13114 }
13115 else if(type->typeName)
13116 strcat(string, type->typeName);
13117 else
13118 {
13119 struct Type * member;
13120
13121 strcat(string, "struct { ");
13122 for(member = type->members.first; member; member = member->next)
13123 {
13124 PrintType(member, string, 0x1, fullName);
13125 strcat(string, "; ");
13126 }
13127 strcat(string, "}");
13128 }
13129 break;
13130 case 10:
13131 if(type->enumName)
13132 {
13133 strcat(string, "union ");
13134 strcat(string, type->enumName);
13135 }
13136 else if(type->typeName)
13137 strcat(string, type->typeName);
13138 else
13139 {
13140 strcat(string, "union ");
13141 strcat(string, "(unnamed)");
13142 }
13143 break;
13144 case 15:
13145 if(type->enumName)
13146 {
13147 strcat(string, "enum ");
13148 strcat(string, type->enumName);
13149 }
13150 else if(type->typeName)
13151 strcat(string, type->typeName);
13152 else
13153 strcat(string, "int");
13154 break;
13155 case 14:
13156 strcat(string, "...");
13157 break;
13158 case 19:
13159 strcat(string, "subclass(");
13160 strcat(string, type->_class ? type->_class->string : "int");
13161 strcat(string, ")");
13162 break;
13163 case 20:
13164 strcat(string, type->templateParameter->identifier->string);
13165 break;
13166 case 21:
13167 strcat(string, "thisclass");
13168 break;
13169 case 17:
13170 strcat(string, "__builtin_va_list");
13171 break;
13172 }
13173 }
13174 }
13175
13176 extern char *  __ecereNameSpace__ecere__sys__RSearchString(char *  buffer, char *  subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
13177
13178 static void PrintName(struct Type * type, char * string, unsigned int fullName)
13179 {
13180 if(type->name && type->name[0])
13181 {
13182 if(fullName)
13183 strcat(string, type->name);
13184 else
13185 {
13186 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
13187
13188 if(name)
13189 name += 2;
13190 else
13191 name = type->name;
13192 strcat(string, name);
13193 }
13194 }
13195 }
13196
13197 static void PrintAttribs(struct Type * type, char * string)
13198 {
13199 if(type)
13200 {
13201 if(type->dllExport)
13202 strcat(string, "dllexport ");
13203 if(type->attrStdcall)
13204 strcat(string, "stdcall ");
13205 }
13206 }
13207
13208 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
13209 {
13210 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13211 {
13212 struct Type * attrType = (((void *)0));
13213
13214 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
13215 PrintAttribs(type, string);
13216 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
13217 strcat(string, " const");
13218 PrePrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName, type, printConst);
13219 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
13220 strcat(string, " (");
13221 if(type->kind == 13)
13222 {
13223 if(type->type->kind == 11 || type->type->kind == 16)
13224 PrintAttribs(type->type, string);
13225 }
13226 if(type->kind == 13)
13227 {
13228 if(type->type->kind == 11 || type->type->kind == 16 || type->type->kind == 12)
13229 strcat(string, "*");
13230 else
13231 strcat(string, " *");
13232 }
13233 if(printConst && type->constant && type->kind == 13)
13234 strcat(string, " const");
13235 }
13236 else
13237 PrintTypeSpecs(type, string, fullName, printConst);
13238 }
13239
13240 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
13241 {
13242 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
13243 strcat(string, ")");
13244 if(type->kind == 12)
13245 PrintArraySize(type, string);
13246 else if(type->kind == 11)
13247 {
13248 struct Type * param;
13249
13250 strcat(string, "(");
13251 for(param = type->params.first; param; param = param->next)
13252 {
13253 PrintType(param, string, 0x1, fullName);
13254 if(param->next)
13255 strcat(string, ", ");
13256 }
13257 strcat(string, ")");
13258 }
13259 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13260 PostPrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName);
13261 }
13262
13263 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
13264 {
13265 PrePrintType(type, string, fullName, (((void *)0)), printConst);
13266 if(type->thisClass || (printName && type->name && type->name[0]))
13267 strcat(string, " ");
13268 if((type->thisClass || type->staticMethod))
13269 {
13270 struct Symbol * _class = type->thisClass;
13271
13272 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
13273 {
13274 if(type->classObjectType == 1)
13275 strcat(string, "class");
13276 else
13277 strcat(string, type->byReference ? "typed_object&" : "typed_object");
13278 }
13279 else if(_class && _class->string)
13280 {
13281 char * s = _class->string;
13282
13283 if(fullName)
13284 strcat(string, s);
13285 else
13286 {
13287 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 0x1, 0x0);
13288
13289 if(name)
13290 name += 2;
13291 else
13292 name = s;
13293 strcat(string, name);
13294 }
13295 }
13296 strcat(string, "::");
13297 }
13298 if(printName && type->name)
13299 PrintName(type, string, fullName);
13300 PostPrintType(type, string, fullName);
13301 if(type->bitFieldCount)
13302 {
13303 char count[100];
13304
13305 sprintf(count, ":%d", type->bitFieldCount);
13306 strcat(string, count);
13307 }
13308 }
13309
13310 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13311 {
13312 _PrintType(type, string, printName, fullName, 0x1);
13313 }
13314
13315 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13316 {
13317 _PrintType(type, string, printName, fullName, 0x0);
13318 }
13319
13320 static struct Type * FindMember(struct Type * type, char * string)
13321 {
13322 struct Type * memberType;
13323
13324 for(memberType = type->members.first; memberType; memberType = memberType->next)
13325 {
13326 if(!memberType->name)
13327 {
13328 struct Type * subType = FindMember(memberType, string);
13329
13330 if(subType)
13331 return subType;
13332 }
13333 else if(!strcmp(memberType->name, string))
13334 return memberType;
13335 }
13336 return (((void *)0));
13337 }
13338
13339 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
13340 {
13341 struct Type * memberType;
13342
13343 for(memberType = type->members.first; memberType; memberType = memberType->next)
13344 {
13345 if(!memberType->name)
13346 {
13347 struct Type * subType = FindMember(memberType, string);
13348
13349 if(subType)
13350 {
13351 *offset += memberType->offset;
13352 return subType;
13353 }
13354 }
13355 else if(!strcmp(memberType->name, string))
13356 {
13357 *offset += memberType->offset;
13358 return memberType;
13359 }
13360 }
13361 return (((void *)0));
13362 }
13363
13364 extern unsigned int parseError;
13365
13366 unsigned int GetParseError()
13367 {
13368 return parseError;
13369 }
13370
13371 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
13372
13373 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
13374
13375 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
13376
13377 struct Expression * ParseExpressionString(char * expression)
13378 {
13379 parseError = 0x0;
13380 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13381 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__extension__ ({
13382 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13383
13384 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13385 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
13386 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13387 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13388
13389 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13390 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13391 echoOn = 0x0;
13392 parsedExpression = (((void *)0));
13393 resetScanner();
13394 expression_yyparse();
13395 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13396 return parsedExpression;
13397 }
13398
13399 extern char *  QMkString(char *  source);
13400
13401 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
13402 {
13403 struct Identifier * id = exp->identifier;
13404 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13405 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13406 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13407 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13408
13409 if(_class && _class->type == 4)
13410 {
13411 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
13412 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
13413
13414 if(enumClass)
13415 {
13416 struct __ecereNameSpace__ecere__com__Class * baseClass;
13417
13418 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
13419 {
13420 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
13421
13422 for(value = e->values.first; value; value = value->next)
13423 {
13424 if(!strcmp(value->name, id->string))
13425 break;
13426 }
13427 if(value)
13428 {
13429 char constant[256];
13430
13431 FreeExpContents(exp);
13432 exp->type = 2;
13433 exp->isConstant = 0x1;
13434 if(!strcmp(baseClass->dataTypeString, "int"))
13435 sprintf(constant, "%d", (int)value->data);
13436 else
13437 sprintf(constant, "0x%X", (int)value->data);
13438 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13439 exp->expType = MkClassType(baseClass->fullName);
13440 break;
13441 }
13442 }
13443 }
13444 if(value)
13445 return 0x1;
13446 }
13447 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
13448 {
13449 ProcessMethodType(method);
13450 exp->expType = __extension__ ({
13451 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13452
13453 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1->methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
13454 });
13455 return 0x1;
13456 }
13457 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
13458 {
13459 if(!prop->dataType)
13460 ProcessPropertyType(prop);
13461 exp->expType = prop->dataType;
13462 if(prop->dataType)
13463 prop->dataType->refCount++;
13464 return 0x1;
13465 }
13466 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
13467 {
13468 if(!member->dataType)
13469 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13470 exp->expType = member->dataType;
13471 if(member->dataType)
13472 member->dataType->refCount++;
13473 return 0x1;
13474 }
13475 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
13476 {
13477 if(!classProp->dataType)
13478 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
13479 if(classProp->constant)
13480 {
13481 FreeExpContents(exp);
13482 exp->isConstant = 0x1;
13483 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
13484 {
13485 exp->type = 3;
13486 exp->constant = QMkString((char *)classProp->Get(_class));
13487 }
13488 else
13489 {
13490 char constant[256];
13491
13492 exp->type = 2;
13493 sprintf(constant, "%d", (int)classProp->Get(_class));
13494 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13495 }
13496 }
13497 else
13498 {
13499 }
13500 exp->expType = classProp->dataType;
13501 if(classProp->dataType)
13502 classProp->dataType->refCount++;
13503 return 0x1;
13504 }
13505 return 0x0;
13506 }
13507
13508 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
13509 {
13510 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
13511 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
13512 struct __ecereNameSpace__ecere__com__NameSpace * child;
13513
13514 if(!data)
13515 {
13516 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)))
13517 {
13518 data = ScanGlobalData(child, name);
13519 if(data)
13520 break;
13521 }
13522 }
13523 return data;
13524 }
13525
13526 extern struct __ecereNameSpace__ecere__com__NameSpace *  globalData;
13527
13528 extern char *  strncpy(char * , const char * , size_t n);
13529
13530 static struct GlobalData * FindGlobalData(char * name)
13531 {
13532 int start = 0, c;
13533 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13534
13535 nameSpace = globalData;
13536 for(c = 0; name[c]; c++)
13537 {
13538 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
13539 {
13540 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
13541 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
13542
13543 strncpy(spaceName, name + start, c - start);
13544 spaceName[c - start] = '\0';
13545 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
13546 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
13547 if(!newSpace)
13548 return (((void *)0));
13549 nameSpace = newSpace;
13550 if(name[c] == ':')
13551 c++;
13552 start = c + 1;
13553 }
13554 }
13555 if(c - start)
13556 {
13557 return ScanGlobalData(nameSpace, name + start);
13558 }
13559 return (((void *)0));
13560 }
13561
13562 static int definedExpStackPos;
13563
13564 static void * definedExpStack[512];
13565
13566 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
13567 {
13568 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
13569
13570 FreeExpContents(checkedExp);
13571 FreeType(checkedExp->expType);
13572 FreeType(checkedExp->destType);
13573 *checkedExp = *newExp;
13574 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13575 checkedExp->prev = prev;
13576 checkedExp->next = next;
13577 }
13578
13579 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
13580
13581 extern int printf(char * , ...);
13582
13583 void __ecereMethod_Expression_Clear();
13584
13585 void ApplyAnyObjectLogic(struct Expression * e)
13586 {
13587 struct Type * destType = e->destType;
13588
13589 if(destType && (destType->classObjectType == 3))
13590 {
13591 if(e && e->expType)
13592 {
13593 struct Type * type = e->expType;
13594 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
13595
13596 if(type->kind == 8 && type->_class && type->_class->registered)
13597 {
13598 _class = type->_class->registered;
13599 }
13600 else if(type->kind == 19)
13601 {
13602 _class = FindClass("ecere::com::Class")->registered;
13603 }
13604 else
13605 {
13606 char string[1024] = "";
13607 struct Symbol * classSym;
13608
13609 PrintTypeNoConst(type, string, 0x0, 0x1);
13610 classSym = FindClass(string);
13611 if(classSym)
13612 _class = classSym->registered;
13613 }
13614 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)))
13615 {
13616 if(!_class || strcmp(_class->fullName, "char *"))
13617 {
13618 struct Expression * checkedExp = e, * newExp;
13619
13620 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->list) || checkedExp->type == 11)
13621 {
13622 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13623 {
13624 if(checkedExp->type == 23)
13625 {
13626 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13627 }
13628 else
13629 checkedExp = (*checkedExp->list).last;
13630 }
13631 else if(checkedExp->type == 11)
13632 checkedExp = checkedExp->cast.exp;
13633 }
13634 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
13635 {
13636 newExp = checkedExp->op.exp2;
13637 checkedExp->op.exp2 = (((void *)0));
13638 FreeExpContents(checkedExp);
13639 if(e->expType && e->expType->passAsTemplate)
13640 {
13641 char size[100];
13642
13643 ComputeTypeSize(e->expType);
13644 sprintf(size, "%d", e->expType->size);
13645 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))))));
13646 }
13647 ReplaceExpContents(checkedExp, newExp);
13648 e->byReference = 0x1;
13649 }
13650 else if(!e->byReference || (_class && _class->type == 5))
13651 {
13652 struct Expression * checkedExp, * newExp;
13653
13654 {
13655 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;
13656
13657 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
13658 {
13659 struct Context * context = PushContext();
13660 struct Declarator * decl;
13661 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13662 char typeString[1024];
13663 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13664
13665 typeString[0] = '\0';
13666 *newExp = *e;
13667 newExp->prev = (((void *)0));
13668 newExp->next = (((void *)0));
13669 newExp->expType = (((void *)0));
13670 PrintTypeNoConst(e->expType, typeString, 0x0, 0x1);
13671 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13672 newExp->destType = ProcessType(specs, decl);
13673 curContext = context;
13674 if(curCompound)
13675 {
13676 char name[100];
13677 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
13678
13679 e->type = 23;
13680 sprintf(name, "__internalValue%03X", internalValueCounter++);
13681 if(!curCompound->compound.declarations)
13682 curCompound->compound.declarations = MkList();
13683 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
13684 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
13685 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
13686 e->compound = MkCompoundStmt((((void *)0)), stmts);
13687 }
13688 else
13689 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
13690 {
13691 struct Type * type = e->destType;
13692
13693 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13694 CopyTypeInto(e->destType, type);
13695 e->destType->refCount = 1;
13696 e->destType->classObjectType = 0;
13697 FreeType(type);
13698 }
13699 e->compound->compound.context = context;
13700 PopContext(context);
13701 curContext = context->parent;
13702 }
13703 }
13704 checkedExp = e;
13705 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->list) || checkedExp->type == 11)
13706 {
13707 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13708 {
13709 if(checkedExp->type == 23)
13710 {
13711 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13712 }
13713 else
13714 checkedExp = (*checkedExp->list).last;
13715 }
13716 else if(checkedExp->type == 11)
13717 checkedExp = checkedExp->cast.exp;
13718 }
13719 {
13720 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13721
13722 *operand = *checkedExp;
13723 checkedExp->destType = (((void *)0));
13724 checkedExp->expType = (((void *)0));
13725 __ecereMethod_Expression_Clear(checkedExp);
13726 checkedExp->type = 4;
13727 checkedExp->op.op = '&';
13728 checkedExp->op.exp1 = (((void *)0));
13729 checkedExp->op.exp2 = operand;
13730 }
13731 }
13732 }
13733 }
13734 }
13735 }
13736 {
13737 }
13738 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))))
13739 {
13740 if(e->expType->classObjectType && destType && destType->classObjectType)
13741 {
13742 return ;
13743 }
13744 else
13745 {
13746 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13747
13748 *thisExp = *e;
13749 thisExp->prev = (((void *)0));
13750 thisExp->next = (((void *)0));
13751 __ecereMethod_Expression_Clear(e);
13752 e->type = 5;
13753 e->list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
13754 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
13755 ((struct Expression *)(*e->list).first)->byReference = 0x1;
13756 {
13757 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13758 CopyTypeInto(e->expType, thisExp->expType);
13759 e->expType->byReference = 0x0;
13760 e->expType->refCount = 1;
13761 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))
13762 {
13763 e->expType->classObjectType = 0;
13764 }
13765 }
13766 }
13767 }
13768 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
13769 {
13770 if(destType->kind == 14)
13771 {
13772 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unspecified type\n", (((void *)0))));
13773 }
13774 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
13775 {
13776 unsigned int byReference = e->expType->byReference;
13777 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13778 struct Declarator * decl;
13779 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13780 char typeString[1024];
13781 struct Type * type;
13782 int backupClassObjectType;
13783 unsigned int backupByReference;
13784
13785 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
13786 type = e->expType;
13787 else
13788 type = destType;
13789 backupClassObjectType = type->classObjectType;
13790 backupByReference = type->byReference;
13791 type->classObjectType = 0;
13792 type->byReference = 0x0;
13793 typeString[0] = '\0';
13794 PrintType(type, typeString, 0x0, 0x1);
13795 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13796 type->classObjectType = backupClassObjectType;
13797 type->byReference = backupByReference;
13798 *thisExp = *e;
13799 thisExp->prev = (((void *)0));
13800 thisExp->next = (((void *)0));
13801 __ecereMethod_Expression_Clear(e);
13802 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)))
13803 {
13804 e->type = 4;
13805 e->op.op = '*';
13806 e->op.exp1 = (((void *)0));
13807 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
13808 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13809 CopyTypeInto(e->expType, type);
13810 e->expType->byReference = 0x0;
13811 e->expType->refCount = 1;
13812 }
13813 else
13814 {
13815 e->type = 11;
13816 e->cast.typeName = MkTypeName(specs, decl);
13817 e->cast.exp = thisExp;
13818 e->byReference = 0x1;
13819 e->expType = type;
13820 type->refCount++;
13821 }
13822 e->destType = destType;
13823 destType->refCount++;
13824 }
13825 }
13826 }
13827
13828 extern char *  strstr(const char * , const char * );
13829
13830 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
13831
13832 struct __ecereNameSpace__ecere__com__DefinedExpression
13833 {
13834 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
13835 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
13836 char *  name;
13837 char *  value;
13838 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
13839 } __attribute__ ((gcc_struct));
13840
13841 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
13842
13843 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
13844
13845 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char *  string, int *  numBytes);
13846
13847 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
13848
13849 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
13850
13851 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
13852
13853 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList *  specifiers, struct Declarator * decl);
13854
13855 static void ProcessStatement(struct Statement * stmt);
13856
13857 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
13858
13859 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
13860
13861 extern char *  __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, void * object, ...);
13862
13863 extern char *  sourceFile;
13864
13865 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
13866
13867 void ProcessExpressionType(struct Expression * exp)
13868 {
13869 unsigned int unresolved = 0x0;
13870 struct Location oldyylloc = yylloc;
13871 unsigned int notByReference = 0x0;
13872
13873 if(!exp || exp->expType)
13874 return ;
13875 yylloc = exp->loc;
13876 switch(exp->type)
13877 {
13878 case 0:
13879 {
13880 struct Identifier * id = exp->identifier;
13881
13882 if(!id || !topContext)
13883 return ;
13884 if(id->_class && id->_class->name)
13885 {
13886 id->classSym = id->_class->symbol;
13887 }
13888 if(strstr(id->string, "__ecereClass") == id->string)
13889 {
13890 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
13891 break;
13892 }
13893 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
13894 {
13895 ReplaceClassMembers(exp, thisClass);
13896 if(exp->type != 0)
13897 {
13898 ProcessExpressionType(exp);
13899 break;
13900 }
13901 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
13902 break;
13903 }
13904 else
13905 {
13906 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13907
13908 if(!symbol)
13909 {
13910 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
13911 break;
13912 else
13913 {
13914 if(thisClass)
13915 {
13916 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
13917 if(exp->type != 0)
13918 {
13919 ProcessExpressionType(exp);
13920 break;
13921 }
13922 }
13923 else if(currentClass && !id->_class)
13924 {
13925 if(ResolveIdWithClass(exp, currentClass, 0x1))
13926 break;
13927 }
13928 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13929 }
13930 }
13931 if(symbol)
13932 {
13933 struct Type * type = symbol->type;
13934 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
13935
13936 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
13937 {
13938 struct Context * context = SetupTemplatesContext(_class);
13939
13940 type = ReplaceThisClassType(_class);
13941 FinishTemplatesContext(context);
13942 if(type)
13943 type->refCount = 0;
13944 }
13945 FreeSpecifier(id->_class);
13946 id->_class = (((void *)0));
13947 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13948 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
13949 id->classSym = (((void *)0));
13950 exp->expType = type;
13951 if(type)
13952 type->refCount++;
13953 if(type && (type->kind == 15))
13954 exp->isConstant = 0x1;
13955 if(symbol->isParam || !strcmp(id->string, "this"))
13956 {
13957 if(_class && _class->type == 1 && !type->declaredWithStruct)
13958 exp->byReference = 0x1;
13959 }
13960 if(symbol->isIterator)
13961 {
13962 if(symbol->isIterator == 3)
13963 {
13964 exp->type = 5;
13965 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
13966 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
13967 exp->expType = (((void *)0));
13968 ProcessExpressionType(exp);
13969 }
13970 else if(symbol->isIterator != 4)
13971 {
13972 exp->type = 8;
13973 exp->member.exp = MkExpIdentifier(exp->identifier);
13974 exp->member.exp->expType = exp->expType;
13975 exp->member.member = MkIdentifier("data");
13976 exp->expType = (((void *)0));
13977 ProcessExpressionType(exp);
13978 }
13979 }
13980 break;
13981 }
13982 else
13983 {
13984 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
13985
13986 if(thisNameSpace && !(id->_class && !id->_class->name))
13987 {
13988 char name[1024];
13989
13990 strcpy(name, thisNameSpace);
13991 strcat(name, "::");
13992 strcat(name, id->string);
13993 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
13994 }
13995 if(!definedExp)
13996 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
13997 if(definedExp)
13998 {
13999 int c;
14000
14001 for(c = 0; c < definedExpStackPos; c++)
14002 if(definedExpStack[c] == definedExp)
14003 break;
14004 if(c == definedExpStackPos && c < sizeof (definedExpStack) / sizeof(void *))
14005 {
14006 struct Location backupYylloc = yylloc;
14007 struct __ecereNameSpace__ecere__com__Instance * backInput = fileInput;
14008
14009 definedExpStack[definedExpStackPos++] = definedExp;
14010 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
14011 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__extension__ ({
14012 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
14013
14014 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
14015 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
14016 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
14017 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
14018
14019 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
14020 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
14021 echoOn = 0x0;
14022 parsedExpression = (((void *)0));
14023 resetScanner();
14024 expression_yyparse();
14025 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
14026 if(backInput)
14027 fileInput = backInput;
14028 yylloc = backupYylloc;
14029 if(parsedExpression)
14030 {
14031 FreeIdentifier(id);
14032 exp->type = 5;
14033 exp->list = MkListOne(parsedExpression);
14034 parsedExpression->loc = yylloc;
14035 ProcessExpressionType(exp);
14036 definedExpStackPos--;
14037 return ;
14038 }
14039 definedExpStackPos--;
14040 }
14041 else
14042 {
14043 if(inCompiler)
14044 {
14045 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Recursion in defined expression %s\n", (((void *)0))), id->string);
14046 }
14047 }
14048 }
14049 else
14050 {
14051 struct GlobalData * data = (((void *)0));
14052
14053 if(thisNameSpace && !(id->_class && !id->_class->name))
14054 {
14055 char name[1024];
14056
14057 strcpy(name, thisNameSpace);
14058 strcat(name, "::");
14059 strcat(name, id->string);
14060 data = FindGlobalData(name);
14061 }
14062 if(!data)
14063 data = FindGlobalData(id->string);
14064 if(data)
14065 {
14066 DeclareGlobalData(data);
14067 exp->expType = data->dataType;
14068 if(data->dataType)
14069 data->dataType->refCount++;
14070 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14071 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
14072 FreeSpecifier(id->_class);
14073 id->_class = (((void *)0));
14074 break;
14075 }
14076 else
14077 {
14078 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
14079
14080 if(thisNameSpace && !(id->_class && !id->_class->name))
14081 {
14082 char name[1024];
14083
14084 strcpy(name, thisNameSpace);
14085 strcat(name, "::");
14086 strcat(name, id->string);
14087 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
14088 }
14089 if(!function)
14090 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
14091 if(function)
14092 {
14093 char name[1024];
14094
14095 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14096 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
14097 name[0] = (char)0;
14098 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
14099 strcpy(name, "__ecereFunction_");
14100 FullClassNameCat(name, id->string, 0x0);
14101 if(DeclareFunction(function, name))
14102 {
14103 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14104 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
14105 }
14106 exp->expType = function->dataType;
14107 if(function->dataType)
14108 function->dataType->refCount++;
14109 FreeSpecifier(id->_class);
14110 id->_class = (((void *)0));
14111 break;
14112 }
14113 }
14114 }
14115 }
14116 }
14117 unresolved = 0x1;
14118 break;
14119 }
14120 case 1:
14121 {
14122 struct __ecereNameSpace__ecere__com__Class * _class;
14123
14124 if(!exp->instance->_class)
14125 {
14126 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
14127 {
14128 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
14129 }
14130 }
14131 ProcessInstantiationType(exp->instance);
14132 exp->isConstant = exp->instance->isConstant;
14133 if(exp->instance->_class)
14134 {
14135 exp->expType = MkClassType(exp->instance->_class->name);
14136 }
14137 break;
14138 }
14139 case 2:
14140 {
14141 if(!exp->expType)
14142 {
14143 char * constant = exp->constant;
14144 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
14145
14146 exp->expType = type;
14147 if(constant[0] == '\'')
14148 {
14149 if((int)((unsigned char *)constant)[1] > 127)
14150 {
14151 int nb;
14152 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
14153
14154 if(nb < 2)
14155 ch = constant[1];
14156 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
14157 exp->constant = PrintUInt(ch);
14158 type->kind = 8;
14159 type->_class = FindClass("unichar");
14160 type->isSigned = 0x0;
14161 }
14162 else
14163 {
14164 type->kind = 1;
14165 type->isSigned = 0x1;
14166 }
14167 }
14168 else
14169 {
14170 char * dot = strchr(constant, '.');
14171 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
14172 char * exponent;
14173
14174 if(isHex)
14175 {
14176 exponent = strchr(constant, 'p');
14177 if(!exponent)
14178 exponent = strchr(constant, 'P');
14179 }
14180 else
14181 {
14182 exponent = strchr(constant, 'e');
14183 if(!exponent)
14184 exponent = strchr(constant, 'E');
14185 }
14186 if(dot || exponent)
14187 {
14188 if(strchr(constant, 'f') || strchr(constant, 'F'))
14189 type->kind = 6;
14190 else
14191 type->kind = 7;
14192 type->isSigned = 0x1;
14193 }
14194 else
14195 {
14196 unsigned int isSigned = constant[0] == '-';
14197 char * endP = (((void *)0));
14198 long long i64 = strtoll(constant, &endP, 0);
14199 uint64 ui64 = strtoull(constant, &endP, 0);
14200 unsigned int is64Bit = endP && (!strcmp(endP, "LL") || !strcmp(endP, "ll"));
14201
14202 if(isSigned)
14203 {
14204 if(i64 < (((int)0x80000000)))
14205 is64Bit = 0x1;
14206 }
14207 else
14208 {
14209 if(ui64 > (((int)0x7fffffff)))
14210 {
14211 if(ui64 > (0xffffffff))
14212 {
14213 is64Bit = 0x1;
14214 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
14215 isSigned = 0x1;
14216 }
14217 }
14218 else if(constant[0] != '0' || !constant[1])
14219 isSigned = 0x1;
14220 }
14221 type->kind = is64Bit ? 4 : 3;
14222 type->isSigned = isSigned;
14223 }
14224 }
14225 exp->isConstant = 0x1;
14226 if(exp->destType && exp->destType->kind == 7)
14227 type->kind = 7;
14228 else if(exp->destType && exp->destType->kind == 6)
14229 type->kind = 6;
14230 else if(exp->destType && exp->destType->kind == 4)
14231 type->kind = 4;
14232 }
14233 break;
14234 }
14235 case 3:
14236 {
14237 exp->isConstant = 0x1;
14238 exp->expType = __extension__ ({
14239 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14240
14241 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
14242 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14243
14244 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 1, __ecereInstance1->constant = 0x1, __ecereInstance1->isSigned = 0x1, __ecereInstance1;
14245 }), __ecereInstance2;
14246 });
14247 break;
14248 }
14249 case 13:
14250 case 26:
14251 ProcessExpressionType(exp->_new.size);
14252 exp->expType = __extension__ ({
14253 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14254
14255 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_new.typeName->qualifiers, exp->_new.typeName->declarator), __ecereInstance1;
14256 });
14257 DeclareType(exp->expType->type, 0x0, 0x0);
14258 break;
14259 case 14:
14260 case 27:
14261 ProcessExpressionType(exp->_renew.size);
14262 ProcessExpressionType(exp->_renew.exp);
14263 exp->expType = __extension__ ({
14264 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14265
14266 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_renew.typeName->qualifiers, exp->_renew.typeName->declarator), __ecereInstance1;
14267 });
14268 DeclareType(exp->expType->type, 0x0, 0x0);
14269 break;
14270 case 4:
14271 {
14272 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
14273 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
14274 unsigned int useDestType = 0x0, useSideType = 0x0;
14275 struct Location oldyylloc = yylloc;
14276 unsigned int useSideUnit = 0x0;
14277 struct __ecereNameSpace__ecere__com__Class * destClass = (exp->destType && exp->destType->kind == 8 && exp->destType->_class) ? exp->destType->_class->registered : (((void *)0));
14278 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
14279
14280 switch(exp->op.op)
14281 {
14282 case '=':
14283 case MUL_ASSIGN:
14284 case DIV_ASSIGN:
14285 case MOD_ASSIGN:
14286 case ADD_ASSIGN:
14287 case SUB_ASSIGN:
14288 case LEFT_ASSIGN:
14289 case RIGHT_ASSIGN:
14290 case AND_ASSIGN:
14291 case XOR_ASSIGN:
14292 case OR_ASSIGN:
14293 assign = 0x1;
14294 break;
14295 case '!':
14296 break;
14297 case AND_OP:
14298 case OR_OP:
14299 boolOps = 0x1;
14300 boolResult = 0x1;
14301 break;
14302 case EQ_OP:
14303 case '<':
14304 case '>':
14305 case LE_OP:
14306 case GE_OP:
14307 case NE_OP:
14308 boolResult = 0x1;
14309 useSideType = 0x1;
14310 break;
14311 case '+':
14312 case '-':
14313 useSideUnit = 0x1;
14314 useSideType = 0x1;
14315 useDestType = 0x1;
14316 break;
14317 case LEFT_OP:
14318 case RIGHT_OP:
14319 useSideType = 0x1;
14320 useDestType = 0x1;
14321 break;
14322 case '|':
14323 case '^':
14324 useSideType = 0x1;
14325 useDestType = 0x1;
14326 break;
14327 case '/':
14328 case '%':
14329 useSideType = 0x1;
14330 useDestType = 0x1;
14331 break;
14332 case '&':
14333 case '*':
14334 if(exp->op.exp1)
14335 {
14336 useSideType = 0x1;
14337 useDestType = 0x1;
14338 }
14339 break;
14340 }
14341 if(exp->op.op == '&')
14342 {
14343 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
14344 {
14345 struct Identifier * id = exp->op.exp2->identifier;
14346 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
14347
14348 if(symbol && symbol->isIterator == 2)
14349 {
14350 exp->type = 8;
14351 exp->member.exp = exp->op.exp2;
14352 exp->member.member = MkIdentifier("key");
14353 exp->expType = (((void *)0));
14354 exp->op.exp2->expType = symbol->type;
14355 symbol->type->refCount++;
14356 ProcessExpressionType(exp);
14357 FreeType(dummy);
14358 break;
14359 }
14360 }
14361 }
14362 if(exp->op.exp1)
14363 {
14364 if(exp->op.exp2 && useSideUnit && useDestType && destClass && destClass->type == 3 && destClass->base->type != 3)
14365 useDestType = 0x0;
14366 if(destClass && useDestType && ((destClass->type == 3 && useSideUnit) || destClass->type == 4 || destClass->type == 2))
14367 {
14368 if(exp->op.exp1->destType)
14369 FreeType(exp->op.exp1->destType);
14370 exp->op.exp1->destType = exp->destType;
14371 exp->op.exp1->opDestType = 0x1;
14372 if(exp->destType)
14373 exp->destType->refCount++;
14374 }
14375 else if(!assign)
14376 {
14377 if(exp->op.exp1->destType)
14378 FreeType(exp->op.exp1->destType);
14379 exp->op.exp1->destType = dummy;
14380 dummy->refCount++;
14381 }
14382 if(exp->op.exp1->destType && exp->op.op != '=')
14383 exp->op.exp1->destType->count++;
14384 ProcessExpressionType(exp->op.exp1);
14385 if(exp->op.exp1->destType && exp->op.op != '=')
14386 exp->op.exp1->destType->count--;
14387 exp->op.exp1->opDestType = 0x0;
14388 if(!exp->op.exp2 && (exp->op.op == INC_OP || exp->op.op == DEC_OP) && exp->op.exp1->expType && exp->op.exp1->expType->kind == 8 && exp->op.exp1->expType->_class && exp->op.exp1->expType->_class->registered && exp->op.exp1->expType->_class->registered->type == 3)
14389 {
14390 exp->op.exp2 = MkExpConstant("1");
14391 exp->op.op = exp->op.op == INC_OP ? ADD_ASSIGN : SUB_ASSIGN;
14392 assign = 0x1;
14393 }
14394 if(exp->op.exp1->destType == dummy)
14395 {
14396 FreeType(dummy);
14397 exp->op.exp1->destType = (((void *)0));
14398 }
14399 type1 = exp->op.exp1->expType;
14400 }
14401 if(exp->op.exp2)
14402 {
14403 char expString[10240];
14404
14405 expString[0] = '\0';
14406 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
14407 {
14408 if(exp->op.exp1)
14409 {
14410 exp->op.exp2->destType = exp->op.exp1->expType;
14411 if(exp->op.exp1->expType)
14412 exp->op.exp1->expType->refCount++;
14413 }
14414 else
14415 {
14416 exp->op.exp2->destType = exp->destType;
14417 if(!exp->op.exp1 || exp->op.op != '&')
14418 exp->op.exp2->opDestType = 0x1;
14419 if(exp->destType)
14420 exp->destType->refCount++;
14421 }
14422 if(type1)
14423 type1->refCount++;
14424 exp->expType = type1;
14425 }
14426 else if(assign)
14427 {
14428 if(inCompiler)
14429 PrintExpression(exp->op.exp2, expString);
14430 if(type1 && type1->kind == 13)
14431 {
14432 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)
14433 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
14434 else if(exp->op.op == '=')
14435 {
14436 if(exp->op.exp2->destType)
14437 FreeType(exp->op.exp2->destType);
14438 exp->op.exp2->destType = type1;
14439 if(type1)
14440 type1->refCount++;
14441 }
14442 }
14443 else
14444 {
14445 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)
14446 ;
14447 else
14448 {
14449 if(exp->op.exp2->destType)
14450 FreeType(exp->op.exp2->destType);
14451 exp->op.exp2->destType = type1;
14452 if(type1)
14453 type1->refCount++;
14454 }
14455 }
14456 if(type1)
14457 type1->refCount++;
14458 exp->expType = type1;
14459 }
14460 else if(destClass && ((destClass->type == 3 && useDestType && useSideUnit) || (destClass->type == 4 && useDestType)))
14461 {
14462 if(exp->op.exp2->destType)
14463 FreeType(exp->op.exp2->destType);
14464 exp->op.exp2->destType = exp->destType;
14465 if(exp->op.op != '&')
14466 exp->op.exp2->opDestType = 0x1;
14467 if(exp->destType)
14468 exp->destType->refCount++;
14469 }
14470 else
14471 {
14472 if(exp->op.exp2->destType)
14473 FreeType(exp->op.exp2->destType);
14474 exp->op.exp2->destType = dummy;
14475 dummy->refCount++;
14476 }
14477 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
14478 {
14479 FreeType(exp->op.exp2->destType);
14480 exp->op.exp2->destType = type1;
14481 type1->refCount++;
14482 }
14483 if(exp->op.exp2->destType && exp->op.op != '=')
14484 exp->op.exp2->destType->count++;
14485 if(exp->op.op == SIZEOF)
14486 {
14487 struct Expression * e = exp->op.exp2;
14488
14489 while((e->type == 5 || e->type == 32 || e->type == 23) && e->list)
14490 {
14491 if(e->type == 5 || e->type == 32 || e->type == 23)
14492 {
14493 if(e->type == 23)
14494 e = (*((struct Statement *)(*e->compound->compound.statements).last)->expressions).last;
14495 else
14496 e = (*e->list).last;
14497 }
14498 }
14499 if(e->type == 11 && e->cast.exp)
14500 e->cast.exp->needCast = 0x1;
14501 }
14502 ProcessExpressionType(exp->op.exp2);
14503 exp->op.exp2->opDestType = 0x0;
14504 if(exp->op.exp2->destType && exp->op.op != '=')
14505 exp->op.exp2->destType->count--;
14506 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
14507 {
14508 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)
14509 {
14510 if(exp->op.op != '=' && type1->type->kind == 0)
14511 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14512 }
14513 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)))
14514 {
14515 if(exp->op.op == ADD_ASSIGN)
14516 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14517 }
14518 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))
14519 {
14520 if(exp->op.op == ADD_ASSIGN)
14521 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14522 }
14523 else if(inCompiler)
14524 {
14525 char type1String[1024];
14526 char type2String[1024];
14527
14528 type1String[0] = '\0';
14529 type2String[0] = '\0';
14530 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
14531 PrintType(type1, type2String, 0x0, 0x1);
14532 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14533 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
14534 }
14535 }
14536 if(exp->op.exp2->destType == dummy)
14537 {
14538 FreeType(dummy);
14539 exp->op.exp2->destType = (((void *)0));
14540 }
14541 if(exp->op.op == '-' && !exp->op.exp1 && exp->op.exp2->expType && !exp->op.exp2->expType->isSigned)
14542 {
14543 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14544 type2->refCount = 1;
14545 CopyTypeInto(type2, exp->op.exp2->expType);
14546 type2->isSigned = 0x1;
14547 }
14548 else if(exp->op.op == '~' && !exp->op.exp1 && exp->op.exp2->expType && (!exp->op.exp2->expType->isSigned || exp->op.exp2->expType->kind != 3))
14549 {
14550 type2 = __extension__ ({
14551 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14552
14553 __ecereInstance1->kind = 3, __ecereInstance1;
14554 });
14555 type2->refCount = 1;
14556 type2->isSigned = 0x1;
14557 }
14558 else
14559 {
14560 type2 = exp->op.exp2->expType;
14561 if(type2)
14562 type2->refCount++;
14563 }
14564 }
14565 dummy->kind = 0;
14566 if(exp->op.op == SIZEOF)
14567 {
14568 exp->expType = __extension__ ({
14569 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14570
14571 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
14572 });
14573 exp->isConstant = 0x1;
14574 }
14575 else if(exp->op.op == '*' && !exp->op.exp1)
14576 {
14577 exp->expType = Dereference(type2);
14578 if(type2 && type2->kind == 8)
14579 notByReference = 0x1;
14580 }
14581 else if(exp->op.op == '&' && !exp->op.exp1)
14582 exp->expType = Reference(type2);
14583 else if(!assign)
14584 {
14585 if(boolOps)
14586 {
14587 if(exp->op.exp1)
14588 {
14589 if(exp->op.exp1->destType)
14590 FreeType(exp->op.exp1->destType);
14591 exp->op.exp1->destType = MkClassType("bool");
14592 exp->op.exp1->destType->truth = 0x1;
14593 if(!exp->op.exp1->expType)
14594 ProcessExpressionType(exp->op.exp1);
14595 else
14596 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14597 FreeType(exp->op.exp1->expType);
14598 exp->op.exp1->expType = MkClassType("bool");
14599 exp->op.exp1->expType->truth = 0x1;
14600 }
14601 if(exp->op.exp2)
14602 {
14603 if(exp->op.exp2->destType)
14604 FreeType(exp->op.exp2->destType);
14605 exp->op.exp2->destType = MkClassType("bool");
14606 exp->op.exp2->destType->truth = 0x1;
14607 if(!exp->op.exp2->expType)
14608 ProcessExpressionType(exp->op.exp2);
14609 else
14610 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14611 FreeType(exp->op.exp2->expType);
14612 exp->op.exp2->expType = MkClassType("bool");
14613 exp->op.exp2->expType->truth = 0x1;
14614 }
14615 }
14616 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")))))
14617 {
14618 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
14619 {
14620 if(exp->op.op == '-' && ((type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 4) || (type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 4)))
14621 {
14622 struct Type * intType;
14623
14624 if(!type1->_class->registered->dataType)
14625 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
14626 if(!type2->_class->registered->dataType)
14627 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
14628 intType = ProcessTypeString((type1->_class->registered->dataType->kind == 4 || type2->_class->registered->dataType->kind == 4) ? "int64" : "int", 0x0);
14629 if(exp->op.exp1->destType)
14630 FreeType(exp->op.exp1->destType);
14631 if(exp->op.exp2->destType)
14632 FreeType(exp->op.exp2->destType);
14633 exp->op.exp1->destType = intType;
14634 exp->op.exp2->destType = intType;
14635 intType->refCount++;
14636 }
14637 else
14638 {
14639 if(exp->op.exp2->destType)
14640 FreeType(exp->op.exp2->destType);
14641 exp->op.exp2->destType = type1;
14642 type1->refCount++;
14643 if(exp->op.exp1->destType)
14644 FreeType(exp->op.exp1->destType);
14645 exp->op.exp1->destType = type2;
14646 type2->refCount++;
14647 }
14648 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)
14649 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "operating on %s and %s with an untyped result, assuming %s\n", (((void *)0))), type1->_class->string, type2->_class->string, type1->_class->string);
14650 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
14651 {
14652 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14653
14654 if(argExp)
14655 {
14656 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14657
14658 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
14659 ProcessExpressionType(exp->op.exp1);
14660 if(type2->kind != 13)
14661 {
14662 ProcessExpressionType(classExp);
14663 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"))))))));
14664 if(!exp->op.exp2->expType)
14665 {
14666 if(type2)
14667 FreeType(type2);
14668 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
14669 type2->refCount++;
14670 }
14671 ProcessExpressionType(exp->op.exp2);
14672 }
14673 }
14674 }
14675 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)))
14676 {
14677 if(type1->kind != 8 && type1->type->kind == 0)
14678 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14679 exp->expType = type1;
14680 if(type1)
14681 type1->refCount++;
14682 }
14683 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)))
14684 {
14685 if(type2->kind != 8 && type2->type->kind == 0)
14686 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14687 exp->expType = type2;
14688 if(type2)
14689 type2->refCount++;
14690 }
14691 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))
14692 {
14693 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "different levels of indirection\n", (((void *)0))));
14694 }
14695 else
14696 {
14697 unsigned int success = 0x0;
14698
14699 if(type1->kind == 13 && type2->kind == 13)
14700 {
14701 if(exp->op.op == '+')
14702 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14703 else if(exp->op.op == '-')
14704 {
14705 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
14706 {
14707 exp->expType = __extension__ ({
14708 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14709
14710 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
14711 });
14712 success = 0x1;
14713 if(type1->type->kind == 20)
14714 {
14715 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14716
14717 if(argExp)
14718 {
14719 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14720
14721 ProcessExpressionType(classExp);
14722 exp->type = 5;
14723 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")))))));
14724 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
14725 FreeType(dummy);
14726 return ;
14727 }
14728 }
14729 }
14730 }
14731 }
14732 if(!success && exp->op.exp1->type == 2)
14733 {
14734 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14735 {
14736 if(exp->expType)
14737 FreeType(exp->expType);
14738 exp->expType = exp->op.exp1->destType;
14739 if(exp->op.exp1->destType)
14740 exp->op.exp1->destType->refCount++;
14741 success = 0x1;
14742 }
14743 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14744 {
14745 if(exp->expType)
14746 FreeType(exp->expType);
14747 exp->expType = exp->op.exp2->destType;
14748 if(exp->op.exp2->destType)
14749 exp->op.exp2->destType->refCount++;
14750 success = 0x1;
14751 }
14752 }
14753 else if(!success)
14754 {
14755 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14756 {
14757 if(exp->expType)
14758 FreeType(exp->expType);
14759 exp->expType = exp->op.exp2->destType;
14760 if(exp->op.exp2->destType)
14761 exp->op.exp2->destType->refCount++;
14762 success = 0x1;
14763 }
14764 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14765 {
14766 if(exp->expType)
14767 FreeType(exp->expType);
14768 exp->expType = exp->op.exp1->destType;
14769 if(exp->op.exp1->destType)
14770 exp->op.exp1->destType->refCount++;
14771 success = 0x1;
14772 }
14773 }
14774 if(!success)
14775 {
14776 char expString1[10240];
14777 char expString2[10240];
14778 char type1[1024];
14779 char type2[1024];
14780
14781 expString1[0] = '\0';
14782 expString2[0] = '\0';
14783 type1[0] = '\0';
14784 type2[0] = '\0';
14785 if(inCompiler)
14786 {
14787 PrintExpression(exp->op.exp1, expString1);
14788 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
14789 PrintExpression(exp->op.exp2, expString2);
14790 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
14791 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
14792 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
14793 }
14794 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
14795 }
14796 }
14797 }
14798 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
14799 {
14800 if(exp->op.exp1->destType)
14801 FreeType(exp->op.exp1->destType);
14802 exp->op.exp1->destType = type2->_class->registered->dataType;
14803 if(type2->_class->registered->dataType)
14804 type2->_class->registered->dataType->refCount++;
14805 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14806 exp->expType = type2;
14807 if(type2)
14808 type2->refCount++;
14809 }
14810 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
14811 {
14812 if(exp->op.exp2->destType)
14813 FreeType(exp->op.exp2->destType);
14814 exp->op.exp2->destType = type1->_class->registered->dataType;
14815 if(type1->_class->registered->dataType)
14816 type1->_class->registered->dataType->refCount++;
14817 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14818 exp->expType = type1;
14819 if(type1)
14820 type1->refCount++;
14821 }
14822 else if(type1)
14823 {
14824 unsigned int valid = 0x0;
14825
14826 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
14827 {
14828 if(exp->op.exp2->destType)
14829 FreeType(exp->op.exp2->destType);
14830 if(!type1->_class->registered->dataType)
14831 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
14832 exp->op.exp2->destType = type1->_class->registered->dataType;
14833 exp->op.exp2->destType->refCount++;
14834 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14835 if(type2)
14836 FreeType(type2);
14837 type2 = exp->op.exp2->destType;
14838 if(type2)
14839 type2->refCount++;
14840 exp->expType = type2;
14841 type2->refCount++;
14842 }
14843 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
14844 {
14845 if(exp->op.exp1->destType)
14846 FreeType(exp->op.exp1->destType);
14847 if(!type2->_class->registered->dataType)
14848 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
14849 exp->op.exp1->destType = type2->_class->registered->dataType;
14850 exp->op.exp1->destType->refCount++;
14851 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14852 type1 = exp->op.exp1->destType;
14853 exp->expType = type1;
14854 type1->refCount++;
14855 }
14856 if(!boolResult || exp->op.op == '>' || exp->op.op == '<' || exp->op.op == GE_OP || exp->op.op == LE_OP)
14857 {
14858 unsigned int op1IsEnum = type1 && type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4;
14859 unsigned int op2IsEnum = type2 && type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4;
14860
14861 if(exp->op.op == '*' || exp->op.op == '/' || exp->op.op == '-' || exp->op.op == '|' || exp->op.op == '^')
14862 {
14863 if(op1IsEnum && exp->op.exp2->expType)
14864 {
14865 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
14866 {
14867 if(exp->expType)
14868 FreeType(exp->expType);
14869 exp->expType = exp->op.exp2->expType;
14870 if(exp->op.exp2->expType)
14871 exp->op.exp2->expType->refCount++;
14872 valid = 0x1;
14873 }
14874 }
14875 else if(op2IsEnum && exp->op.exp1->expType)
14876 {
14877 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
14878 {
14879 if(exp->expType)
14880 FreeType(exp->expType);
14881 exp->expType = exp->op.exp1->expType;
14882 if(exp->op.exp1->expType)
14883 exp->op.exp1->expType->refCount++;
14884 valid = 0x1;
14885 }
14886 }
14887 }
14888 else
14889 {
14890 if(op1IsEnum && exp->op.exp2->expType)
14891 {
14892 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
14893 {
14894 if(exp->expType)
14895 FreeType(exp->expType);
14896 exp->expType = exp->op.exp1->expType;
14897 if(exp->op.exp1->expType)
14898 exp->op.exp1->expType->refCount++;
14899 valid = 0x1;
14900 }
14901 }
14902 else if(op2IsEnum && exp->op.exp1->expType)
14903 {
14904 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
14905 {
14906 if(exp->expType)
14907 FreeType(exp->expType);
14908 exp->expType = exp->op.exp2->expType;
14909 if(exp->op.exp2->expType)
14910 exp->op.exp2->expType->refCount++;
14911 valid = 0x1;
14912 }
14913 }
14914 }
14915 }
14916 if(!valid)
14917 {
14918 if(type2 && type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3 && (type1->kind != 8 || !type1->_class || !type1->_class->registered || type1->_class->registered->type != 3))
14919 {
14920 if(exp->op.exp1->destType)
14921 FreeType(exp->op.exp1->destType);
14922 exp->op.exp1->destType = type2;
14923 type2->refCount++;
14924 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14925 {
14926 if(exp->expType)
14927 FreeType(exp->expType);
14928 exp->expType = exp->op.exp1->destType;
14929 if(exp->op.exp1->destType)
14930 exp->op.exp1->destType->refCount++;
14931 }
14932 }
14933 else
14934 {
14935 if(exp->op.exp2->destType)
14936 FreeType(exp->op.exp2->destType);
14937 exp->op.exp2->destType = type1;
14938 type1->refCount++;
14939 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14940 {
14941 if(exp->expType)
14942 FreeType(exp->expType);
14943 exp->expType = exp->op.exp2->destType;
14944 if(exp->op.exp2->destType)
14945 exp->op.exp2->destType->refCount++;
14946 }
14947 else if(type1 && type2)
14948 {
14949 char expString1[10240];
14950 char expString2[10240];
14951 char type1String[1024];
14952 char type2String[1024];
14953
14954 expString1[0] = '\0';
14955 expString2[0] = '\0';
14956 type1String[0] = '\0';
14957 type2String[0] = '\0';
14958 if(inCompiler)
14959 {
14960 PrintExpression(exp->op.exp1, expString1);
14961 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
14962 PrintExpression(exp->op.exp2, expString2);
14963 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
14964 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
14965 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
14966 }
14967 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
14968 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
14969 {
14970 exp->expType = exp->op.exp1->expType;
14971 if(exp->op.exp1->expType)
14972 exp->op.exp1->expType->refCount++;
14973 }
14974 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
14975 {
14976 exp->expType = exp->op.exp2->expType;
14977 if(exp->op.exp2->expType)
14978 exp->op.exp2->expType->refCount++;
14979 }
14980 }
14981 }
14982 }
14983 }
14984 else if(type2)
14985 {
14986 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
14987 {
14988 struct Type * oldType = exp->op.exp1->expType;
14989
14990 exp->op.exp1->expType = (((void *)0));
14991 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14992 FreeType(oldType);
14993 else
14994 exp->op.exp1->expType = oldType;
14995 }
14996 if(exp->op.exp1->destType)
14997 FreeType(exp->op.exp1->destType);
14998 exp->op.exp1->destType = type2;
14999 type2->refCount++;
15000 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
15001 {
15002 if(exp->expType)
15003 FreeType(exp->expType);
15004 exp->expType = exp->op.exp1->destType;
15005 if(exp->op.exp1->destType)
15006 exp->op.exp1->destType->refCount++;
15007 }
15008 }
15009 }
15010 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
15011 {
15012 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
15013 {
15014 if(exp->op.exp1->destType)
15015 FreeType(exp->op.exp1->destType);
15016 exp->op.exp1->destType = type2->_class->registered->dataType;
15017 if(type2->_class->registered->dataType)
15018 type2->_class->registered->dataType->refCount++;
15019 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
15020 }
15021 if(exp->op.op == '!')
15022 {
15023 exp->expType = MkClassType("bool");
15024 exp->expType->truth = 0x1;
15025 }
15026 else
15027 {
15028 exp->expType = type2;
15029 if(type2)
15030 type2->refCount++;
15031 }
15032 }
15033 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
15034 {
15035 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
15036 {
15037 if(exp->op.exp2->destType)
15038 FreeType(exp->op.exp2->destType);
15039 exp->op.exp2->destType = type1->_class->registered->dataType;
15040 if(type1->_class->registered->dataType)
15041 type1->_class->registered->dataType->refCount++;
15042 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
15043 }
15044 exp->expType = type1;
15045 if(type1)
15046 type1->refCount++;
15047 }
15048 }
15049 yylloc = exp->loc;
15050 if(exp->op.exp1 && !exp->op.exp1->expType)
15051 {
15052 char expString[10000];
15053
15054 expString[0] = '\0';
15055 if(inCompiler)
15056 {
15057 PrintExpression(exp->op.exp1, expString);
15058 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15059 }
15060 if(expString[0])
15061 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
15062 }
15063 if(exp->op.exp2 && !exp->op.exp2->expType)
15064 {
15065 char expString[10240];
15066
15067 expString[0] = '\0';
15068 if(inCompiler)
15069 {
15070 PrintExpression(exp->op.exp2, expString);
15071 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15072 }
15073 if(expString[0])
15074 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
15075 }
15076 if(boolResult)
15077 {
15078 FreeType(exp->expType);
15079 exp->expType = MkClassType("bool");
15080 exp->expType->truth = 0x1;
15081 }
15082 if(exp->op.op != SIZEOF)
15083 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
15084 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
15085 {
15086 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
15087 }
15088 yylloc = oldyylloc;
15089 FreeType(dummy);
15090 if(type2)
15091 FreeType(type2);
15092 break;
15093 }
15094 case 5:
15095 case 32:
15096 {
15097 struct Expression * e;
15098
15099 exp->isConstant = 0x1;
15100 for(e = (*exp->list).first; e; e = e->next)
15101 {
15102 unsigned int inced = 0x0;
15103
15104 if(!e->next)
15105 {
15106 FreeType(e->destType);
15107 e->opDestType = exp->opDestType;
15108 e->destType = exp->destType;
15109 if(e->destType)
15110 {
15111 exp->destType->refCount++;
15112 e->destType->count++;
15113 inced = 0x1;
15114 }
15115 }
15116 ProcessExpressionType(e);
15117 if(inced)
15118 exp->destType->count--;
15119 if(!exp->expType && !e->next)
15120 {
15121 exp->expType = e->expType;
15122 if(e->expType)
15123 e->expType->refCount++;
15124 }
15125 if(!e->isConstant)
15126 exp->isConstant = 0x0;
15127 }
15128 e = (*exp->list).first;
15129 if(!e->next && e->type == 8)
15130 {
15131 struct Expression * next = exp->next, * prev = exp->prev;
15132
15133 FreeType(exp->expType);
15134 FreeType(exp->destType);
15135 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
15136 *exp = *e;
15137 exp->prev = prev;
15138 exp->next = next;
15139 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
15140 ProcessExpressionType(exp);
15141 }
15142 break;
15143 }
15144 case 6:
15145 {
15146 struct Expression * e;
15147
15148 exp->isConstant = 0x1;
15149 ProcessExpressionType(exp->index.exp);
15150 if(!exp->index.exp->isConstant)
15151 exp->isConstant = 0x0;
15152 if(exp->index.exp->expType)
15153 {
15154 struct Type * source = exp->index.exp->expType;
15155
15156 if(source->kind == 8 && source->_class && source->_class->registered)
15157 {
15158 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
15159 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
15160
15161 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
15162 {
15163 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
15164 if(exp->index.index && (*exp->index.index).last)
15165 {
15166 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
15167 }
15168 }
15169 }
15170 }
15171 for(e = (*exp->index.index).first; e; e = e->next)
15172 {
15173 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
15174 {
15175 if(e->destType)
15176 FreeType(e->destType);
15177 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
15178 }
15179 ProcessExpressionType(e);
15180 if(!e->next)
15181 {
15182 }
15183 if(!e->isConstant)
15184 exp->isConstant = 0x0;
15185 }
15186 if(!exp->expType)
15187 exp->expType = Dereference(exp->index.exp->expType);
15188 if(exp->expType)
15189 DeclareType(exp->expType, 0x0, 0x0);
15190 break;
15191 }
15192 case 7:
15193 {
15194 struct Expression * e;
15195 struct Type * functionType;
15196 struct Type * methodType = (((void *)0));
15197 char name[1024];
15198
15199 name[0] = '\0';
15200 if(inCompiler)
15201 {
15202 PrintExpression(exp->call.exp, name);
15203 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
15204 {
15205 PrintExpression(exp->call.exp, name);
15206 }
15207 }
15208 if(exp->call.exp->type == 0)
15209 {
15210 struct Expression * idExp = exp->call.exp;
15211 struct Identifier * id = idExp->identifier;
15212
15213 if(!strcmp(id->string, "__builtin_frame_address"))
15214 {
15215 exp->expType = ProcessTypeString("void *", 0x1);
15216 if(exp->call.arguments && (*exp->call.arguments).first)
15217 ProcessExpressionType((*exp->call.arguments).first);
15218 break;
15219 }
15220 else if(!strcmp(id->string, "__ENDIAN_PAD"))
15221 {
15222 exp->expType = ProcessTypeString("int", 0x1);
15223 if(exp->call.arguments && (*exp->call.arguments).first)
15224 ProcessExpressionType((*exp->call.arguments).first);
15225 break;
15226 }
15227 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
15228 {
15229 struct Expression * a = (((void *)0));
15230 struct Expression * b = (((void *)0));
15231 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
15232
15233 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
15234 {
15235 a = (*exp->call.arguments).first;
15236 b = (*exp->call.arguments).last;
15237 tempExp1 = a;
15238 tempExp2 = b;
15239 }
15240 else if((*exp->call.arguments).count == 1)
15241 {
15242 a = (*exp->call.arguments).first;
15243 tempExp1 = a;
15244 }
15245 if(a)
15246 {
15247 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
15248 idExp->identifier = (((void *)0));
15249 FreeExpContents(exp);
15250 ProcessExpressionType(a);
15251 if(b)
15252 ProcessExpressionType(b);
15253 exp->type = 5;
15254 exp->list = MkList();
15255 if(a->expType && (!b || b->expType))
15256 {
15257 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
15258 {
15259 if(inCompiler)
15260 {
15261 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15262 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
15263 struct Declaration * decl;
15264 char temp1[1024], temp2[1024];
15265
15266 GetTypeSpecs(a->expType, specs);
15267 if(a && !a->isConstant && a->type != 0)
15268 {
15269 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
15270 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
15271 tempExp1 = QMkExpId(temp1);
15272 tempExp1->expType = a->expType;
15273 if(a->expType)
15274 a->expType->refCount++;
15275 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
15276 }
15277 if(b && !b->isConstant && b->type != 0)
15278 {
15279 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
15280 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
15281 tempExp2 = QMkExpId(temp2);
15282 tempExp2->expType = b->expType;
15283 if(b->expType)
15284 b->expType->refCount++;
15285 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
15286 }
15287 decl = MkDeclaration(specs, decls);
15288 if(!curCompound->compound.declarations)
15289 curCompound->compound.declarations = MkList();
15290 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
15291 }
15292 }
15293 }
15294 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
15295 {
15296 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
15297
15298 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
15299 exp->expType = a->expType;
15300 if(a->expType)
15301 a->expType->refCount++;
15302 }
15303 else if(!strcmp(id->string, "Abs"))
15304 {
15305 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
15306 exp->expType = a->expType;
15307 if(a->expType)
15308 a->expType->refCount++;
15309 }
15310 else if(!strcmp(id->string, "Sgn"))
15311 {
15312 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"))))));
15313 exp->expType = ProcessTypeString("int", 0x0);
15314 }
15315 FreeExpression(tempExp1);
15316 if(tempExp2)
15317 FreeExpression(tempExp2);
15318 FreeIdentifier(id);
15319 break;
15320 }
15321 }
15322 }
15323 {
15324 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
15325
15326 if(!exp->call.exp->destType)
15327 {
15328 exp->call.exp->destType = dummy;
15329 dummy->refCount++;
15330 }
15331 ProcessExpressionType(exp->call.exp);
15332 if(exp->call.exp->destType == dummy)
15333 {
15334 FreeType(dummy);
15335 exp->call.exp->destType = (((void *)0));
15336 }
15337 FreeType(dummy);
15338 }
15339 functionType = exp->call.exp->expType;
15340 if(functionType && functionType->kind == 16)
15341 {
15342 methodType = functionType;
15343 functionType = methodType->method->dataType;
15344 if(exp->call.exp->expType->usedClass)
15345 {
15346 char typeString[1024];
15347
15348 typeString[0] = '\0';
15349 {
15350 struct Symbol * back = functionType->thisClass;
15351
15352 functionType->thisClass = (((void *)0));
15353 PrintType(functionType, typeString, 0x1, 0x1);
15354 functionType->thisClass = back;
15355 }
15356 if(strstr(typeString, "thisclass"))
15357 {
15358 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15359 struct Declarator * decl;
15360
15361 {
15362 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
15363
15364 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
15365 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
15366 thisClassParams = 0x0;
15367 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
15368 {
15369 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
15370
15371 thisClass = exp->call.exp->expType->usedClass;
15372 ProcessDeclarator(decl);
15373 thisClass = backupThisClass;
15374 }
15375 thisClassParams = 0x1;
15376 functionType = ProcessType(specs, decl);
15377 functionType->refCount = 0;
15378 FinishTemplatesContext(context);
15379 }
15380 FreeList(specs, FreeSpecifier);
15381 FreeDeclarator(decl);
15382 }
15383 }
15384 }
15385 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
15386 {
15387 struct Type * type = functionType->type;
15388
15389 if(!functionType->refCount)
15390 {
15391 functionType->type = (((void *)0));
15392 FreeType(functionType);
15393 }
15394 functionType = type;
15395 }
15396 if(functionType && functionType->kind != 11)
15397 {
15398 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "called object %s is not a function\n", (((void *)0))), name);
15399 }
15400 else if(functionType)
15401 {
15402 unsigned int emptyParams = 0x0, noParams = 0x0;
15403 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
15404 struct Type * type = functionType->params.first;
15405 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
15406 int extra = 0;
15407 struct Location oldyylloc = yylloc;
15408
15409 if(!type)
15410 emptyParams = 0x1;
15411 if(functionType->extraParam && e && functionType->thisClass)
15412 {
15413 e->destType = MkClassType(functionType->thisClass->string);
15414 e = e->next;
15415 }
15416 if(!functionType->staticMethod && !functionType->extraParam)
15417 {
15418 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
15419 {
15420 type = MkClassType(memberExp->member.exp->expType->_class->string);
15421 if(e)
15422 {
15423 e->destType = type;
15424 e = e->next;
15425 type = functionType->params.first;
15426 }
15427 else
15428 type->refCount = 0;
15429 }
15430 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
15431 {
15432 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
15433 type->byReference = functionType->byReference;
15434 type->typedByReference = functionType->typedByReference;
15435 if(e)
15436 {
15437 if(e->next && type->kind == 8 && (functionType && functionType->thisClass) && functionType->classObjectType == 2)
15438 e = e->next;
15439 e->destType = type;
15440 e = e->next;
15441 type = functionType->params.first;
15442 }
15443 else
15444 type->refCount = 0;
15445 }
15446 }
15447 if(type && type->kind == 0)
15448 {
15449 noParams = 0x1;
15450 if(!type->refCount)
15451 FreeType(type);
15452 type = (((void *)0));
15453 }
15454 for(; e; e = e->next)
15455 {
15456 if(!type && !emptyParams)
15457 {
15458 yylloc = e->loc;
15459 if(methodType && methodType->methodClass)
15460 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "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);
15461 else
15462 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many arguments for function %s (%d given, expected %d)\n", (((void *)0))), name, (*exp->call.arguments).count, noParams ? 0 : functionType->params.count);
15463 break;
15464 }
15465 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
15466 {
15467 struct Type * templatedType = (((void *)0));
15468 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
15469 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15470 int id = 0;
15471
15472 if(_class && _class->templateArgs)
15473 {
15474 struct __ecereNameSpace__ecere__com__Class * sClass;
15475
15476 for(sClass = _class; sClass; sClass = sClass->base)
15477 {
15478 if(sClass->templateClass)
15479 sClass = sClass->templateClass;
15480 id = 0;
15481 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15482 {
15483 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
15484 {
15485 struct __ecereNameSpace__ecere__com__Class * nextClass;
15486
15487 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15488 {
15489 if(nextClass->templateClass)
15490 nextClass = nextClass->templateClass;
15491 id += nextClass->templateParams.count;
15492 }
15493 break;
15494 }
15495 id++;
15496 }
15497 if(curParam)
15498 break;
15499 }
15500 }
15501 if(curParam && _class->templateArgs[id].dataTypeString)
15502 {
15503 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
15504
15505 {
15506 struct Context * context = SetupTemplatesContext(_class);
15507
15508 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
15509 FinishTemplatesContext(context);
15510 }
15511 e->destType = templatedType;
15512 if(templatedType)
15513 {
15514 templatedType->passAsTemplate = 0x1;
15515 }
15516 }
15517 else
15518 {
15519 e->destType = type;
15520 if(type)
15521 type->refCount++;
15522 }
15523 }
15524 else
15525 {
15526 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
15527 {
15528 e->destType = type->prev;
15529 e->destType->refCount++;
15530 }
15531 else
15532 {
15533 e->destType = type;
15534 if(type)
15535 type->refCount++;
15536 }
15537 }
15538 if(type && type->kind != 14)
15539 {
15540 struct Type * next = type->next;
15541
15542 if(!type->refCount)
15543 FreeType(type);
15544 type = next;
15545 }
15546 }
15547 if(type && type->kind != 14)
15548 {
15549 if(methodType && methodType->methodClass)
15550 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "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);
15551 else
15552 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "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);
15553 }
15554 yylloc = oldyylloc;
15555 if(type && !type->refCount)
15556 FreeType(type);
15557 }
15558 else
15559 {
15560 functionType = __extension__ ({
15561 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15562
15563 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
15564 });
15565 if(exp->call.exp->type == 0)
15566 {
15567 char * string = exp->call.exp->identifier->string;
15568
15569 if(inCompiler)
15570 {
15571 struct Symbol * symbol;
15572 struct Location oldyylloc = yylloc;
15573
15574 yylloc = exp->call.exp->identifier->loc;
15575 if(strstr(string, "__builtin_") == string)
15576 {
15577 if(exp->destType)
15578 {
15579 functionType->returnType = exp->destType;
15580 exp->destType->refCount++;
15581 }
15582 }
15583 else
15584 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s undefined; assuming extern returning int\n", (((void *)0))), string);
15585 symbol = __extension__ ({
15586 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
15587
15588 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 0x1), __ecereInstance1;
15589 });
15590 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
15591 if(strstr(symbol->string, "::"))
15592 globalContext->hasNameSpace = 0x1;
15593 yylloc = oldyylloc;
15594 }
15595 }
15596 else if(exp->call.exp->type == 8)
15597 {
15598 }
15599 else
15600 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "callable object undefined; extern assuming returning int\n", (((void *)0))));
15601 if(!functionType->returnType)
15602 {
15603 functionType->returnType = __extension__ ({
15604 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15605
15606 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15607 });
15608 }
15609 }
15610 if(functionType && functionType->kind == 11)
15611 {
15612 exp->expType = functionType->returnType;
15613 if(functionType->returnType)
15614 functionType->returnType->refCount++;
15615 if(!functionType->refCount)
15616 FreeType(functionType);
15617 }
15618 if(exp->call.arguments)
15619 {
15620 for(e = (*exp->call.arguments).first; e; e = e->next)
15621 {
15622 struct Type * destType = e->destType;
15623
15624 ProcessExpressionType(e);
15625 }
15626 }
15627 break;
15628 }
15629 case 8:
15630 {
15631 struct Type * type;
15632 struct Location oldyylloc = yylloc;
15633 unsigned int thisPtr;
15634 struct Expression * checkExp = exp->member.exp;
15635
15636 while(checkExp)
15637 {
15638 if(checkExp->type == 11)
15639 checkExp = checkExp->cast.exp;
15640 else if(checkExp->type == 5)
15641 checkExp = checkExp->list ? (*checkExp->list).first : (((void *)0));
15642 else
15643 break;
15644 }
15645 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->identifier->string, "this"));
15646 exp->thisPtr = thisPtr;
15647 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
15648 {
15649 exp->member.member->classSym = exp->member.member->_class->symbol;
15650 }
15651 ProcessExpressionType(exp->member.exp);
15652 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)
15653 {
15654 exp->isConstant = 0x0;
15655 }
15656 else
15657 exp->isConstant = exp->member.exp->isConstant;
15658 type = exp->member.exp->expType;
15659 yylloc = exp->loc;
15660 if(type && (type->kind == 20))
15661 {
15662 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
15663 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
15664
15665 if(_class)
15666 {
15667 for(param = _class->templateParams.first; param; param = param->next)
15668 {
15669 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
15670 break;
15671 }
15672 }
15673 if(param && param->defaultArg.member)
15674 {
15675 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
15676
15677 if(argExp)
15678 {
15679 struct Expression * expMember = exp->member.exp;
15680 struct Declarator * decl;
15681 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15682 char thisClassTypeString[1024];
15683
15684 FreeIdentifier(exp->member.member);
15685 ProcessExpressionType(argExp);
15686 {
15687 char * colon = strstr(param->defaultArg.memberString, "::");
15688
15689 if(colon)
15690 {
15691 char className[1024];
15692 struct __ecereNameSpace__ecere__com__Class * sClass;
15693
15694 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
15695 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
15696 }
15697 else
15698 strcpy(thisClassTypeString, _class->fullName);
15699 }
15700 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
15701 exp->expType = ProcessType(specs, decl);
15702 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
15703 {
15704 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
15705 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
15706 int c;
15707 int paramCount = 0;
15708 int lastParam = -1;
15709 char templateString[1024];
15710 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
15711
15712 sprintf(templateString, "%s<", expClass->templateClass->fullName);
15713 for(cClass = expClass; cClass; cClass = cClass->base)
15714 {
15715 int p = 0;
15716
15717 for(param = cClass->templateParams.first; param; param = param->next)
15718 {
15719 int id = p;
15720 struct __ecereNameSpace__ecere__com__Class * sClass;
15721 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
15722
15723 for(sClass = cClass->base; sClass; sClass = sClass->base)
15724 id += sClass->templateParams.count;
15725 arg = expClass->templateArgs[id];
15726 for(sClass = _class; sClass; sClass = sClass->base)
15727 {
15728 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
15729 int p = 0;
15730 struct __ecereNameSpace__ecere__com__Class * nextClass;
15731
15732 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15733 p += nextClass->templateParams.count;
15734 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
15735 {
15736 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
15737 {
15738 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15739 {
15740 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
15741 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
15742 break;
15743 }
15744 }
15745 }
15746 }
15747 {
15748 char argument[256];
15749
15750 argument[0] = '\0';
15751 switch(param->type)
15752 {
15753 case 2:
15754 {
15755 char expString[1024];
15756 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15757 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
15758 struct Expression * exp;
15759 char * string = PrintHexUInt64(arg.expression.ui64);
15760
15761 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
15762 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
15763 ProcessExpressionType(exp);
15764 ComputeExpression(exp);
15765 expString[0] = '\0';
15766 PrintExpression(exp, expString);
15767 strcat(argument, expString);
15768 FreeExpression(exp);
15769 break;
15770 }
15771 case 1:
15772 {
15773 strcat(argument, arg.member->name);
15774 break;
15775 }
15776 case 0:
15777 {
15778 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15779 {
15780 if(!strcmp(arg.dataTypeString, "thisclass"))
15781 strcat(argument, thisClassTypeString);
15782 else
15783 strcat(argument, arg.dataTypeString);
15784 }
15785 break;
15786 }
15787 }
15788 if(argument[0])
15789 {
15790 if(paramCount)
15791 strcat(templateString, ", ");
15792 if(lastParam != p - 1)
15793 {
15794 strcat(templateString, param->name);
15795 strcat(templateString, " = ");
15796 }
15797 strcat(templateString, argument);
15798 paramCount++;
15799 lastParam = p;
15800 }
15801 p++;
15802 }
15803 }
15804 }
15805 {
15806 int len = strlen(templateString);
15807
15808 if(templateString[len - 1] == '>')
15809 templateString[len++] = ' ';
15810 templateString[len++] = '>';
15811 templateString[len++] = '\0';
15812 }
15813 {
15814 struct Context * context = SetupTemplatesContext(_class);
15815
15816 FreeType(exp->expType);
15817 exp->expType = ProcessTypeString(templateString, 0x0);
15818 FinishTemplatesContext(context);
15819 }
15820 }
15821 exp->type = 5;
15822 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")))))))));
15823 }
15824 }
15825 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
15826 {
15827 type = ProcessTemplateParameterType(type->templateParameter);
15828 }
15829 }
15830 if(type && (type->kind == 20))
15831 ;
15832 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)))
15833 {
15834 struct Identifier * id = exp->member.member;
15835 int typeKind = type->kind;
15836 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));
15837
15838 if(typeKind == 19 && exp->member.exp->type == 24)
15839 {
15840 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
15841 typeKind = 8;
15842 }
15843 if(id)
15844 {
15845 if(typeKind == 3 || typeKind == 15)
15846 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
15847 else if(!_class)
15848 {
15849 if(type->kind == 8 && type->_class && type->_class->registered)
15850 {
15851 _class = type->_class->registered;
15852 }
15853 else if((type->kind == 12 || type->kind == 13) && type->type && type->type->kind == 1)
15854 {
15855 _class = FindClass("char *")->registered;
15856 }
15857 else if(type->kind == 13)
15858 {
15859 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
15860 FreeType(exp->expType);
15861 exp->expType = ProcessTypeString("uintptr", 0x0);
15862 exp->byReference = 0x1;
15863 }
15864 else
15865 {
15866 char string[1024] = "";
15867 struct Symbol * classSym;
15868
15869 PrintTypeNoConst(type, string, 0x0, 0x1);
15870 classSym = FindClass(string);
15871 if(classSym)
15872 _class = classSym->registered;
15873 }
15874 }
15875 }
15876 if(_class && id)
15877 {
15878 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
15879 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
15880 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
15881 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
15882 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
15883
15884 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
15885 exp->member.memberType = 1;
15886 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
15887 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
15888 if(typeKind != 19)
15889 {
15890 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
15891 {
15892 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
15893 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
15894 {
15895 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15896 if(prop)
15897 member = (((void *)0));
15898 }
15899 if(!member && !prop)
15900 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15901 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
15902 exp->member.thisPtr = 0x1;
15903 }
15904 else
15905 {
15906 if(!id->classSym)
15907 {
15908 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
15909 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
15910 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
15911 }
15912 if(!prop && !member)
15913 {
15914 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
15915 if(!method)
15916 {
15917 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15918 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
15919 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
15920 }
15921 }
15922 if(member && prop)
15923 {
15924 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
15925 prop = (((void *)0));
15926 else
15927 member = (((void *)0));
15928 }
15929 }
15930 }
15931 if(!prop && !member && !method)
15932 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
15933 if(!prop && !member && !method)
15934 {
15935 if(typeKind == 19)
15936 {
15937 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
15938 if(classProp)
15939 {
15940 exp->member.memberType = 5;
15941 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
15942 }
15943 else
15944 {
15945 char structName[1024];
15946 struct Identifier * id = exp->member.member;
15947 struct Expression * classExp = exp->member.exp;
15948
15949 type->refCount++;
15950 FreeType(classExp->expType);
15951 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
15952 strcpy(structName, "__ecereClassData_");
15953 FullClassNameCat(structName, type->_class->string, 0x0);
15954 exp->type = 9;
15955 exp->member.member = id;
15956 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"))))))));
15957 FreeType(type);
15958 ProcessExpressionType(exp);
15959 return ;
15960 }
15961 }
15962 else
15963 {
15964 struct Symbol * classSym = FindClass(id->string);
15965
15966 if(classSym)
15967 {
15968 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
15969
15970 if(convertClass)
15971 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
15972 }
15973 }
15974 }
15975 if(prop)
15976 {
15977 exp->member.memberType = 1;
15978 if(!prop->dataType)
15979 ProcessPropertyType(prop);
15980 exp->expType = prop->dataType;
15981 if(prop->dataType)
15982 prop->dataType->refCount++;
15983 }
15984 else if(member)
15985 {
15986 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
15987 {
15988 FreeExpContents(exp);
15989 exp->type = 0;
15990 exp->identifier = MkIdentifier("class");
15991 ProcessExpressionType(exp);
15992 return ;
15993 }
15994 exp->member.memberType = 3;
15995 DeclareStruct(_class->fullName, 0x0);
15996 if(!member->dataType)
15997 {
15998 struct Context * context = SetupTemplatesContext(_class);
15999
16000 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
16001 FinishTemplatesContext(context);
16002 }
16003 exp->expType = member->dataType;
16004 if(member->dataType)
16005 member->dataType->refCount++;
16006 }
16007 else if(revConvert)
16008 {
16009 exp->member.memberType = 4;
16010 exp->expType = MkClassType(revConvert->_class->fullName);
16011 }
16012 else if(method)
16013 {
16014 {
16015 exp->member.memberType = 2;
16016 }
16017 if(!method->dataType)
16018 ProcessMethodType(method);
16019 exp->expType = __extension__ ({
16020 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16021
16022 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1;
16023 });
16024 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
16025 exp->expType->usedClass = _class;
16026 }
16027 else if(!classProp)
16028 {
16029 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
16030 {
16031 FreeExpContents(exp);
16032 exp->type = 0;
16033 exp->identifier = MkIdentifier("class");
16034 FreeType(exp->expType);
16035 exp->expType = MkClassType("ecere::com::Class");
16036 return ;
16037 }
16038 yylloc = exp->member.member->loc;
16039 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
16040 if(inCompiler)
16041 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
16042 }
16043 if(_class && exp->expType)
16044 {
16045 struct __ecereNameSpace__ecere__com__Class * tClass;
16046
16047 tClass = _class;
16048 while(tClass && !tClass->templateClass)
16049 tClass = tClass->base;
16050 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
16051 {
16052 int id = 0;
16053 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
16054 struct __ecereNameSpace__ecere__com__Class * sClass;
16055
16056 for(sClass = tClass; sClass; sClass = sClass->base)
16057 {
16058 id = 0;
16059 if(sClass->templateClass)
16060 sClass = sClass->templateClass;
16061 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
16062 {
16063 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
16064 {
16065 for(sClass = sClass->base; sClass; sClass = sClass->base)
16066 id += sClass->templateParams.count;
16067 break;
16068 }
16069 id++;
16070 }
16071 if(curParam)
16072 break;
16073 }
16074 if(curParam && tClass->templateArgs[id].dataTypeString)
16075 {
16076 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
16077 struct Context * context = SetupTemplatesContext(tClass);
16078
16079 FreeType(exp->expType);
16080 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
16081 if(exp->expType)
16082 {
16083 if(exp->expType->kind == 21)
16084 {
16085 FreeType(exp->expType);
16086 exp->expType = ReplaceThisClassType(_class);
16087 }
16088 if(tClass->templateClass)
16089 exp->expType->passAsTemplate = 0x1;
16090 if(!exp->destType)
16091 {
16092 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
16093 if(exp->destType->kind == 21)
16094 {
16095 FreeType(exp->destType);
16096 exp->destType = ReplaceThisClassType(_class);
16097 }
16098 }
16099 }
16100 FinishTemplatesContext(context);
16101 }
16102 }
16103 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
16104 {
16105 int id = 0;
16106 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
16107 struct __ecereNameSpace__ecere__com__Class * sClass;
16108
16109 for(sClass = tClass; sClass; sClass = sClass->base)
16110 {
16111 id = 0;
16112 if(sClass->templateClass)
16113 sClass = sClass->templateClass;
16114 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
16115 {
16116 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
16117 {
16118 for(sClass = sClass->base; sClass; sClass = sClass->base)
16119 id += sClass->templateParams.count;
16120 break;
16121 }
16122 id++;
16123 }
16124 if(curParam)
16125 break;
16126 }
16127 if(curParam)
16128 {
16129 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
16130 struct Context * context = SetupTemplatesContext(tClass);
16131 struct Type * basicType;
16132
16133 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
16134 if(basicType)
16135 {
16136 if(basicType->kind == 21)
16137 {
16138 FreeType(basicType);
16139 basicType = ReplaceThisClassType(_class);
16140 }
16141 FreeType(exp->expType);
16142 exp->expType = __extension__ ({
16143 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16144
16145 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = basicType, __ecereInstance1;
16146 });
16147 if(!exp->destType)
16148 {
16149 exp->destType = exp->expType;
16150 exp->destType->refCount++;
16151 }
16152 {
16153 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16154 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16155 struct Declarator * decl;
16156
16157 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
16158 *newExp = *exp;
16159 if(exp->destType)
16160 exp->destType->refCount++;
16161 if(exp->expType)
16162 exp->expType->refCount++;
16163 exp->type = 11;
16164 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
16165 exp->cast.exp = newExp;
16166 }
16167 }
16168 FinishTemplatesContext(context);
16169 }
16170 }
16171 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
16172 {
16173 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
16174
16175 if(expClass)
16176 {
16177 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
16178 int c;
16179 int p = 0;
16180 int paramCount = 0;
16181 int lastParam = -1;
16182 char templateString[1024];
16183 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
16184
16185 sprintf(templateString, "%s<", expClass->templateClass->fullName);
16186 while(cClass != expClass)
16187 {
16188 struct __ecereNameSpace__ecere__com__Class * sClass;
16189
16190 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
16191 ;
16192 cClass = sClass;
16193 for(param = cClass->templateParams.first; param; param = param->next)
16194 {
16195 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
16196 int c;
16197 int cp = 0;
16198 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
16199 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
16200
16201 while(cClassCur != tClass && !paramCur)
16202 {
16203 struct __ecereNameSpace__ecere__com__Class * sClassCur;
16204
16205 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
16206 ;
16207 cClassCur = sClassCur;
16208 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
16209 {
16210 if(!strcmp(paramCur->name, param->name))
16211 {
16212 break;
16213 }
16214 cp++;
16215 }
16216 }
16217 if(paramCur && paramCur->type == 0)
16218 arg = tClass->templateArgs[cp];
16219 else
16220 arg = expClass->templateArgs[p];
16221 {
16222 char argument[256];
16223
16224 argument[0] = '\0';
16225 switch(param->type)
16226 {
16227 case 2:
16228 {
16229 char expString[1024];
16230 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16231 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
16232 struct Expression * exp;
16233 char * string = PrintHexUInt64(arg.expression.ui64);
16234
16235 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
16236 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
16237 ProcessExpressionType(exp);
16238 ComputeExpression(exp);
16239 expString[0] = '\0';
16240 PrintExpression(exp, expString);
16241 strcat(argument, expString);
16242 FreeExpression(exp);
16243 break;
16244 }
16245 case 1:
16246 {
16247 strcat(argument, arg.member->name);
16248 break;
16249 }
16250 case 0:
16251 {
16252 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
16253 strcat(argument, arg.dataTypeString);
16254 break;
16255 }
16256 }
16257 if(argument[0])
16258 {
16259 if(paramCount)
16260 strcat(templateString, ", ");
16261 if(lastParam != p - 1)
16262 {
16263 strcat(templateString, param->name);
16264 strcat(templateString, " = ");
16265 }
16266 strcat(templateString, argument);
16267 paramCount++;
16268 lastParam = p;
16269 }
16270 }
16271 p++;
16272 }
16273 }
16274 {
16275 int len = strlen(templateString);
16276
16277 if(templateString[len - 1] == '>')
16278 templateString[len++] = ' ';
16279 templateString[len++] = '>';
16280 templateString[len++] = '\0';
16281 }
16282 FreeType(exp->expType);
16283 {
16284 struct Context * context = SetupTemplatesContext(tClass);
16285
16286 exp->expType = ProcessTypeString(templateString, 0x0);
16287 FinishTemplatesContext(context);
16288 }
16289 }
16290 }
16291 }
16292 }
16293 else
16294 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "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)");
16295 }
16296 else if(type && (type->kind == 9 || type->kind == 10))
16297 {
16298 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
16299
16300 if(memberType)
16301 {
16302 exp->expType = memberType;
16303 if(memberType)
16304 memberType->refCount++;
16305 }
16306 }
16307 else
16308 {
16309 char expString[10240];
16310
16311 expString[0] = '\0';
16312 if(inCompiler)
16313 {
16314 PrintExpression(exp, expString);
16315 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16316 }
16317 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "member operator on non-structure type expression %s\n", (((void *)0))), expString);
16318 }
16319 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
16320 {
16321 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
16322 {
16323 struct Identifier * id = exp->member.member;
16324 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));
16325
16326 if(_class)
16327 {
16328 FreeType(exp->expType);
16329 exp->expType = ReplaceThisClassType(_class);
16330 }
16331 }
16332 }
16333 yylloc = oldyylloc;
16334 break;
16335 }
16336 case 9:
16337 {
16338 struct Type * destType = exp->destType;
16339
16340 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
16341 {
16342 exp->member.member->classSym = exp->member.member->_class->symbol;
16343 }
16344 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
16345 exp->type = 8;
16346 if(destType)
16347 destType->count++;
16348 ProcessExpressionType(exp);
16349 if(destType)
16350 destType->count--;
16351 break;
16352 }
16353 case 15:
16354 {
16355 struct Symbol * classSym = exp->_class->symbol;
16356
16357 if(classSym && classSym->registered)
16358 {
16359 if(classSym->registered->type == 5)
16360 {
16361 char name[1024];
16362
16363 name[0] = '\0';
16364 DeclareStruct(classSym->string, 0x0);
16365 FreeSpecifier(exp->_class);
16366 exp->type = 10;
16367 FullClassNameCat(name, classSym->string, 0x0);
16368 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
16369 }
16370 else
16371 {
16372 if(classSym->registered->fixed)
16373 {
16374 FreeSpecifier(exp->_class);
16375 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
16376 exp->type = 2;
16377 }
16378 else
16379 {
16380 char className[1024];
16381
16382 strcpy(className, "__ecereClass_");
16383 FullClassNameCat(className, classSym->string, 0x1);
16384 MangleClassName(className);
16385 DeclareClass(classSym, className);
16386 FreeExpContents(exp);
16387 exp->type = 9;
16388 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
16389 exp->member.member = MkIdentifier("structSize");
16390 }
16391 }
16392 }
16393 exp->expType = __extension__ ({
16394 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16395
16396 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
16397 });
16398 break;
16399 }
16400 case 10:
16401 {
16402 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
16403
16404 exp->expType = __extension__ ({
16405 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16406
16407 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
16408 });
16409 exp->isConstant = 0x1;
16410 DeclareType(type, 0x0, 0x0);
16411 FreeType(type);
16412 break;
16413 }
16414 case 11:
16415 {
16416 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
16417
16418 type->count = 1;
16419 FreeType(exp->cast.exp->destType);
16420 exp->cast.exp->destType = type;
16421 type->refCount++;
16422 ProcessExpressionType(exp->cast.exp);
16423 type->count = 0;
16424 exp->expType = type;
16425 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
16426 {
16427 void * prev = exp->prev, * next = exp->next;
16428 struct Type * expType = exp->cast.exp->destType;
16429 struct Expression * castExp = exp->cast.exp;
16430 struct Type * destType = exp->destType;
16431
16432 if(expType)
16433 expType->refCount++;
16434 FreeType(exp->expType);
16435 FreeTypeName(exp->cast.typeName);
16436 *exp = *castExp;
16437 FreeType(exp->expType);
16438 FreeType(exp->destType);
16439 exp->expType = expType;
16440 exp->destType = destType;
16441 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
16442 exp->prev = prev;
16443 exp->next = next;
16444 }
16445 else
16446 {
16447 exp->isConstant = exp->cast.exp->isConstant;
16448 }
16449 break;
16450 }
16451 case 33:
16452 {
16453 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
16454
16455 exp->expType = type;
16456 break;
16457 }
16458 case 34:
16459 {
16460 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
16461
16462 ProcessExpressionType(exp->vaArg.exp);
16463 exp->expType = type;
16464 break;
16465 }
16466 case 12:
16467 {
16468 struct Expression * e;
16469
16470 exp->isConstant = 0x1;
16471 FreeType(exp->cond.cond->destType);
16472 exp->cond.cond->destType = MkClassType("bool");
16473 exp->cond.cond->destType->truth = 0x1;
16474 ProcessExpressionType(exp->cond.cond);
16475 if(!exp->cond.cond->isConstant)
16476 exp->isConstant = 0x0;
16477 for(e = (*exp->cond.exp).first; e; e = e->next)
16478 {
16479 if(!e->next)
16480 {
16481 FreeType(e->destType);
16482 e->destType = exp->destType;
16483 if(e->destType)
16484 e->destType->refCount++;
16485 }
16486 ProcessExpressionType(e);
16487 if(!e->next)
16488 {
16489 exp->expType = e->expType;
16490 if(e->expType)
16491 e->expType->refCount++;
16492 }
16493 if(!e->isConstant)
16494 exp->isConstant = 0x0;
16495 }
16496 FreeType(exp->cond.elseExp->destType);
16497 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
16498 if(exp->cond.elseExp->destType)
16499 exp->cond.elseExp->destType->refCount++;
16500 ProcessExpressionType(exp->cond.elseExp);
16501 if(!exp->cond.elseExp->isConstant)
16502 exp->isConstant = 0x0;
16503 break;
16504 }
16505 case 23:
16506 {
16507 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
16508 {
16509 struct Statement * last = (*exp->compound->compound.statements).last;
16510
16511 if(last->type == 3 && last->expressions && (*last->expressions).last)
16512 {
16513 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
16514 if(exp->destType)
16515 exp->destType->refCount++;
16516 }
16517 ProcessStatement(exp->compound);
16518 exp->expType = (last->expressions && (*last->expressions).last) ? ((struct Expression *)(*last->expressions).last)->expType : (((void *)0));
16519 if(exp->expType)
16520 exp->expType->refCount++;
16521 }
16522 break;
16523 }
16524 case 24:
16525 {
16526 struct Specifier * spec = (*exp->_classExp.specifiers).first;
16527
16528 if(spec && spec->type == 1)
16529 {
16530 exp->expType = MkClassType(spec->name);
16531 exp->expType->kind = 19;
16532 exp->byReference = 0x1;
16533 }
16534 else
16535 {
16536 exp->expType = MkClassType("ecere::com::Class");
16537 exp->byReference = 0x1;
16538 }
16539 break;
16540 }
16541 case 25:
16542 {
16543 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
16544
16545 if(_class)
16546 {
16547 struct Identifier * id = exp->classData.id;
16548 char structName[1024];
16549 struct Expression * classExp;
16550
16551 strcpy(structName, "__ecereClassData_");
16552 FullClassNameCat(structName, _class->fullName, 0x0);
16553 exp->type = 9;
16554 exp->member.member = id;
16555 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
16556 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
16557 else
16558 classExp = MkExpIdentifier(MkIdentifier("class"));
16559 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"))))))));
16560 ProcessExpressionType(exp);
16561 return ;
16562 }
16563 break;
16564 }
16565 case 35:
16566 {
16567 struct Type * type = (((void *)0));
16568 char * typeString = (((void *)0));
16569 char typeStringBuf[1024];
16570
16571 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))
16572 {
16573 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
16574
16575 typeString = templateClass->templateArgs[2].dataTypeString;
16576 }
16577 else if(exp->list)
16578 {
16579 struct Expression * e;
16580
16581 for(e = (*exp->list).first; e; e = e->next)
16582 {
16583 ProcessExpressionType(e);
16584 if(e->expType)
16585 {
16586 if(!type)
16587 {
16588 type = e->expType;
16589 type->refCount++;
16590 }
16591 else
16592 {
16593 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
16594 {
16595 FreeType(type);
16596 type = e->expType;
16597 e->expType = (((void *)0));
16598 e = (*exp->list).first;
16599 ProcessExpressionType(e);
16600 if(e->expType)
16601 {
16602 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
16603 {
16604 FreeType(e->expType);
16605 e->expType = (((void *)0));
16606 FreeType(type);
16607 type = (((void *)0));
16608 break;
16609 }
16610 }
16611 }
16612 }
16613 if(e->expType)
16614 {
16615 FreeType(e->expType);
16616 e->expType = (((void *)0));
16617 }
16618 }
16619 }
16620 if(type)
16621 {
16622 typeStringBuf[0] = '\0';
16623 PrintTypeNoConst(type, typeStringBuf, 0x0, 0x1);
16624 typeString = typeStringBuf;
16625 FreeType(type);
16626 type = (((void *)0));
16627 }
16628 }
16629 if(typeString)
16630 {
16631 char templateString[1024];
16632 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
16633 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
16634 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16635 struct Expression * expExt;
16636 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16637
16638 sprintf(templateString, "Container<%s>", typeString);
16639 if(exp->list)
16640 {
16641 struct Expression * e;
16642
16643 type = ProcessTypeString(typeString, 0x0);
16644 while(e = (*exp->list).first)
16645 {
16646 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
16647 e->destType = type;
16648 type->refCount++;
16649 ProcessExpressionType(e);
16650 ListAdd(initializers, MkInitializerAssignment(e));
16651 }
16652 FreeType(type);
16653 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
16654 }
16655 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
16656 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
16657 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16658 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
16659 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16660 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
16661 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16662 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
16663 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16664 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
16665 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16666
16667 __ecereInstance1->type = 2, __ecereInstance1->constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, (void *)0), __ecereInstance1;
16668 })));
16669 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16670 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
16671 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16672 exp->expType = ProcessTypeString(templateString, 0x0);
16673 exp->type = 5;
16674 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
16675 ProcessExpressionType(expExt);
16676 }
16677 else
16678 {
16679 exp->expType = ProcessTypeString("Container", 0x0);
16680 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
16681 }
16682 break;
16683 }
16684 }
16685 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
16686 {
16687 FreeType(exp->expType);
16688 exp->expType = ReplaceThisClassType(thisClass);
16689 }
16690 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
16691 {
16692 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
16693
16694 if(symbol)
16695 {
16696 if(exp->expType->kind != 15)
16697 {
16698 struct Type * member;
16699 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
16700
16701 FreeType(exp->expType);
16702 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16703 exp->expType->kind = symbol->type->kind;
16704 exp->expType->refCount++;
16705 exp->expType->enumName = enumName;
16706 exp->expType->members = symbol->type->members;
16707 for(member = symbol->type->members.first; member; member = member->next)
16708 member->refCount++;
16709 }
16710 else
16711 {
16712 struct __ecereNameSpace__ecere__sys__NamedLink * member;
16713
16714 for(member = symbol->type->members.first; member; member = member->next)
16715 {
16716 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(structSize_NamedLink), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
16717
16718 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
16719 }
16720 }
16721 }
16722 }
16723 yylloc = exp->loc;
16724 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
16725 ;
16726 else if(exp->destType && !exp->destType->keepCast)
16727 {
16728 if(!CheckExpressionType(exp, exp->destType, 0x0))
16729 {
16730 if(!exp->destType->count || unresolved)
16731 {
16732 if(!exp->expType)
16733 {
16734 yylloc = exp->loc;
16735 if(exp->destType->kind != 14)
16736 {
16737 char type2[1024];
16738
16739 type2[0] = '\0';
16740 if(inCompiler)
16741 {
16742 char expString[10240];
16743
16744 expString[0] = '\0';
16745 PrintType(exp->destType, type2, 0x0, 0x1);
16746 if(inCompiler)
16747 {
16748 PrintExpression(exp, expString);
16749 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16750 }
16751 if(unresolved)
16752 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
16753 else if(exp->type != 16)
16754 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
16755 }
16756 }
16757 else
16758 {
16759 char expString[10240];
16760
16761 expString[0] = '\0';
16762 if(inCompiler)
16763 {
16764 PrintExpression(exp, expString);
16765 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16766 }
16767 if(unresolved)
16768 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), expString);
16769 else if(exp->type != 16)
16770 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16771 }
16772 }
16773 else
16774 {
16775 char type1[1024];
16776 char type2[1024];
16777
16778 type1[0] = '\0';
16779 type2[0] = '\0';
16780 if(inCompiler)
16781 {
16782 PrintType(exp->expType, type1, 0x0, 0x1);
16783 PrintType(exp->destType, type2, 0x0, 0x1);
16784 }
16785 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)))
16786 ;
16787 else
16788 {
16789 char expString[10240];
16790
16791 expString[0] = '\0';
16792 if(inCompiler)
16793 {
16794 PrintExpression(exp, expString);
16795 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16796 }
16797 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
16798 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
16799 FreeType(exp->expType);
16800 exp->destType->refCount++;
16801 exp->expType = exp->destType;
16802 }
16803 }
16804 }
16805 }
16806 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
16807 {
16808 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16809 char typeString[1024];
16810 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16811 struct Declarator * decl;
16812
16813 typeString[0] = '\0';
16814 *newExp = *exp;
16815 if(exp->expType)
16816 exp->expType->refCount++;
16817 if(exp->expType)
16818 exp->expType->refCount++;
16819 exp->type = 11;
16820 newExp->destType = exp->expType;
16821 PrintType(exp->expType, typeString, 0x0, 0x0);
16822 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16823 exp->cast.typeName = MkTypeName(specs, decl);
16824 exp->cast.exp = newExp;
16825 }
16826 }
16827 else if(unresolved)
16828 {
16829 if(exp->identifier->_class && exp->identifier->_class->name)
16830 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
16831 else if(exp->identifier->string && exp->identifier->string[0])
16832 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
16833 }
16834 else if(!exp->expType && exp->type != 16)
16835 {
16836 char expString[10240];
16837
16838 expString[0] = '\0';
16839 if(inCompiler)
16840 {
16841 PrintExpression(exp, expString);
16842 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16843 }
16844 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16845 }
16846 if(inCompiler)
16847 ApplyAnyObjectLogic(exp);
16848 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 && exp->destType->kind != 24)))
16849 {
16850 exp->byReference = 0x1;
16851 }
16852 yylloc = oldyylloc;
16853 }
16854
16855 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)
16856 {
16857 if(*curMember)
16858 {
16859 *curMember = (*curMember)->next;
16860 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
16861 {
16862 *curMember = subMemberStack[--(*subMemberStackPos)];
16863 *curMember = (*curMember)->next;
16864 }
16865 while((*curMember) && (*curMember)->isProperty)
16866 *curMember = (*curMember)->next;
16867 if(subMemberStackPos)
16868 {
16869 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
16870 {
16871 subMemberStack[(*subMemberStackPos)++] = *curMember;
16872 *curMember = (*curMember)->members.first;
16873 while(*curMember && (*curMember)->isProperty)
16874 *curMember = (*curMember)->next;
16875 }
16876 }
16877 }
16878 while(!*curMember)
16879 {
16880 if(!*curMember)
16881 {
16882 if(subMemberStackPos && *subMemberStackPos)
16883 {
16884 *curMember = subMemberStack[--(*subMemberStackPos)];
16885 *curMember = (*curMember)->next;
16886 }
16887 else
16888 {
16889 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
16890
16891 if(*curClass == _class)
16892 break;
16893 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
16894 ;
16895 *curMember = (*curClass)->membersAndProperties.first;
16896 }
16897 while((*curMember) && (*curMember)->isProperty)
16898 *curMember = (*curMember)->next;
16899 if(subMemberStackPos)
16900 {
16901 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
16902 {
16903 subMemberStack[(*subMemberStackPos)++] = *curMember;
16904 *curMember = (*curMember)->members.first;
16905 while(*curMember && (*curMember)->isProperty)
16906 *curMember = (*curMember)->next;
16907 }
16908 }
16909 }
16910 }
16911 }
16912
16913 static void ProcessInitializer(struct Initializer * init, struct Type * type)
16914 {
16915 switch(init->type)
16916 {
16917 case 0:
16918 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
16919 {
16920 if(init->exp && !init->exp->destType)
16921 {
16922 FreeType(init->exp->destType);
16923 init->exp->destType = type;
16924 if(type)
16925 type->refCount++;
16926 }
16927 if(init->exp)
16928 {
16929 ProcessExpressionType(init->exp);
16930 init->isConstant = init->exp->isConstant;
16931 }
16932 break;
16933 }
16934 else
16935 {
16936 struct Expression * exp = init->exp;
16937 struct Instantiation * inst = exp->instance;
16938 struct MembersInit * members;
16939
16940 init->type = 1;
16941 init->list = MkList();
16942 if(inst->members)
16943 {
16944 for(members = (*inst->members).first; members; members = members->next)
16945 {
16946 if(members->type == 0)
16947 {
16948 struct MemberInit * member;
16949
16950 for(member = (*members->dataMembers).first; member; member = member->next)
16951 {
16952 ListAdd(init->list, member->initializer);
16953 member->initializer = (((void *)0));
16954 }
16955 }
16956 }
16957 }
16958 FreeExpression(exp);
16959 }
16960 case 1:
16961 {
16962 struct Initializer * i;
16963 struct Type * initializerType = (((void *)0));
16964 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
16965 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
16966 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
16967 int subMemberStackPos = 0;
16968
16969 if(type && type->kind == 12)
16970 initializerType = Dereference(type);
16971 else if(type && (type->kind == 9 || type->kind == 10))
16972 initializerType = type->members.first;
16973 for(i = (*init->list).first; i; i = i->next)
16974 {
16975 if(type && type->kind == 8 && type->_class && type->_class->registered)
16976 {
16977 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
16978 if(curMember)
16979 {
16980 if(!curMember->dataType)
16981 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
16982 initializerType = curMember->dataType;
16983 }
16984 }
16985 ProcessInitializer(i, initializerType);
16986 if(initializerType && type && (type->kind == 9 || type->kind == 10))
16987 initializerType = initializerType->next;
16988 if(!i->isConstant)
16989 init->isConstant = 0x0;
16990 }
16991 if(type && type->kind == 12)
16992 FreeType(initializerType);
16993 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
16994 {
16995 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Assigning list initializer to non list\n", (((void *)0))));
16996 }
16997 break;
16998 }
16999 }
17000 }
17001
17002 extern struct Symbol * FindType(struct Context * ctx, char *  name);
17003
17004 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
17005
17006 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
17007 {
17008 switch(spec->type)
17009 {
17010 case 0:
17011 {
17012 if(spec->specifier == THISCLASS)
17013 {
17014 if(thisClass)
17015 {
17016 spec->type = 1;
17017 spec->name = ReplaceThisClass(thisClass);
17018 spec->symbol = FindClass(spec->name);
17019 ProcessSpecifier(spec, declareStruct);
17020 }
17021 }
17022 break;
17023 }
17024 case 1:
17025 {
17026 struct Symbol * symbol = FindType(curContext, spec->name);
17027
17028 if(symbol)
17029 DeclareType(symbol->type, 0x1, 0x1);
17030 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
17031 DeclareStruct(spec->name, 0x0);
17032 break;
17033 }
17034 case 2:
17035 {
17036 struct Enumerator * e;
17037
17038 if(spec->list)
17039 {
17040 for(e = (*spec->list).first; e; e = e->next)
17041 {
17042 if(e->exp)
17043 ProcessExpressionType(e->exp);
17044 }
17045 }
17046 break;
17047 }
17048 case 3:
17049 case 4:
17050 {
17051 if(spec->definitions)
17052 {
17053 struct ClassDef * def;
17054 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
17055
17056 ProcessClass(spec->definitions, symbol);
17057 }
17058 break;
17059 }
17060 }
17061 }
17062
17063 static void ProcessDeclarator(struct Declarator * decl)
17064 {
17065 switch(decl->type)
17066 {
17067 case 1:
17068 if(decl->identifier->classSym)
17069 {
17070 FreeSpecifier(decl->identifier->_class);
17071 decl->identifier->_class = (((void *)0));
17072 }
17073 break;
17074 case 3:
17075 if(decl->array.exp)
17076 ProcessExpressionType(decl->array.exp);
17077 case 0:
17078 case 2:
17079 case 4:
17080 case 5:
17081 case 6:
17082 case 7:
17083 if(decl->declarator)
17084 ProcessDeclarator(decl->declarator);
17085 if(decl->type == 4)
17086 {
17087 struct Identifier * id = GetDeclId(decl);
17088
17089 if(id && id->_class)
17090 {
17091 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
17092
17093 if(!decl->function.parameters)
17094 decl->function.parameters = MkList();
17095 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
17096 id->_class = (((void *)0));
17097 }
17098 if(decl->function.parameters)
17099 {
17100 struct TypeName * param;
17101
17102 for(param = (*decl->function.parameters).first; param; param = param->next)
17103 {
17104 if(param->qualifiers && (*param->qualifiers).first)
17105 {
17106 struct Specifier * spec = (*param->qualifiers).first;
17107
17108 if(spec && spec->specifier == TYPED_OBJECT)
17109 {
17110 struct Declarator * d = param->declarator;
17111 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);
17112
17113 FreeList(param->qualifiers, FreeSpecifier);
17114 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
17115 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
17116 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
17117 param = newParam;
17118 }
17119 else if(spec && spec->specifier == ANY_OBJECT)
17120 {
17121 struct Declarator * d = param->declarator;
17122
17123 FreeList(param->qualifiers, FreeSpecifier);
17124 param->qualifiers = MkListOne(MkSpecifier(VOID));
17125 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
17126 }
17127 else if(spec->specifier == THISCLASS)
17128 {
17129 if(thisClass)
17130 {
17131 spec->type = 1;
17132 spec->name = ReplaceThisClass(thisClass);
17133 spec->symbol = FindClass(spec->name);
17134 ProcessSpecifier(spec, 0x0);
17135 }
17136 }
17137 }
17138 if(param->declarator)
17139 ProcessDeclarator(param->declarator);
17140 }
17141 }
17142 }
17143 break;
17144 }
17145 }
17146
17147 extern struct Identifier * CopyIdentifier(struct Identifier * id);
17148
17149 extern void FreeInitDeclarator(struct InitDeclarator * decl);
17150
17151 static void ProcessDeclaration(struct Declaration * decl)
17152 {
17153 yylloc = decl->loc;
17154 switch(decl->type)
17155 {
17156 case 1:
17157 {
17158 unsigned int declareStruct = 0x0;
17159
17160 if(decl->declarators)
17161 {
17162 struct InitDeclarator * d;
17163
17164 for(d = (*decl->declarators).first; d; d = d->next)
17165 {
17166 struct Type * type, * subType;
17167
17168 ProcessDeclarator(d->declarator);
17169 type = ProcessType(decl->specifiers, d->declarator);
17170 if(d->initializer)
17171 {
17172 ProcessInitializer(d->initializer, type);
17173 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
17174 {
17175 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
17176 {
17177 struct Instantiation * inst = d->initializer->exp->instance;
17178
17179 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
17180 d->initializer->exp->instance = (((void *)0));
17181 if(decl->specifiers)
17182 FreeList(decl->specifiers, FreeSpecifier);
17183 FreeList(decl->declarators, FreeInitDeclarator);
17184 d = (((void *)0));
17185 decl->type = 2;
17186 decl->inst = inst;
17187 }
17188 }
17189 }
17190 for(subType = type; subType; )
17191 {
17192 if(subType->kind == 8)
17193 {
17194 declareStruct = 0x1;
17195 break;
17196 }
17197 else if(subType->kind == 13)
17198 break;
17199 else if(subType->kind == 12)
17200 subType = subType->arrayType;
17201 else
17202 break;
17203 }
17204 FreeType(type);
17205 if(!d)
17206 break;
17207 }
17208 }
17209 if(decl->specifiers)
17210 {
17211 struct Specifier * s;
17212
17213 for(s = (*decl->specifiers).first; s; s = s->next)
17214 {
17215 ProcessSpecifier(s, declareStruct);
17216 }
17217 }
17218 break;
17219 }
17220 case 2:
17221 {
17222 ProcessInstantiationType(decl->inst);
17223 break;
17224 }
17225 case 0:
17226 {
17227 struct Specifier * spec;
17228 struct Declarator * d;
17229 unsigned int declareStruct = 0x0;
17230
17231 if(decl->declarators)
17232 {
17233 for(d = (*decl->declarators).first; d; d = d->next)
17234 {
17235 struct Type * type = ProcessType(decl->specifiers, d->declarator);
17236 struct Type * subType;
17237
17238 ProcessDeclarator(d);
17239 for(subType = type; subType; )
17240 {
17241 if(subType->kind == 8)
17242 {
17243 declareStruct = 0x1;
17244 break;
17245 }
17246 else if(subType->kind == 13)
17247 break;
17248 else if(subType->kind == 12)
17249 subType = subType->arrayType;
17250 else
17251 break;
17252 }
17253 FreeType(type);
17254 }
17255 }
17256 if(decl->specifiers)
17257 {
17258 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
17259 ProcessSpecifier(spec, declareStruct);
17260 }
17261 break;
17262 }
17263 }
17264 }
17265
17266 static struct FunctionDefinition * curFunction;
17267
17268 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
17269 {
17270 char propName[1024], propNameM[1024];
17271 char getName[1024], setName[1024];
17272 struct __ecereNameSpace__ecere__sys__OldList * args;
17273
17274 DeclareProperty(prop, setName, getName);
17275 strcpy(propName, "__ecereProp_");
17276 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17277 strcat(propName, "_");
17278 FullClassNameCat(propName, prop->name, 0x1);
17279 MangleClassName(propName);
17280 strcpy(propNameM, "__ecerePropM_");
17281 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
17282 strcat(propNameM, "_");
17283 FullClassNameCat(propNameM, prop->name, 0x1);
17284 MangleClassName(propNameM);
17285 if(prop->isWatchable)
17286 {
17287 args = MkList();
17288 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17289 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17290 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17291 args = MkList();
17292 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17293 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17294 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17295 }
17296 {
17297 args = MkList();
17298 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17299 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17300 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17301 args = MkList();
17302 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17303 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17304 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17305 }
17306 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
17307 curFunction->propSet->fireWatchersDone = 0x1;
17308 }
17309
17310 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
17311
17312 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
17313
17314 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
17315
17316 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
17317
17318 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
17319
17320 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
17321
17322 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
17323
17324 extern void FreePropertyWatch(struct PropertyWatch * watcher);
17325
17326 static void ProcessStatement(struct Statement * stmt)
17327 {
17328 yylloc = stmt->loc;
17329 switch(stmt->type)
17330 {
17331 case 0:
17332 ProcessStatement(stmt->labeled.stmt);
17333 break;
17334 case 1:
17335 if(stmt->caseStmt.exp)
17336 {
17337 FreeType(stmt->caseStmt.exp->destType);
17338 stmt->caseStmt.exp->destType = curSwitchType;
17339 if(curSwitchType)
17340 curSwitchType->refCount++;
17341 ProcessExpressionType(stmt->caseStmt.exp);
17342 ComputeExpression(stmt->caseStmt.exp);
17343 }
17344 if(stmt->caseStmt.stmt)
17345 ProcessStatement(stmt->caseStmt.stmt);
17346 break;
17347 case 2:
17348 {
17349 if(stmt->compound.context)
17350 {
17351 struct Declaration * decl;
17352 struct Statement * s;
17353 struct Statement * prevCompound = curCompound;
17354 struct Context * prevContext = curContext;
17355
17356 if(!stmt->compound.isSwitch)
17357 curCompound = stmt;
17358 curContext = stmt->compound.context;
17359 if(stmt->compound.declarations)
17360 {
17361 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
17362 ProcessDeclaration(decl);
17363 }
17364 if(stmt->compound.statements)
17365 {
17366 for(s = (*stmt->compound.statements).first; s; s = s->next)
17367 ProcessStatement(s);
17368 }
17369 curContext = prevContext;
17370 curCompound = prevCompound;
17371 }
17372 break;
17373 }
17374 case 3:
17375 {
17376 struct Expression * exp;
17377
17378 if(stmt->expressions)
17379 {
17380 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
17381 ProcessExpressionType(exp);
17382 }
17383 break;
17384 }
17385 case 4:
17386 {
17387 struct Expression * exp;
17388
17389 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
17390 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
17391 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
17392 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
17393 {
17394 ProcessExpressionType(exp);
17395 }
17396 if(stmt->ifStmt.stmt)
17397 ProcessStatement(stmt->ifStmt.stmt);
17398 if(stmt->ifStmt.elseStmt)
17399 ProcessStatement(stmt->ifStmt.elseStmt);
17400 break;
17401 }
17402 case 5:
17403 {
17404 struct Type * oldSwitchType = curSwitchType;
17405
17406 if(stmt->switchStmt.exp)
17407 {
17408 struct Expression * exp;
17409
17410 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
17411 {
17412 if(!exp->next)
17413 {
17414 ProcessExpressionType(exp);
17415 }
17416 if(!exp->next)
17417 curSwitchType = exp->expType;
17418 }
17419 }
17420 ProcessStatement(stmt->switchStmt.stmt);
17421 curSwitchType = oldSwitchType;
17422 break;
17423 }
17424 case 6:
17425 {
17426 if(stmt->whileStmt.exp)
17427 {
17428 struct Expression * exp;
17429
17430 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
17431 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
17432 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
17433 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
17434 {
17435 ProcessExpressionType(exp);
17436 }
17437 }
17438 if(stmt->whileStmt.stmt)
17439 ProcessStatement(stmt->whileStmt.stmt);
17440 break;
17441 }
17442 case 7:
17443 {
17444 if(stmt->doWhile.exp)
17445 {
17446 struct Expression * exp;
17447
17448 if((*stmt->doWhile.exp).last)
17449 {
17450 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
17451 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
17452 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
17453 }
17454 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
17455 {
17456 ProcessExpressionType(exp);
17457 }
17458 }
17459 if(stmt->doWhile.stmt)
17460 ProcessStatement(stmt->doWhile.stmt);
17461 break;
17462 }
17463 case 8:
17464 {
17465 struct Expression * exp;
17466
17467 if(stmt->forStmt.init)
17468 ProcessStatement(stmt->forStmt.init);
17469 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
17470 {
17471 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
17472 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
17473 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
17474 }
17475 if(stmt->forStmt.check)
17476 ProcessStatement(stmt->forStmt.check);
17477 if(stmt->forStmt.increment)
17478 {
17479 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
17480 ProcessExpressionType(exp);
17481 }
17482 if(stmt->forStmt.stmt)
17483 ProcessStatement(stmt->forStmt.stmt);
17484 break;
17485 }
17486 case 18:
17487 {
17488 struct Identifier * id = stmt->forEachStmt.id;
17489 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
17490 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
17491 struct Statement * block = stmt->forEachStmt.stmt;
17492 char iteratorType[1024];
17493 struct Type * source;
17494 struct Expression * e;
17495 unsigned int isBuiltin = exp && (*exp).last && (((struct Expression *)(*exp).last)->type == 35 || (((struct Expression *)(*exp).last)->type == 11 && ((struct Expression *)(*exp).last)->cast.exp->type == 35));
17496 struct Expression * arrayExp;
17497 char * typeString = (((void *)0));
17498 int builtinCount = 0;
17499
17500 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
17501 {
17502 if(!e->next)
17503 {
17504 FreeType(e->destType);
17505 e->destType = ProcessTypeString("Container", 0x0);
17506 }
17507 if(!isBuiltin || e->next)
17508 ProcessExpressionType(e);
17509 }
17510 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
17511 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
17512 {
17513 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
17514 struct Symbol * symbol;
17515 struct Expression * expIt = (((void *)0));
17516 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
17517 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
17518 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
17519 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
17520
17521 stmt->type = 2;
17522 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
17523 stmt->compound.context->parent = curContext;
17524 curContext = stmt->compound.context;
17525 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
17526 {
17527 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
17528 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
17529
17530 isCustomAVLTree = 0x1;
17531 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
17532 isAVLTree = 0x1;
17533 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
17534 isMap = 0x1;
17535 }
17536 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
17537 isArray = 0x1;
17538 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
17539 {
17540 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
17541
17542 isLinkList = 0x1;
17543 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
17544 }
17545 if(isArray)
17546 {
17547 struct Declarator * decl;
17548 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17549
17550 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
17551 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17552 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
17553 }
17554 else if(isBuiltin)
17555 {
17556 struct Type * type = (((void *)0));
17557 char typeStringBuf[1024];
17558
17559 arrayExp = (((struct Expression *)(*exp).last)->type == 35) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
17560 if(((struct Expression *)(*exp).last)->type == 11)
17561 {
17562 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
17563
17564 if(typeName)
17565 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
17566 }
17567 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)
17568 {
17569 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
17570
17571 typeString = templateClass->templateArgs[2].dataTypeString;
17572 }
17573 else if(arrayExp->list)
17574 {
17575 struct Expression * e;
17576
17577 for(e = (*arrayExp->list).first; e; e = e->next)
17578 {
17579 ProcessExpressionType(e);
17580 if(e->expType)
17581 {
17582 if(!type)
17583 {
17584 type = e->expType;
17585 type->refCount++;
17586 }
17587 else
17588 {
17589 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
17590 {
17591 FreeType(type);
17592 type = e->expType;
17593 e->expType = (((void *)0));
17594 e = (*arrayExp->list).first;
17595 ProcessExpressionType(e);
17596 if(e->expType)
17597 {
17598 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
17599 {
17600 FreeType(e->expType);
17601 e->expType = (((void *)0));
17602 FreeType(type);
17603 type = (((void *)0));
17604 break;
17605 }
17606 }
17607 }
17608 }
17609 if(e->expType)
17610 {
17611 FreeType(e->expType);
17612 e->expType = (((void *)0));
17613 }
17614 }
17615 }
17616 if(type)
17617 {
17618 typeStringBuf[0] = '\0';
17619 PrintType(type, typeStringBuf, 0x0, 0x1);
17620 typeString = typeStringBuf;
17621 FreeType(type);
17622 }
17623 }
17624 if(typeString)
17625 {
17626 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
17627 struct Declarator * decl;
17628 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17629
17630 if(arrayExp->list)
17631 {
17632 struct Expression * e;
17633
17634 builtinCount = (*arrayExp->list).count;
17635 type = ProcessTypeString(typeString, 0x0);
17636 while(e = (*arrayExp->list).first)
17637 {
17638 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
17639 e->destType = type;
17640 type->refCount++;
17641 ProcessExpressionType(e);
17642 ListAdd(initializers, MkInitializerAssignment(e));
17643 }
17644 FreeType(type);
17645 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
17646 }
17647 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
17648 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
17649 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
17650 FreeList(exp, FreeExpression);
17651 }
17652 else
17653 {
17654 arrayExp->expType = ProcessTypeString("Container", 0x0);
17655 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
17656 }
17657 }
17658 else if(isLinkList && !isList)
17659 {
17660 struct Declarator * decl;
17661 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17662
17663 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
17664 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17665 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
17666 }
17667 else if(_class->templateArgs)
17668 {
17669 if(isMap)
17670 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
17671 else
17672 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
17673 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
17674 }
17675 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
17676 if(block)
17677 {
17678 switch(block->type)
17679 {
17680 case 2:
17681 if(block->compound.context)
17682 block->compound.context->parent = stmt->compound.context;
17683 break;
17684 case 4:
17685 if(block->ifStmt.stmt && block->ifStmt.stmt->type == 2 && block->ifStmt.stmt->compound.context)
17686 block->ifStmt.stmt->compound.context->parent = stmt->compound.context;
17687 if(block->ifStmt.elseStmt && block->ifStmt.elseStmt->type == 2 && block->ifStmt.elseStmt->compound.context)
17688 block->ifStmt.elseStmt->compound.context->parent = stmt->compound.context;
17689 break;
17690 case 5:
17691 if(block->switchStmt.stmt && block->switchStmt.stmt->type == 2 && block->switchStmt.stmt->compound.context)
17692 block->switchStmt.stmt->compound.context->parent = stmt->compound.context;
17693 break;
17694 case 6:
17695 if(block->whileStmt.stmt && block->whileStmt.stmt->type == 2 && block->whileStmt.stmt->compound.context)
17696 block->whileStmt.stmt->compound.context->parent = stmt->compound.context;
17697 break;
17698 case 7:
17699 if(block->doWhile.stmt && block->doWhile.stmt->type == 2 && block->doWhile.stmt->compound.context)
17700 block->doWhile.stmt->compound.context->parent = stmt->compound.context;
17701 break;
17702 case 8:
17703 if(block->forStmt.stmt && block->forStmt.stmt->type == 2 && block->forStmt.stmt->compound.context)
17704 block->forStmt.stmt->compound.context->parent = stmt->compound.context;
17705 break;
17706 case 18:
17707 if(block->forEachStmt.stmt && block->forEachStmt.stmt->type == 2 && block->forEachStmt.stmt->compound.context)
17708 block->forEachStmt.stmt->compound.context->parent = stmt->compound.context;
17709 break;
17710 }
17711 }
17712 if(filter)
17713 {
17714 block = MkIfStmt(filter, block, (((void *)0)));
17715 }
17716 if(isArray)
17717 {
17718 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));
17719 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17720 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17721 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17722 }
17723 else if(isBuiltin)
17724 {
17725 char count[128];
17726
17727 sprintf(count, "%d", builtinCount);
17728 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));
17729 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17730 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17731 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17732 }
17733 else if(isLinkList && !isList)
17734 {
17735 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
17736 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
17737
17738 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
17739 {
17740 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));
17741 }
17742 else
17743 {
17744 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17745 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
17746
17747 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));
17748 }
17749 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17750 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17751 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17752 }
17753 else
17754 {
17755 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
17756 }
17757 ProcessExpressionType(expIt);
17758 if((*stmt->compound.declarations).first)
17759 ProcessDeclaration((*stmt->compound.declarations).first);
17760 if(symbol)
17761 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
17762 ProcessStatement(stmt);
17763 curContext = stmt->compound.context->parent;
17764 break;
17765 }
17766 else
17767 {
17768 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Expression is not a container\n", (((void *)0))));
17769 }
17770 break;
17771 }
17772 case 9:
17773 break;
17774 case 10:
17775 break;
17776 case 11:
17777 break;
17778 case 12:
17779 {
17780 struct Expression * exp;
17781
17782 if(stmt->expressions)
17783 {
17784 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
17785 {
17786 if(!exp->next)
17787 {
17788 if(curFunction && !curFunction->type)
17789 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
17790 FreeType(exp->destType);
17791 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
17792 if(exp->destType)
17793 exp->destType->refCount++;
17794 }
17795 ProcessExpressionType(exp);
17796 }
17797 }
17798 break;
17799 }
17800 case 14:
17801 {
17802 ProcessDeclaration(stmt->decl);
17803 break;
17804 }
17805 case 13:
17806 {
17807 struct AsmField * field;
17808
17809 if(stmt->asmStmt.inputFields)
17810 {
17811 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
17812 if(field->expression)
17813 ProcessExpressionType(field->expression);
17814 }
17815 if(stmt->asmStmt.outputFields)
17816 {
17817 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
17818 if(field->expression)
17819 ProcessExpressionType(field->expression);
17820 }
17821 if(stmt->asmStmt.clobberedFields)
17822 {
17823 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
17824 {
17825 if(field->expression)
17826 ProcessExpressionType(field->expression);
17827 }
17828 }
17829 break;
17830 }
17831 case 17:
17832 {
17833 struct PropertyWatch * propWatch;
17834 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17835 struct Expression * object = stmt->_watch.object;
17836 struct Expression * watcher = stmt->_watch.watcher;
17837
17838 if(watcher)
17839 ProcessExpressionType(watcher);
17840 if(object)
17841 ProcessExpressionType(object);
17842 if(inCompiler)
17843 {
17844 if(watcher || thisClass)
17845 {
17846 struct External * external = curExternal;
17847 struct Context * context = curContext;
17848
17849 stmt->type = 3;
17850 stmt->expressions = MkList();
17851 curExternal = external->prev;
17852 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
17853 {
17854 struct ClassFunction * func;
17855 char watcherName[1024];
17856 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
17857 struct External * createdExternal;
17858 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
17859
17860 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
17861 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
17862 if(propWatch->deleteWatch)
17863 strcat(watcherName, "_delete");
17864 else
17865 {
17866 struct Identifier * propID;
17867
17868 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
17869 {
17870 strcat(watcherName, "_");
17871 strcat(watcherName, propID->string);
17872 }
17873 }
17874 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
17875 {
17876 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
17877 ProcessClassFunctionBody(func, propWatch->compound);
17878 propWatch->compound = (((void *)0));
17879 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
17880 createdExternal->symbol->idCode = external->symbol->idCode;
17881 curExternal = createdExternal;
17882 ProcessFunction(createdExternal->function);
17883 {
17884 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
17885
17886 externalDecl->declaration = decl;
17887 if(decl->symbol && !decl->symbol->pointerExternal)
17888 decl->symbol->pointerExternal = externalDecl;
17889 }
17890 if(propWatch->deleteWatch)
17891 {
17892 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17893
17894 ListAdd(args, CopyExpression(object));
17895 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17896 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
17897 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
17898 }
17899 else
17900 {
17901 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
17902 struct Identifier * propID;
17903
17904 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
17905 {
17906 char propName[1024];
17907 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17908
17909 if(prop)
17910 {
17911 char getName[1024], setName[1024];
17912 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17913
17914 DeclareProperty(prop, setName, getName);
17915 strcpy(propName, "__ecereProp_");
17916 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17917 strcat(propName, "_");
17918 FullClassNameCat(propName, prop->name, 0x1);
17919 ListAdd(args, CopyExpression(object));
17920 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17921 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17922 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
17923 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
17924 }
17925 else
17926 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
17927 }
17928 }
17929 }
17930 else
17931 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid watched object\n", (((void *)0))));
17932 }
17933 curExternal = external;
17934 curContext = context;
17935 if(watcher)
17936 FreeExpression(watcher);
17937 if(object)
17938 FreeExpression(object);
17939 FreeList(watches, FreePropertyWatch);
17940 }
17941 else
17942 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a _class\n", (((void *)0))));
17943 }
17944 else
17945 {
17946 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
17947 {
17948 ProcessStatement(propWatch->compound);
17949 }
17950 }
17951 break;
17952 }
17953 case 15:
17954 {
17955 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17956 struct Expression * object = stmt->_watch.object;
17957 struct __ecereNameSpace__ecere__com__Class * _class;
17958
17959 if(object)
17960 ProcessExpressionType(object);
17961 if(inCompiler)
17962 {
17963 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
17964 if(_class)
17965 {
17966 struct Identifier * propID;
17967
17968 stmt->type = 3;
17969 stmt->expressions = MkList();
17970 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
17971 {
17972 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
17973 }
17974 else if(!watches)
17975 {
17976 }
17977 if(watches)
17978 {
17979 for(propID = (*watches).first; propID; propID = propID->next)
17980 {
17981 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17982
17983 if(prop)
17984 {
17985 CreateFireWatcher(prop, object, stmt);
17986 }
17987 else
17988 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
17989 }
17990 }
17991 else
17992 {
17993 struct __ecereNameSpace__ecere__com__Property * prop;
17994 struct __ecereNameSpace__ecere__com__Class * base;
17995
17996 for(base = _class; base; base = base->base)
17997 {
17998 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
17999 {
18000 if(prop->isProperty && prop->isWatchable)
18001 {
18002 CreateFireWatcher(prop, object, stmt);
18003 }
18004 }
18005 }
18006 }
18007 if(object)
18008 FreeExpression(object);
18009 FreeList(watches, FreeIdentifier);
18010 }
18011 else
18012 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
18013 }
18014 break;
18015 }
18016 case 16:
18017 {
18018 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
18019 struct Expression * object = stmt->_watch.object;
18020 struct Expression * watcher = stmt->_watch.watcher;
18021 struct __ecereNameSpace__ecere__com__Class * _class;
18022
18023 if(object)
18024 ProcessExpressionType(object);
18025 if(watcher)
18026 ProcessExpressionType(watcher);
18027 if(inCompiler)
18028 {
18029 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
18030 if(watcher || thisClass)
18031 {
18032 if(_class)
18033 {
18034 struct Identifier * propID;
18035
18036 stmt->type = 3;
18037 stmt->expressions = MkList();
18038 if(!watches)
18039 {
18040 struct __ecereNameSpace__ecere__sys__OldList * args;
18041
18042 args = MkList();
18043 ListAdd(args, CopyExpression(object));
18044 ListAdd(args, MkExpConstant("0"));
18045 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18046 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
18047 }
18048 else
18049 {
18050 for(propID = (*watches).first; propID; propID = propID->next)
18051 {
18052 char propName[1024];
18053 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
18054
18055 if(prop)
18056 {
18057 char getName[1024], setName[1024];
18058 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
18059
18060 DeclareProperty(prop, setName, getName);
18061 strcpy(propName, "__ecereProp_");
18062 FullClassNameCat(propName, prop->_class->fullName, 0x0);
18063 strcat(propName, "_");
18064 FullClassNameCat(propName, prop->name, 0x1);
18065 MangleClassName(propName);
18066 ListAdd(args, CopyExpression(object));
18067 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
18068 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18069 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
18070 }
18071 else
18072 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
18073 }
18074 }
18075 if(object)
18076 FreeExpression(object);
18077 if(watcher)
18078 FreeExpression(watcher);
18079 FreeList(watches, FreeIdentifier);
18080 }
18081 else
18082 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
18083 }
18084 else
18085 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
18086 }
18087 break;
18088 }
18089 }
18090 }
18091
18092 extern struct Expression * QBrackets(struct Expression * exp);
18093
18094 extern struct TypeName * QMkType(char *  spec, struct Declarator * decl);
18095
18096 extern struct Declarator * QMkPtrDecl(char *  id);
18097
18098 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
18099
18100 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
18101
18102 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
18103
18104 static void ProcessFunction(struct FunctionDefinition * function)
18105 {
18106 struct Identifier * id = GetDeclId(function->declarator);
18107 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
18108 struct Type * type = symbol ? symbol->type : (((void *)0));
18109 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
18110 struct Context * oldTopContext = topContext;
18111
18112 yylloc = function->loc;
18113 if(type && type->thisClass)
18114 {
18115 struct Symbol * classSym = type->thisClass;
18116 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
18117 char className[1024];
18118 char structName[1024];
18119 struct Declarator * funcDecl;
18120 struct Symbol * thisSymbol;
18121 unsigned int typedObject = 0x0;
18122
18123 if(_class && !_class->base)
18124 {
18125 _class = currentClass;
18126 if(_class && !_class->symbol)
18127 _class->symbol = FindClass(_class->fullName);
18128 classSym = _class ? _class->symbol : (((void *)0));
18129 typedObject = 0x1;
18130 }
18131 thisClass = _class;
18132 if(inCompiler && _class)
18133 {
18134 if(type->kind == 11)
18135 {
18136 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
18137 {
18138 struct Type * param = symbol->type->params.first;
18139
18140 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
18141 FreeType(param);
18142 }
18143 if(type->classObjectType != 1)
18144 {
18145 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
18146 symbol->type->staticMethod = 0x1;
18147 symbol->type->thisClass = (((void *)0));
18148 symbol->type->extraParam = 0x0;
18149 }
18150 }
18151 strcpy(className, "__ecereClass_");
18152 FullClassNameCat(className, _class->fullName, 0x1);
18153 MangleClassName(className);
18154 structName[0] = (char)0;
18155 FullClassNameCat(structName, _class->fullName, 0x0);
18156 funcDecl = GetFuncDecl(function->declarator);
18157 if(funcDecl)
18158 {
18159 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
18160 {
18161 struct TypeName * param = (*funcDecl->function.parameters).first;
18162
18163 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
18164 {
18165 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
18166 FreeTypeName(param);
18167 }
18168 }
18169 if(!function->propertyNoThis)
18170 {
18171 struct TypeName * thisParam;
18172
18173 if(type->classObjectType != 1)
18174 {
18175 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18176 if(!funcDecl->function.parameters)
18177 funcDecl->function.parameters = MkList();
18178 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
18179 }
18180 if(typedObject)
18181 {
18182 if(type->classObjectType != 1)
18183 {
18184 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
18185 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
18186 }
18187 thisParam = __extension__ ({
18188 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
18189
18190 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
18191 });
18192 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
18193 }
18194 }
18195 }
18196 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
18197 {
18198 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
18199
18200 funcDecl = GetFuncDecl(initDecl->declarator);
18201 if(funcDecl)
18202 {
18203 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
18204 {
18205 struct TypeName * param = (*funcDecl->function.parameters).first;
18206
18207 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
18208 {
18209 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
18210 FreeTypeName(param);
18211 }
18212 }
18213 if(type->classObjectType != 1)
18214 {
18215 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
18216 {
18217 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18218
18219 if(!funcDecl->function.parameters)
18220 funcDecl->function.parameters = MkList();
18221 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
18222 }
18223 }
18224 }
18225 }
18226 }
18227 if(function->body)
18228 {
18229 if(type->classObjectType != 1)
18230 {
18231 thisSymbol = __extension__ ({
18232 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18233
18234 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
18235 });
18236 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18237 if(typedObject && thisSymbol->type)
18238 {
18239 thisSymbol->type->classObjectType = 2;
18240 thisSymbol->type->byReference = type->byReference;
18241 thisSymbol->type->typedByReference = type->byReference;
18242 }
18243 }
18244 }
18245 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
18246 {
18247 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
18248
18249 {
18250 struct __ecereNameSpace__ecere__com__Class * base;
18251
18252 for(base = _class; base && base->type != 1000; base = base->next)
18253 {
18254 for(member = base->membersAndProperties.first; member; member = member->next)
18255 if(!member->isProperty)
18256 break;
18257 if(member)
18258 break;
18259 }
18260 }
18261 for(member = _class->membersAndProperties.first; member; member = member->next)
18262 if(!member->isProperty)
18263 break;
18264 if(member)
18265 {
18266 char pointerName[1024];
18267 struct Declaration * decl;
18268 struct Initializer * initializer;
18269 struct Expression * exp, * bytePtr;
18270
18271 strcpy(pointerName, "__ecerePointer_");
18272 FullClassNameCat(pointerName, _class->fullName, 0x0);
18273 {
18274 char className[1024];
18275
18276 strcpy(className, "__ecereClass_");
18277 FullClassNameCat(className, classSym->string, 0x1);
18278 MangleClassName(className);
18279 DeclareClass(classSym, className);
18280 }
18281 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
18282 if(_class->fixed)
18283 {
18284 char string[256];
18285
18286 sprintf(string, "%d", _class->offset);
18287 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
18288 }
18289 else
18290 {
18291 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
18292 }
18293 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
18294 exp->expType = __extension__ ({
18295 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18296
18297 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
18298 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18299
18300 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
18301 }), __ecereInstance2;
18302 });
18303 if(function->body)
18304 {
18305 yylloc = function->body->loc;
18306 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
18307 {
18308 struct Context * prevContext = curContext;
18309
18310 curContext = function->body->compound.context;
18311 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
18312 curContext = prevContext;
18313 }
18314 decl->symbol = (((void *)0));
18315 if(!function->body->compound.declarations)
18316 function->body->compound.declarations = MkList();
18317 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
18318 }
18319 }
18320 }
18321 }
18322 else
18323 thisClass = (((void *)0));
18324 if(id)
18325 {
18326 FreeSpecifier(id->_class);
18327 id->_class = (((void *)0));
18328 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
18329 {
18330 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
18331
18332 id = GetDeclId(initDecl->declarator);
18333 FreeSpecifier(id->_class);
18334 id->_class = (((void *)0));
18335 }
18336 }
18337 if(function->body)
18338 topContext = function->body->compound.context;
18339 {
18340 struct FunctionDefinition * oldFunction = curFunction;
18341
18342 curFunction = function;
18343 if(function->body)
18344 ProcessStatement(function->body);
18345 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
18346 {
18347 struct Statement * prevCompound = curCompound;
18348 struct Context * prevContext = curContext;
18349 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
18350
18351 if(!function->body->compound.statements)
18352 function->body->compound.statements = MkList();
18353 ListAdd(function->body->compound.statements, fireWatchers);
18354 curCompound = function->body;
18355 curContext = function->body->compound.context;
18356 ProcessStatement(fireWatchers);
18357 curContext = prevContext;
18358 curCompound = prevCompound;
18359 }
18360 curFunction = oldFunction;
18361 }
18362 if(function->declarator)
18363 {
18364 ProcessDeclarator(function->declarator);
18365 }
18366 topContext = oldTopContext;
18367 thisClass = oldThisClass;
18368 }
18369
18370 extern void FreeSymbol(struct Symbol * symbol);
18371
18372 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
18373
18374 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
18375 {
18376 struct ClassDef * def;
18377 struct External * external = curExternal;
18378 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
18379
18380 for(def = definitions->first; def; def = def->next)
18381 {
18382 if(def->type == 0)
18383 {
18384 if(def->function->declarator)
18385 curExternal = def->function->declarator->symbol->pointerExternal;
18386 else
18387 curExternal = external;
18388 ProcessFunction((struct FunctionDefinition *)def->function);
18389 }
18390 else if(def->type == 2)
18391 {
18392 if(def->decl->type == 2)
18393 {
18394 thisClass = regClass;
18395 ProcessInstantiationType(def->decl->inst);
18396 thisClass = (((void *)0));
18397 }
18398 else
18399 {
18400 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
18401
18402 if(regClass)
18403 thisClass = regClass;
18404 ProcessDeclaration(def->decl);
18405 thisClass = backThisClass;
18406 }
18407 }
18408 else if(def->type == 1 && def->defProperties)
18409 {
18410 struct MemberInit * defProperty;
18411 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);
18412
18413 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18414 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
18415 {
18416 thisClass = regClass;
18417 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
18418 thisClass = (((void *)0));
18419 }
18420 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18421 FreeSymbol(thisSymbol);
18422 }
18423 else if(def->type == 3 && def->propertyDef)
18424 {
18425 struct PropertyDef * prop = def->propertyDef;
18426
18427 thisClass = regClass;
18428 if(prop->setStmt)
18429 {
18430 if(regClass)
18431 {
18432 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18433
18434 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18435 }
18436 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
18437 ProcessStatement(prop->setStmt);
18438 }
18439 if(prop->getStmt)
18440 {
18441 if(regClass)
18442 {
18443 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18444
18445 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18446 }
18447 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
18448 ProcessStatement(prop->getStmt);
18449 }
18450 if(prop->issetStmt)
18451 {
18452 if(regClass)
18453 {
18454 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18455
18456 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18457 }
18458 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
18459 ProcessStatement(prop->issetStmt);
18460 }
18461 thisClass = (((void *)0));
18462 }
18463 else if(def->type == 4 && def->propertyWatch)
18464 {
18465 struct PropertyWatch * propertyWatch = def->propertyWatch;
18466
18467 thisClass = regClass;
18468 if(propertyWatch->compound)
18469 {
18470 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);
18471
18472 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18473 curExternal = (((void *)0));
18474 ProcessStatement(propertyWatch->compound);
18475 }
18476 thisClass = (((void *)0));
18477 }
18478 }
18479 }
18480
18481 void DeclareFunctionUtil(char * s)
18482 {
18483 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
18484
18485 if(function)
18486 {
18487 char name[1024];
18488
18489 name[0] = (char)0;
18490 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
18491 strcpy(name, "__ecereFunction_");
18492 FullClassNameCat(name, s, 0x0);
18493 DeclareFunction(function, name);
18494 }
18495 }
18496
18497 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
18498
18499 void ComputeDataTypes()
18500 {
18501 struct External * external;
18502 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
18503 struct External * after = (((void *)0));
18504
18505 currentClass = (((void *)0));
18506 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
18507 for(external = (*ast).first; external; external = external->next)
18508 {
18509 if(external->type == 1)
18510 {
18511 struct Declaration * decl = external->declaration;
18512
18513 if(decl)
18514 {
18515 struct __ecereNameSpace__ecere__sys__OldList * decls = decl->declarators;
18516
18517 if(decls)
18518 {
18519 struct InitDeclarator * initDecl = (*decls).first;
18520
18521 if(initDecl)
18522 {
18523 struct Declarator * declarator = initDecl->declarator;
18524
18525 if(declarator && declarator->type == 1)
18526 {
18527 struct Identifier * id = declarator->identifier;
18528
18529 if(id && id->string)
18530 {
18531 if(!strcmp(id->string, "uintptr_t") || !strcmp(id->string, "intptr_t") || !strcmp(id->string, "size_t") || !strcmp(id->string, "ssize_t"))
18532 {
18533 external->symbol->id = -1001, external->symbol->idCode = -1001;
18534 after = external;
18535 }
18536 }
18537 }
18538 }
18539 }
18540 }
18541 }
18542 }
18543 temp->symbol = __extension__ ({
18544 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18545
18546 __ecereInstance1->id = -1000, __ecereInstance1->idCode = -1000, __ecereInstance1;
18547 });
18548 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
18549 curExternal = temp;
18550 DeclareFunctionUtil("eSystem_New");
18551 DeclareFunctionUtil("eSystem_New0");
18552 DeclareFunctionUtil("eSystem_Renew");
18553 DeclareFunctionUtil("eSystem_Renew0");
18554 DeclareFunctionUtil("eSystem_Delete");
18555 DeclareFunctionUtil("eClass_GetProperty");
18556 DeclareFunctionUtil("eInstance_FireSelfWatchers");
18557 DeclareStruct("ecere::com::Class", 0x0);
18558 DeclareStruct("ecere::com::Instance", 0x0);
18559 DeclareStruct("ecere::com::Property", 0x0);
18560 DeclareStruct("ecere::com::DataMember", 0x0);
18561 DeclareStruct("ecere::com::Method", 0x0);
18562 DeclareStruct("ecere::com::SerialBuffer", 0x0);
18563 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
18564 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
18565 for(external = (*ast).first; external; external = external->next)
18566 {
18567 afterExternal = curExternal = external;
18568 if(external->type == 0)
18569 {
18570 currentClass = external->function->_class;
18571 ProcessFunction(external->function);
18572 }
18573 else if(external->type == 1)
18574 {
18575 currentClass = (((void *)0));
18576 if(external->declaration)
18577 ProcessDeclaration(external->declaration);
18578 }
18579 else if(external->type == 2)
18580 {
18581 struct ClassDefinition * _class = external->_class;
18582
18583 currentClass = external->symbol->registered;
18584 if(_class->definitions)
18585 {
18586 ProcessClass(_class->definitions, _class->symbol);
18587 }
18588 if(inCompiler)
18589 {
18590 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
18591 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
18592 }
18593 }
18594 else if(external->type == 4)
18595 {
18596 thisNameSpace = external->id->string;
18597 }
18598 }
18599 currentClass = (((void *)0));
18600 thisNameSpace = (((void *)0));
18601 curExternal = (((void *)0));
18602 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
18603 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
18604 }
18605
18606 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);
18607
18608 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);
18609
18610 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
18611
18612 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
18613 {
18614 struct __ecereNameSpace__ecere__com__Class * class;
18615
18616 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
18617 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
18618 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
18619 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
18620 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
18621 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
18622 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
18623 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
18624 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
18625 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
18626 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
18627 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
18628 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
18629 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
18630 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
18631 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
18632 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
18633 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
18634 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt", "bool GetOpInt(Operand op2, int * value2)", GetOpInt, module, 1);
18635 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
18636 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt", "bool GetOpUInt(Operand op2, uint * value2)", GetOpUInt, module, 1);
18637 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
18638 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt64", "bool GetOpInt64(Operand op2, int64 * value2)", GetOpInt64, module, 1);
18639 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
18640 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt64", "bool GetOpUInt64(Operand op2, uint64 * value2)", GetOpUInt64, module, 1);
18641 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
18642 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntPtr", "bool GetOpIntPtr(Operand op2, intptr * value2)", GetOpIntPtr, module, 1);
18643 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
18644 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntPtr", "bool GetOpUIntPtr(Operand op2, uintptr * value2)", GetOpUIntPtr, module, 1);
18645 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
18646 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntSize", "bool GetOpIntSize(Operand op2, intsize * value2)", GetOpIntSize, module, 1);
18647 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
18648 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntSize", "bool GetOpUIntSize(Operand op2, uintsize * value2)", GetOpUIntSize, module, 1);
18649 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
18650 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpShort", "bool GetOpShort(Operand op2, short * value2)", GetOpShort, module, 1);
18651 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
18652 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUShort", "bool GetOpUShort(Operand op2, uint16 * value2)", GetOpUShort, module, 1);
18653 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
18654 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpChar", "bool GetOpChar(Operand op2, char * value2)", GetOpChar, module, 1);
18655 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
18656 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUChar", "bool GetOpUChar(Operand op2, byte * value2)", GetOpUChar, module, 1);
18657 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
18658 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpFloat", "bool GetOpFloat(Operand op2, float * value2)", GetOpFloat, module, 1);
18659 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
18660 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpDouble", "bool GetOpDouble(Operand op2, double * value2)", GetOpDouble, module, 1);
18661 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
18662 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
18663 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
18664 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
18665 __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);
18666 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
18667 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
18668 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
18669 __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);
18670 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
18671 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
18672 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
18673 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
18674 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
18675 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
18676 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
18677 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
18678 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
18679 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
18680 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
18681 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
18682 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
18683 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
18684 __ecereClass_Conversion = class;
18685 __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);
18686 __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);
18687 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
18688 __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);
18689 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
18690 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
18691 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("UnescapeString", "int UnescapeString(char * d, char * s, int len)", UnescapeString, module, 1);
18692 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("OffsetEscapedString", "char * OffsetEscapedString(char * s, int len, int offset)", OffsetEscapedString, module, 1);
18693 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
18694 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
18695 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
18696 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
18697 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
18698 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
18699 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
18700 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
18701 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
18702 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
18703 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetParseError", "bool GetParseError(void)", GetParseError, module, 1);
18704 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
18705 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
18706 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
18707 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
18708 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(String s)", DeclareFunctionUtil, module, 1);
18709 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
18710 }
18711
18712 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
18713 {
18714
18715 }
18716