compiler/libec/pass15: (#276) Fixed computation of bit classes
[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 } __attribute__ ((gcc_struct));
356
357 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
358
359 struct __ecereNameSpace__ecere__com__DataValue
360 {
361 union
362 {
363 char c;
364 unsigned char uc;
365 short s;
366 unsigned short us;
367 int i;
368 unsigned int ui;
369 void *  p;
370 float f;
371 double d;
372 long long i64;
373 uint64 ui64;
374 } __attribute__ ((gcc_struct));
375 } __attribute__ ((gcc_struct));
376
377 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
378
379 struct Expression
380 {
381 struct Expression * prev;
382 struct Expression * next;
383 struct Location loc;
384 int type;
385 union
386 {
387 struct
388 {
389 char *  constant;
390 struct Identifier * identifier;
391 } __attribute__ ((gcc_struct));
392 struct Statement * compound;
393 struct Instantiation * instance;
394 struct
395 {
396 char *  string;
397 unsigned int intlString;
398 } __attribute__ ((gcc_struct));
399 struct __ecereNameSpace__ecere__sys__OldList *  list;
400 struct
401 {
402 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
403 struct Declarator * decl;
404 } __attribute__ ((gcc_struct)) _classExp;
405 struct
406 {
407 struct Identifier * id;
408 } __attribute__ ((gcc_struct)) classData;
409 struct
410 {
411 struct Expression * exp;
412 struct __ecereNameSpace__ecere__sys__OldList * arguments;
413 struct Location argLoc;
414 } __attribute__ ((gcc_struct)) call;
415 struct
416 {
417 struct Expression * exp;
418 struct __ecereNameSpace__ecere__sys__OldList * index;
419 } __attribute__ ((gcc_struct)) index;
420 struct
421 {
422 struct Expression * exp;
423 struct Identifier * member;
424 int memberType;
425 unsigned int thisPtr;
426 } __attribute__ ((gcc_struct)) member;
427 struct
428 {
429 int op;
430 struct Expression * exp1;
431 struct Expression * exp2;
432 } __attribute__ ((gcc_struct)) op;
433 struct TypeName * typeName;
434 struct Specifier * _class;
435 struct
436 {
437 struct TypeName * typeName;
438 struct Expression * exp;
439 } __attribute__ ((gcc_struct)) cast;
440 struct
441 {
442 struct Expression * cond;
443 struct __ecereNameSpace__ecere__sys__OldList * exp;
444 struct Expression * elseExp;
445 } __attribute__ ((gcc_struct)) cond;
446 struct
447 {
448 struct TypeName * typeName;
449 struct Expression * size;
450 } __attribute__ ((gcc_struct)) _new;
451 struct
452 {
453 struct TypeName * typeName;
454 struct Expression * size;
455 struct Expression * exp;
456 } __attribute__ ((gcc_struct)) _renew;
457 struct
458 {
459 char * table;
460 struct Identifier * id;
461 } __attribute__ ((gcc_struct)) db;
462 struct
463 {
464 struct Expression * ds;
465 struct Expression * name;
466 } __attribute__ ((gcc_struct)) dbopen;
467 struct
468 {
469 struct TypeName * typeName;
470 struct Initializer * initializer;
471 } __attribute__ ((gcc_struct)) initializer;
472 struct
473 {
474 struct Expression * exp;
475 struct TypeName * typeName;
476 } __attribute__ ((gcc_struct)) vaArg;
477 } __attribute__ ((gcc_struct));
478 unsigned int debugValue;
479 struct __ecereNameSpace__ecere__com__DataValue val;
480 uint64 address;
481 unsigned int hasAddress;
482 struct Type * expType;
483 struct Type * destType;
484 unsigned int usage;
485 int tempCount;
486 unsigned int byReference;
487 unsigned int isConstant;
488 unsigned int addedThis;
489 unsigned int needCast;
490 unsigned int thisPtr;
491 } __attribute__ ((gcc_struct));
492
493 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
494
495 struct TemplateDatatype
496 {
497 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
498 struct Declarator * decl;
499 } __attribute__ ((gcc_struct));
500
501 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
502
503 struct TemplateArgument;
504
505 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
506
507 struct TemplateParameter
508 {
509 struct TemplateParameter * prev;
510 struct TemplateParameter * next;
511 struct Location loc;
512 int type;
513 struct Identifier * identifier;
514 union
515 {
516 struct TemplateDatatype * dataType;
517 int memberType;
518 } __attribute__ ((gcc_struct));
519 struct TemplateArgument * defaultArgument;
520 char *  dataTypeString;
521 struct Type * baseType;
522 } __attribute__ ((gcc_struct));
523
524 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
525
526 struct Specifier
527 {
528 struct Specifier * prev;
529 struct Specifier * next;
530 struct Location loc;
531 int type;
532 union
533 {
534 int specifier;
535 struct
536 {
537 struct ExtDecl * extDecl;
538 char *  name;
539 struct Symbol * symbol;
540 struct __ecereNameSpace__ecere__sys__OldList *  templateArgs;
541 } __attribute__ ((gcc_struct));
542 struct
543 {
544 struct Identifier * id;
545 struct __ecereNameSpace__ecere__sys__OldList *  list;
546 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
547 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
548 unsigned int addNameSpace;
549 struct Context * ctx;
550 struct ExtDecl * extDeclStruct;
551 } __attribute__ ((gcc_struct));
552 struct Expression * expression;
553 struct Specifier * _class;
554 struct TemplateParameter * templateParameter;
555 } __attribute__ ((gcc_struct));
556 } __attribute__ ((gcc_struct));
557
558 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
559
560 struct Identifier
561 {
562 struct Identifier * prev;
563 struct Identifier * next;
564 struct Location loc;
565 struct Symbol * classSym;
566 struct Specifier * _class;
567 char *  string;
568 struct Identifier * badID;
569 } __attribute__ ((gcc_struct));
570
571 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Pointer;
572
573 struct Pointer;
574
575 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
576
577 struct Declarator
578 {
579 struct Declarator * prev;
580 struct Declarator * next;
581 struct Location loc;
582 int type;
583 struct Symbol * symbol;
584 struct Declarator * declarator;
585 union
586 {
587 struct Identifier * identifier;
588 struct
589 {
590 struct Expression * exp;
591 struct Expression * posExp;
592 struct Attrib * attrib;
593 } __attribute__ ((gcc_struct)) structDecl;
594 struct
595 {
596 struct Expression * exp;
597 struct Specifier * enumClass;
598 } __attribute__ ((gcc_struct)) array;
599 struct
600 {
601 struct __ecereNameSpace__ecere__sys__OldList * parameters;
602 } __attribute__ ((gcc_struct)) function;
603 struct
604 {
605 struct Pointer * pointer;
606 } __attribute__ ((gcc_struct)) pointer;
607 struct
608 {
609 struct ExtDecl * extended;
610 } __attribute__ ((gcc_struct)) extended;
611 } __attribute__ ((gcc_struct));
612 } __attribute__ ((gcc_struct));
613
614 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
615
616 struct FunctionDefinition
617 {
618 struct FunctionDefinition * prev;
619 struct FunctionDefinition * next;
620 struct Location loc;
621 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
622 struct Declarator * declarator;
623 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
624 struct Statement * body;
625 struct __ecereNameSpace__ecere__com__Class * _class;
626 struct __ecereNameSpace__ecere__sys__OldList attached;
627 int declMode;
628 struct Type * type;
629 struct Symbol * propSet;
630 int tempCount;
631 unsigned int propertyNoThis;
632 } __attribute__ ((gcc_struct));
633
634 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
635
636 struct DBTableDef;
637
638 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
639
640 struct External
641 {
642 struct External * prev;
643 struct External * next;
644 struct Location loc;
645 int type;
646 struct Symbol * symbol;
647 union
648 {
649 struct FunctionDefinition * function;
650 struct ClassDefinition * _class;
651 struct Declaration * declaration;
652 char *  importString;
653 struct Identifier * id;
654 struct DBTableDef * table;
655 } __attribute__ ((gcc_struct));
656 int importType;
657 } __attribute__ ((gcc_struct));
658
659 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
660
661 struct ModuleImport
662 {
663 struct ModuleImport * prev;
664 struct ModuleImport * next;
665 char *  name;
666 struct __ecereNameSpace__ecere__sys__OldList classes;
667 struct __ecereNameSpace__ecere__sys__OldList functions;
668 int importType;
669 int importAccess;
670 } __attribute__ ((gcc_struct));
671
672 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
673
674 struct ClassImport
675 {
676 struct ClassImport * prev;
677 struct ClassImport * next;
678 char *  name;
679 struct __ecereNameSpace__ecere__sys__OldList methods;
680 struct __ecereNameSpace__ecere__sys__OldList properties;
681 unsigned int itself;
682 unsigned int isRemote;
683 } __attribute__ ((gcc_struct));
684
685 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
686
687 struct Symbol
688 {
689 char *  string;
690 struct Symbol * parent;
691 struct Symbol * left;
692 struct Symbol * right;
693 int depth;
694 struct Type * type;
695 union
696 {
697 struct __ecereNameSpace__ecere__com__Method * method;
698 struct __ecereNameSpace__ecere__com__Property * _property;
699 struct __ecereNameSpace__ecere__com__Class * registered;
700 } __attribute__ ((gcc_struct));
701 int id;
702 int idCode;
703 union
704 {
705 struct
706 {
707 struct External * pointerExternal;
708 struct External * structExternal;
709 } __attribute__ ((gcc_struct));
710 struct
711 {
712 struct External * externalGet;
713 struct External * externalSet;
714 struct External * externalPtr;
715 struct External * externalIsSet;
716 } __attribute__ ((gcc_struct));
717 struct
718 {
719 struct External * methodExternal;
720 struct External * methodCodeExternal;
721 } __attribute__ ((gcc_struct));
722 } __attribute__ ((gcc_struct));
723 unsigned int imported;
724 unsigned int declaredStructSym;
725 struct __ecereNameSpace__ecere__com__Class * _class;
726 unsigned int declaredStruct;
727 unsigned int needConstructor;
728 unsigned int needDestructor;
729 char *  constructorName;
730 char *  structName;
731 char *  className;
732 char *  destructorName;
733 struct ModuleImport * module;
734 struct ClassImport * _import;
735 struct Location nameLoc;
736 unsigned int isParam;
737 unsigned int isRemote;
738 unsigned int isStruct;
739 unsigned int fireWatchersDone;
740 int declaring;
741 unsigned int classData;
742 unsigned int isStatic;
743 char *  shortName;
744 struct __ecereNameSpace__ecere__sys__OldList *  templateParams;
745 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
746 struct Context * ctx;
747 int isIterator;
748 struct Expression * propCategory;
749 } __attribute__ ((gcc_struct));
750
751 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
752
753 struct Type
754 {
755 struct Type * prev;
756 struct Type * next;
757 int refCount;
758 union
759 {
760 struct Symbol * _class;
761 struct
762 {
763 struct __ecereNameSpace__ecere__sys__OldList members;
764 char *  enumName;
765 } __attribute__ ((gcc_struct));
766 struct
767 {
768 struct Type * returnType;
769 struct __ecereNameSpace__ecere__sys__OldList params;
770 struct Symbol * thisClass;
771 unsigned int staticMethod;
772 struct TemplateParameter * thisClassTemplate;
773 } __attribute__ ((gcc_struct));
774 struct
775 {
776 struct __ecereNameSpace__ecere__com__Method * method;
777 struct __ecereNameSpace__ecere__com__Class * methodClass;
778 struct __ecereNameSpace__ecere__com__Class * usedClass;
779 } __attribute__ ((gcc_struct));
780 struct
781 {
782 struct Type * arrayType;
783 int arraySize;
784 struct Expression * arraySizeExp;
785 unsigned int freeExp;
786 struct Symbol * enumClass;
787 } __attribute__ ((gcc_struct));
788 struct Type * type;
789 struct TemplateParameter * templateParameter;
790 } __attribute__ ((gcc_struct));
791 int kind;
792 unsigned int size;
793 char *  name;
794 char *  typeName;
795 int classObjectType;
796 int alignment;
797 unsigned int offset;
798 int bitFieldCount;
799 int count;
800 unsigned int isSigned : 1;
801 unsigned int constant : 1;
802 unsigned int truth : 1;
803 unsigned int byReference : 1;
804 unsigned int extraParam : 1;
805 unsigned int directClassAccess : 1;
806 unsigned int computing : 1;
807 unsigned int keepCast : 1;
808 unsigned int passAsTemplate : 1;
809 unsigned int dllExport : 1;
810 unsigned int attrStdcall : 1;
811 unsigned int declaredWithStruct : 1;
812 unsigned int typedByReference : 1;
813 } __attribute__ ((gcc_struct));
814
815 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
816
817 struct __ecereNameSpace__ecere__com__Class
818 {
819 struct __ecereNameSpace__ecere__com__Class * prev;
820 struct __ecereNameSpace__ecere__com__Class * next;
821 char *  name;
822 int offset;
823 int structSize;
824 int (* *  _vTbl)();
825 int vTblSize;
826 int (*  Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
827 void (*  Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
828 int offsetClass;
829 int sizeClass;
830 struct __ecereNameSpace__ecere__com__Class * base;
831 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
832 struct __ecereNameSpace__ecere__sys__BinaryTree members;
833 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
834 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
835 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
836 struct __ecereNameSpace__ecere__sys__OldList derivatives;
837 int memberID;
838 int startMemberID;
839 int type;
840 struct __ecereNameSpace__ecere__com__Instance * module;
841 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
842 char *  dataTypeString;
843 struct Type * dataType;
844 int typeSize;
845 int defaultAlignment;
846 void (*  Initialize)();
847 int memberOffset;
848 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
849 char *  designerClass;
850 unsigned int noExpansion;
851 char *  defaultProperty;
852 unsigned int comRedefinition;
853 int count;
854 unsigned int isRemote;
855 unsigned int internalDecl;
856 void *  data;
857 unsigned int computeSize;
858 int structAlignment;
859 int destructionWatchOffset;
860 unsigned int fixed;
861 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
862 int inheritanceAccess;
863 char *  fullName;
864 void *  symbol;
865 struct __ecereNameSpace__ecere__sys__OldList conversions;
866 struct __ecereNameSpace__ecere__sys__OldList templateParams;
867 struct __ecereNameSpace__ecere__com__ClassTemplateArgument *  templateArgs;
868 struct __ecereNameSpace__ecere__com__Class * templateClass;
869 struct __ecereNameSpace__ecere__sys__OldList templatized;
870 int numParams;
871 unsigned int isInstanceClass;
872 unsigned int byValueSystemClass;
873 } __attribute__ ((gcc_struct));
874
875 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char *  name);
876
877 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
878
879 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
880
881 struct __ecereNameSpace__ecere__com__Instance
882 {
883 int (* *  _vTbl)();
884 struct __ecereNameSpace__ecere__com__Class * _class;
885 int _refCount;
886 } __attribute__ ((gcc_struct));
887
888 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
889
890 struct __ecereNameSpace__ecere__com__DataMember
891 {
892 struct __ecereNameSpace__ecere__com__DataMember * prev;
893 struct __ecereNameSpace__ecere__com__DataMember * next;
894 char *  name;
895 unsigned int isProperty;
896 int memberAccess;
897 int id;
898 struct __ecereNameSpace__ecere__com__Class * _class;
899 char *  dataTypeString;
900 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
901 struct Type * dataType;
902 int type;
903 int offset;
904 int memberID;
905 struct __ecereNameSpace__ecere__sys__OldList members;
906 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
907 int memberOffset;
908 int structAlignment;
909 } __attribute__ ((gcc_struct));
910
911 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
912
913 struct __ecereNameSpace__ecere__com__SerialBuffer
914 {
915 unsigned char *  _buffer;
916 unsigned int count;
917 unsigned int _size;
918 unsigned int pos;
919 } __attribute__ ((gcc_struct));
920
921 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
922
923 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
924 {
925 union
926 {
927 struct
928 {
929 char *  dataTypeString;
930 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
931 } __attribute__ ((gcc_struct));
932 struct __ecereNameSpace__ecere__com__DataValue expression;
933 struct
934 {
935 char *  memberString;
936 union
937 {
938 struct __ecereNameSpace__ecere__com__DataMember * member;
939 struct __ecereNameSpace__ecere__com__Property * prop;
940 struct __ecereNameSpace__ecere__com__Method * method;
941 } __attribute__ ((gcc_struct));
942 } __attribute__ ((gcc_struct));
943 } __attribute__ ((gcc_struct));
944 } __attribute__ ((gcc_struct));
945
946 void exit(int status);
947
948 void * calloc(size_t nmemb, size_t size);
949
950 void free(void * ptr);
951
952 void * malloc(size_t size);
953
954 void * realloc(void * ptr, size_t size);
955
956 long int strtol(const char * nptr, char ** endptr, int base);
957
958 long long int strtoll(const char * nptr, char ** endptr, int base);
959
960 unsigned long long int strtoull(const char * nptr, char ** endptr, int base);
961
962 enum yytokentype
963 {
964 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
965 };
966
967 typedef union YYSTYPE
968 {
969 int specifierType;
970 int i;
971 int declMode;
972 struct Identifier * id;
973 struct Expression * exp;
974 struct Specifier * specifier;
975 struct __ecereNameSpace__ecere__sys__OldList * list;
976 struct Enumerator * enumerator;
977 struct Declarator * declarator;
978 struct Pointer * pointer;
979 struct Initializer * initializer;
980 struct InitDeclarator * initDeclarator;
981 struct TypeName * typeName;
982 struct Declaration * declaration;
983 struct Statement * stmt;
984 struct FunctionDefinition * function;
985 struct External * external;
986 struct Context * context;
987 struct AsmField * asmField;
988 struct Attrib * attrib;
989 struct ExtDecl * extDecl;
990 struct Attribute * attribute;
991 struct Instantiation * instance;
992 struct MembersInit * membersInit;
993 struct MemberInit * memberInit;
994 struct ClassFunction * classFunction;
995 struct ClassDefinition * _class;
996 struct ClassDef * classDef;
997 struct PropertyDef * prop;
998 char * string;
999 struct Symbol * symbol;
1000 struct PropertyWatch * propertyWatch;
1001 struct TemplateParameter * templateParameter;
1002 struct TemplateArgument * templateArgument;
1003 struct TemplateDatatype * templateDatatype;
1004 struct DBTableEntry * dbtableEntry;
1005 struct DBIndexItem * dbindexItem;
1006 struct DBTableDef * dbtableDef;
1007 } __attribute__ ((gcc_struct)) YYSTYPE;
1008
1009 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
1010
1011 struct Enumerator
1012 {
1013 struct Enumerator * prev;
1014 struct Enumerator * next;
1015 struct Location loc;
1016 struct Identifier * id;
1017 struct Expression * exp;
1018 } __attribute__ ((gcc_struct));
1019
1020 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
1021
1022 struct InitDeclarator
1023 {
1024 struct InitDeclarator * prev;
1025 struct InitDeclarator * next;
1026 struct Location loc;
1027 struct Declarator * declarator;
1028 struct Initializer * initializer;
1029 } __attribute__ ((gcc_struct));
1030
1031 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
1032
1033 struct AsmField
1034 {
1035 struct AsmField * prev;
1036 struct AsmField * next;
1037 struct Location loc;
1038 char *  command;
1039 struct Expression * expression;
1040 struct Identifier * symbolic;
1041 } __attribute__ ((gcc_struct));
1042
1043 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attribute;
1044
1045 struct Attribute;
1046
1047 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
1048
1049 struct ClassFunction
1050 {
1051 struct ClassFunction * prev;
1052 struct ClassFunction * next;
1053 struct Location loc;
1054 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1055 struct Declarator * declarator;
1056 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
1057 struct Statement * body;
1058 struct __ecereNameSpace__ecere__com__Class * _class;
1059 struct __ecereNameSpace__ecere__sys__OldList attached;
1060 int declMode;
1061 struct Type * type;
1062 struct Symbol * propSet;
1063 unsigned int isVirtual;
1064 unsigned int isConstructor;
1065 unsigned int isDestructor;
1066 unsigned int dontMangle;
1067 int id;
1068 int idCode;
1069 } __attribute__ ((gcc_struct));
1070
1071 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
1072
1073 struct MembersInit
1074 {
1075 struct MembersInit * prev;
1076 struct MembersInit * next;
1077 struct Location loc;
1078 int type;
1079 union
1080 {
1081 struct __ecereNameSpace__ecere__sys__OldList *  dataMembers;
1082 struct ClassFunction * function;
1083 } __attribute__ ((gcc_struct));
1084 } __attribute__ ((gcc_struct));
1085
1086 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
1087
1088 struct MemberInit
1089 {
1090 struct MemberInit * prev;
1091 struct MemberInit * next;
1092 struct Location loc;
1093 struct Location realLoc;
1094 struct __ecereNameSpace__ecere__sys__OldList *  identifiers;
1095 struct Initializer * initializer;
1096 unsigned int used;
1097 unsigned int variable;
1098 unsigned int takeOutExp;
1099 } __attribute__ ((gcc_struct));
1100
1101 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1102
1103 struct PropertyDef
1104 {
1105 struct PropertyDef * prev;
1106 struct PropertyDef * next;
1107 struct Location loc;
1108 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1109 struct Declarator * declarator;
1110 struct Identifier * id;
1111 struct Statement * getStmt;
1112 struct Statement * setStmt;
1113 struct Statement * issetStmt;
1114 struct Symbol * symbol;
1115 struct Expression * category;
1116 struct
1117 {
1118 unsigned int conversion : 1;
1119 unsigned int isWatchable : 1;
1120 unsigned int isDBProp : 1;
1121 } __attribute__ ((gcc_struct));
1122 } __attribute__ ((gcc_struct));
1123
1124 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1125
1126 struct PropertyWatch
1127 {
1128 struct PropertyWatch * prev;
1129 struct PropertyWatch * next;
1130 struct Location loc;
1131 struct Statement * compound;
1132 struct __ecereNameSpace__ecere__sys__OldList *  properties;
1133 unsigned int deleteWatch;
1134 } __attribute__ ((gcc_struct));
1135
1136 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1137
1138 struct ClassDef
1139 {
1140 struct ClassDef * prev;
1141 struct ClassDef * next;
1142 struct Location loc;
1143 int type;
1144 union
1145 {
1146 struct Declaration * decl;
1147 struct ClassFunction * function;
1148 struct __ecereNameSpace__ecere__sys__OldList *  defProperties;
1149 struct PropertyDef * propertyDef;
1150 struct PropertyWatch * propertyWatch;
1151 char *  designer;
1152 struct Identifier * defaultProperty;
1153 struct
1154 {
1155 struct Identifier * id;
1156 struct Initializer * initializer;
1157 } __attribute__ ((gcc_struct));
1158 } __attribute__ ((gcc_struct));
1159 int memberAccess;
1160 void *  object;
1161 } __attribute__ ((gcc_struct));
1162
1163 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1164
1165 struct DBTableEntry;
1166
1167 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1168
1169 struct DBIndexItem;
1170
1171 extern YYSTYPE yylval;
1172
1173 extern struct Location yylloc;
1174
1175 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1176
1177 extern int returnCode;
1178
1179 extern struct Expression * parsedExpression;
1180
1181 extern unsigned int yydebug;
1182
1183 void SetYydebug(unsigned int b)
1184 {
1185 yydebug = b;
1186 }
1187
1188 extern unsigned int echoOn;
1189
1190 void resetScanner();
1191
1192 int propWatcherID;
1193
1194 int expression_yyparse();
1195
1196 static struct Statement * curCompound;
1197
1198 struct External * curExternal, * afterExternal;
1199
1200 static struct Type * curSwitchType;
1201
1202 static struct __ecereNameSpace__ecere__com__Class * currentClass;
1203
1204 struct __ecereNameSpace__ecere__com__Class * thisClass;
1205
1206 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
1207 {
1208 thisClass = c;
1209 }
1210
1211 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
1212 {
1213 return thisClass;
1214 }
1215
1216 static char * thisNameSpace;
1217
1218 struct __ecereNameSpace__ecere__com__Class * containerClass;
1219
1220 unsigned int thisClassParams = 0x1;
1221
1222 unsigned int internalValueCounter;
1223
1224 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
1225
1226 extern size_t strlen(const char * );
1227
1228 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
1229
1230 extern void *  __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1231
1232 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
1233
1234 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
1235
1236 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
1237
1238 void PrintExpression(struct Expression * exp, char * string)
1239 {
1240 {
1241 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
1242 int count;
1243
1244 if(exp)
1245 OutputExpression(exp, f);
1246 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
1247 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
1248
1249 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
1250 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
1251 count = strlen(string);
1252 count += ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__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_Read])(f, string + count, 1, 1023);
1257 string[count] = '\0';
1258 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
1259 }
1260 }
1261
1262 extern struct Type * ProcessTypeString(char *  string, unsigned int staticMethod);
1263
1264 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1265
1266 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1267 {
1268 if(param && param->type == 0 && (param->dataType || param->dataTypeString))
1269 {
1270 if(!param->baseType)
1271 {
1272 if(param->dataTypeString)
1273 param->baseType = ProcessTypeString(param->dataTypeString, 0x0);
1274 else
1275 param->baseType = ProcessType(param->dataType->specifiers, param->dataType->decl);
1276 }
1277 return param->baseType;
1278 }
1279 return (((void *)0));
1280 }
1281
1282 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1283 {
1284 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1285 return 0x1;
1286 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0x0)
1287 {
1288 return 0x0;
1289 }
1290 if(type1->kind == type2->kind)
1291 {
1292 switch(type1->kind)
1293 {
1294 case 24:
1295 case 1:
1296 case 2:
1297 case 3:
1298 case 4:
1299 case 22:
1300 case 23:
1301 if(type1->passAsTemplate && !type2->passAsTemplate)
1302 return 0x1;
1303 return type1->isSigned != type2->isSigned;
1304 case 8:
1305 return type1->_class != type2->_class;
1306 case 13:
1307 return NeedCast(type1->type, type2->type);
1308 default:
1309 return 0x1;
1310 }
1311 }
1312 return 0x1;
1313 }
1314
1315 extern int strcmp(const char * , const char * );
1316
1317 extern struct Context * curContext;
1318
1319 extern struct Context * topContext;
1320
1321 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
1322
1323 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);
1324
1325 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1326
1327 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);
1328
1329 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);
1330
1331 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassProperty;
1332
1333 struct __ecereNameSpace__ecere__com__ClassProperty
1334 {
1335 char *  name;
1336 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1337 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1338 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1339 int depth;
1340 void (*  Set)(struct __ecereNameSpace__ecere__com__Class *, long long);
1341 long long (*  Get)(struct __ecereNameSpace__ecere__com__Class *);
1342 char *  dataTypeString;
1343 struct Type * dataType;
1344 unsigned int constant;
1345 } __attribute__ ((gcc_struct));
1346
1347 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, char *  name);
1348
1349 extern struct Expression * QMkExpId(char *  id);
1350
1351 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateParameter;
1352
1353 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
1354 {
1355 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
1356 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
1357 char *  name;
1358 int type;
1359 union
1360 {
1361 char *  dataTypeString;
1362 int memberType;
1363 } __attribute__ ((gcc_struct));
1364 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
1365 void *  param;
1366 } __attribute__ ((gcc_struct));
1367
1368 extern struct Expression * GetTemplateArgExpByName(char *  paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
1369
1370 extern struct __ecereNameSpace__ecere__sys__OldList *  MkList(void);
1371
1372 extern void FreeIdentifier(struct Identifier * id);
1373
1374 void ProcessExpressionType(struct Expression * exp);
1375
1376 extern struct Declarator * SpecDeclFromString(char *  string, struct __ecereNameSpace__ecere__sys__OldList *  specs, struct Declarator * baseDecl);
1377
1378 extern struct __ecereNameSpace__ecere__sys__OldList *  MkListOne(void *  item);
1379
1380 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1381
1382 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1383
1384 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1385
1386 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1387
1388 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1389
1390 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char *  key);
1391
1392 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
1393 {
1394 if(exp->type == 0 && exp->identifier)
1395 {
1396 struct Identifier * id = exp->identifier;
1397 struct Context * ctx;
1398 struct Symbol * symbol = (((void *)0));
1399
1400 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
1401 {
1402 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
1403 {
1404 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
1405 if(symbol)
1406 break;
1407 }
1408 }
1409 if(!symbol && ((!id->_class || (id->_class->name && !strcmp(id->_class->name, "property"))) || (id->classSym && __ecereNameSpace__ecere__com__eClass_IsDerived(_class, id->classSym->registered))))
1410 {
1411 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
1412 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
1413 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
1414 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
1415
1416 if(!prop)
1417 {
1418 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
1419 }
1420 if(!prop && !method)
1421 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
1422 if(!prop && !method && !member)
1423 {
1424 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
1425 }
1426 if(prop || method || member || classProp)
1427 {
1428 exp->type = 8;
1429 exp->member.member = id;
1430 exp->member.memberType = 0;
1431 exp->member.exp = QMkExpId("this");
1432 exp->addedThis = 0x1;
1433 }
1434 else if(_class && _class->templateParams.first)
1435 {
1436 struct __ecereNameSpace__ecere__com__Class * sClass;
1437
1438 for(sClass = _class; sClass; sClass = sClass->base)
1439 {
1440 if(sClass->templateParams.first)
1441 {
1442 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
1443
1444 for(param = sClass->templateParams.first; param; param = param->next)
1445 {
1446 if(param->type == 2 && !strcmp(param->name, id->string))
1447 {
1448 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
1449
1450 if(argExp)
1451 {
1452 struct Declarator * decl;
1453 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1454
1455 FreeIdentifier(exp->member.member);
1456 ProcessExpressionType(argExp);
1457 decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
1458 exp->expType = ProcessType(specs, decl);
1459 exp->type = 5;
1460 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
1461 }
1462 }
1463 }
1464 }
1465 }
1466 }
1467 }
1468 }
1469 }
1470
1471 extern int sprintf(char * , char * , ...);
1472
1473 extern int __ecereNameSpace__ecere__com__GetRuntimePlatform(void);
1474
1475 extern char *  strcat(char * , const char * );
1476
1477 extern char *  __ecereNameSpace__ecere__sys__CopyString(char *  string);
1478
1479 char * PrintInt(long long result)
1480 {
1481 char temp[100];
1482
1483 if(result > (((int)0x7fffffff)))
1484 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1485 else
1486 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1487 if(result > (((int)0x7fffffff)) || result < (((int)0x80000000)))
1488 strcat(temp, "LL");
1489 return __ecereNameSpace__ecere__sys__CopyString(temp);
1490 }
1491
1492 char * PrintUInt(uint64 result)
1493 {
1494 char temp[100];
1495
1496 if(result > (0xffffffff))
1497 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1498 else if(result > (((int)0x7fffffff)))
1499 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1500 else
1501 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1502 return __ecereNameSpace__ecere__sys__CopyString(temp);
1503 }
1504
1505 char * PrintInt64(long long result)
1506 {
1507 char temp[100];
1508
1509 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1510 return __ecereNameSpace__ecere__sys__CopyString(temp);
1511 }
1512
1513 char * PrintUInt64(uint64 result)
1514 {
1515 char temp[100];
1516
1517 if(result > (((long long)0x7fffffffffffffffLL)))
1518 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1519 else
1520 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1521 return __ecereNameSpace__ecere__sys__CopyString(temp);
1522 }
1523
1524 char * PrintHexUInt(uint64 result)
1525 {
1526 char temp[100];
1527
1528 if(result > (0xffffffff))
1529 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1530 else
1531 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1532 if(result > (0xffffffff))
1533 strcat(temp, "LL");
1534 return __ecereNameSpace__ecere__sys__CopyString(temp);
1535 }
1536
1537 char * PrintHexUInt64(uint64 result)
1538 {
1539 char temp[100];
1540
1541 if(result > (0xffffffff))
1542 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1543 else
1544 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1545 return __ecereNameSpace__ecere__sys__CopyString(temp);
1546 }
1547
1548 char * PrintShort(short result)
1549 {
1550 char temp[100];
1551
1552 sprintf(temp, "%d", (unsigned short)result);
1553 return __ecereNameSpace__ecere__sys__CopyString(temp);
1554 }
1555
1556 char * PrintUShort(unsigned short result)
1557 {
1558 char temp[100];
1559
1560 if(result > (unsigned short)32767)
1561 sprintf(temp, "0x%X", (int)result);
1562 else
1563 sprintf(temp, "%d", (int)result);
1564 return __ecereNameSpace__ecere__sys__CopyString(temp);
1565 }
1566
1567 extern int isprint(int c);
1568
1569 char * PrintChar(char result)
1570 {
1571 char temp[100];
1572
1573 if(result > (char)0 && isprint(result))
1574 sprintf(temp, "'%c'", result);
1575 else if(result < (char)0)
1576 sprintf(temp, "%d", (int)result);
1577 else
1578 sprintf(temp, "0x%X", (unsigned char)result);
1579 return __ecereNameSpace__ecere__sys__CopyString(temp);
1580 }
1581
1582 char * PrintUChar(unsigned char result)
1583 {
1584 char temp[100];
1585
1586 sprintf(temp, "0x%X", result);
1587 return __ecereNameSpace__ecere__sys__CopyString(temp);
1588 }
1589
1590 extern char *  strcpy(char * , const char * );
1591
1592 extern unsigned int (* __ecereProp_float_Get_isInf)(float this);
1593
1594 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_isInf;
1595
1596 extern int (* __ecereProp_float_Get_signBit)(float this);
1597
1598 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_signBit;
1599
1600 extern unsigned int (* __ecereProp_float_Get_isNan)(float this);
1601
1602 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_isNan;
1603
1604 char * PrintFloat(float result)
1605 {
1606 char temp[350];
1607
1608 if(__ecereProp_float_Get_isInf(result))
1609 {
1610 if(__ecereProp_float_Get_signBit(result))
1611 strcpy(temp, "-inf");
1612 else
1613 strcpy(temp, "inf");
1614 }
1615 else if(__ecereProp_float_Get_isNan(result))
1616 {
1617 if(__ecereProp_float_Get_signBit(result))
1618 strcpy(temp, "-nan");
1619 else
1620 strcpy(temp, "nan");
1621 }
1622 else
1623 sprintf(temp, "%.16ff", result);
1624 return __ecereNameSpace__ecere__sys__CopyString(temp);
1625 }
1626
1627 extern unsigned int (* __ecereProp_double_Get_isInf)(double this);
1628
1629 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_isInf;
1630
1631 extern int (* __ecereProp_double_Get_signBit)(double this);
1632
1633 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_signBit;
1634
1635 extern unsigned int (* __ecereProp_double_Get_isNan)(double this);
1636
1637 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_isNan;
1638
1639 char * PrintDouble(double result)
1640 {
1641 char temp[350];
1642
1643 if(__ecereProp_double_Get_isInf(result))
1644 {
1645 if(__ecereProp_double_Get_signBit(result))
1646 strcpy(temp, "-inf");
1647 else
1648 strcpy(temp, "inf");
1649 }
1650 else if(__ecereProp_double_Get_isNan(result))
1651 {
1652 if(__ecereProp_double_Get_signBit(result))
1653 strcpy(temp, "-nan");
1654 else
1655 strcpy(temp, "nan");
1656 }
1657 else
1658 sprintf(temp, "%.16f", result);
1659 return __ecereNameSpace__ecere__sys__CopyString(temp);
1660 }
1661
1662 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1663
1664 struct OpTable
1665 {
1666 unsigned int (*  Add)(struct Expression *, struct Operand *, struct Operand *);
1667 unsigned int (*  Sub)(struct Expression *, struct Operand *, struct Operand *);
1668 unsigned int (*  Mul)(struct Expression *, struct Operand *, struct Operand *);
1669 unsigned int (*  Div)(struct Expression *, struct Operand *, struct Operand *);
1670 unsigned int (*  Mod)(struct Expression *, struct Operand *, struct Operand *);
1671 unsigned int (*  Neg)(struct Expression *, struct Operand *);
1672 unsigned int (*  Inc)(struct Expression *, struct Operand *);
1673 unsigned int (*  Dec)(struct Expression *, struct Operand *);
1674 unsigned int (*  Asign)(struct Expression *, struct Operand *, struct Operand *);
1675 unsigned int (*  AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1676 unsigned int (*  SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1677 unsigned int (*  MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1678 unsigned int (*  DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1679 unsigned int (*  ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1680 unsigned int (*  BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1681 unsigned int (*  BitOr)(struct Expression *, struct Operand *, struct Operand *);
1682 unsigned int (*  BitXor)(struct Expression *, struct Operand *, struct Operand *);
1683 unsigned int (*  LShift)(struct Expression *, struct Operand *, struct Operand *);
1684 unsigned int (*  RShift)(struct Expression *, struct Operand *, struct Operand *);
1685 unsigned int (*  BitNot)(struct Expression *, struct Operand *);
1686 unsigned int (*  AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1687 unsigned int (*  OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1688 unsigned int (*  XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1689 unsigned int (*  LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1690 unsigned int (*  RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1691 unsigned int (*  Not)(struct Expression *, struct Operand *);
1692 unsigned int (*  Equ)(struct Expression *, struct Operand *, struct Operand *);
1693 unsigned int (*  Nqu)(struct Expression *, struct Operand *, struct Operand *);
1694 unsigned int (*  And)(struct Expression *, struct Operand *, struct Operand *);
1695 unsigned int (*  Or)(struct Expression *, struct Operand *, struct Operand *);
1696 unsigned int (*  Grt)(struct Expression *, struct Operand *, struct Operand *);
1697 unsigned int (*  Sma)(struct Expression *, struct Operand *, struct Operand *);
1698 unsigned int (*  GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1699 unsigned int (*  SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1700 unsigned int (*  Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1701 } __attribute__ ((gcc_struct));
1702
1703 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1704
1705 struct Operand
1706 {
1707 int kind;
1708 struct Type * type;
1709 unsigned int ptrSize;
1710 union
1711 {
1712 char c;
1713 unsigned char uc;
1714 short s;
1715 unsigned short us;
1716 int i;
1717 unsigned int ui;
1718 float f;
1719 double d;
1720 long long i64;
1721 uint64 ui64;
1722 } __attribute__ ((gcc_struct));
1723 struct OpTable ops;
1724 } __attribute__ ((gcc_struct));
1725
1726 unsigned int GetOpInt(struct Operand * op2, int * value2)
1727 {
1728 if(op2->kind == 3 && op2->type->isSigned)
1729 *value2 = op2->i;
1730 else if(op2->kind == 3)
1731 *value2 = (int)op2->ui;
1732 else if(op2->kind == 4 && op2->type->isSigned)
1733 *value2 = (int)op2->i64;
1734 else if(op2->kind == 4)
1735 *value2 = (int)op2->ui64;
1736 else if(op2->kind == 23 && op2->type->isSigned)
1737 *value2 = (int)op2->i64;
1738 else if(op2->kind == 23)
1739 *value2 = (int)op2->ui64;
1740 else if(op2->kind == 22 && op2->type->isSigned)
1741 *value2 = (int)op2->i64;
1742 else if(op2->kind == 22)
1743 *value2 = (int)op2->ui64;
1744 else if(op2->kind == 2 && op2->type->isSigned)
1745 *value2 = (int)op2->s;
1746 else if(op2->kind == 2)
1747 *value2 = (int)op2->us;
1748 else if(op2->kind == 1 && op2->type->isSigned)
1749 *value2 = (int)op2->c;
1750 else if(op2->kind == 24 || op2->kind == 1)
1751 *value2 = (int)op2->uc;
1752 else if(op2->kind == 6)
1753 *value2 = (int)op2->f;
1754 else if(op2->kind == 7)
1755 *value2 = (int)op2->d;
1756 else if(op2->kind == 13)
1757 *value2 = (int)op2->ui64;
1758 else
1759 return 0x0;
1760 return 0x1;
1761 }
1762
1763 struct Operand GetOperand(struct Expression * exp);
1764
1765 unsigned int GetInt(struct Expression * exp, int * value2)
1766 {
1767 struct Operand op2 = GetOperand(exp);
1768
1769 return GetOpInt(&op2, value2);
1770 }
1771
1772 unsigned int GetOpUInt(struct Operand * op2, unsigned int * value2)
1773 {
1774 if(op2->kind == 3 && op2->type->isSigned)
1775 *value2 = (unsigned int)op2->i;
1776 else if(op2->kind == 3)
1777 *value2 = op2->ui;
1778 else if(op2->kind == 4 && op2->type->isSigned)
1779 *value2 = (unsigned int)op2->i64;
1780 else if(op2->kind == 4)
1781 *value2 = (unsigned int)op2->ui64;
1782 else if(op2->kind == 23 && op2->type->isSigned)
1783 *value2 = (unsigned int)op2->i64;
1784 else if(op2->kind == 23)
1785 *value2 = (unsigned int)op2->ui64;
1786 else if(op2->kind == 22 && op2->type->isSigned)
1787 *value2 = (unsigned int)op2->i64;
1788 else if(op2->kind == 22)
1789 *value2 = (unsigned int)op2->ui64;
1790 else if(op2->kind == 2 && op2->type->isSigned)
1791 *value2 = (unsigned int)op2->s;
1792 else if(op2->kind == 2)
1793 *value2 = (unsigned int)op2->us;
1794 else if(op2->kind == 1 && op2->type->isSigned)
1795 *value2 = (unsigned int)op2->c;
1796 else if(op2->kind == 24 || op2->kind == 1)
1797 *value2 = (unsigned int)op2->uc;
1798 else if(op2->kind == 6)
1799 *value2 = (unsigned int)op2->f;
1800 else if(op2->kind == 7)
1801 *value2 = (unsigned int)op2->d;
1802 else if(op2->kind == 13)
1803 *value2 = (unsigned int)op2->ui64;
1804 else
1805 return 0x0;
1806 return 0x1;
1807 }
1808
1809 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1810 {
1811 struct Operand op2 = GetOperand(exp);
1812
1813 return GetOpUInt(&op2, value2);
1814 }
1815
1816 unsigned int GetOpInt64(struct Operand * op2, long long * value2)
1817 {
1818 if(op2->kind == 3 && op2->type->isSigned)
1819 *value2 = (long long)op2->i;
1820 else if(op2->kind == 3)
1821 *value2 = (long long)op2->ui;
1822 else if(op2->kind == 4 && op2->type->isSigned)
1823 *value2 = op2->i64;
1824 else if(op2->kind == 4)
1825 *value2 = (long long)op2->ui64;
1826 else if(op2->kind == 23 && op2->type->isSigned)
1827 *value2 = op2->i64;
1828 else if(op2->kind == 23)
1829 *value2 = (long long)op2->ui64;
1830 else if(op2->kind == 22 && op2->type->isSigned)
1831 *value2 = op2->i64;
1832 else if(op2->kind == 22)
1833 *value2 = (long long)op2->ui64;
1834 else if(op2->kind == 2 && op2->type->isSigned)
1835 *value2 = (long long)op2->s;
1836 else if(op2->kind == 2)
1837 *value2 = (long long)op2->us;
1838 else if(op2->kind == 1 && op2->type->isSigned)
1839 *value2 = (long long)op2->c;
1840 else if(op2->kind == 24 || op2->kind == 1)
1841 *value2 = (long long)op2->uc;
1842 else if(op2->kind == 6)
1843 *value2 = (long long)op2->f;
1844 else if(op2->kind == 7)
1845 *value2 = (long long)op2->d;
1846 else if(op2->kind == 13)
1847 *value2 = (long long)op2->ui64;
1848 else
1849 return 0x0;
1850 return 0x1;
1851 }
1852
1853 unsigned int GetInt64(struct Expression * exp, long long * value2)
1854 {
1855 struct Operand op2 = GetOperand(exp);
1856
1857 return GetOpInt64(&op2, value2);
1858 }
1859
1860 unsigned int GetOpUInt64(struct Operand * op2, uint64 * value2)
1861 {
1862 if(op2->kind == 3 && op2->type->isSigned)
1863 *value2 = (uint64)op2->i;
1864 else if(op2->kind == 3)
1865 *value2 = (uint64)op2->ui;
1866 else if(op2->kind == 4 && op2->type->isSigned)
1867 *value2 = (uint64)op2->i64;
1868 else if(op2->kind == 4)
1869 *value2 = op2->ui64;
1870 else if(op2->kind == 23 && op2->type->isSigned)
1871 *value2 = (uint64)op2->i64;
1872 else if(op2->kind == 23)
1873 *value2 = op2->ui64;
1874 else if(op2->kind == 22 && op2->type->isSigned)
1875 *value2 = (uint64)op2->i64;
1876 else if(op2->kind == 22)
1877 *value2 = op2->ui64;
1878 else if(op2->kind == 2 && op2->type->isSigned)
1879 *value2 = (uint64)op2->s;
1880 else if(op2->kind == 2)
1881 *value2 = (uint64)op2->us;
1882 else if(op2->kind == 1 && op2->type->isSigned)
1883 *value2 = (uint64)op2->c;
1884 else if(op2->kind == 24 || op2->kind == 1)
1885 *value2 = (uint64)op2->uc;
1886 else if(op2->kind == 6)
1887 *value2 = (uint64)op2->f;
1888 else if(op2->kind == 7)
1889 *value2 = (uint64)op2->d;
1890 else if(op2->kind == 13)
1891 *value2 = op2->ui64;
1892 else
1893 return 0x0;
1894 return 0x1;
1895 }
1896
1897 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1898 {
1899 struct Operand op2 = GetOperand(exp);
1900
1901 return GetOpUInt64(&op2, value2);
1902 }
1903
1904 unsigned int GetOpIntPtr(struct Operand * op2, intptr_t * value2)
1905 {
1906 if(op2->kind == 3 && op2->type->isSigned)
1907 *value2 = (intptr_t)op2->i;
1908 else if(op2->kind == 3)
1909 *value2 = (intptr_t)op2->ui;
1910 else if(op2->kind == 4 && op2->type->isSigned)
1911 *value2 = (intptr_t)op2->i64;
1912 else if(op2->kind == 4)
1913 *value2 = (intptr_t)op2->ui64;
1914 else if(op2->kind == 23 && op2->type->isSigned)
1915 *value2 = (intptr_t)op2->i64;
1916 else if(op2->kind == 23)
1917 *value2 = (intptr_t)op2->ui64;
1918 else if(op2->kind == 22 && op2->type->isSigned)
1919 *value2 = (intptr_t)op2->i64;
1920 else if(op2->kind == 22)
1921 *value2 = (intptr_t)op2->ui64;
1922 else if(op2->kind == 2 && op2->type->isSigned)
1923 *value2 = (intptr_t)op2->s;
1924 else if(op2->kind == 2)
1925 *value2 = (intptr_t)op2->us;
1926 else if(op2->kind == 1 && op2->type->isSigned)
1927 *value2 = (intptr_t)op2->c;
1928 else if(op2->kind == 24 || op2->kind == 1)
1929 *value2 = (intptr_t)op2->uc;
1930 else if(op2->kind == 6)
1931 *value2 = (intptr_t)op2->f;
1932 else if(op2->kind == 7)
1933 *value2 = (intptr_t)op2->d;
1934 else if(op2->kind == 13)
1935 *value2 = (intptr_t)op2->ui64;
1936 else
1937 return 0x0;
1938 return 0x1;
1939 }
1940
1941 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
1942 {
1943 struct Operand op2 = GetOperand(exp);
1944
1945 return GetOpIntPtr(&op2, value2);
1946 }
1947
1948 unsigned int GetOpUIntPtr(struct Operand * op2, uintptr_t * value2)
1949 {
1950 if(op2->kind == 3 && op2->type->isSigned)
1951 *value2 = (uintptr_t)op2->i;
1952 else if(op2->kind == 3)
1953 *value2 = (uintptr_t)op2->ui;
1954 else if(op2->kind == 4 && op2->type->isSigned)
1955 *value2 = (uintptr_t)op2->i64;
1956 else if(op2->kind == 4)
1957 *value2 = (uintptr_t)op2->ui64;
1958 else if(op2->kind == 23 && op2->type->isSigned)
1959 *value2 = (uintptr_t)op2->i64;
1960 else if(op2->kind == 23)
1961 *value2 = (uintptr_t)op2->ui64;
1962 else if(op2->kind == 22 && op2->type->isSigned)
1963 *value2 = (uintptr_t)op2->i64;
1964 else if(op2->kind == 22)
1965 *value2 = (uintptr_t)op2->ui64;
1966 else if(op2->kind == 2 && op2->type->isSigned)
1967 *value2 = (uintptr_t)op2->s;
1968 else if(op2->kind == 2)
1969 *value2 = (uintptr_t)op2->us;
1970 else if(op2->kind == 1 && op2->type->isSigned)
1971 *value2 = (uintptr_t)op2->c;
1972 else if(op2->kind == 24 || op2->kind == 1)
1973 *value2 = (uintptr_t)op2->uc;
1974 else if(op2->kind == 6)
1975 *value2 = (uintptr_t)op2->f;
1976 else if(op2->kind == 7)
1977 *value2 = (uintptr_t)op2->d;
1978 else if(op2->kind == 13)
1979 *value2 = (uintptr_t)op2->ui64;
1980 else
1981 return 0x0;
1982 return 0x1;
1983 }
1984
1985 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
1986 {
1987 struct Operand op2 = GetOperand(exp);
1988
1989 return GetOpUIntPtr(&op2, value2);
1990 }
1991
1992 unsigned int GetOpIntSize(struct Operand * op2, ssize_t * value2)
1993 {
1994 if(op2->kind == 3 && op2->type->isSigned)
1995 *value2 = (ssize_t)op2->i;
1996 else if(op2->kind == 3)
1997 *value2 = (ssize_t)op2->ui;
1998 else if(op2->kind == 4 && op2->type->isSigned)
1999 *value2 = (ssize_t)op2->i64;
2000 else if(op2->kind == 4)
2001 *value2 = (ssize_t)op2->ui64;
2002 else if(op2->kind == 23 && op2->type->isSigned)
2003 *value2 = (ssize_t)op2->i64;
2004 else if(op2->kind == 23)
2005 *value2 = (ssize_t)op2->ui64;
2006 else if(op2->kind == 22 && op2->type->isSigned)
2007 *value2 = (ssize_t)op2->i64;
2008 else if(op2->kind == 22)
2009 *value2 = (ssize_t)op2->ui64;
2010 else if(op2->kind == 2 && op2->type->isSigned)
2011 *value2 = (ssize_t)op2->s;
2012 else if(op2->kind == 2)
2013 *value2 = (ssize_t)op2->us;
2014 else if(op2->kind == 1 && op2->type->isSigned)
2015 *value2 = (ssize_t)op2->c;
2016 else if(op2->kind == 24 || op2->kind == 1)
2017 *value2 = (ssize_t)op2->uc;
2018 else if(op2->kind == 6)
2019 *value2 = (ssize_t)op2->f;
2020 else if(op2->kind == 7)
2021 *value2 = (ssize_t)op2->d;
2022 else if(op2->kind == 13)
2023 *value2 = (ssize_t)op2->ui64;
2024 else
2025 return 0x0;
2026 return 0x1;
2027 }
2028
2029 unsigned int GetIntSize(struct Expression * exp, ssize_t * value2)
2030 {
2031 struct Operand op2 = GetOperand(exp);
2032
2033 return GetOpIntSize(&op2, value2);
2034 }
2035
2036 unsigned int GetOpUIntSize(struct Operand * op2, size_t * value2)
2037 {
2038 if(op2->kind == 3 && op2->type->isSigned)
2039 *value2 = (size_t)op2->i;
2040 else if(op2->kind == 3)
2041 *value2 = (size_t)op2->ui;
2042 else if(op2->kind == 4 && op2->type->isSigned)
2043 *value2 = (size_t)op2->i64;
2044 else if(op2->kind == 4)
2045 *value2 = (size_t)op2->ui64;
2046 else if(op2->kind == 23 && op2->type->isSigned)
2047 *value2 = (size_t)op2->i64;
2048 else if(op2->kind == 23)
2049 *value2 = (size_t)op2->ui64;
2050 else if(op2->kind == 22 && op2->type->isSigned)
2051 *value2 = (size_t)op2->i64;
2052 else if(op2->kind == 22)
2053 *value2 = (size_t)op2->ui64;
2054 else if(op2->kind == 2 && op2->type->isSigned)
2055 *value2 = (size_t)op2->s;
2056 else if(op2->kind == 2)
2057 *value2 = (size_t)op2->us;
2058 else if(op2->kind == 1 && op2->type->isSigned)
2059 *value2 = (size_t)op2->c;
2060 else if(op2->kind == 24 || op2->kind == 1)
2061 *value2 = (size_t)op2->uc;
2062 else if(op2->kind == 6)
2063 *value2 = (size_t)op2->f;
2064 else if(op2->kind == 7)
2065 *value2 = (size_t)op2->d;
2066 else if(op2->kind == 13)
2067 *value2 = (size_t)op2->ui64;
2068 else
2069 return 0x0;
2070 return 0x1;
2071 }
2072
2073 unsigned int GetUIntSize(struct Expression * exp, size_t * value2)
2074 {
2075 struct Operand op2 = GetOperand(exp);
2076
2077 return GetOpUIntSize(&op2, value2);
2078 }
2079
2080 unsigned int GetOpShort(struct Operand * op2, short * value2)
2081 {
2082 if(op2->kind == 3 && op2->type->isSigned)
2083 *value2 = (short)op2->i;
2084 else if(op2->kind == 3)
2085 *value2 = (short)op2->ui;
2086 else if(op2->kind == 4 && op2->type->isSigned)
2087 *value2 = (short)op2->i64;
2088 else if(op2->kind == 4)
2089 *value2 = (short)op2->ui64;
2090 else if(op2->kind == 23 && op2->type->isSigned)
2091 *value2 = (short)op2->i64;
2092 else if(op2->kind == 23)
2093 *value2 = (short)op2->ui64;
2094 else if(op2->kind == 22 && op2->type->isSigned)
2095 *value2 = (short)op2->i64;
2096 else if(op2->kind == 22)
2097 *value2 = (short)op2->ui64;
2098 else if(op2->kind == 2 && op2->type->isSigned)
2099 *value2 = op2->s;
2100 else if(op2->kind == 2)
2101 *value2 = (short)op2->us;
2102 else if(op2->kind == 1 && op2->type->isSigned)
2103 *value2 = (short)op2->c;
2104 else if(op2->kind == 24 || op2->kind == 1)
2105 *value2 = (short)op2->uc;
2106 else if(op2->kind == 6)
2107 *value2 = (short)op2->f;
2108 else if(op2->kind == 7)
2109 *value2 = (short)op2->d;
2110 else if(op2->kind == 13)
2111 *value2 = (short)op2->ui64;
2112 else
2113 return 0x0;
2114 return 0x1;
2115 }
2116
2117 unsigned int GetShort(struct Expression * exp, short * value2)
2118 {
2119 struct Operand op2 = GetOperand(exp);
2120
2121 return GetOpShort(&op2, value2);
2122 }
2123
2124 unsigned int GetOpUShort(struct Operand * op2, unsigned short * value2)
2125 {
2126 if(op2->kind == 3 && op2->type->isSigned)
2127 *value2 = (unsigned short)op2->i;
2128 else if(op2->kind == 3)
2129 *value2 = (unsigned short)op2->ui;
2130 else if(op2->kind == 4 && op2->type->isSigned)
2131 *value2 = (unsigned short)op2->i64;
2132 else if(op2->kind == 4)
2133 *value2 = (unsigned short)op2->ui64;
2134 else if(op2->kind == 23 && op2->type->isSigned)
2135 *value2 = (unsigned short)op2->i64;
2136 else if(op2->kind == 23)
2137 *value2 = (unsigned short)op2->ui64;
2138 else if(op2->kind == 22 && op2->type->isSigned)
2139 *value2 = (unsigned short)op2->i64;
2140 else if(op2->kind == 22)
2141 *value2 = (unsigned short)op2->ui64;
2142 else if(op2->kind == 2 && op2->type->isSigned)
2143 *value2 = (unsigned short)op2->s;
2144 else if(op2->kind == 2)
2145 *value2 = op2->us;
2146 else if(op2->kind == 1 && op2->type->isSigned)
2147 *value2 = (unsigned short)op2->c;
2148 else if(op2->kind == 24 || op2->kind == 1)
2149 *value2 = (unsigned short)op2->uc;
2150 else if(op2->kind == 6)
2151 *value2 = (unsigned short)op2->f;
2152 else if(op2->kind == 7)
2153 *value2 = (unsigned short)op2->d;
2154 else if(op2->kind == 13)
2155 *value2 = (unsigned short)op2->ui64;
2156 else
2157 return 0x0;
2158 return 0x1;
2159 }
2160
2161 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
2162 {
2163 struct Operand op2 = GetOperand(exp);
2164
2165 return GetOpUShort(&op2, value2);
2166 }
2167
2168 unsigned int GetOpChar(struct Operand * op2, char * value2)
2169 {
2170 if(op2->kind == 3 && op2->type->isSigned)
2171 *value2 = (char)op2->i;
2172 else if(op2->kind == 3)
2173 *value2 = (char)op2->ui;
2174 else if(op2->kind == 4 && op2->type->isSigned)
2175 *value2 = (char)op2->i64;
2176 else if(op2->kind == 4)
2177 *value2 = (char)op2->ui64;
2178 else if(op2->kind == 23 && op2->type->isSigned)
2179 *value2 = (char)op2->i64;
2180 else if(op2->kind == 23)
2181 *value2 = (char)op2->ui64;
2182 else if(op2->kind == 22 && op2->type->isSigned)
2183 *value2 = (char)op2->i64;
2184 else if(op2->kind == 22)
2185 *value2 = (char)op2->ui64;
2186 else if(op2->kind == 2 && op2->type->isSigned)
2187 *value2 = (char)op2->s;
2188 else if(op2->kind == 2)
2189 *value2 = (char)op2->us;
2190 else if(op2->kind == 1 && op2->type->isSigned)
2191 *value2 = op2->c;
2192 else if(op2->kind == 24 || op2->kind == 1)
2193 *value2 = (char)op2->uc;
2194 else if(op2->kind == 6)
2195 *value2 = (char)op2->f;
2196 else if(op2->kind == 7)
2197 *value2 = (char)op2->d;
2198 else if(op2->kind == 13)
2199 *value2 = (char)op2->ui64;
2200 else
2201 return 0x0;
2202 return 0x1;
2203 }
2204
2205 unsigned int GetChar(struct Expression * exp, char * value2)
2206 {
2207 struct Operand op2 = GetOperand(exp);
2208
2209 return GetOpChar(&op2, value2);
2210 }
2211
2212 unsigned int GetOpUChar(struct Operand * op2, unsigned char * value2)
2213 {
2214 if(op2->kind == 3 && op2->type->isSigned)
2215 *value2 = (unsigned char)op2->i;
2216 else if(op2->kind == 3)
2217 *value2 = (unsigned char)op2->ui;
2218 else if(op2->kind == 4 && op2->type->isSigned)
2219 *value2 = (unsigned char)op2->i64;
2220 else if(op2->kind == 4)
2221 *value2 = (unsigned char)op2->ui64;
2222 else if(op2->kind == 23 && op2->type->isSigned)
2223 *value2 = (unsigned char)op2->i64;
2224 else if(op2->kind == 23)
2225 *value2 = (unsigned char)op2->ui64;
2226 else if(op2->kind == 22 && op2->type->isSigned)
2227 *value2 = (unsigned char)op2->i64;
2228 else if(op2->kind == 22)
2229 *value2 = (unsigned char)op2->ui64;
2230 else if(op2->kind == 2 && op2->type->isSigned)
2231 *value2 = (unsigned char)op2->s;
2232 else if(op2->kind == 2)
2233 *value2 = (unsigned char)op2->us;
2234 else if(op2->kind == 1 && op2->type->isSigned)
2235 *value2 = (unsigned char)op2->c;
2236 else if(op2->kind == 24 || op2->kind == 1)
2237 *value2 = op2->uc;
2238 else if(op2->kind == 6)
2239 *value2 = (unsigned char)op2->f;
2240 else if(op2->kind == 7)
2241 *value2 = (unsigned char)op2->d;
2242 else if(op2->kind == 13)
2243 *value2 = (unsigned char)op2->ui64;
2244 else
2245 return 0x0;
2246 return 0x1;
2247 }
2248
2249 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
2250 {
2251 struct Operand op2 = GetOperand(exp);
2252
2253 return GetOpUChar(&op2, value2);
2254 }
2255
2256 unsigned int GetOpFloat(struct Operand * op2, float * value2)
2257 {
2258 if(op2->kind == 3 && op2->type->isSigned)
2259 *value2 = (float)(float)op2->i;
2260 else if(op2->kind == 3)
2261 *value2 = (float)(float)op2->ui;
2262 else if(op2->kind == 4 && op2->type->isSigned)
2263 *value2 = (float)(float)op2->i64;
2264 else if(op2->kind == 4)
2265 *value2 = (float)(float)op2->ui64;
2266 else if(op2->kind == 23 && op2->type->isSigned)
2267 *value2 = (float)(float)op2->i64;
2268 else if(op2->kind == 23)
2269 *value2 = (float)(float)op2->ui64;
2270 else if(op2->kind == 22 && op2->type->isSigned)
2271 *value2 = (float)(float)op2->i64;
2272 else if(op2->kind == 22)
2273 *value2 = (float)(float)op2->ui64;
2274 else if(op2->kind == 2 && op2->type->isSigned)
2275 *value2 = (float)(float)op2->s;
2276 else if(op2->kind == 2)
2277 *value2 = (float)(float)op2->us;
2278 else if(op2->kind == 1 && op2->type->isSigned)
2279 *value2 = (float)(float)op2->c;
2280 else if(op2->kind == 24 || op2->kind == 1)
2281 *value2 = (float)(float)op2->uc;
2282 else if(op2->kind == 6)
2283 *value2 = (float)op2->f;
2284 else if(op2->kind == 7)
2285 *value2 = (float)op2->d;
2286 else if(op2->kind == 13)
2287 *value2 = (float)(float)op2->ui64;
2288 else
2289 return 0x0;
2290 return 0x1;
2291 }
2292
2293 unsigned int GetFloat(struct Expression * exp, float * value2)
2294 {
2295 struct Operand op2 = GetOperand(exp);
2296
2297 return GetOpFloat(&op2, value2);
2298 }
2299
2300 unsigned int GetOpDouble(struct Operand * op2, double * value2)
2301 {
2302 if(op2->kind == 3 && op2->type->isSigned)
2303 *value2 = (double)(double)op2->i;
2304 else if(op2->kind == 3)
2305 *value2 = (double)(double)op2->ui;
2306 else if(op2->kind == 4 && op2->type->isSigned)
2307 *value2 = (double)(double)op2->i64;
2308 else if(op2->kind == 4)
2309 *value2 = (double)(double)op2->ui64;
2310 else if(op2->kind == 23 && op2->type->isSigned)
2311 *value2 = (double)(double)op2->i64;
2312 else if(op2->kind == 23)
2313 *value2 = (double)(double)op2->ui64;
2314 else if(op2->kind == 22 && op2->type->isSigned)
2315 *value2 = (double)(double)op2->i64;
2316 else if(op2->kind == 22)
2317 *value2 = (double)(double)op2->ui64;
2318 else if(op2->kind == 2 && op2->type->isSigned)
2319 *value2 = (double)(double)op2->s;
2320 else if(op2->kind == 2)
2321 *value2 = (double)(double)op2->us;
2322 else if(op2->kind == 1 && op2->type->isSigned)
2323 *value2 = (double)(double)op2->c;
2324 else if(op2->kind == 24 || op2->kind == 1)
2325 *value2 = (double)(double)op2->uc;
2326 else if(op2->kind == 6)
2327 *value2 = (double)op2->f;
2328 else if(op2->kind == 7)
2329 *value2 = (double)op2->d;
2330 else if(op2->kind == 13)
2331 *value2 = (double)(double)op2->ui64;
2332 else
2333 return 0x0;
2334 return 0x1;
2335 }
2336
2337 unsigned int GetDouble(struct Expression * exp, double * value2)
2338 {
2339 struct Operand op2 = GetOperand(exp);
2340
2341 return GetOpDouble(&op2, value2);
2342 }
2343
2344 void ComputeExpression(struct Expression * exp);
2345
2346 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2347
2348 extern int targetBits;
2349
2350 int ComputeTypeSize(struct Type * type);
2351
2352 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2353
2354 struct __ecereNameSpace__ecere__com__BitMember
2355 {
2356 struct __ecereNameSpace__ecere__com__BitMember * prev;
2357 struct __ecereNameSpace__ecere__com__BitMember * next;
2358 char *  name;
2359 unsigned int isProperty;
2360 int memberAccess;
2361 int id;
2362 struct __ecereNameSpace__ecere__com__Class * _class;
2363 char *  dataTypeString;
2364 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2365 struct Type * dataType;
2366 int type;
2367 int size;
2368 int pos;
2369 uint64 mask;
2370 } __attribute__ ((gcc_struct));
2371
2372 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2373
2374 struct __ecereNameSpace__ecere__sys__OldLink
2375 {
2376 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2377 struct __ecereNameSpace__ecere__sys__OldLink * next;
2378 void *  data;
2379 } __attribute__ ((gcc_struct));
2380
2381 void FinishTemplatesContext(struct Context * context);
2382
2383 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2384 {
2385 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2386 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2387
2388 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))
2389 {
2390 int c;
2391 int unionMemberOffset = 0;
2392 int bitFields = 0;
2393
2394 if(member)
2395 {
2396 member->memberOffset = 0;
2397 if(targetBits < sizeof(void *) * 8)
2398 member->structAlignment = 0;
2399 }
2400 else if(targetBits < sizeof(void *) * 8)
2401 _class->structAlignment = 0;
2402 if(!member && ((_class->type == 0 || _class->type == 5) || (_class->type == 1 && _class->memberOffset && _class->memberOffset > _class->base->structSize)))
2403 _class->memberOffset = (_class->base && _class->type == 1) ? _class->base->structSize : 0;
2404 if(!member && _class->destructionWatchOffset)
2405 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2406 {
2407 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2408
2409 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2410 {
2411 if(!dataMember->isProperty)
2412 {
2413 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2414 {
2415 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
2416 }
2417 }
2418 }
2419 }
2420 {
2421 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2422
2423 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2424 {
2425 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2426 {
2427 if(!isMember && _class->type == 2 && dataMember->dataType)
2428 {
2429 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2430 uint64 mask = 0;
2431 int d;
2432
2433 ComputeTypeSize(dataMember->dataType);
2434 if(bitMember->pos == -1)
2435 bitMember->pos = _class->memberOffset;
2436 if(!bitMember->size)
2437 bitMember->size = dataMember->dataType->size * 8;
2438 _class->memberOffset = bitMember->pos + bitMember->size;
2439 for(d = 0; d < bitMember->size; d++)
2440 {
2441 if(d)
2442 mask <<= 1;
2443 mask |= 1;
2444 }
2445 bitMember->mask = mask << bitMember->pos;
2446 }
2447 else if(dataMember->type == 0 && dataMember->dataType)
2448 {
2449 int size;
2450 int alignment = 0;
2451
2452 if(dataMember->dataType->kind != 8 || ((!dataMember->dataType->_class || !dataMember->dataType->_class->registered || dataMember->dataType->_class->registered != _class || _class->type != 1)))
2453 ComputeTypeSize(dataMember->dataType);
2454 if(dataMember->dataType->bitFieldCount)
2455 {
2456 bitFields += dataMember->dataType->bitFieldCount;
2457 size = 0;
2458 }
2459 else
2460 {
2461 if(bitFields)
2462 {
2463 int size = (bitFields + 7) / 8;
2464
2465 if(isMember)
2466 {
2467 int __simpleStruct0;
2468
2469 if(alignment)
2470 {
2471 int __simpleStruct0;
2472
2473 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2474 if(member->memberOffset % alignment)
2475 member->memberOffset += alignment - (member->memberOffset % alignment);
2476 }
2477 dataMember->offset = member->memberOffset;
2478 if(member->type == 1)
2479 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2480 else
2481 {
2482 member->memberOffset += size;
2483 }
2484 }
2485 else
2486 {
2487 if(alignment)
2488 {
2489 int __simpleStruct0;
2490
2491 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2492 if(_class->memberOffset % alignment)
2493 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2494 }
2495 dataMember->offset = _class->memberOffset;
2496 _class->memberOffset += size;
2497 }
2498 bitFields = 0;
2499 }
2500 size = dataMember->dataType->size;
2501 alignment = dataMember->dataType->alignment;
2502 }
2503 if(isMember)
2504 {
2505 int __simpleStruct0;
2506
2507 if(alignment)
2508 {
2509 int __simpleStruct0;
2510
2511 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2512 if(member->memberOffset % alignment)
2513 member->memberOffset += alignment - (member->memberOffset % alignment);
2514 }
2515 dataMember->offset = member->memberOffset;
2516 if(member->type == 1)
2517 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2518 else
2519 {
2520 member->memberOffset += size;
2521 }
2522 }
2523 else
2524 {
2525 if(alignment)
2526 {
2527 int __simpleStruct0;
2528
2529 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2530 if(_class->memberOffset % alignment)
2531 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2532 }
2533 dataMember->offset = _class->memberOffset;
2534 _class->memberOffset += size;
2535 }
2536 }
2537 else
2538 {
2539 int alignment;
2540
2541 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 0x1);
2542 alignment = dataMember->structAlignment;
2543 if(isMember)
2544 {
2545 int __simpleStruct0;
2546
2547 if(alignment)
2548 {
2549 int __simpleStruct0;
2550
2551 if(member->memberOffset % alignment)
2552 member->memberOffset += alignment - (member->memberOffset % alignment);
2553 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2554 }
2555 dataMember->offset = member->memberOffset;
2556 if(member->type == 1)
2557 unionMemberOffset = (__simpleStruct0 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2558 else
2559 member->memberOffset += dataMember->memberOffset;
2560 }
2561 else
2562 {
2563 if(alignment)
2564 {
2565 int __simpleStruct0;
2566
2567 if(_class->memberOffset % alignment)
2568 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2569 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2570 }
2571 dataMember->offset = _class->memberOffset;
2572 _class->memberOffset += dataMember->memberOffset;
2573 }
2574 }
2575 }
2576 }
2577 if(bitFields)
2578 {
2579 int alignment = 0;
2580 int size = (bitFields + 7) / 8;
2581
2582 if(isMember)
2583 {
2584 int __simpleStruct0;
2585
2586 if(alignment)
2587 {
2588 int __simpleStruct0;
2589
2590 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2591 if(member->memberOffset % alignment)
2592 member->memberOffset += alignment - (member->memberOffset % alignment);
2593 }
2594 if(member->type == 1)
2595 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2596 else
2597 {
2598 member->memberOffset += size;
2599 }
2600 }
2601 else
2602 {
2603 if(alignment)
2604 {
2605 int __simpleStruct0;
2606
2607 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2608 if(_class->memberOffset % alignment)
2609 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2610 }
2611 _class->memberOffset += size;
2612 }
2613 bitFields = 0;
2614 }
2615 }
2616 if(member && member->type == 1)
2617 {
2618 member->memberOffset = unionMemberOffset;
2619 }
2620 if(!isMember)
2621 {
2622 if(_class->type != 2)
2623 {
2624 int extra = 0;
2625
2626 if(_class->structAlignment)
2627 {
2628 if(_class->memberOffset % _class->structAlignment)
2629 extra += _class->structAlignment - (_class->memberOffset % _class->structAlignment);
2630 }
2631 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset + extra;
2632 if(!member)
2633 {
2634 struct __ecereNameSpace__ecere__com__Property * prop;
2635
2636 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2637 {
2638 if(prop->isProperty && prop->isWatchable)
2639 {
2640 prop->watcherOffset = _class->structSize;
2641 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2642 }
2643 }
2644 }
2645 {
2646 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2647
2648 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2649 {
2650 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2651
2652 if(deriv->computeSize)
2653 {
2654 deriv->offset = _class->structSize;
2655 deriv->memberOffset = 0;
2656 deriv->structSize = deriv->offset;
2657 ComputeClassMembers(deriv, 0x0);
2658 }
2659 }
2660 }
2661 }
2662 }
2663 }
2664 if(context)
2665 FinishTemplatesContext(context);
2666 }
2667
2668 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2669
2670 struct __ecereNameSpace__ecere__com__NameSpace
2671 {
2672 char *  name;
2673 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
2674 struct __ecereNameSpace__ecere__com__NameSpace *  left;
2675 struct __ecereNameSpace__ecere__com__NameSpace *  right;
2676 int depth;
2677 struct __ecereNameSpace__ecere__com__NameSpace *  parent;
2678 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2679 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2680 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2681 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2682 } __attribute__ ((gcc_struct));
2683
2684 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2685
2686 struct __ecereNameSpace__ecere__com__Module
2687 {
2688 struct __ecereNameSpace__ecere__com__Instance * application;
2689 struct __ecereNameSpace__ecere__sys__OldList classes;
2690 struct __ecereNameSpace__ecere__sys__OldList defines;
2691 struct __ecereNameSpace__ecere__sys__OldList functions;
2692 struct __ecereNameSpace__ecere__sys__OldList modules;
2693 struct __ecereNameSpace__ecere__com__Instance * prev;
2694 struct __ecereNameSpace__ecere__com__Instance * next;
2695 char *  name;
2696 void *  library;
2697 void *  Unload;
2698 int importType;
2699 int origImportType;
2700 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2701 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2702 } __attribute__ ((gcc_struct));
2703
2704 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2705 {
2706 struct __ecereNameSpace__ecere__com__Class * _class;
2707 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2708
2709 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
2710 ComputeModuleClasses(subModule->data);
2711 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->classes.first; _class; _class = _class->next)
2712 ComputeClassMembers(_class, 0x0);
2713 }
2714
2715 extern unsigned int inCompiler;
2716
2717 extern void Compiler_Error(char *  format, ...);
2718
2719 extern char *  __ecereNameSpace__ecere__GetTranslatedString(char * name, char *  string, char *  stringAndContext);
2720
2721 int ComputeTypeSize(struct Type * type)
2722 {
2723 unsigned int size = type ? type->size : 0;
2724
2725 if(!size && type && !type->computing)
2726 {
2727 type->computing = 0x1;
2728 switch(type->kind)
2729 {
2730 case 24:
2731 type->alignment = size = sizeof(char);
2732 break;
2733 case 1:
2734 type->alignment = size = sizeof(char);
2735 break;
2736 case 3:
2737 type->alignment = size = sizeof(int);
2738 break;
2739 case 4:
2740 type->alignment = size = sizeof(long long);
2741 break;
2742 case 22:
2743 type->alignment = size = targetBits / 8;
2744 break;
2745 case 23:
2746 type->alignment = size = targetBits / 8;
2747 break;
2748 case 5:
2749 type->alignment = size = sizeof(long);
2750 break;
2751 case 2:
2752 type->alignment = size = sizeof(short);
2753 break;
2754 case 6:
2755 type->alignment = size = sizeof(float);
2756 break;
2757 case 7:
2758 type->alignment = size = sizeof(double);
2759 break;
2760 case 8:
2761 {
2762 struct __ecereNameSpace__ecere__com__Class * _class = type->_class ? type->_class->registered : (((void *)0));
2763
2764 if(_class && _class->type == 1)
2765 {
2766 ComputeClassMembers(_class, 0x0);
2767 type->alignment = _class->structAlignment;
2768 size = _class->structSize;
2769 if(type->alignment && size % type->alignment)
2770 size += type->alignment - (size % type->alignment);
2771 }
2772 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2773 {
2774 if(!_class->dataType)
2775 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2776 size = type->alignment = ComputeTypeSize(_class->dataType);
2777 }
2778 else
2779 size = type->alignment = targetBits / 8;
2780 break;
2781 }
2782 case 13:
2783 case 19:
2784 size = type->alignment = targetBits / 8;
2785 break;
2786 case 12:
2787 if(type->arraySizeExp)
2788 {
2789 ProcessExpressionType(type->arraySizeExp);
2790 ComputeExpression(type->arraySizeExp);
2791 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)))
2792 {
2793 struct Location oldLoc = yylloc;
2794 char expression[10240];
2795
2796 expression[0] = '\0';
2797 type->arraySizeExp->expType = (((void *)0));
2798 yylloc = type->arraySizeExp->loc;
2799 if(inCompiler)
2800 PrintExpression(type->arraySizeExp, expression);
2801 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Array size not constant int (%s)\n", (((void *)0))), expression);
2802 yylloc = oldLoc;
2803 }
2804 GetInt(type->arraySizeExp, &type->arraySize);
2805 }
2806 else if(type->enumClass)
2807 {
2808 if(type->enumClass && type->enumClass->registered && type->enumClass->registered->type == 4)
2809 {
2810 type->arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->enumClass->registered, "enumSize");
2811 }
2812 else
2813 type->arraySize = 0;
2814 }
2815 else
2816 {
2817 type->arraySize = 0;
2818 }
2819 size = ComputeTypeSize(type->type) * type->arraySize;
2820 if(type->type)
2821 type->alignment = type->type->alignment;
2822 break;
2823 case 9:
2824 {
2825 struct Type * member;
2826
2827 for(member = type->members.first; member; member = member->next)
2828 {
2829 int __simpleStruct0, __simpleStruct1;
2830 unsigned int addSize = ComputeTypeSize(member);
2831
2832 member->offset = size;
2833 if(member->alignment && size % member->alignment)
2834 member->offset += member->alignment - (size % member->alignment);
2835 size = member->offset;
2836 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2837 size += addSize;
2838 }
2839 if(type->alignment && size % type->alignment)
2840 size += type->alignment - (size % type->alignment);
2841 break;
2842 }
2843 case 10:
2844 {
2845 struct Type * member;
2846
2847 for(member = type->members.first; member; member = member->next)
2848 {
2849 int __simpleStruct0, __simpleStruct1;
2850 unsigned int addSize = ComputeTypeSize(member);
2851
2852 member->offset = size;
2853 if(member->alignment && size % member->alignment)
2854 member->offset += member->alignment - (size % member->alignment);
2855 size = member->offset;
2856 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2857 size = ((size > addSize) ? size : addSize);
2858 }
2859 if(type->alignment && size % type->alignment)
2860 size += type->alignment - (size % type->alignment);
2861 break;
2862 }
2863 case 20:
2864 {
2865 struct TemplateParameter * param = type->templateParameter;
2866 struct Type * baseType = ProcessTemplateParameterType(param);
2867
2868 if(baseType)
2869 {
2870 size = ComputeTypeSize(baseType);
2871 type->alignment = baseType->alignment;
2872 }
2873 else
2874 type->alignment = size = sizeof(uint64);
2875 break;
2876 }
2877 case 15:
2878 {
2879 type->alignment = size = sizeof(enum
2880 {
2881 test
2882 });
2883 break;
2884 }
2885 case 21:
2886 {
2887 type->alignment = size = targetBits / 8;
2888 break;
2889 }
2890 }
2891 type->size = size;
2892 type->computing = 0x0;
2893 }
2894 return size;
2895 }
2896
2897 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2898
2899 extern struct Identifier * MkIdentifier(char *  string);
2900
2901 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void *  item);
2902
2903 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2904
2905 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2906
2907 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2908
2909 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2910
2911 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2912
2913 extern void FreeType(struct Type * type);
2914
2915 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2916
2917 extern struct Specifier * MkSpecifier(int specifier);
2918
2919 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2920
2921 extern struct Expression * MkExpConstant(char *  string);
2922
2923 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)
2924 {
2925 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2926 unsigned int totalSize = 0;
2927 unsigned int maxSize = 0;
2928 int alignment, size;
2929 struct __ecereNameSpace__ecere__com__DataMember * member;
2930 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2931
2932 if(addedPadding)
2933 *addedPadding = 0x0;
2934 if(!isMember && _class->base)
2935 {
2936 maxSize = _class->structSize;
2937 {
2938 if(_class->type == 1 || _class->type == 5)
2939 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass, (((void *)0)));
2940 else
2941 {
2942 unsigned int baseSize = _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2943
2944 if(maxSize > baseSize)
2945 maxSize -= baseSize;
2946 else
2947 maxSize = 0;
2948 }
2949 }
2950 }
2951 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2952 {
2953 if(!member->isProperty)
2954 {
2955 switch(member->type)
2956 {
2957 case 0:
2958 {
2959 if(member->dataTypeString)
2960 {
2961 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2962 struct Declarator * decl;
2963
2964 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2965 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2966 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2967 if(!member->dataType)
2968 member->dataType = ProcessType(specs, decl);
2969 ReplaceThisClassSpecifiers(specs, topClass);
2970 {
2971 struct Type * type = ProcessType(specs, decl);
2972
2973 DeclareType(member->dataType, 0x0, 0x0);
2974 FreeType(type);
2975 }
2976 ComputeTypeSize(member->dataType);
2977 size = member->dataType->size;
2978 alignment = member->dataType->alignment;
2979 if(alignment)
2980 {
2981 if(totalSize % alignment)
2982 totalSize += alignment - (totalSize % alignment);
2983 }
2984 totalSize += size;
2985 }
2986 break;
2987 }
2988 case 1:
2989 case 2:
2990 {
2991 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
2992
2993 size = 0;
2994 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass, (((void *)0)));
2995 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
2996 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, (((void *)0)), (((void *)0)))));
2997 alignment = member->structAlignment;
2998 if(alignment)
2999 {
3000 if(totalSize % alignment)
3001 totalSize += alignment - (totalSize % alignment);
3002 }
3003 totalSize += size;
3004 break;
3005 }
3006 }
3007 }
3008 }
3009 if(retSize)
3010 {
3011 unsigned int __simpleStruct0;
3012
3013 if(topMember && topMember->type == 1)
3014 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
3015 else
3016 *retSize += totalSize;
3017 }
3018 else if(totalSize < maxSize && _class->type != 1000)
3019 {
3020 int autoPadding = 0;
3021
3022 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
3023 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
3024 if(totalSize + autoPadding < maxSize)
3025 {
3026 char sizeString[50];
3027
3028 sprintf(sizeString, "%d", maxSize - totalSize);
3029 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
3030 if(addedPadding)
3031 *addedPadding = 0x1;
3032 }
3033 }
3034 if(context)
3035 FinishTemplatesContext(context);
3036 return topMember ? topMember->memberID : _class->memberID;
3037 }
3038
3039 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
3040 {
3041 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
3042 unsigned int totalSize = 0;
3043 struct __ecereNameSpace__ecere__com__DataMember * member;
3044 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
3045
3046 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
3047 DeclareMembers(_class->base, 0x0);
3048 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
3049 {
3050 if(!member->isProperty)
3051 {
3052 switch(member->type)
3053 {
3054 case 0:
3055 {
3056 if(!member->dataType && member->dataTypeString)
3057 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
3058 if(member->dataType)
3059 DeclareType(member->dataType, 0x0, 0x0);
3060 break;
3061 }
3062 case 1:
3063 case 2:
3064 {
3065 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
3066 break;
3067 }
3068 }
3069 }
3070 }
3071 if(context)
3072 FinishTemplatesContext(context);
3073 return topMember ? topMember->memberID : _class->memberID;
3074 }
3075
3076 extern struct Symbol * FindClass(char *  name);
3077
3078 extern char *  strchr(const char * , int);
3079
3080 extern void FullClassNameCat(char *  output, char *  className, unsigned int includeTemplateParams);
3081
3082 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (*  FreeFunction)(void * ));
3083
3084 extern void FreeClassDef(struct ClassDef * def);
3085
3086 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
3087
3088 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
3089
3090 extern void MangleClassName(char *  className);
3091
3092 extern void DeclareClass(struct Symbol * classSym, char *  className);
3093
3094 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item, void *  prevItem);
3095
3096 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void *  prevItem, void *  item);
3097
3098 void DeclareStruct(char * name, unsigned int skipNoHead)
3099 {
3100 struct External * external = (((void *)0));
3101 struct Symbol * classSym = FindClass(name);
3102
3103 if(!inCompiler || !classSym)
3104 return ;
3105 if(classSym->registered && (classSym->registered->type == 2 || classSym->registered->type == 3 || classSym->registered->type == 4))
3106 return ;
3107 if(classSym->registered && classSym->imported && !classSym->declaredStructSym)
3108 {
3109 struct Declaration * decl;
3110 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3111 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
3112 char structName[1024];
3113
3114 external = (classSym->registered && classSym->registered->type == 1) ? classSym->pointerExternal : classSym->structExternal;
3115 classSym->declaring++;
3116 if(strchr(classSym->string, '<'))
3117 {
3118 if(classSym->registered->templateClass)
3119 {
3120 DeclareStruct(classSym->registered->templateClass->fullName, skipNoHead);
3121 classSym->declaring--;
3122 }
3123 return ;
3124 }
3125 DeclareMembers(classSym->registered, 0x0);
3126 structName[0] = (char)0;
3127 FullClassNameCat(structName, name, 0x0);
3128 if(!skipNoHead)
3129 {
3130 unsigned int addedPadding = 0x0;
3131
3132 classSym->declaredStructSym = 0x1;
3133 declarations = MkList();
3134 AddMembers(declarations, classSym->registered, 0x0, (((void *)0)), classSym->registered, &addedPadding);
3135 if(!(*declarations).count || ((*declarations).count == 1 && addedPadding))
3136 {
3137 FreeList(declarations, FreeClassDef);
3138 declarations = (((void *)0));
3139 }
3140 }
3141 if(skipNoHead || declarations)
3142 {
3143 if(external && external->declaration)
3144 {
3145 ((struct Specifier *)(*external->declaration->specifiers).first)->definitions = declarations;
3146 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3147 {
3148 if(classSym->structExternal)
3149 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3150 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3151 classSym->id = curExternal->symbol->idCode;
3152 classSym->idCode = curExternal->symbol->idCode;
3153 }
3154 }
3155 else
3156 {
3157 if(!external)
3158 external = MkExternalDeclaration((((void *)0)));
3159 specifiers = MkList();
3160 declarators = MkList();
3161 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
3162 external->declaration = decl = MkDeclaration(specifiers, declarators);
3163 if(decl->symbol && !decl->symbol->pointerExternal)
3164 decl->symbol->pointerExternal = external;
3165 if(classSym->registered && classSym->registered->type == 1)
3166 {
3167 char className[1024];
3168
3169 strcpy(className, "__ecereClass_");
3170 FullClassNameCat(className, classSym->string, 0x1);
3171 MangleClassName(className);
3172 DeclareClass(classSym, className);
3173 external->symbol = classSym;
3174 classSym->pointerExternal = external;
3175 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3176 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3177 }
3178 else
3179 {
3180 char className[1024];
3181
3182 strcpy(className, "__ecereClass_");
3183 FullClassNameCat(className, classSym->string, 0x1);
3184 MangleClassName(className);
3185 classSym->structExternal = external;
3186 DeclareClass(classSym, className);
3187 external->symbol = classSym;
3188 }
3189 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
3190 }
3191 }
3192 classSym->declaring--;
3193 }
3194 else if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3195 {
3196 classSym->declaring++;
3197 {
3198 if(classSym->registered)
3199 DeclareMembers(classSym->registered, 0x0);
3200 }
3201 if(classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 5))
3202 {
3203 if(classSym->structExternal)
3204 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3205 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3206 classSym->id = curExternal->symbol->idCode;
3207 classSym->idCode = curExternal->symbol->idCode;
3208 }
3209 classSym->declaring--;
3210 }
3211 }
3212
3213 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
3214
3215 extern struct ModuleImport * mainModule;
3216
3217 extern struct Specifier * MkSpecifierName(char *  name);
3218
3219 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
3220
3221 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
3222
3223 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
3224
3225 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
3226
3227 extern void FreeDeclarator(struct Declarator * decl);
3228
3229 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
3230
3231 struct PropertyImport
3232 {
3233 struct PropertyImport * prev;
3234 struct PropertyImport * next;
3235 char *  name;
3236 unsigned int isVirtual;
3237 unsigned int hasSet;
3238 unsigned int hasGet;
3239 } __attribute__ ((gcc_struct));
3240
3241 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
3242
3243 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
3244 {
3245 struct Symbol * symbol = prop->symbol;
3246 char propName[1024];
3247
3248 strcpy(setName, "__ecereProp_");
3249 FullClassNameCat(setName, prop->_class->fullName, 0x0);
3250 strcat(setName, "_Set_");
3251 FullClassNameCat(setName, prop->name, 0x1);
3252 strcpy(getName, "__ecereProp_");
3253 FullClassNameCat(getName, prop->_class->fullName, 0x0);
3254 strcat(getName, "_Get_");
3255 FullClassNameCat(getName, prop->name, 0x1);
3256 strcpy(propName, "__ecereProp_");
3257 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3258 strcat(propName, "_");
3259 FullClassNameCat(propName, prop->name, 0x1);
3260 MangleClassName(getName);
3261 MangleClassName(setName);
3262 MangleClassName(propName);
3263 if(prop->_class->type == 1)
3264 DeclareStruct(prop->_class->fullName, 0x0);
3265 if(!symbol || curExternal->symbol->idCode < symbol->id)
3266 {
3267 unsigned int imported = 0x0;
3268 unsigned int dllImport = 0x0;
3269
3270 if(!symbol || symbol->_import)
3271 {
3272 if(!symbol)
3273 {
3274 struct Symbol * classSym;
3275
3276 if(!prop->_class->symbol)
3277 prop->_class->symbol = FindClass(prop->_class->fullName);
3278 classSym = prop->_class->symbol;
3279 if(classSym && !classSym->_import)
3280 {
3281 struct ModuleImport * module;
3282
3283 if(prop->_class->module)
3284 module = FindModule(prop->_class->module);
3285 else
3286 module = mainModule;
3287 classSym->_import = __extension__ ({
3288 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
3289
3290 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
3291 });
3292 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3293 }
3294 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3295 symbol->_import = (struct ClassImport *)__extension__ ({
3296 struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
3297
3298 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0x0, __ecereInstance1->hasSet = prop->Set ? 0x1 : 0x0, __ecereInstance1->hasGet = prop->Get ? 0x1 : 0x0, __ecereInstance1;
3299 });
3300 if(classSym)
3301 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3302 }
3303 imported = 0x1;
3304 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)
3305 dllImport = 0x1;
3306 }
3307 if(!symbol->type)
3308 {
3309 struct Context * context = SetupTemplatesContext(prop->_class);
3310
3311 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
3312 FinishTemplatesContext(context);
3313 }
3314 if(prop->Get)
3315 {
3316 if(!symbol->externalGet || symbol->externalGet->type == 0)
3317 {
3318 struct Declaration * decl;
3319 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3320 struct Declarator * d;
3321 struct __ecereNameSpace__ecere__sys__OldList * params;
3322 struct Specifier * spec;
3323 struct External * external;
3324 struct Declarator * typeDecl;
3325 unsigned int simple = 0x0;
3326
3327 specifiers = MkList();
3328 declarators = MkList();
3329 params = MkList();
3330 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3331 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3332 if(dllImport)
3333 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3334 {
3335 struct Context * context = SetupTemplatesContext(prop->_class);
3336
3337 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3338 FinishTemplatesContext(context);
3339 }
3340 for(spec = (*specifiers).first; spec; spec = spec->next)
3341 {
3342 if(spec->type == 1)
3343 {
3344 if((!typeDecl || typeDecl->type == 1))
3345 {
3346 struct Symbol * classSym = spec->symbol;
3347
3348 symbol->_class = classSym->registered;
3349 if(classSym->registered && classSym->registered->type == 1)
3350 {
3351 DeclareStruct(spec->name, 0x0);
3352 simple = 0x1;
3353 }
3354 }
3355 }
3356 }
3357 if(!simple)
3358 d = PlugDeclarator(typeDecl, d);
3359 else
3360 {
3361 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3362 specifiers = MkList();
3363 }
3364 d = MkDeclaratorFunction(d, params);
3365 if(dllImport)
3366 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3367 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3368 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3369 if(simple)
3370 ListAdd(specifiers, MkSpecifier(VOID));
3371 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3372 decl = MkDeclaration(specifiers, declarators);
3373 external = MkExternalDeclaration(decl);
3374 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3375 external->symbol = symbol;
3376 symbol->externalGet = external;
3377 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3378 if(typeDecl)
3379 FreeDeclarator(typeDecl);
3380 }
3381 else
3382 {
3383 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
3384 }
3385 }
3386 if(prop->Set)
3387 {
3388 if(!symbol->externalSet || symbol->externalSet->type == 0)
3389 {
3390 struct Declaration * decl;
3391 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3392 struct Declarator * d;
3393 struct __ecereNameSpace__ecere__sys__OldList * params;
3394 struct Specifier * spec;
3395 struct External * external;
3396 struct Declarator * typeDecl;
3397
3398 declarators = MkList();
3399 params = MkList();
3400 if(!prop->conversion || prop->_class->type == 1)
3401 {
3402 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3403 }
3404 specifiers = MkList();
3405 {
3406 struct Context * context = SetupTemplatesContext(prop->_class);
3407
3408 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3409 FinishTemplatesContext(context);
3410 }
3411 ListAdd(params, MkTypeName(specifiers, d));
3412 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3413 if(dllImport)
3414 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3415 d = MkDeclaratorFunction(d, params);
3416 for(spec = (*specifiers).first; spec; spec = spec->next)
3417 {
3418 if(spec->type == 1)
3419 {
3420 if((!typeDecl || typeDecl->type == 1))
3421 {
3422 struct Symbol * classSym = spec->symbol;
3423
3424 symbol->_class = classSym->registered;
3425 if(classSym->registered && classSym->registered->type == 1)
3426 DeclareStruct(spec->name, 0x0);
3427 }
3428 }
3429 }
3430 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3431 specifiers = MkList();
3432 if(dllImport)
3433 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3434 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3435 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3436 if(!prop->conversion || prop->_class->type == 1)
3437 ListAdd(specifiers, MkSpecifier(VOID));
3438 else
3439 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3440 decl = MkDeclaration(specifiers, declarators);
3441 external = MkExternalDeclaration(decl);
3442 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3443 external->symbol = symbol;
3444 symbol->externalSet = external;
3445 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3446 }
3447 else
3448 {
3449 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3450 }
3451 }
3452 if(!symbol->externalPtr)
3453 {
3454 struct Declaration * decl;
3455 struct External * external;
3456 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3457
3458 if(imported)
3459 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3460 else
3461 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3462 ListAdd(specifiers, MkSpecifierName("Property"));
3463 {
3464 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3465
3466 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3467 if(!imported)
3468 {
3469 strcpy(propName, "__ecerePropM_");
3470 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3471 strcat(propName, "_");
3472 FullClassNameCat(propName, prop->name, 0x1);
3473 MangleClassName(propName);
3474 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3475 }
3476 decl = MkDeclaration(specifiers, list);
3477 }
3478 external = MkExternalDeclaration(decl);
3479 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3480 external->symbol = symbol;
3481 symbol->externalPtr = external;
3482 }
3483 else
3484 {
3485 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3486 }
3487 symbol->id = curExternal->symbol->idCode;
3488 }
3489 }
3490
3491 struct Type * Dereference(struct Type * source)
3492 {
3493 struct Type * type = (((void *)0));
3494
3495 if(source)
3496 {
3497 if(source->kind == 13 || source->kind == 12)
3498 {
3499 type = source->type;
3500 source->type->refCount++;
3501 }
3502 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3503 {
3504 type = __extension__ ({
3505 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3506
3507 __ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
3508 });
3509 }
3510 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3511 {
3512 type = source;
3513 source->refCount++;
3514 }
3515 else
3516 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot dereference type\n", (((void *)0))));
3517 }
3518 return type;
3519 }
3520
3521 static struct Type * Reference(struct Type * source)
3522 {
3523 struct Type * type = (((void *)0));
3524
3525 if(source)
3526 {
3527 type = __extension__ ({
3528 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3529
3530 __ecereInstance1->kind = 13, __ecereInstance1->type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
3531 });
3532 source->refCount++;
3533 }
3534 return type;
3535 }
3536
3537 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);
3538
3539 extern void *  memcpy(void * , const void * , size_t size);
3540
3541 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3542
3543 extern void FreeExpression(struct Expression * exp);
3544
3545 extern void __ecereNameSpace__ecere__sys__ChangeCh(char *  string, char ch1, char ch2);
3546
3547 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);
3548
3549 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3550
3551 extern struct Type * MkClassType(char *  name);
3552
3553 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);
3554
3555 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)
3556 {
3557 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3558 unsigned int found = 0x0;
3559 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3560 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3561 unsigned int freeType = 0x0;
3562
3563 yylloc = member->loc;
3564 if(!ident)
3565 {
3566 if(curMember)
3567 {
3568 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3569 if(*curMember)
3570 {
3571 found = 0x1;
3572 dataMember = *curMember;
3573 }
3574 }
3575 }
3576 else
3577 {
3578 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3579 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3580 int _subMemberStackPos = 0;
3581
3582 if(!thisMember)
3583 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3584 if(thisMember)
3585 {
3586 dataMember = thisMember;
3587 if(curMember && thisMember->memberAccess == 1)
3588 {
3589 *curMember = thisMember;
3590 *curClass = thisMember->_class;
3591 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
3592 *subMemberStackPos = _subMemberStackPos;
3593 }
3594 found = 0x1;
3595 }
3596 else
3597 {
3598 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3599 if(method && method->type == 1)
3600 found = 0x1;
3601 else
3602 method = (((void *)0));
3603 }
3604 }
3605 if(found)
3606 {
3607 struct Type * type = (((void *)0));
3608
3609 if(dataMember)
3610 {
3611 if(!dataMember->dataType && dataMember->dataTypeString)
3612 {
3613 struct Context * context = SetupTemplatesContext(_class);
3614
3615 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3616 FinishTemplatesContext(context);
3617 }
3618 type = dataMember->dataType;
3619 }
3620 else if(method)
3621 {
3622 if(!method->dataType)
3623 ProcessMethodType(method);
3624 type = method->dataType;
3625 }
3626 if(ident && ident->next)
3627 {
3628 for(ident = ident->next; ident && type; ident = ident->next)
3629 {
3630 if(type->kind == 8)
3631 {
3632 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3633 if(!dataMember)
3634 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3635 if(dataMember)
3636 type = dataMember->dataType;
3637 }
3638 else if(type->kind == 9 || type->kind == 10)
3639 {
3640 struct Type * memberType;
3641
3642 for(memberType = type->members.first; memberType; memberType = memberType->next)
3643 {
3644 if(!strcmp(memberType->name, ident->string))
3645 {
3646 type = memberType;
3647 break;
3648 }
3649 }
3650 }
3651 }
3652 }
3653 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3654 {
3655 int id = 0;
3656 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3657 struct __ecereNameSpace__ecere__com__Class * sClass;
3658
3659 for(sClass = _class; sClass; sClass = sClass->base)
3660 {
3661 id = 0;
3662 if(sClass->templateClass)
3663 sClass = sClass->templateClass;
3664 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3665 {
3666 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3667 {
3668 for(sClass = sClass->base; sClass; sClass = sClass->base)
3669 {
3670 if(sClass->templateClass)
3671 sClass = sClass->templateClass;
3672 id += sClass->templateParams.count;
3673 }
3674 break;
3675 }
3676 id++;
3677 }
3678 if(curParam)
3679 break;
3680 }
3681 if(curParam)
3682 {
3683 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3684
3685 if(arg.dataTypeString)
3686 {
3687 type = ProcessTypeString(arg.dataTypeString, 0x0);
3688 freeType = 0x1;
3689 if(type && _class->templateClass)
3690 type->passAsTemplate = 0x1;
3691 if(type)
3692 {
3693 }
3694 }
3695 }
3696 }
3697 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3698 {
3699 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3700 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3701 int c;
3702 int paramCount = 0;
3703 int lastParam = -1;
3704 char templateString[1024];
3705 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3706
3707 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3708 for(cClass = expClass; cClass; cClass = cClass->base)
3709 {
3710 int p = 0;
3711
3712 if(cClass->templateClass)
3713 cClass = cClass->templateClass;
3714 for(param = cClass->templateParams.first; param; param = param->next)
3715 {
3716 int id = p;
3717 struct __ecereNameSpace__ecere__com__Class * sClass;
3718 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3719
3720 for(sClass = cClass->base; sClass; sClass = sClass->base)
3721 {
3722 if(sClass->templateClass)
3723 sClass = sClass->templateClass;
3724 id += sClass->templateParams.count;
3725 }
3726 arg = expClass->templateArgs[id];
3727 for(sClass = _class; sClass; sClass = sClass->base)
3728 {
3729 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3730 int p = 0;
3731 struct __ecereNameSpace__ecere__com__Class * nextClass;
3732
3733 if(sClass->templateClass)
3734 sClass = sClass->templateClass;
3735 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3736 {
3737 if(nextClass->templateClass)
3738 nextClass = nextClass->templateClass;
3739 p += nextClass->templateParams.count;
3740 }
3741 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3742 {
3743 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3744 {
3745 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3746 {
3747 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3748 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3749 break;
3750 }
3751 }
3752 }
3753 }
3754 {
3755 char argument[256];
3756
3757 argument[0] = '\0';
3758 switch(param->type)
3759 {
3760 case 2:
3761 {
3762 char expString[1024];
3763 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3764 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3765 struct Expression * exp;
3766 char * string = PrintHexUInt64(arg.expression.ui64);
3767
3768 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3769 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
3770 ProcessExpressionType(exp);
3771 ComputeExpression(exp);
3772 expString[0] = '\0';
3773 PrintExpression(exp, expString);
3774 strcat(argument, expString);
3775 FreeExpression(exp);
3776 break;
3777 }
3778 case 1:
3779 {
3780 strcat(argument, arg.member->name);
3781 break;
3782 }
3783 case 0:
3784 {
3785 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3786 strcat(argument, arg.dataTypeString);
3787 break;
3788 }
3789 }
3790 if(argument[0])
3791 {
3792 if(paramCount)
3793 strcat(templateString, ", ");
3794 if(lastParam != p - 1)
3795 {
3796 strcat(templateString, param->name);
3797 strcat(templateString, " = ");
3798 }
3799 strcat(templateString, argument);
3800 paramCount++;
3801 lastParam = p;
3802 }
3803 p++;
3804 }
3805 }
3806 }
3807 {
3808 int len = strlen(templateString);
3809
3810 if(templateString[len - 1] == '<')
3811 len--;
3812 else
3813 {
3814 if(templateString[len - 1] == '>')
3815 templateString[len++] = ' ';
3816 templateString[len++] = '>';
3817 }
3818 templateString[len++] = '\0';
3819 }
3820 {
3821 struct Context * context = SetupTemplatesContext(_class);
3822
3823 if(freeType)
3824 FreeType(type);
3825 type = ProcessTypeString(templateString, 0x0);
3826 freeType = 0x1;
3827 FinishTemplatesContext(context);
3828 }
3829 }
3830 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3831 {
3832 ProcessExpressionType(member->initializer->exp);
3833 if(!member->initializer->exp->expType)
3834 {
3835 if(inCompiler)
3836 {
3837 char expString[10240];
3838
3839 expString[0] = '\0';
3840 PrintExpression(member->initializer->exp, expString);
3841 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3842 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3843 }
3844 }
3845 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0))
3846 {
3847 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible instance method %s\n", (((void *)0))), ident->string);
3848 }
3849 }
3850 else if(member->initializer)
3851 {
3852 ProcessInitializer(member->initializer, type);
3853 }
3854 if(freeType)
3855 FreeType(type);
3856 }
3857 else
3858 {
3859 if(_class && _class->type == 3)
3860 {
3861 if(member->initializer)
3862 {
3863 struct Type * type = MkClassType(_class->fullName);
3864
3865 ProcessInitializer(member->initializer, type);
3866 FreeType(type);
3867 }
3868 }
3869 else
3870 {
3871 if(member->initializer)
3872 {
3873 ProcessInitializer(member->initializer, (((void *)0)));
3874 }
3875 if(ident)
3876 {
3877 if(method)
3878 {
3879 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3880 }
3881 else if(_class)
3882 {
3883 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3884 if(inCompiler)
3885 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3886 }
3887 }
3888 else if(_class)
3889 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3890 }
3891 }
3892 }
3893
3894 extern struct Identifier * GetDeclId(struct Declarator * decl);
3895
3896 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);
3897
3898 extern void FreeSpecifier(struct Specifier * spec);
3899
3900 static void ProcessFunction(struct FunctionDefinition * function);
3901
3902 extern struct __ecereNameSpace__ecere__sys__OldList *  CopyList(struct __ecereNameSpace__ecere__sys__OldList *  source, void *  (*  CopyFunction)(void * ));
3903
3904 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3905
3906 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3907
3908 extern void FreeClassFunction(struct ClassFunction * func);
3909
3910 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3911
3912 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3913
3914 void ProcessInstantiationType(struct Instantiation * inst)
3915 {
3916 yylloc = inst->loc;
3917 if(inst->_class)
3918 {
3919 struct MembersInit * members;
3920 struct Symbol * classSym;
3921 struct __ecereNameSpace__ecere__com__Class * _class;
3922
3923 classSym = inst->_class->symbol;
3924 _class = classSym ? classSym->registered : (((void *)0));
3925 if(!_class || _class->type != 5)
3926 DeclareStruct(inst->_class->name, 0x0);
3927 afterExternal = afterExternal ? afterExternal : curExternal;
3928 if(inst->exp)
3929 ProcessExpressionType(inst->exp);
3930 inst->isConstant = 0x1;
3931 if(inst->members)
3932 {
3933 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3934 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3935 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3936 int subMemberStackPos = 0;
3937
3938 for(members = (*inst->members).first; members; members = members->next)
3939 {
3940 switch(members->type)
3941 {
3942 case 1:
3943 {
3944 char name[1024];
3945 static unsigned int instMethodID = 0;
3946 struct External * external = curExternal;
3947 struct Context * context = curContext;
3948 struct Declarator * declarator = members->function->declarator;
3949 struct Identifier * nameID = GetDeclId(declarator);
3950 char * unmangled = nameID ? nameID->string : (((void *)0));
3951 struct Expression * exp;
3952 struct External * createdExternal = (((void *)0));
3953
3954 if(inCompiler)
3955 {
3956 char number[16];
3957
3958 strcpy(name, "__ecereInstMeth_");
3959 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
3960 strcat(name, "_");
3961 strcat(name, nameID->string);
3962 strcat(name, "_");
3963 sprintf(number, "_%08d", instMethodID++);
3964 strcat(name, number);
3965 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
3966 }
3967 if(declarator)
3968 {
3969 struct Symbol * symbol = declarator->symbol;
3970 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
3971
3972 if(method && method->type == 1)
3973 {
3974 symbol->method = method;
3975 ProcessMethodType(method);
3976 if(!symbol->type->thisClass)
3977 {
3978 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
3979 {
3980 if(!currentClass->symbol)
3981 currentClass->symbol = FindClass(currentClass->fullName);
3982 symbol->type->thisClass = currentClass->symbol;
3983 }
3984 else
3985 {
3986 if(!_class->symbol)
3987 _class->symbol = FindClass(_class->fullName);
3988 symbol->type->thisClass = _class->symbol;
3989 }
3990 }
3991 DeclareType(symbol->type, 0x1, 0x1);
3992 }
3993 else if(classSym)
3994 {
3995 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
3996 }
3997 }
3998 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
3999 if(nameID)
4000 {
4001 FreeSpecifier(nameID->_class);
4002 nameID->_class = (((void *)0));
4003 }
4004 if(inCompiler)
4005 {
4006 struct Type * type = declarator->symbol->type;
4007 struct External * oldExternal = curExternal;
4008
4009 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
4010 {
4011 struct External * externalDecl;
4012
4013 externalDecl = MkExternalDeclaration((((void *)0)));
4014 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
4015 if(createdExternal->function)
4016 {
4017 ProcessFunction(createdExternal->function);
4018 {
4019 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
4020
4021 externalDecl->declaration = decl;
4022 if(decl->symbol && !decl->symbol->pointerExternal)
4023 decl->symbol->pointerExternal = externalDecl;
4024 declarator->symbol->pointerExternal = externalDecl;
4025 }
4026 }
4027 }
4028 }
4029 else if(declarator)
4030 {
4031 curExternal = declarator->symbol->pointerExternal;
4032 ProcessFunction((struct FunctionDefinition *)members->function);
4033 }
4034 curExternal = external;
4035 curContext = context;
4036 if(inCompiler)
4037 {
4038 FreeClassFunction(members->function);
4039 exp = QMkExpId(name);
4040 members->type = 0;
4041 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
4042 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
4043 }
4044 break;
4045 }
4046 case 0:
4047 {
4048 if(members->dataMembers && classSym)
4049 {
4050 struct MemberInit * member;
4051 struct Location oldyyloc = yylloc;
4052
4053 for(member = (*members->dataMembers).first; member; member = member->next)
4054 {
4055 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
4056 if(member->initializer && !member->initializer->isConstant)
4057 inst->isConstant = 0x0;
4058 }
4059 yylloc = oldyyloc;
4060 }
4061 break;
4062 }
4063 }
4064 }
4065 }
4066 }
4067 }
4068
4069 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
4070 {
4071 if(inCompiler)
4072 {
4073 if(type->kind == 11)
4074 {
4075 struct Type * param;
4076
4077 if(declareParams)
4078 {
4079 for(param = type->params.first; param; param = param->next)
4080 DeclareType(param, declarePointers, 0x1);
4081 }
4082 DeclareType(type->returnType, declarePointers, 0x1);
4083 }
4084 else if(type->kind == 13 && declarePointers)
4085 DeclareType(type->type, declarePointers, 0x0);
4086 else if(type->kind == 8)
4087 {
4088 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
4089 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
4090 }
4091 else if(type->kind == 9 || type->kind == 10)
4092 {
4093 struct Type * member;
4094
4095 for(member = type->members.first; member; member = member->next)
4096 DeclareType(member, 0x0, 0x0);
4097 }
4098 else if(type->kind == 12)
4099 DeclareType(type->arrayType, declarePointers, 0x0);
4100 }
4101 }
4102
4103 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
4104
4105 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
4106 {
4107 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
4108 int id = 0;
4109 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4110 struct __ecereNameSpace__ecere__com__Class * sClass;
4111
4112 for(sClass = _class; sClass; sClass = sClass->base)
4113 {
4114 id = 0;
4115 if(sClass->templateClass)
4116 sClass = sClass->templateClass;
4117 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4118 {
4119 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
4120 {
4121 for(sClass = sClass->base; sClass; sClass = sClass->base)
4122 {
4123 if(sClass->templateClass)
4124 sClass = sClass->templateClass;
4125 id += sClass->templateParams.count;
4126 }
4127 break;
4128 }
4129 id++;
4130 }
4131 if(curParam)
4132 break;
4133 }
4134 if(curParam)
4135 {
4136 arg = &_class->templateArgs[id];
4137 if(arg && param->type == 0)
4138 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
4139 }
4140 return arg;
4141 }
4142
4143 extern struct Context * PushContext(void);
4144
4145 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
4146
4147 struct TemplatedType
4148 {
4149 uintptr_t key;
4150 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4151 struct __ecereNameSpace__ecere__sys__BTNode * left;
4152 struct __ecereNameSpace__ecere__sys__BTNode * right;
4153 int depth;
4154 struct TemplateParameter * param;
4155 } __attribute__ ((gcc_struct));
4156
4157 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
4158
4159 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
4160 {
4161 struct Context * context = PushContext();
4162
4163 context->templateTypesOnly = 0x1;
4164 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
4165 {
4166 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
4167
4168 for(; param; param = param->next)
4169 {
4170 if(param->type == 0 && param->identifier)
4171 {
4172 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
4173
4174 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4175 }
4176 }
4177 }
4178 else if(_class)
4179 {
4180 struct __ecereNameSpace__ecere__com__Class * sClass;
4181
4182 for(sClass = _class; sClass; sClass = sClass->base)
4183 {
4184 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
4185
4186 for(p = sClass->templateParams.first; p; p = p->next)
4187 {
4188 if(p->type == 0)
4189 {
4190 struct TemplateParameter * param = p->param;
4191 struct TemplatedType * type;
4192
4193 if(!param)
4194 {
4195 p->param = param = __extension__ ({
4196 struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
4197
4198 __ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->dataTypeString, __ecereInstance1;
4199 });
4200 }
4201 type = __extension__ ({
4202 struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
4203
4204 __ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
4205 });
4206 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4207 }
4208 }
4209 }
4210 }
4211 return context;
4212 }
4213
4214 extern void PopContext(struct Context * ctx);
4215
4216 extern void FreeContext(struct Context * context);
4217
4218 void FinishTemplatesContext(struct Context * context)
4219 {
4220 PopContext(context);
4221 FreeContext(context);
4222 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
4223 }
4224
4225 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
4226 {
4227 if(!method->dataType)
4228 {
4229 struct Context * context = SetupTemplatesContext(method->_class);
4230
4231 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4232 FinishTemplatesContext(context);
4233 if(method->type != 1 && method->dataType)
4234 {
4235 if(!method->dataType->thisClass && !method->dataType->staticMethod)
4236 {
4237 if(!method->_class->symbol)
4238 method->_class->symbol = FindClass(method->_class->fullName);
4239 method->dataType->thisClass = method->_class->symbol;
4240 }
4241 }
4242 }
4243 }
4244
4245 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
4246 {
4247 if(!prop->dataType)
4248 {
4249 struct Context * context = SetupTemplatesContext(prop->_class);
4250
4251 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
4252 FinishTemplatesContext(context);
4253 }
4254 }
4255
4256 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4257
4258 extern void FreeTypeName(struct TypeName * typeName);
4259
4260 static void ProcessDeclarator(struct Declarator * decl);
4261
4262 extern struct __ecereNameSpace__ecere__sys__OldList *  excludedSymbols;
4263
4264 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4265
4266 struct MethodImport
4267 {
4268 struct MethodImport * prev;
4269 struct MethodImport * next;
4270 char *  name;
4271 unsigned int isVirtual;
4272 } __attribute__ ((gcc_struct));
4273
4274 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
4275
4276 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
4277 {
4278 struct Symbol * symbol = method->symbol;
4279
4280 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4281 {
4282 unsigned int imported = 0x0;
4283 unsigned int dllImport = 0x0;
4284
4285 if(!method->dataType)
4286 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4287 if(!symbol || symbol->_import || method->type == 1)
4288 {
4289 if(!symbol || method->type == 1)
4290 {
4291 struct Symbol * classSym;
4292
4293 if(!method->_class->symbol)
4294 method->_class->symbol = FindClass(method->_class->fullName);
4295 classSym = method->_class->symbol;
4296 if(!classSym->_import)
4297 {
4298 struct ModuleImport * module;
4299
4300 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->name)
4301 module = FindModule(method->_class->module);
4302 else
4303 module = mainModule;
4304 classSym->_import = __extension__ ({
4305 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
4306
4307 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
4308 });
4309 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4310 }
4311 if(!symbol)
4312 {
4313 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4314 }
4315 if(!symbol->_import)
4316 {
4317 symbol->_import = (struct ClassImport *)__extension__ ({
4318 struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
4319
4320 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
4321 });
4322 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4323 }
4324 if(!symbol)
4325 {
4326 symbol->type = method->dataType;
4327 if(symbol->type)
4328 symbol->type->refCount++;
4329 }
4330 }
4331 if(!method->dataType->dllExport)
4332 {
4333 imported = 0x1;
4334 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)
4335 dllImport = 0x1;
4336 }
4337 }
4338 if(method->type != 1 && method->dataType)
4339 DeclareType(method->dataType, 0x1, 0x1);
4340 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4341 {
4342 struct Declaration * decl;
4343 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4344 struct Declarator * d;
4345 struct Declarator * funcDecl;
4346 struct External * external;
4347
4348 specifiers = MkList();
4349 declarators = MkList();
4350 if(dllImport)
4351 ListAdd(specifiers, MkSpecifier(EXTERN));
4352 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4353 ListAdd(specifiers, MkSpecifier(STATIC));
4354 if(method->type == 1)
4355 {
4356 ListAdd(specifiers, MkSpecifier(INT));
4357 d = MkDeclaratorIdentifier(MkIdentifier(name));
4358 }
4359 else
4360 {
4361 d = MkDeclaratorIdentifier(MkIdentifier(name));
4362 if(dllImport)
4363 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4364 {
4365 struct Context * context = SetupTemplatesContext(method->_class);
4366
4367 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4368 FinishTemplatesContext(context);
4369 }
4370 funcDecl = GetFuncDecl(d);
4371 if(dllImport)
4372 {
4373 struct Specifier * spec, * next;
4374
4375 for(spec = (*specifiers).first; spec; spec = next)
4376 {
4377 next = spec->next;
4378 if(spec->type == 5)
4379 {
4380 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4381 FreeSpecifier(spec);
4382 }
4383 }
4384 }
4385 if(method->dataType && !method->dataType->staticMethod)
4386 {
4387 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
4388 {
4389 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
4390 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")));
4391 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
4392 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4393
4394 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
4395 {
4396 struct TypeName * param = (*funcDecl->function.parameters).first;
4397
4398 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
4399 FreeTypeName(param);
4400 }
4401 if(!funcDecl->function.parameters)
4402 funcDecl->function.parameters = MkList();
4403 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
4404 }
4405 }
4406 }
4407 ProcessDeclarator(d);
4408 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4409 decl = MkDeclaration(specifiers, declarators);
4410 ReplaceThisClassSpecifiers(specifiers, method->_class);
4411 if(symbol->pointerExternal)
4412 {
4413 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4414
4415 {
4416 *functionSymbol = *symbol;
4417 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4418 if(functionSymbol->type)
4419 functionSymbol->type->refCount++;
4420 }
4421 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4422 symbol->pointerExternal->symbol = functionSymbol;
4423 }
4424 external = MkExternalDeclaration(decl);
4425 if(curExternal)
4426 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4427 external->symbol = symbol;
4428 symbol->pointerExternal = external;
4429 }
4430 else if(ast)
4431 {
4432 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4433 }
4434 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4435 }
4436 }
4437
4438 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4439 {
4440 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4441 {
4442 unsigned int first = 0x1;
4443 int p = 0;
4444 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4445 int lastParam = -1;
4446 char className[1024];
4447
4448 strcpy(className, _class->fullName);
4449 for(param = _class->templateParams.first; param; param = param->next)
4450 {
4451 {
4452 if(first)
4453 strcat(className, "<");
4454 if(!first)
4455 strcat(className, ", ");
4456 if(lastParam + 1 != p)
4457 {
4458 strcat(className, param->name);
4459 strcat(className, " = ");
4460 }
4461 strcat(className, param->name);
4462 first = 0x0;
4463 lastParam = p;
4464 }
4465 p++;
4466 }
4467 if(!first)
4468 {
4469 int len = strlen(className);
4470
4471 if(className[len - 1] == '>')
4472 className[len++] = ' ';
4473 className[len++] = '>';
4474 className[len++] = '\0';
4475 }
4476 return __ecereNameSpace__ecere__sys__CopyString(className);
4477 }
4478 else
4479 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4480 }
4481
4482 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4483 {
4484 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4485 {
4486 unsigned int first = 0x1;
4487 int p = 0;
4488 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4489 int lastParam = -1;
4490 char className[1024];
4491
4492 strcpy(className, _class->fullName);
4493 for(param = _class->templateParams.first; param; param = param->next)
4494 {
4495 {
4496 if(first)
4497 strcat(className, "<");
4498 if(!first)
4499 strcat(className, ", ");
4500 if(lastParam + 1 != p)
4501 {
4502 strcat(className, param->name);
4503 strcat(className, " = ");
4504 }
4505 strcat(className, param->name);
4506 first = 0x0;
4507 lastParam = p;
4508 }
4509 p++;
4510 }
4511 if(!first)
4512 {
4513 int len = strlen(className);
4514
4515 if(className[len - 1] == '>')
4516 className[len++] = ' ';
4517 className[len++] = '>';
4518 className[len++] = '\0';
4519 }
4520 return MkClassType(className);
4521 }
4522 else
4523 {
4524 return MkClassType(_class->fullName);
4525 }
4526 }
4527
4528 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4529 {
4530 if(specs != (((void *)0)) && _class)
4531 {
4532 struct Specifier * spec;
4533
4534 for(spec = specs->first; spec; spec = spec->next)
4535 {
4536 if(spec->type == 0 && spec->specifier == THISCLASS)
4537 {
4538 spec->type = 1;
4539 spec->name = ReplaceThisClass(_class);
4540 spec->symbol = FindClass(spec->name);
4541 }
4542 }
4543 }
4544 }
4545
4546 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4547
4548 struct __ecereNameSpace__ecere__com__GlobalFunction
4549 {
4550 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4551 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4552 char *  name;
4553 int (*  function)();
4554 struct __ecereNameSpace__ecere__com__Instance * module;
4555 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
4556 char *  dataTypeString;
4557 struct Type * dataType;
4558 void *  symbol;
4559 } __attribute__ ((gcc_struct));
4560
4561 extern struct Context * globalContext;
4562
4563 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4564
4565 struct FunctionImport
4566 {
4567 struct FunctionImport * prev;
4568 struct FunctionImport * next;
4569 char *  name;
4570 } __attribute__ ((gcc_struct));
4571
4572 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4573 {
4574 struct Symbol * symbol = function->symbol;
4575
4576 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4577 {
4578 unsigned int imported = 0x0;
4579 unsigned int dllImport = 0x0;
4580
4581 if(!function->dataType)
4582 {
4583 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4584 if(!function->dataType->thisClass)
4585 function->dataType->staticMethod = 0x1;
4586 }
4587 if(inCompiler)
4588 {
4589 if(!symbol)
4590 {
4591 struct ModuleImport * module = FindModule(function->module);
4592
4593 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4594 if(module->name)
4595 {
4596 if(!function->dataType->dllExport)
4597 {
4598 symbol->_import = (struct ClassImport *)__extension__ ({
4599 struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
4600
4601 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
4602 });
4603 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4604 }
4605 }
4606 {
4607 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4608 if(!symbol->type->thisClass)
4609 symbol->type->staticMethod = 0x1;
4610 }
4611 }
4612 imported = symbol->_import ? 0x1 : 0x0;
4613 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1)
4614 dllImport = 0x1;
4615 }
4616 DeclareType(function->dataType, 0x1, 0x1);
4617 if(inCompiler)
4618 {
4619 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4620 {
4621 struct Declaration * decl;
4622 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4623 struct Declarator * d;
4624 struct Declarator * funcDecl;
4625 struct External * external;
4626
4627 specifiers = MkList();
4628 declarators = MkList();
4629 ListAdd(specifiers, MkSpecifier(EXTERN));
4630 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4631 if(dllImport)
4632 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4633 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4634 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType == 1)
4635 {
4636 struct Specifier * spec;
4637
4638 for(spec = (*specifiers).first; spec; spec = spec->next)
4639 if(spec->type == 5 && spec->extDecl && spec->extDecl->type == 0 && !strcmp(spec->extDecl->s, "dllexport"))
4640 {
4641 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4642 FreeSpecifier(spec);
4643 break;
4644 }
4645 }
4646 funcDecl = GetFuncDecl(d);
4647 if(funcDecl && !funcDecl->function.parameters)
4648 {
4649 funcDecl->function.parameters = MkList();
4650 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4651 }
4652 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4653 {
4654 struct Context * oldCtx = curContext;
4655
4656 curContext = globalContext;
4657 decl = MkDeclaration(specifiers, declarators);
4658 curContext = oldCtx;
4659 }
4660 if(symbol->pointerExternal)
4661 {
4662 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4663
4664 {
4665 *functionSymbol = *symbol;
4666 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4667 if(functionSymbol->type)
4668 functionSymbol->type->refCount++;
4669 }
4670 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4671 symbol->pointerExternal->symbol = functionSymbol;
4672 }
4673 external = MkExternalDeclaration(decl);
4674 if(curExternal)
4675 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4676 external->symbol = symbol;
4677 symbol->pointerExternal = external;
4678 }
4679 else
4680 {
4681 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4682 }
4683 if(curExternal)
4684 symbol->id = curExternal->symbol->idCode;
4685 }
4686 }
4687 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1) ? 0x1 : 0x0;
4688 }
4689
4690 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4691
4692 struct GlobalData
4693 {
4694 uintptr_t key;
4695 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4696 struct __ecereNameSpace__ecere__sys__BTNode * left;
4697 struct __ecereNameSpace__ecere__sys__BTNode * right;
4698 int depth;
4699 struct __ecereNameSpace__ecere__com__Instance * module;
4700 char *  dataTypeString;
4701 struct Type * dataType;
4702 void *  symbol;
4703 char *  fullName;
4704 } __attribute__ ((gcc_struct));
4705
4706 void DeclareGlobalData(struct GlobalData * data)
4707 {
4708 struct Symbol * symbol = data->symbol;
4709
4710 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4711 {
4712 if(inCompiler)
4713 {
4714 if(!symbol)
4715 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4716 }
4717 if(!data->dataType)
4718 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4719 DeclareType(data->dataType, 0x1, 0x1);
4720 if(inCompiler)
4721 {
4722 if(!symbol->pointerExternal)
4723 {
4724 struct Declaration * decl;
4725 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4726 struct Declarator * d;
4727 struct External * external;
4728
4729 specifiers = MkList();
4730 declarators = MkList();
4731 ListAdd(specifiers, MkSpecifier(EXTERN));
4732 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4733 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4734 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4735 decl = MkDeclaration(specifiers, declarators);
4736 external = MkExternalDeclaration(decl);
4737 if(curExternal)
4738 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4739 external->symbol = symbol;
4740 symbol->pointerExternal = external;
4741 }
4742 else
4743 {
4744 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4745 }
4746 if(curExternal)
4747 symbol->id = curExternal->symbol->idCode;
4748 }
4749 }
4750 }
4751
4752 struct Conversion
4753 {
4754 struct Conversion * prev, * next;
4755 struct __ecereNameSpace__ecere__com__Property * convert;
4756 unsigned int isGet;
4757 struct Type * resultType;
4758 } __attribute__ ((gcc_struct));
4759
4760 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4761
4762 extern void Compiler_Warning(char *  format, ...);
4763
4764 void PrintType(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
4765
4766 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)
4767 {
4768 if(source && dest)
4769 {
4770 if(source->kind == 20 && dest->kind != 20)
4771 {
4772 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4773
4774 if(type)
4775 source = type;
4776 }
4777 if(dest->kind == 20 && source->kind != 20)
4778 {
4779 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4780
4781 if(type)
4782 dest = type;
4783 }
4784 if(dest->classObjectType == 2)
4785 {
4786 if(source->classObjectType != 3)
4787 return 0x1;
4788 else
4789 {
4790 if((dest->_class && strcmp(dest->_class->string, "class")) || (source->_class && strcmp(source->_class->string, "class")))
4791 {
4792 return 0x1;
4793 }
4794 }
4795 }
4796 else
4797 {
4798 if(source->classObjectType == 3)
4799 return 0x1;
4800 if(dest->classObjectType == 3 && source->classObjectType != 2)
4801 return 0x1;
4802 }
4803 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4804 {
4805 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4806 return 0x1;
4807 }
4808 if(dest->kind == 14 && source->kind != 0)
4809 return 0x1;
4810 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))
4811 return 0x1;
4812 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))
4813 return 0x1;
4814 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4815 {
4816 if(source->_class->registered && source->_class->registered->type == 3)
4817 {
4818 if(conversions != (((void *)0)))
4819 {
4820 if(source->_class->registered == dest->_class->registered)
4821 return 0x1;
4822 }
4823 else
4824 {
4825 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4826
4827 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4828 ;
4829 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4830 ;
4831 if(sourceBase == destBase)
4832 return 0x1;
4833 }
4834 }
4835 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))
4836 return 0x1;
4837 else
4838 {
4839 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))
4840 {
4841 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4842 {
4843 return 0x1;
4844 }
4845 }
4846 }
4847 }
4848 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
4849 return 0x1;
4850 if(doConversion)
4851 {
4852 if(source->kind == 8)
4853 {
4854 struct __ecereNameSpace__ecere__com__Class * _class;
4855
4856 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4857 {
4858 struct __ecereNameSpace__ecere__com__Property * convert;
4859
4860 for(convert = _class->conversions.first; convert; convert = convert->next)
4861 {
4862 if(convert->memberAccess == 1 || _class->module == privateModule)
4863 {
4864 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4865
4866 if(!convert->dataType)
4867 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4868 if(MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x0, 0x1, 0x0, 0x1))
4869 {
4870 if(!conversions && !convert->Get)
4871 return 0x1;
4872 else if(conversions != (((void *)0)))
4873 {
4874 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))
4875 return 0x1;
4876 else
4877 {
4878 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4879
4880 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4881 return 0x1;
4882 }
4883 }
4884 }
4885 }
4886 }
4887 }
4888 }
4889 if(dest->kind == 8)
4890 {
4891 struct __ecereNameSpace__ecere__com__Class * _class;
4892
4893 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4894 {
4895 struct __ecereNameSpace__ecere__com__Property * convert;
4896
4897 for(convert = _class->conversions.first; convert; convert = convert->next)
4898 {
4899 if(convert->memberAccess == 1 || _class->module == privateModule)
4900 {
4901 if(!convert->dataType)
4902 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4903 if(convert->dataType != dest && MatchTypes(source, convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1))
4904 {
4905 if(!conversions && !convert->Set)
4906 return 0x1;
4907 else if(conversions != (((void *)0)))
4908 {
4909 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))
4910 return 0x1;
4911 else
4912 {
4913 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4914
4915 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4916 return 0x1;
4917 }
4918 }
4919 }
4920 }
4921 }
4922 }
4923 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
4924 {
4925 if(!dest->_class->registered->dataType)
4926 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
4927 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
4928 {
4929 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4930 {
4931 return 0x1;
4932 }
4933 }
4934 }
4935 }
4936 if(source->kind == 8)
4937 {
4938 struct __ecereNameSpace__ecere__com__Class * _class;
4939
4940 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4941 {
4942 struct __ecereNameSpace__ecere__com__Property * convert;
4943
4944 for(convert = _class->conversions.first; convert; convert = convert->next)
4945 {
4946 if(convert->memberAccess == 1 || _class->module == privateModule)
4947 {
4948 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4949
4950 if(!convert->dataType)
4951 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4952 if(convert->dataType != source && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x1))
4953 {
4954 if(!conversions && !convert->Get)
4955 return 0x1;
4956 else if(conversions != (((void *)0)))
4957 {
4958 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))
4959 return 0x1;
4960 else
4961 {
4962 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4963
4964 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4965 return 0x1;
4966 }
4967 }
4968 }
4969 }
4970 }
4971 }
4972 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
4973 {
4974 if(!source->_class->registered->dataType)
4975 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
4976 if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4977 {
4978 return 0x1;
4979 }
4980 }
4981 }
4982 }
4983 if(source->kind == 8 || source->kind == 19)
4984 ;
4985 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
4986 return 0x1;
4987 else if(dest->kind == 7 && source->kind == 6)
4988 return 0x1;
4989 else if(dest->kind == 2 && (source->kind == 1 || source->kind == 24))
4990 return 0x1;
4991 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 23))
4992 return 0x1;
4993 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 22 || source->kind == 23))
4994 return 0x1;
4995 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 23 || source->kind == 4))
4996 return 0x1;
4997 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 4 || source->kind == 22))
4998 return 0x1;
4999 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))
5000 return 0x1;
5001 else if(dest->kind == 15 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 5 || source->kind == 4 || source->kind == 22 || source->kind == 23))
5002 return 0x1;
5003 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)))
5004 {
5005 struct Type * paramSource, * paramDest;
5006
5007 if(dest->kind == 16)
5008 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
5009 if(source->kind == 16)
5010 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
5011 if(dest->kind == 13 && dest->type->kind == 11)
5012 dest = dest->type;
5013 if(source->kind == 13 && source->type->kind == 11)
5014 source = source->type;
5015 if(dest->kind == 16)
5016 dest = dest->method->dataType;
5017 if(source->kind == 16)
5018 source = source->method->dataType;
5019 paramSource = source->params.first;
5020 if(paramSource && paramSource->kind == 0)
5021 paramSource = (((void *)0));
5022 paramDest = dest->params.first;
5023 if(paramDest && paramDest->kind == 0)
5024 paramDest = (((void *)0));
5025 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
5026 {
5027 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))))
5028 {
5029 if(paramDest && paramDest->kind == 8)
5030 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), paramDest->_class->string);
5031 else
5032 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class should not take an object\n", (((void *)0))));
5033 return 0x0;
5034 }
5035 paramDest = paramDest->next;
5036 }
5037 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
5038 {
5039 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
5040 {
5041 if(dest->thisClass)
5042 {
5043 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
5044 {
5045 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
5046 return 0x0;
5047 }
5048 }
5049 else
5050 {
5051 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
5052 {
5053 if(owningClassDest)
5054 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
5055 else
5056 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "overriding class expected to be derived from method class\n", (((void *)0))));
5057 return 0x0;
5058 }
5059 }
5060 paramSource = paramSource->next;
5061 }
5062 else
5063 {
5064 if(dest->thisClass)
5065 {
5066 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
5067 {
5068 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
5069 return 0x0;
5070 }
5071 }
5072 else
5073 {
5074 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
5075 {
5076 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), source->thisClass->registered->fullName);
5077 return 0x0;
5078 }
5079 }
5080 }
5081 }
5082 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5083 {
5084 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible return type for function\n", (((void *)0))));
5085 return 0x0;
5086 }
5087 for(; paramDest; paramDest = paramDest->next)
5088 {
5089 if(!paramSource)
5090 {
5091 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "not enough parameters\n", (((void *)0))));
5092 return 0x0;
5093 }
5094 {
5095 struct Type * paramDestType = paramDest;
5096 struct Type * paramSourceType = paramSource;
5097 struct Type * type = paramDestType;
5098
5099 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
5100 {
5101 int id = 0;
5102 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
5103 struct __ecereNameSpace__ecere__com__Class * sClass;
5104
5105 for(sClass = owningClassSource; sClass; sClass = sClass->base)
5106 {
5107 id = 0;
5108 if(sClass->templateClass)
5109 sClass = sClass->templateClass;
5110 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
5111 {
5112 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
5113 {
5114 for(sClass = sClass->base; sClass; sClass = sClass->base)
5115 {
5116 if(sClass->templateClass)
5117 sClass = sClass->templateClass;
5118 id += sClass->templateParams.count;
5119 }
5120 break;
5121 }
5122 id++;
5123 }
5124 if(curParam)
5125 break;
5126 }
5127 if(curParam)
5128 {
5129 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
5130
5131 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
5132 }
5133 }
5134 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)))
5135 {
5136 char type[1024];
5137
5138 type[0] = (char)0;
5139 PrintType(paramDest, type, 0x0, 0x1);
5140 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
5141 if(paramDestType != paramDest)
5142 FreeType(paramDestType);
5143 return 0x0;
5144 }
5145 if(paramDestType != paramDest)
5146 FreeType(paramDestType);
5147 }
5148 paramSource = paramSource->next;
5149 }
5150 if(paramSource)
5151 {
5152 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many parameters\n", (((void *)0))));
5153 return 0x0;
5154 }
5155 return 0x1;
5156 }
5157 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
5158 {
5159 return 0x1;
5160 }
5161 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
5162 {
5163 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5164 return 0x1;
5165 }
5166 }
5167 return 0x0;
5168 }
5169
5170 static void FreeConvert(struct Conversion * convert)
5171 {
5172 if(convert->resultType)
5173 FreeType(convert->resultType);
5174 }
5175
5176 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
5177
5178 struct __ecereNameSpace__ecere__com__BTNamedLink
5179 {
5180 char *  name;
5181 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
5182 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
5183 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
5184 int depth;
5185 void *  data;
5186 } __attribute__ ((gcc_struct));
5187
5188 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
5189
5190 struct __ecereNameSpace__ecere__com__EnumClassData
5191 {
5192 struct __ecereNameSpace__ecere__sys__OldList values;
5193 int largest;
5194 } __attribute__ ((gcc_struct));
5195
5196 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
5197
5198 struct __ecereNameSpace__ecere__sys__NamedLink
5199 {
5200 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
5201 struct __ecereNameSpace__ecere__sys__NamedLink * next;
5202 char *  name;
5203 void *  data;
5204 } __attribute__ ((gcc_struct));
5205
5206 extern void FreeExpContents(struct Expression * exp);
5207
5208 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
5209
5210 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
5211
5212 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
5213
5214 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
5215
5216 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (*  freeFn)(void * ));
5217
5218 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5219 {
5220 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
5221
5222 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)))
5223 {
5224 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
5225
5226 if(_class->type == 4)
5227 {
5228 struct __ecereNameSpace__ecere__sys__OldList converts = 
5229 {
5230 0, 0, 0, 0, 0
5231 };
5232 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5233
5234 type->kind = 8;
5235 if(!_class->symbol)
5236 _class->symbol = FindClass(_class->fullName);
5237 type->_class = _class->symbol;
5238 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0))
5239 {
5240 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5241 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5242
5243 if(enumClass)
5244 {
5245 struct __ecereNameSpace__ecere__com__Class * baseClass;
5246
5247 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
5248 {
5249 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
5250
5251 for(value = e->values.first; value; value = value->next)
5252 {
5253 if(!strcmp(value->name, string))
5254 break;
5255 }
5256 if(value)
5257 {
5258 FreeExpContents(sourceExp);
5259 FreeType(sourceExp->expType);
5260 sourceExp->isConstant = 0x1;
5261 sourceExp->expType = MkClassType(baseClass->fullName);
5262 {
5263 char constant[256];
5264
5265 sourceExp->type = 2;
5266 if(!strcmp(baseClass->dataTypeString, "int"))
5267 sprintf(constant, "%d", (int)value->data);
5268 else
5269 sprintf(constant, "0x%X", (int)value->data);
5270 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5271 }
5272 while(converts.first)
5273 {
5274 struct Conversion * convert = converts.first;
5275
5276 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
5277 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5278 }
5279 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5280 return 0x1;
5281 }
5282 }
5283 }
5284 }
5285 if(converts.first)
5286 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
5287 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5288 }
5289 }
5290 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)))
5291 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5292 return 0x1;
5293 return 0x0;
5294 }
5295
5296 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5297
5298 struct __ecereNameSpace__ecere__com__SubModule
5299 {
5300 struct __ecereNameSpace__ecere__com__SubModule * prev;
5301 struct __ecereNameSpace__ecere__com__SubModule * next;
5302 struct __ecereNameSpace__ecere__com__Instance * module;
5303 int importMode;
5304 } __attribute__ ((gcc_struct));
5305
5306 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5307 {
5308 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5309
5310 if(searchFor == searchIn)
5311 return 0x1;
5312 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
5313 {
5314 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->application)
5315 {
5316 if(ModuleVisibility(subModule->module, searchFor))
5317 return 0x1;
5318 }
5319 }
5320 return 0x0;
5321 }
5322
5323 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5324
5325 struct __ecereNameSpace__ecere__com__Application
5326 {
5327 int argc;
5328 char * *  argv;
5329 int exitCode;
5330 unsigned int isGUIApp;
5331 struct __ecereNameSpace__ecere__sys__OldList allModules;
5332 char *  parsedCommand;
5333 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5334 } __attribute__ ((gcc_struct));
5335
5336 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5337 {
5338 struct __ecereNameSpace__ecere__com__Instance * module;
5339
5340 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))
5341 return 0x1;
5342 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))
5343 return 0x1;
5344 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))
5345 return 0x1;
5346 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)
5347 {
5348 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5349 return 0x1;
5350 }
5351 return 0x0;
5352 }
5353
5354 extern unsigned long strtoul(const char *  nptr, char * *  endptr, int base);
5355
5356 void ReadString(char *  output, char *  string);
5357
5358 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5359
5360 extern struct TypeName * QMkClass(char *  spec, struct Declarator * decl);
5361
5362 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5363
5364 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
5365 {
5366 struct Type * source = sourceExp->expType;
5367 struct Type * realDest = dest;
5368 struct Type * backupSourceExpType = (((void *)0));
5369
5370 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
5371 return 0x1;
5372 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5373 {
5374 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
5375 {
5376 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5377
5378 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5379 ;
5380 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5381 ;
5382 if(sourceBase == destBase)
5383 return 0x1;
5384 }
5385 }
5386 if(source)
5387 {
5388 struct __ecereNameSpace__ecere__sys__OldList * specs;
5389 unsigned int flag = 0x0;
5390 long long value = (((int)0x7fffffff));
5391
5392 source->refCount++;
5393 dest->refCount++;
5394 if(sourceExp->type == 2)
5395 {
5396 if(source->isSigned)
5397 value = strtoll(sourceExp->constant, (((void *)0)), 0);
5398 else
5399 value = strtoull(sourceExp->constant, (((void *)0)), 0);
5400 }
5401 else if(sourceExp->type == 4 && sourceExp->op.op == '-' && !sourceExp->op.exp1 && sourceExp->op.exp2 && sourceExp->op.exp2->type == 2)
5402 {
5403 if(source->isSigned)
5404 value = -strtoll(sourceExp->op.exp2->constant, (((void *)0)), 0);
5405 else
5406 value = -strtoull(sourceExp->op.exp2->constant, (((void *)0)), 0);
5407 }
5408 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
5409 {
5410 FreeType(source);
5411 source = __extension__ ({
5412 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5413
5414 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0x0, __ecereInstance1->refCount = 1, __ecereInstance1;
5415 });
5416 }
5417 if(dest->kind == 8)
5418 {
5419 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5420
5421 if(_class && _class->type == 3)
5422 {
5423 if(source->kind != 8)
5424 {
5425 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5426 struct Type * tempDest, * tempSource;
5427
5428 for(; _class->base->type != 1000; _class = _class->base)
5429 ;
5430 tempSource = dest;
5431 tempDest = tempType;
5432 tempType->kind = 8;
5433 if(!_class->symbol)
5434 _class->symbol = FindClass(_class->fullName);
5435 tempType->_class = _class->symbol;
5436 tempType->truth = dest->truth;
5437 if(tempType->_class)
5438 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5439 backupSourceExpType = sourceExp->expType;
5440 sourceExp->expType = dest;
5441 dest->refCount++;
5442 flag = 0x1;
5443 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5444 }
5445 }
5446 if(_class && _class->type == 2 && source->kind != 8)
5447 {
5448 if(!dest->_class->registered->dataType)
5449 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5450 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5451 {
5452 FreeType(source);
5453 FreeType(sourceExp->expType);
5454 source = sourceExp->expType = MkClassType(dest->_class->string);
5455 source->refCount++;
5456 }
5457 }
5458 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5459 {
5460 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5461 struct Declarator * decl;
5462 char string[1024];
5463
5464 ReadString(string, sourceExp->string);
5465 decl = SpecDeclFromString(string, specs, (((void *)0)));
5466 FreeExpContents(sourceExp);
5467 FreeType(sourceExp->expType);
5468 sourceExp->type = 24;
5469 sourceExp->_classExp.specifiers = specs;
5470 sourceExp->_classExp.decl = decl;
5471 sourceExp->expType = dest;
5472 dest->refCount++;
5473 FreeType(source);
5474 FreeType(dest);
5475 if(backupSourceExpType)
5476 FreeType(backupSourceExpType);
5477 return 0x1;
5478 }
5479 }
5480 else if(source->kind == 8)
5481 {
5482 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5483
5484 if(_class && (_class->type == 3 || !strcmp(_class->fullName, "bool") || _class->type == 2))
5485 {
5486 if(dest->kind != 8)
5487 {
5488 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5489 struct Type * tempDest, * tempSource;
5490
5491 if(!source->_class->registered->dataType)
5492 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5493 for(; _class->base->type != 1000; _class = _class->base)
5494 ;
5495 tempDest = source;
5496 tempSource = tempType;
5497 tempType->kind = 8;
5498 tempType->_class = FindClass(_class->fullName);
5499 tempType->truth = source->truth;
5500 tempType->classObjectType = source->classObjectType;
5501 if(tempType->_class)
5502 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5503 if(conversions->last)
5504 {
5505 ((struct Conversion *)conversions->last)->resultType = dest;
5506 dest->refCount++;
5507 }
5508 FreeType(sourceExp->expType);
5509 sourceExp->expType = MkClassType(_class->fullName);
5510 sourceExp->expType->truth = source->truth;
5511 sourceExp->expType->classObjectType = source->classObjectType;
5512 if(!sourceExp->destType)
5513 {
5514 FreeType(sourceExp->destType);
5515 sourceExp->destType = sourceExp->expType;
5516 if(sourceExp->expType)
5517 sourceExp->expType->refCount++;
5518 }
5519 if(!_class->dataType)
5520 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5521 FreeType(dest);
5522 dest = MkClassType(source->_class->string);
5523 dest->truth = source->truth;
5524 dest->classObjectType = source->classObjectType;
5525 FreeType(source);
5526 source = _class->dataType;
5527 source->refCount++;
5528 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5529 }
5530 }
5531 }
5532 if(!flag)
5533 {
5534 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5535 {
5536 FreeType(source);
5537 FreeType(dest);
5538 return 0x1;
5539 }
5540 }
5541 if(dest->kind == 8)
5542 {
5543 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5544
5545 if(_class && !dest->truth && (_class->type == 3 || !strcmp(_class->fullName, "bool") || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5546 {
5547 if(_class->type == 0 || _class->type == 5)
5548 {
5549 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5550
5551 *newExp = *sourceExp;
5552 if(sourceExp->destType)
5553 sourceExp->destType->refCount++;
5554 if(sourceExp->expType)
5555 sourceExp->expType->refCount++;
5556 sourceExp->type = 11;
5557 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5558 sourceExp->cast.exp = newExp;
5559 FreeType(sourceExp->expType);
5560 sourceExp->expType = (((void *)0));
5561 ProcessExpressionType(sourceExp);
5562 if(!inCompiler)
5563 {
5564 FreeType(sourceExp->expType);
5565 sourceExp->expType = dest;
5566 }
5567 FreeType(source);
5568 if(inCompiler)
5569 FreeType(dest);
5570 if(backupSourceExpType)
5571 FreeType(backupSourceExpType);
5572 return 0x1;
5573 }
5574 if(!_class->dataType)
5575 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5576 FreeType(dest);
5577 dest = _class->dataType;
5578 dest->refCount++;
5579 }
5580 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))
5581 {
5582 specs = MkListOne(MkSpecifier(DOUBLE));
5583 }
5584 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))
5585 {
5586 specs = MkListOne(MkSpecifier(FLOAT));
5587 }
5588 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))
5589 {
5590 specs = MkList();
5591 if(!dest->isSigned)
5592 ListAdd(specs, MkSpecifier(UNSIGNED));
5593 ListAdd(specs, MkSpecifier(INT64));
5594 }
5595 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
5596 {
5597 specs = MkList();
5598 if(!dest->isSigned)
5599 ListAdd(specs, MkSpecifier(UNSIGNED));
5600 ListAdd(specs, MkSpecifier(INT));
5601 }
5602 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5603 {
5604 specs = MkList();
5605 if(!dest->isSigned)
5606 ListAdd(specs, MkSpecifier(UNSIGNED));
5607 ListAdd(specs, MkSpecifier(SHORT));
5608 }
5609 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 24 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5610 {
5611 specs = MkList();
5612 if(!dest->isSigned)
5613 ListAdd(specs, MkSpecifier(UNSIGNED));
5614 ListAdd(specs, MkSpecifier(CHAR));
5615 }
5616 else
5617 {
5618 FreeType(source);
5619 FreeType(dest);
5620 if(backupSourceExpType)
5621 {
5622 if(sourceExp->expType)
5623 FreeType(sourceExp->expType);
5624 sourceExp->expType = backupSourceExpType;
5625 }
5626 return 0x0;
5627 }
5628 }
5629 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))
5630 {
5631 specs = MkListOne(MkSpecifier(DOUBLE));
5632 }
5633 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))
5634 {
5635 specs = MkListOne(MkSpecifier(FLOAT));
5636 }
5637 else if(dest->kind == 24 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (value == 1 || value == 0))
5638 {
5639 specs = MkList();
5640 ListAdd(specs, MkSpecifier(BOOL));
5641 }
5642 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)))
5643 {
5644 specs = MkList();
5645 if(!dest->isSigned)
5646 ListAdd(specs, MkSpecifier(UNSIGNED));
5647 ListAdd(specs, MkSpecifier(CHAR));
5648 }
5649 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)))))
5650 {
5651 specs = MkList();
5652 if(!dest->isSigned)
5653 ListAdd(specs, MkSpecifier(UNSIGNED));
5654 ListAdd(specs, MkSpecifier(SHORT));
5655 }
5656 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3))
5657 {
5658 specs = MkList();
5659 if(!dest->isSigned)
5660 ListAdd(specs, MkSpecifier(UNSIGNED));
5661 ListAdd(specs, MkSpecifier(INT));
5662 }
5663 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5664 {
5665 specs = MkList();
5666 if(!dest->isSigned)
5667 ListAdd(specs, MkSpecifier(UNSIGNED));
5668 ListAdd(specs, MkSpecifier(INT64));
5669 }
5670 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
5671 {
5672 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5673 }
5674 else
5675 {
5676 FreeType(source);
5677 FreeType(dest);
5678 if(backupSourceExpType)
5679 {
5680 if(sourceExp->expType)
5681 FreeType(sourceExp->expType);
5682 sourceExp->expType = backupSourceExpType;
5683 }
5684 return 0x0;
5685 }
5686 if(!flag)
5687 {
5688 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5689
5690 *newExp = *sourceExp;
5691 newExp->prev = (((void *)0));
5692 newExp->next = (((void *)0));
5693 if(sourceExp->destType)
5694 sourceExp->destType->refCount++;
5695 if(sourceExp->expType)
5696 sourceExp->expType->refCount++;
5697 sourceExp->type = 11;
5698 if(realDest->kind == 8)
5699 {
5700 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5701 FreeList(specs, FreeSpecifier);
5702 }
5703 else
5704 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5705 if(newExp->type == 4)
5706 {
5707 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5708 }
5709 else
5710 sourceExp->cast.exp = newExp;
5711 FreeType(sourceExp->expType);
5712 sourceExp->expType = (((void *)0));
5713 ProcessExpressionType(sourceExp);
5714 }
5715 else
5716 FreeList(specs, FreeSpecifier);
5717 FreeType(dest);
5718 FreeType(source);
5719 if(backupSourceExpType)
5720 FreeType(backupSourceExpType);
5721 return 0x1;
5722 }
5723 else
5724 {
5725 while((sourceExp->type == 5 || sourceExp->type == 32) && sourceExp->list)
5726 sourceExp = (*sourceExp->list).last;
5727 if(sourceExp->type == 0)
5728 {
5729 struct Identifier * id = sourceExp->identifier;
5730
5731 if(dest->kind == 8)
5732 {
5733 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5734 {
5735 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5736 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5737
5738 if(enumClass)
5739 {
5740 for(; _class && _class->type == 4; _class = _class->base)
5741 {
5742 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5743 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5744
5745 for(value = e->values.first; value; value = value->next)
5746 {
5747 if(!strcmp(value->name, id->string))
5748 break;
5749 }
5750 if(value)
5751 {
5752 FreeExpContents(sourceExp);
5753 FreeType(sourceExp->expType);
5754 sourceExp->isConstant = 0x1;
5755 sourceExp->expType = MkClassType(_class->fullName);
5756 {
5757 char constant[256];
5758
5759 sourceExp->type = 2;
5760 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5761 sprintf(constant, "%d", (int)value->data);
5762 else
5763 sprintf(constant, "0x%X", (int)value->data);
5764 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5765 }
5766 return 0x1;
5767 }
5768 }
5769 }
5770 }
5771 }
5772 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5773 return 0x1;
5774 }
5775 }
5776 return 0x0;
5777 }
5778
5779 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5780 {
5781 int value2 = op2->i;
5782
5783 exp->type = 2;
5784 exp->string = PrintInt(op1->i + value2);
5785 if(!exp->expType)
5786 {
5787 exp->expType = op1->type;
5788 if(op1->type)
5789 op1->type->refCount++;
5790 }
5791 return 0x1;
5792 }
5793
5794 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5795 {
5796 unsigned int value2 = op2->ui;
5797
5798 exp->type = 2;
5799 exp->string = PrintUInt(op1->ui + value2);
5800 if(!exp->expType)
5801 {
5802 exp->expType = op1->type;
5803 if(op1->type)
5804 op1->type->refCount++;
5805 }
5806 return 0x1;
5807 }
5808
5809 static unsigned int Int64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5810 {
5811 long long value2 = op2->i64;
5812
5813 exp->type = 2;
5814 exp->string = PrintInt64(op1->i64 + value2);
5815 if(!exp->expType)
5816 {
5817 exp->expType = op1->type;
5818 if(op1->type)
5819 op1->type->refCount++;
5820 }
5821 return 0x1;
5822 }
5823
5824 static unsigned int UInt64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5825 {
5826 uint64 value2 = op2->ui64;
5827
5828 exp->type = 2;
5829 exp->string = PrintUInt64(op1->ui64 + value2);
5830 if(!exp->expType)
5831 {
5832 exp->expType = op1->type;
5833 if(op1->type)
5834 op1->type->refCount++;
5835 }
5836 return 0x1;
5837 }
5838
5839 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5840 {
5841 short value2 = op2->s;
5842
5843 exp->type = 2;
5844 exp->string = PrintShort(op1->s + value2);
5845 if(!exp->expType)
5846 {
5847 exp->expType = op1->type;
5848 if(op1->type)
5849 op1->type->refCount++;
5850 }
5851 return 0x1;
5852 }
5853
5854 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5855 {
5856 unsigned short value2 = op2->us;
5857
5858 exp->type = 2;
5859 exp->string = PrintUShort(op1->us + value2);
5860 if(!exp->expType)
5861 {
5862 exp->expType = op1->type;
5863 if(op1->type)
5864 op1->type->refCount++;
5865 }
5866 return 0x1;
5867 }
5868
5869 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5870 {
5871 char value2 = op2->c;
5872
5873 exp->type = 2;
5874 exp->string = PrintChar(op1->c + value2);
5875 if(!exp->expType)
5876 {
5877 exp->expType = op1->type;
5878 if(op1->type)
5879 op1->type->refCount++;
5880 }
5881 return 0x1;
5882 }
5883
5884 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5885 {
5886 unsigned char value2 = op2->uc;
5887
5888 exp->type = 2;
5889 exp->string = PrintUChar(op1->uc + value2);
5890 if(!exp->expType)
5891 {
5892 exp->expType = op1->type;
5893 if(op1->type)
5894 op1->type->refCount++;
5895 }
5896 return 0x1;
5897 }
5898
5899 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5900 {
5901 float value2 = op2->f;
5902
5903 exp->type = 2;
5904 exp->string = PrintFloat(op1->f + value2);
5905 if(!exp->expType)
5906 {
5907 exp->expType = op1->type;
5908 if(op1->type)
5909 op1->type->refCount++;
5910 }
5911 return 0x1;
5912 }
5913
5914 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5915 {
5916 double value2 = op2->d;
5917
5918 exp->type = 2;
5919 exp->string = PrintDouble(op1->d + value2);
5920 if(!exp->expType)
5921 {
5922 exp->expType = op1->type;
5923 if(op1->type)
5924 op1->type->refCount++;
5925 }
5926 return 0x1;
5927 }
5928
5929 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5930 {
5931 int value2 = op2->i;
5932
5933 exp->type = 2;
5934 exp->string = PrintInt(op1->i - value2);
5935 if(!exp->expType)
5936 {
5937 exp->expType = op1->type;
5938 if(op1->type)
5939 op1->type->refCount++;
5940 }
5941 return 0x1;
5942 }
5943
5944 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5945 {
5946 unsigned int value2 = op2->ui;
5947
5948 exp->type = 2;
5949 exp->string = PrintUInt(op1->ui - value2);
5950 if(!exp->expType)
5951 {
5952 exp->expType = op1->type;
5953 if(op1->type)
5954 op1->type->refCount++;
5955 }
5956 return 0x1;
5957 }
5958
5959 static unsigned int Int64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5960 {
5961 long long value2 = op2->i64;
5962
5963 exp->type = 2;
5964 exp->string = PrintInt64(op1->i64 - value2);
5965 if(!exp->expType)
5966 {
5967 exp->expType = op1->type;
5968 if(op1->type)
5969 op1->type->refCount++;
5970 }
5971 return 0x1;
5972 }
5973
5974 static unsigned int UInt64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5975 {
5976 uint64 value2 = op2->ui64;
5977
5978 exp->type = 2;
5979 exp->string = PrintUInt64(op1->ui64 - value2);
5980 if(!exp->expType)
5981 {
5982 exp->expType = op1->type;
5983 if(op1->type)
5984 op1->type->refCount++;
5985 }
5986 return 0x1;
5987 }
5988
5989 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5990 {
5991 short value2 = op2->s;
5992
5993 exp->type = 2;
5994 exp->string = PrintShort(op1->s - value2);
5995 if(!exp->expType)
5996 {
5997 exp->expType = op1->type;
5998 if(op1->type)
5999 op1->type->refCount++;
6000 }
6001 return 0x1;
6002 }
6003
6004 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6005 {
6006 unsigned short value2 = op2->us;
6007
6008 exp->type = 2;
6009 exp->string = PrintUShort(op1->us - value2);
6010 if(!exp->expType)
6011 {
6012 exp->expType = op1->type;
6013 if(op1->type)
6014 op1->type->refCount++;
6015 }
6016 return 0x1;
6017 }
6018
6019 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6020 {
6021 char value2 = op2->c;
6022
6023 exp->type = 2;
6024 exp->string = PrintChar(op1->c - value2);
6025 if(!exp->expType)
6026 {
6027 exp->expType = op1->type;
6028 if(op1->type)
6029 op1->type->refCount++;
6030 }
6031 return 0x1;
6032 }
6033
6034 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6035 {
6036 unsigned char value2 = op2->uc;
6037
6038 exp->type = 2;
6039 exp->string = PrintUChar(op1->uc - value2);
6040 if(!exp->expType)
6041 {
6042 exp->expType = op1->type;
6043 if(op1->type)
6044 op1->type->refCount++;
6045 }
6046 return 0x1;
6047 }
6048
6049 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6050 {
6051 float value2 = op2->f;
6052
6053 exp->type = 2;
6054 exp->string = PrintFloat(op1->f - value2);
6055 if(!exp->expType)
6056 {
6057 exp->expType = op1->type;
6058 if(op1->type)
6059 op1->type->refCount++;
6060 }
6061 return 0x1;
6062 }
6063
6064 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6065 {
6066 double value2 = op2->d;
6067
6068 exp->type = 2;
6069 exp->string = PrintDouble(op1->d - value2);
6070 if(!exp->expType)
6071 {
6072 exp->expType = op1->type;
6073 if(op1->type)
6074 op1->type->refCount++;
6075 }
6076 return 0x1;
6077 }
6078
6079 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6080 {
6081 int value2 = op2->i;
6082
6083 exp->type = 2;
6084 exp->string = PrintInt(op1->i * value2);
6085 if(!exp->expType)
6086 {
6087 exp->expType = op1->type;
6088 if(op1->type)
6089 op1->type->refCount++;
6090 }
6091 return 0x1;
6092 }
6093
6094 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6095 {
6096 unsigned int value2 = op2->ui;
6097
6098 exp->type = 2;
6099 exp->string = PrintUInt(op1->ui * value2);
6100 if(!exp->expType)
6101 {
6102 exp->expType = op1->type;
6103 if(op1->type)
6104 op1->type->refCount++;
6105 }
6106 return 0x1;
6107 }
6108
6109 static unsigned int Int64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6110 {
6111 long long value2 = op2->i64;
6112
6113 exp->type = 2;
6114 exp->string = PrintInt64(op1->i64 * value2);
6115 if(!exp->expType)
6116 {
6117 exp->expType = op1->type;
6118 if(op1->type)
6119 op1->type->refCount++;
6120 }
6121 return 0x1;
6122 }
6123
6124 static unsigned int UInt64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6125 {
6126 uint64 value2 = op2->ui64;
6127
6128 exp->type = 2;
6129 exp->string = PrintUInt64(op1->ui64 * value2);
6130 if(!exp->expType)
6131 {
6132 exp->expType = op1->type;
6133 if(op1->type)
6134 op1->type->refCount++;
6135 }
6136 return 0x1;
6137 }
6138
6139 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6140 {
6141 short value2 = op2->s;
6142
6143 exp->type = 2;
6144 exp->string = PrintShort(op1->s * value2);
6145 if(!exp->expType)
6146 {
6147 exp->expType = op1->type;
6148 if(op1->type)
6149 op1->type->refCount++;
6150 }
6151 return 0x1;
6152 }
6153
6154 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6155 {
6156 unsigned short value2 = op2->us;
6157
6158 exp->type = 2;
6159 exp->string = PrintUShort(op1->us * value2);
6160 if(!exp->expType)
6161 {
6162 exp->expType = op1->type;
6163 if(op1->type)
6164 op1->type->refCount++;
6165 }
6166 return 0x1;
6167 }
6168
6169 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6170 {
6171 char value2 = op2->c;
6172
6173 exp->type = 2;
6174 exp->string = PrintChar(op1->c * value2);
6175 if(!exp->expType)
6176 {
6177 exp->expType = op1->type;
6178 if(op1->type)
6179 op1->type->refCount++;
6180 }
6181 return 0x1;
6182 }
6183
6184 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6185 {
6186 unsigned char value2 = op2->uc;
6187
6188 exp->type = 2;
6189 exp->string = PrintUChar(op1->uc * value2);
6190 if(!exp->expType)
6191 {
6192 exp->expType = op1->type;
6193 if(op1->type)
6194 op1->type->refCount++;
6195 }
6196 return 0x1;
6197 }
6198
6199 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6200 {
6201 float value2 = op2->f;
6202
6203 exp->type = 2;
6204 exp->string = PrintFloat(op1->f * value2);
6205 if(!exp->expType)
6206 {
6207 exp->expType = op1->type;
6208 if(op1->type)
6209 op1->type->refCount++;
6210 }
6211 return 0x1;
6212 }
6213
6214 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6215 {
6216 double value2 = op2->d;
6217
6218 exp->type = 2;
6219 exp->string = PrintDouble(op1->d * value2);
6220 if(!exp->expType)
6221 {
6222 exp->expType = op1->type;
6223 if(op1->type)
6224 op1->type->refCount++;
6225 }
6226 return 0x1;
6227 }
6228
6229 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6230 {
6231 int value2 = op2->i;
6232
6233 exp->type = 2;
6234 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
6235 if(!exp->expType)
6236 {
6237 exp->expType = op1->type;
6238 if(op1->type)
6239 op1->type->refCount++;
6240 }
6241 return 0x1;
6242 }
6243
6244 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6245 {
6246 unsigned int value2 = op2->ui;
6247
6248 exp->type = 2;
6249 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
6250 if(!exp->expType)
6251 {
6252 exp->expType = op1->type;
6253 if(op1->type)
6254 op1->type->refCount++;
6255 }
6256 return 0x1;
6257 }
6258
6259 static unsigned int Int64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6260 {
6261 long long value2 = op2->i64;
6262
6263 exp->type = 2;
6264 exp->string = PrintInt64(value2 ? (op1->i64 / value2) : 0);
6265 if(!exp->expType)
6266 {
6267 exp->expType = op1->type;
6268 if(op1->type)
6269 op1->type->refCount++;
6270 }
6271 return 0x1;
6272 }
6273
6274 static unsigned int UInt64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6275 {
6276 uint64 value2 = op2->ui64;
6277
6278 exp->type = 2;
6279 exp->string = PrintUInt64(value2 ? (op1->ui64 / value2) : 0);
6280 if(!exp->expType)
6281 {
6282 exp->expType = op1->type;
6283 if(op1->type)
6284 op1->type->refCount++;
6285 }
6286 return 0x1;
6287 }
6288
6289 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6290 {
6291 short value2 = op2->s;
6292
6293 exp->type = 2;
6294 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
6295 if(!exp->expType)
6296 {
6297 exp->expType = op1->type;
6298 if(op1->type)
6299 op1->type->refCount++;
6300 }
6301 return 0x1;
6302 }
6303
6304 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6305 {
6306 unsigned short value2 = op2->us;
6307
6308 exp->type = 2;
6309 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
6310 if(!exp->expType)
6311 {
6312 exp->expType = op1->type;
6313 if(op1->type)
6314 op1->type->refCount++;
6315 }
6316 return 0x1;
6317 }
6318
6319 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6320 {
6321 char value2 = op2->c;
6322
6323 exp->type = 2;
6324 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
6325 if(!exp->expType)
6326 {
6327 exp->expType = op1->type;
6328 if(op1->type)
6329 op1->type->refCount++;
6330 }
6331 return 0x1;
6332 }
6333
6334 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6335 {
6336 unsigned char value2 = op2->uc;
6337
6338 exp->type = 2;
6339 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
6340 if(!exp->expType)
6341 {
6342 exp->expType = op1->type;
6343 if(op1->type)
6344 op1->type->refCount++;
6345 }
6346 return 0x1;
6347 }
6348
6349 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6350 {
6351 float value2 = op2->f;
6352
6353 exp->type = 2;
6354 exp->string = PrintFloat(op1->f / value2);
6355 if(!exp->expType)
6356 {
6357 exp->expType = op1->type;
6358 if(op1->type)
6359 op1->type->refCount++;
6360 }
6361 return 0x1;
6362 }
6363
6364 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6365 {
6366 double value2 = op2->d;
6367
6368 exp->type = 2;
6369 exp->string = PrintDouble(op1->d / value2);
6370 if(!exp->expType)
6371 {
6372 exp->expType = op1->type;
6373 if(op1->type)
6374 op1->type->refCount++;
6375 }
6376 return 0x1;
6377 }
6378
6379 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6380 {
6381 int value2 = op2->i;
6382
6383 exp->type = 2;
6384 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
6385 if(!exp->expType)
6386 {
6387 exp->expType = op1->type;
6388 if(op1->type)
6389 op1->type->refCount++;
6390 }
6391 return 0x1;
6392 }
6393
6394 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6395 {
6396 unsigned int value2 = op2->ui;
6397
6398 exp->type = 2;
6399 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
6400 if(!exp->expType)
6401 {
6402 exp->expType = op1->type;
6403 if(op1->type)
6404 op1->type->refCount++;
6405 }
6406 return 0x1;
6407 }
6408
6409 static unsigned int Int64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6410 {
6411 long long value2 = op2->i64;
6412
6413 exp->type = 2;
6414 exp->string = PrintInt64(value2 ? (op1->i64 % value2) : 0);
6415 if(!exp->expType)
6416 {
6417 exp->expType = op1->type;
6418 if(op1->type)
6419 op1->type->refCount++;
6420 }
6421 return 0x1;
6422 }
6423
6424 static unsigned int UInt64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6425 {
6426 uint64 value2 = op2->ui64;
6427
6428 exp->type = 2;
6429 exp->string = PrintUInt64(value2 ? (op1->ui64 % value2) : 0);
6430 if(!exp->expType)
6431 {
6432 exp->expType = op1->type;
6433 if(op1->type)
6434 op1->type->refCount++;
6435 }
6436 return 0x1;
6437 }
6438
6439 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6440 {
6441 short value2 = op2->s;
6442
6443 exp->type = 2;
6444 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
6445 if(!exp->expType)
6446 {
6447 exp->expType = op1->type;
6448 if(op1->type)
6449 op1->type->refCount++;
6450 }
6451 return 0x1;
6452 }
6453
6454 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6455 {
6456 unsigned short value2 = op2->us;
6457
6458 exp->type = 2;
6459 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
6460 if(!exp->expType)
6461 {
6462 exp->expType = op1->type;
6463 if(op1->type)
6464 op1->type->refCount++;
6465 }
6466 return 0x1;
6467 }
6468
6469 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6470 {
6471 char value2 = op2->c;
6472
6473 exp->type = 2;
6474 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
6475 if(!exp->expType)
6476 {
6477 exp->expType = op1->type;
6478 if(op1->type)
6479 op1->type->refCount++;
6480 }
6481 return 0x1;
6482 }
6483
6484 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6485 {
6486 unsigned char value2 = op2->uc;
6487
6488 exp->type = 2;
6489 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
6490 if(!exp->expType)
6491 {
6492 exp->expType = op1->type;
6493 if(op1->type)
6494 op1->type->refCount++;
6495 }
6496 return 0x1;
6497 }
6498
6499 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6500 {
6501 exp->type = 2;
6502 exp->string = PrintInt((-op1->i));
6503 if(!exp->expType)
6504 {
6505 exp->expType = op1->type;
6506 if(op1->type)
6507 op1->type->refCount++;
6508 }
6509 return 0x1;
6510 }
6511
6512 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6513 {
6514 exp->type = 2;
6515 exp->string = PrintUInt((unsigned int)(-op1->ui));
6516 if(!exp->expType)
6517 {
6518 exp->expType = op1->type;
6519 if(op1->type)
6520 op1->type->refCount++;
6521 }
6522 return 0x1;
6523 }
6524
6525 static unsigned int Int64Neg(struct Expression * exp, struct Operand * op1)
6526 {
6527 exp->type = 2;
6528 exp->string = PrintInt64((-op1->i64));
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 UInt64Neg(struct Expression * exp, struct Operand * op1)
6539 {
6540 exp->type = 2;
6541 exp->string = PrintUInt64((uint64)(-op1->ui64));
6542 if(!exp->expType)
6543 {
6544 exp->expType = op1->type;
6545 if(op1->type)
6546 op1->type->refCount++;
6547 }
6548 return 0x1;
6549 }
6550
6551 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6552 {
6553 exp->type = 2;
6554 exp->string = PrintShort((-op1->s));
6555 if(!exp->expType)
6556 {
6557 exp->expType = op1->type;
6558 if(op1->type)
6559 op1->type->refCount++;
6560 }
6561 return 0x1;
6562 }
6563
6564 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6565 {
6566 exp->type = 2;
6567 exp->string = PrintUShort((unsigned short)(-op1->us));
6568 if(!exp->expType)
6569 {
6570 exp->expType = op1->type;
6571 if(op1->type)
6572 op1->type->refCount++;
6573 }
6574 return 0x1;
6575 }
6576
6577 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6578 {
6579 exp->type = 2;
6580 exp->string = PrintChar((-op1->c));
6581 if(!exp->expType)
6582 {
6583 exp->expType = op1->type;
6584 if(op1->type)
6585 op1->type->refCount++;
6586 }
6587 return 0x1;
6588 }
6589
6590 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6591 {
6592 exp->type = 2;
6593 exp->string = PrintUChar((unsigned char)(-op1->uc));
6594 if(!exp->expType)
6595 {
6596 exp->expType = op1->type;
6597 if(op1->type)
6598 op1->type->refCount++;
6599 }
6600 return 0x1;
6601 }
6602
6603 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6604 {
6605 exp->type = 2;
6606 exp->string = PrintFloat((float)(-op1->f));
6607 if(!exp->expType)
6608 {
6609 exp->expType = op1->type;
6610 if(op1->type)
6611 op1->type->refCount++;
6612 }
6613 return 0x1;
6614 }
6615
6616 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6617 {
6618 exp->type = 2;
6619 exp->string = PrintDouble((double)(-op1->d));
6620 if(!exp->expType)
6621 {
6622 exp->expType = op1->type;
6623 if(op1->type)
6624 op1->type->refCount++;
6625 }
6626 return 0x1;
6627 }
6628
6629 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6630 {
6631 exp->type = 2;
6632 exp->string = PrintInt((++op1->i));
6633 if(!exp->expType)
6634 {
6635 exp->expType = op1->type;
6636 if(op1->type)
6637 op1->type->refCount++;
6638 }
6639 return 0x1;
6640 }
6641
6642 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6643 {
6644 exp->type = 2;
6645 exp->string = PrintUInt((++op1->ui));
6646 if(!exp->expType)
6647 {
6648 exp->expType = op1->type;
6649 if(op1->type)
6650 op1->type->refCount++;
6651 }
6652 return 0x1;
6653 }
6654
6655 static unsigned int Int64Inc(struct Expression * exp, struct Operand * op1)
6656 {
6657 exp->type = 2;
6658 exp->string = PrintInt64((++op1->i64));
6659 if(!exp->expType)
6660 {
6661 exp->expType = op1->type;
6662 if(op1->type)
6663 op1->type->refCount++;
6664 }
6665 return 0x1;
6666 }
6667
6668 static unsigned int UInt64Inc(struct Expression * exp, struct Operand * op1)
6669 {
6670 exp->type = 2;
6671 exp->string = PrintUInt64((++op1->ui64));
6672 if(!exp->expType)
6673 {
6674 exp->expType = op1->type;
6675 if(op1->type)
6676 op1->type->refCount++;
6677 }
6678 return 0x1;
6679 }
6680
6681 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6682 {
6683 exp->type = 2;
6684 exp->string = PrintShort((++op1->s));
6685 if(!exp->expType)
6686 {
6687 exp->expType = op1->type;
6688 if(op1->type)
6689 op1->type->refCount++;
6690 }
6691 return 0x1;
6692 }
6693
6694 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6695 {
6696 exp->type = 2;
6697 exp->string = PrintUShort((++op1->us));
6698 if(!exp->expType)
6699 {
6700 exp->expType = op1->type;
6701 if(op1->type)
6702 op1->type->refCount++;
6703 }
6704 return 0x1;
6705 }
6706
6707 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6708 {
6709 exp->type = 2;
6710 exp->string = PrintChar((++op1->c));
6711 if(!exp->expType)
6712 {
6713 exp->expType = op1->type;
6714 if(op1->type)
6715 op1->type->refCount++;
6716 }
6717 return 0x1;
6718 }
6719
6720 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6721 {
6722 exp->type = 2;
6723 exp->string = PrintUChar((++op1->uc));
6724 if(!exp->expType)
6725 {
6726 exp->expType = op1->type;
6727 if(op1->type)
6728 op1->type->refCount++;
6729 }
6730 return 0x1;
6731 }
6732
6733 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6734 {
6735 exp->type = 2;
6736 exp->string = PrintFloat((float)(++op1->f));
6737 if(!exp->expType)
6738 {
6739 exp->expType = op1->type;
6740 if(op1->type)
6741 op1->type->refCount++;
6742 }
6743 return 0x1;
6744 }
6745
6746 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6747 {
6748 exp->type = 2;
6749 exp->string = PrintDouble((double)(++op1->d));
6750 if(!exp->expType)
6751 {
6752 exp->expType = op1->type;
6753 if(op1->type)
6754 op1->type->refCount++;
6755 }
6756 return 0x1;
6757 }
6758
6759 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6760 {
6761 exp->type = 2;
6762 exp->string = PrintInt((--op1->i));
6763 if(!exp->expType)
6764 {
6765 exp->expType = op1->type;
6766 if(op1->type)
6767 op1->type->refCount++;
6768 }
6769 return 0x1;
6770 }
6771
6772 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6773 {
6774 exp->type = 2;
6775 exp->string = PrintUInt((--op1->ui));
6776 if(!exp->expType)
6777 {
6778 exp->expType = op1->type;
6779 if(op1->type)
6780 op1->type->refCount++;
6781 }
6782 return 0x1;
6783 }
6784
6785 static unsigned int Int64Dec(struct Expression * exp, struct Operand * op1)
6786 {
6787 exp->type = 2;
6788 exp->string = PrintInt64((--op1->i64));
6789 if(!exp->expType)
6790 {
6791 exp->expType = op1->type;
6792 if(op1->type)
6793 op1->type->refCount++;
6794 }
6795 return 0x1;
6796 }
6797
6798 static unsigned int UInt64Dec(struct Expression * exp, struct Operand * op1)
6799 {
6800 exp->type = 2;
6801 exp->string = PrintUInt64((--op1->ui64));
6802 if(!exp->expType)
6803 {
6804 exp->expType = op1->type;
6805 if(op1->type)
6806 op1->type->refCount++;
6807 }
6808 return 0x1;
6809 }
6810
6811 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6812 {
6813 exp->type = 2;
6814 exp->string = PrintShort((--op1->s));
6815 if(!exp->expType)
6816 {
6817 exp->expType = op1->type;
6818 if(op1->type)
6819 op1->type->refCount++;
6820 }
6821 return 0x1;
6822 }
6823
6824 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6825 {
6826 exp->type = 2;
6827 exp->string = PrintUShort((--op1->us));
6828 if(!exp->expType)
6829 {
6830 exp->expType = op1->type;
6831 if(op1->type)
6832 op1->type->refCount++;
6833 }
6834 return 0x1;
6835 }
6836
6837 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6838 {
6839 exp->type = 2;
6840 exp->string = PrintChar((--op1->c));
6841 if(!exp->expType)
6842 {
6843 exp->expType = op1->type;
6844 if(op1->type)
6845 op1->type->refCount++;
6846 }
6847 return 0x1;
6848 }
6849
6850 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6851 {
6852 exp->type = 2;
6853 exp->string = PrintUChar((--op1->uc));
6854 if(!exp->expType)
6855 {
6856 exp->expType = op1->type;
6857 if(op1->type)
6858 op1->type->refCount++;
6859 }
6860 return 0x1;
6861 }
6862
6863 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6864 {
6865 exp->type = 2;
6866 exp->string = PrintFloat((float)(--op1->f));
6867 if(!exp->expType)
6868 {
6869 exp->expType = op1->type;
6870 if(op1->type)
6871 op1->type->refCount++;
6872 }
6873 return 0x1;
6874 }
6875
6876 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6877 {
6878 exp->type = 2;
6879 exp->string = PrintDouble((double)(--op1->d));
6880 if(!exp->expType)
6881 {
6882 exp->expType = op1->type;
6883 if(op1->type)
6884 op1->type->refCount++;
6885 }
6886 return 0x1;
6887 }
6888
6889 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6890 {
6891 int value2 = op2->i;
6892
6893 exp->type = 2;
6894 exp->string = PrintInt(op1->i = value2);
6895 if(!exp->expType)
6896 {
6897 exp->expType = op1->type;
6898 if(op1->type)
6899 op1->type->refCount++;
6900 }
6901 return 0x1;
6902 }
6903
6904 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6905 {
6906 unsigned int value2 = op2->ui;
6907
6908 exp->type = 2;
6909 exp->string = PrintUInt(op1->ui = value2);
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 Int64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6920 {
6921 long long value2 = op2->i64;
6922
6923 exp->type = 2;
6924 exp->string = PrintInt64(op1->i64 = value2);
6925 if(!exp->expType)
6926 {
6927 exp->expType = op1->type;
6928 if(op1->type)
6929 op1->type->refCount++;
6930 }
6931 return 0x1;
6932 }
6933
6934 static unsigned int UInt64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6935 {
6936 uint64 value2 = op2->ui64;
6937
6938 exp->type = 2;
6939 exp->string = PrintUInt64(op1->ui64 = value2);
6940 if(!exp->expType)
6941 {
6942 exp->expType = op1->type;
6943 if(op1->type)
6944 op1->type->refCount++;
6945 }
6946 return 0x1;
6947 }
6948
6949 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6950 {
6951 short value2 = op2->s;
6952
6953 exp->type = 2;
6954 exp->string = PrintShort(op1->s = value2);
6955 if(!exp->expType)
6956 {
6957 exp->expType = op1->type;
6958 if(op1->type)
6959 op1->type->refCount++;
6960 }
6961 return 0x1;
6962 }
6963
6964 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6965 {
6966 unsigned short value2 = op2->us;
6967
6968 exp->type = 2;
6969 exp->string = PrintUShort(op1->us = value2);
6970 if(!exp->expType)
6971 {
6972 exp->expType = op1->type;
6973 if(op1->type)
6974 op1->type->refCount++;
6975 }
6976 return 0x1;
6977 }
6978
6979 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6980 {
6981 char value2 = op2->c;
6982
6983 exp->type = 2;
6984 exp->string = PrintChar(op1->c = value2);
6985 if(!exp->expType)
6986 {
6987 exp->expType = op1->type;
6988 if(op1->type)
6989 op1->type->refCount++;
6990 }
6991 return 0x1;
6992 }
6993
6994 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6995 {
6996 unsigned char value2 = op2->uc;
6997
6998 exp->type = 2;
6999 exp->string = PrintUChar(op1->uc = value2);
7000 if(!exp->expType)
7001 {
7002 exp->expType = op1->type;
7003 if(op1->type)
7004 op1->type->refCount++;
7005 }
7006 return 0x1;
7007 }
7008
7009 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7010 {
7011 float value2 = op2->f;
7012
7013 exp->type = 2;
7014 exp->string = PrintFloat(op1->f = value2);
7015 if(!exp->expType)
7016 {
7017 exp->expType = op1->type;
7018 if(op1->type)
7019 op1->type->refCount++;
7020 }
7021 return 0x1;
7022 }
7023
7024 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7025 {
7026 double value2 = op2->d;
7027
7028 exp->type = 2;
7029 exp->string = PrintDouble(op1->d = value2);
7030 if(!exp->expType)
7031 {
7032 exp->expType = op1->type;
7033 if(op1->type)
7034 op1->type->refCount++;
7035 }
7036 return 0x1;
7037 }
7038
7039 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7040 {
7041 int value2 = op2->i;
7042
7043 exp->type = 2;
7044 exp->string = PrintInt(op1->i += value2);
7045 if(!exp->expType)
7046 {
7047 exp->expType = op1->type;
7048 if(op1->type)
7049 op1->type->refCount++;
7050 }
7051 return 0x1;
7052 }
7053
7054 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7055 {
7056 unsigned int value2 = op2->ui;
7057
7058 exp->type = 2;
7059 exp->string = PrintUInt(op1->ui += value2);
7060 if(!exp->expType)
7061 {
7062 exp->expType = op1->type;
7063 if(op1->type)
7064 op1->type->refCount++;
7065 }
7066 return 0x1;
7067 }
7068
7069 static unsigned int Int64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7070 {
7071 long long value2 = op2->i64;
7072
7073 exp->type = 2;
7074 exp->string = PrintInt64(op1->i64 += value2);
7075 if(!exp->expType)
7076 {
7077 exp->expType = op1->type;
7078 if(op1->type)
7079 op1->type->refCount++;
7080 }
7081 return 0x1;
7082 }
7083
7084 static unsigned int UInt64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7085 {
7086 uint64 value2 = op2->ui64;
7087
7088 exp->type = 2;
7089 exp->string = PrintUInt64(op1->ui64 += value2);
7090 if(!exp->expType)
7091 {
7092 exp->expType = op1->type;
7093 if(op1->type)
7094 op1->type->refCount++;
7095 }
7096 return 0x1;
7097 }
7098
7099 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7100 {
7101 short value2 = op2->s;
7102
7103 exp->type = 2;
7104 exp->string = PrintShort(op1->s += value2);
7105 if(!exp->expType)
7106 {
7107 exp->expType = op1->type;
7108 if(op1->type)
7109 op1->type->refCount++;
7110 }
7111 return 0x1;
7112 }
7113
7114 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7115 {
7116 unsigned short value2 = op2->us;
7117
7118 exp->type = 2;
7119 exp->string = PrintUShort(op1->us += value2);
7120 if(!exp->expType)
7121 {
7122 exp->expType = op1->type;
7123 if(op1->type)
7124 op1->type->refCount++;
7125 }
7126 return 0x1;
7127 }
7128
7129 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7130 {
7131 char value2 = op2->c;
7132
7133 exp->type = 2;
7134 exp->string = PrintChar(op1->c += value2);
7135 if(!exp->expType)
7136 {
7137 exp->expType = op1->type;
7138 if(op1->type)
7139 op1->type->refCount++;
7140 }
7141 return 0x1;
7142 }
7143
7144 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7145 {
7146 unsigned char value2 = op2->uc;
7147
7148 exp->type = 2;
7149 exp->string = PrintUChar(op1->uc += value2);
7150 if(!exp->expType)
7151 {
7152 exp->expType = op1->type;
7153 if(op1->type)
7154 op1->type->refCount++;
7155 }
7156 return 0x1;
7157 }
7158
7159 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7160 {
7161 float value2 = op2->f;
7162
7163 exp->type = 2;
7164 exp->string = PrintFloat(op1->f += value2);
7165 if(!exp->expType)
7166 {
7167 exp->expType = op1->type;
7168 if(op1->type)
7169 op1->type->refCount++;
7170 }
7171 return 0x1;
7172 }
7173
7174 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7175 {
7176 double value2 = op2->d;
7177
7178 exp->type = 2;
7179 exp->string = PrintDouble(op1->d += value2);
7180 if(!exp->expType)
7181 {
7182 exp->expType = op1->type;
7183 if(op1->type)
7184 op1->type->refCount++;
7185 }
7186 return 0x1;
7187 }
7188
7189 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7190 {
7191 int value2 = op2->i;
7192
7193 exp->type = 2;
7194 exp->string = PrintInt(op1->i -= value2);
7195 if(!exp->expType)
7196 {
7197 exp->expType = op1->type;
7198 if(op1->type)
7199 op1->type->refCount++;
7200 }
7201 return 0x1;
7202 }
7203
7204 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7205 {
7206 unsigned int value2 = op2->ui;
7207
7208 exp->type = 2;
7209 exp->string = PrintUInt(op1->ui -= value2);
7210 if(!exp->expType)
7211 {
7212 exp->expType = op1->type;
7213 if(op1->type)
7214 op1->type->refCount++;
7215 }
7216 return 0x1;
7217 }
7218
7219 static unsigned int Int64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7220 {
7221 long long value2 = op2->i64;
7222
7223 exp->type = 2;
7224 exp->string = PrintInt64(op1->i64 -= value2);
7225 if(!exp->expType)
7226 {
7227 exp->expType = op1->type;
7228 if(op1->type)
7229 op1->type->refCount++;
7230 }
7231 return 0x1;
7232 }
7233
7234 static unsigned int UInt64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7235 {
7236 uint64 value2 = op2->ui64;
7237
7238 exp->type = 2;
7239 exp->string = PrintUInt64(op1->ui64 -= value2);
7240 if(!exp->expType)
7241 {
7242 exp->expType = op1->type;
7243 if(op1->type)
7244 op1->type->refCount++;
7245 }
7246 return 0x1;
7247 }
7248
7249 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7250 {
7251 short value2 = op2->s;
7252
7253 exp->type = 2;
7254 exp->string = PrintShort(op1->s -= value2);
7255 if(!exp->expType)
7256 {
7257 exp->expType = op1->type;
7258 if(op1->type)
7259 op1->type->refCount++;
7260 }
7261 return 0x1;
7262 }
7263
7264 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7265 {
7266 unsigned short value2 = op2->us;
7267
7268 exp->type = 2;
7269 exp->string = PrintUShort(op1->us -= value2);
7270 if(!exp->expType)
7271 {
7272 exp->expType = op1->type;
7273 if(op1->type)
7274 op1->type->refCount++;
7275 }
7276 return 0x1;
7277 }
7278
7279 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7280 {
7281 char value2 = op2->c;
7282
7283 exp->type = 2;
7284 exp->string = PrintChar(op1->c -= value2);
7285 if(!exp->expType)
7286 {
7287 exp->expType = op1->type;
7288 if(op1->type)
7289 op1->type->refCount++;
7290 }
7291 return 0x1;
7292 }
7293
7294 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7295 {
7296 unsigned char value2 = op2->uc;
7297
7298 exp->type = 2;
7299 exp->string = PrintUChar(op1->uc -= value2);
7300 if(!exp->expType)
7301 {
7302 exp->expType = op1->type;
7303 if(op1->type)
7304 op1->type->refCount++;
7305 }
7306 return 0x1;
7307 }
7308
7309 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7310 {
7311 float value2 = op2->f;
7312
7313 exp->type = 2;
7314 exp->string = PrintFloat(op1->f -= value2);
7315 if(!exp->expType)
7316 {
7317 exp->expType = op1->type;
7318 if(op1->type)
7319 op1->type->refCount++;
7320 }
7321 return 0x1;
7322 }
7323
7324 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7325 {
7326 double value2 = op2->d;
7327
7328 exp->type = 2;
7329 exp->string = PrintDouble(op1->d -= value2);
7330 if(!exp->expType)
7331 {
7332 exp->expType = op1->type;
7333 if(op1->type)
7334 op1->type->refCount++;
7335 }
7336 return 0x1;
7337 }
7338
7339 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7340 {
7341 int value2 = op2->i;
7342
7343 exp->type = 2;
7344 exp->string = PrintInt(op1->i *= value2);
7345 if(!exp->expType)
7346 {
7347 exp->expType = op1->type;
7348 if(op1->type)
7349 op1->type->refCount++;
7350 }
7351 return 0x1;
7352 }
7353
7354 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7355 {
7356 unsigned int value2 = op2->ui;
7357
7358 exp->type = 2;
7359 exp->string = PrintUInt(op1->ui *= value2);
7360 if(!exp->expType)
7361 {
7362 exp->expType = op1->type;
7363 if(op1->type)
7364 op1->type->refCount++;
7365 }
7366 return 0x1;
7367 }
7368
7369 static unsigned int Int64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7370 {
7371 long long value2 = op2->i64;
7372
7373 exp->type = 2;
7374 exp->string = PrintInt64(op1->i64 *= value2);
7375 if(!exp->expType)
7376 {
7377 exp->expType = op1->type;
7378 if(op1->type)
7379 op1->type->refCount++;
7380 }
7381 return 0x1;
7382 }
7383
7384 static unsigned int UInt64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7385 {
7386 uint64 value2 = op2->ui64;
7387
7388 exp->type = 2;
7389 exp->string = PrintUInt64(op1->ui64 *= value2);
7390 if(!exp->expType)
7391 {
7392 exp->expType = op1->type;
7393 if(op1->type)
7394 op1->type->refCount++;
7395 }
7396 return 0x1;
7397 }
7398
7399 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7400 {
7401 short value2 = op2->s;
7402
7403 exp->type = 2;
7404 exp->string = PrintShort(op1->s *= value2);
7405 if(!exp->expType)
7406 {
7407 exp->expType = op1->type;
7408 if(op1->type)
7409 op1->type->refCount++;
7410 }
7411 return 0x1;
7412 }
7413
7414 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7415 {
7416 unsigned short value2 = op2->us;
7417
7418 exp->type = 2;
7419 exp->string = PrintUShort(op1->us *= value2);
7420 if(!exp->expType)
7421 {
7422 exp->expType = op1->type;
7423 if(op1->type)
7424 op1->type->refCount++;
7425 }
7426 return 0x1;
7427 }
7428
7429 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7430 {
7431 char value2 = op2->c;
7432
7433 exp->type = 2;
7434 exp->string = PrintChar(op1->c *= value2);
7435 if(!exp->expType)
7436 {
7437 exp->expType = op1->type;
7438 if(op1->type)
7439 op1->type->refCount++;
7440 }
7441 return 0x1;
7442 }
7443
7444 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7445 {
7446 unsigned char value2 = op2->uc;
7447
7448 exp->type = 2;
7449 exp->string = PrintUChar(op1->uc *= value2);
7450 if(!exp->expType)
7451 {
7452 exp->expType = op1->type;
7453 if(op1->type)
7454 op1->type->refCount++;
7455 }
7456 return 0x1;
7457 }
7458
7459 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7460 {
7461 float value2 = op2->f;
7462
7463 exp->type = 2;
7464 exp->string = PrintFloat(op1->f *= value2);
7465 if(!exp->expType)
7466 {
7467 exp->expType = op1->type;
7468 if(op1->type)
7469 op1->type->refCount++;
7470 }
7471 return 0x1;
7472 }
7473
7474 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7475 {
7476 double value2 = op2->d;
7477
7478 exp->type = 2;
7479 exp->string = PrintDouble(op1->d *= value2);
7480 if(!exp->expType)
7481 {
7482 exp->expType = op1->type;
7483 if(op1->type)
7484 op1->type->refCount++;
7485 }
7486 return 0x1;
7487 }
7488
7489 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7490 {
7491 int value2 = op2->i;
7492
7493 exp->type = 2;
7494 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
7495 if(!exp->expType)
7496 {
7497 exp->expType = op1->type;
7498 if(op1->type)
7499 op1->type->refCount++;
7500 }
7501 return 0x1;
7502 }
7503
7504 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7505 {
7506 unsigned int value2 = op2->ui;
7507
7508 exp->type = 2;
7509 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
7510 if(!exp->expType)
7511 {
7512 exp->expType = op1->type;
7513 if(op1->type)
7514 op1->type->refCount++;
7515 }
7516 return 0x1;
7517 }
7518
7519 static unsigned int Int64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7520 {
7521 long long value2 = op2->i64;
7522
7523 exp->type = 2;
7524 exp->string = PrintInt64(value2 ? (op1->i64 /= value2) : 0);
7525 if(!exp->expType)
7526 {
7527 exp->expType = op1->type;
7528 if(op1->type)
7529 op1->type->refCount++;
7530 }
7531 return 0x1;
7532 }
7533
7534 static unsigned int UInt64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7535 {
7536 uint64 value2 = op2->ui64;
7537
7538 exp->type = 2;
7539 exp->string = PrintUInt64(value2 ? (op1->ui64 /= value2) : 0);
7540 if(!exp->expType)
7541 {
7542 exp->expType = op1->type;
7543 if(op1->type)
7544 op1->type->refCount++;
7545 }
7546 return 0x1;
7547 }
7548
7549 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7550 {
7551 short value2 = op2->s;
7552
7553 exp->type = 2;
7554 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
7555 if(!exp->expType)
7556 {
7557 exp->expType = op1->type;
7558 if(op1->type)
7559 op1->type->refCount++;
7560 }
7561 return 0x1;
7562 }
7563
7564 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7565 {
7566 unsigned short value2 = op2->us;
7567
7568 exp->type = 2;
7569 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
7570 if(!exp->expType)
7571 {
7572 exp->expType = op1->type;
7573 if(op1->type)
7574 op1->type->refCount++;
7575 }
7576 return 0x1;
7577 }
7578
7579 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7580 {
7581 char value2 = op2->c;
7582
7583 exp->type = 2;
7584 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
7585 if(!exp->expType)
7586 {
7587 exp->expType = op1->type;
7588 if(op1->type)
7589 op1->type->refCount++;
7590 }
7591 return 0x1;
7592 }
7593
7594 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7595 {
7596 unsigned char value2 = op2->uc;
7597
7598 exp->type = 2;
7599 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
7600 if(!exp->expType)
7601 {
7602 exp->expType = op1->type;
7603 if(op1->type)
7604 op1->type->refCount++;
7605 }
7606 return 0x1;
7607 }
7608
7609 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7610 {
7611 float value2 = op2->f;
7612
7613 exp->type = 2;
7614 exp->string = PrintFloat(op1->f /= value2);
7615 if(!exp->expType)
7616 {
7617 exp->expType = op1->type;
7618 if(op1->type)
7619 op1->type->refCount++;
7620 }
7621 return 0x1;
7622 }
7623
7624 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7625 {
7626 double value2 = op2->d;
7627
7628 exp->type = 2;
7629 exp->string = PrintDouble(op1->d /= value2);
7630 if(!exp->expType)
7631 {
7632 exp->expType = op1->type;
7633 if(op1->type)
7634 op1->type->refCount++;
7635 }
7636 return 0x1;
7637 }
7638
7639 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7640 {
7641 int value2 = op2->i;
7642
7643 exp->type = 2;
7644 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
7645 if(!exp->expType)
7646 {
7647 exp->expType = op1->type;
7648 if(op1->type)
7649 op1->type->refCount++;
7650 }
7651 return 0x1;
7652 }
7653
7654 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7655 {
7656 unsigned int value2 = op2->ui;
7657
7658 exp->type = 2;
7659 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
7660 if(!exp->expType)
7661 {
7662 exp->expType = op1->type;
7663 if(op1->type)
7664 op1->type->refCount++;
7665 }
7666 return 0x1;
7667 }
7668
7669 static unsigned int Int64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7670 {
7671 long long value2 = op2->i64;
7672
7673 exp->type = 2;
7674 exp->string = PrintInt64(value2 ? (op1->i64 %= value2) : 0);
7675 if(!exp->expType)
7676 {
7677 exp->expType = op1->type;
7678 if(op1->type)
7679 op1->type->refCount++;
7680 }
7681 return 0x1;
7682 }
7683
7684 static unsigned int UInt64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7685 {
7686 uint64 value2 = op2->ui64;
7687
7688 exp->type = 2;
7689 exp->string = PrintUInt64(value2 ? (op1->ui64 %= value2) : 0);
7690 if(!exp->expType)
7691 {
7692 exp->expType = op1->type;
7693 if(op1->type)
7694 op1->type->refCount++;
7695 }
7696 return 0x1;
7697 }
7698
7699 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7700 {
7701 short value2 = op2->s;
7702
7703 exp->type = 2;
7704 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
7705 if(!exp->expType)
7706 {
7707 exp->expType = op1->type;
7708 if(op1->type)
7709 op1->type->refCount++;
7710 }
7711 return 0x1;
7712 }
7713
7714 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7715 {
7716 unsigned short value2 = op2->us;
7717
7718 exp->type = 2;
7719 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
7720 if(!exp->expType)
7721 {
7722 exp->expType = op1->type;
7723 if(op1->type)
7724 op1->type->refCount++;
7725 }
7726 return 0x1;
7727 }
7728
7729 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7730 {
7731 char value2 = op2->c;
7732
7733 exp->type = 2;
7734 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
7735 if(!exp->expType)
7736 {
7737 exp->expType = op1->type;
7738 if(op1->type)
7739 op1->type->refCount++;
7740 }
7741 return 0x1;
7742 }
7743
7744 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7745 {
7746 unsigned char value2 = op2->uc;
7747
7748 exp->type = 2;
7749 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
7750 if(!exp->expType)
7751 {
7752 exp->expType = op1->type;
7753 if(op1->type)
7754 op1->type->refCount++;
7755 }
7756 return 0x1;
7757 }
7758
7759 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7760 {
7761 int value2 = op2->i;
7762
7763 exp->type = 2;
7764 exp->string = PrintInt(op1->i & value2);
7765 if(!exp->expType)
7766 {
7767 exp->expType = op1->type;
7768 if(op1->type)
7769 op1->type->refCount++;
7770 }
7771 return 0x1;
7772 }
7773
7774 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7775 {
7776 unsigned int value2 = op2->ui;
7777
7778 exp->type = 2;
7779 exp->string = PrintUInt(op1->ui & value2);
7780 if(!exp->expType)
7781 {
7782 exp->expType = op1->type;
7783 if(op1->type)
7784 op1->type->refCount++;
7785 }
7786 return 0x1;
7787 }
7788
7789 static unsigned int Int64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7790 {
7791 long long value2 = op2->i64;
7792
7793 exp->type = 2;
7794 exp->string = PrintInt64(op1->i64 & value2);
7795 if(!exp->expType)
7796 {
7797 exp->expType = op1->type;
7798 if(op1->type)
7799 op1->type->refCount++;
7800 }
7801 return 0x1;
7802 }
7803
7804 static unsigned int UInt64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7805 {
7806 uint64 value2 = op2->ui64;
7807
7808 exp->type = 2;
7809 exp->string = PrintUInt64(op1->ui64 & value2);
7810 if(!exp->expType)
7811 {
7812 exp->expType = op1->type;
7813 if(op1->type)
7814 op1->type->refCount++;
7815 }
7816 return 0x1;
7817 }
7818
7819 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7820 {
7821 short value2 = op2->s;
7822
7823 exp->type = 2;
7824 exp->string = PrintShort(op1->s & value2);
7825 if(!exp->expType)
7826 {
7827 exp->expType = op1->type;
7828 if(op1->type)
7829 op1->type->refCount++;
7830 }
7831 return 0x1;
7832 }
7833
7834 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7835 {
7836 unsigned short value2 = op2->us;
7837
7838 exp->type = 2;
7839 exp->string = PrintUShort(op1->us & value2);
7840 if(!exp->expType)
7841 {
7842 exp->expType = op1->type;
7843 if(op1->type)
7844 op1->type->refCount++;
7845 }
7846 return 0x1;
7847 }
7848
7849 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7850 {
7851 char value2 = op2->c;
7852
7853 exp->type = 2;
7854 exp->string = PrintChar(op1->c & value2);
7855 if(!exp->expType)
7856 {
7857 exp->expType = op1->type;
7858 if(op1->type)
7859 op1->type->refCount++;
7860 }
7861 return 0x1;
7862 }
7863
7864 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7865 {
7866 unsigned char value2 = op2->uc;
7867
7868 exp->type = 2;
7869 exp->string = PrintUChar(op1->uc & value2);
7870 if(!exp->expType)
7871 {
7872 exp->expType = op1->type;
7873 if(op1->type)
7874 op1->type->refCount++;
7875 }
7876 return 0x1;
7877 }
7878
7879 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7880 {
7881 int value2 = op2->i;
7882
7883 exp->type = 2;
7884 exp->string = PrintInt(op1->i | value2);
7885 if(!exp->expType)
7886 {
7887 exp->expType = op1->type;
7888 if(op1->type)
7889 op1->type->refCount++;
7890 }
7891 return 0x1;
7892 }
7893
7894 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7895 {
7896 unsigned int value2 = op2->ui;
7897
7898 exp->type = 2;
7899 exp->string = PrintUInt(op1->ui | value2);
7900 if(!exp->expType)
7901 {
7902 exp->expType = op1->type;
7903 if(op1->type)
7904 op1->type->refCount++;
7905 }
7906 return 0x1;
7907 }
7908
7909 static unsigned int Int64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7910 {
7911 long long value2 = op2->i64;
7912
7913 exp->type = 2;
7914 exp->string = PrintInt64(op1->i64 | value2);
7915 if(!exp->expType)
7916 {
7917 exp->expType = op1->type;
7918 if(op1->type)
7919 op1->type->refCount++;
7920 }
7921 return 0x1;
7922 }
7923
7924 static unsigned int UInt64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7925 {
7926 uint64 value2 = op2->ui64;
7927
7928 exp->type = 2;
7929 exp->string = PrintUInt64(op1->ui64 | value2);
7930 if(!exp->expType)
7931 {
7932 exp->expType = op1->type;
7933 if(op1->type)
7934 op1->type->refCount++;
7935 }
7936 return 0x1;
7937 }
7938
7939 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7940 {
7941 short value2 = op2->s;
7942
7943 exp->type = 2;
7944 exp->string = PrintShort(op1->s | value2);
7945 if(!exp->expType)
7946 {
7947 exp->expType = op1->type;
7948 if(op1->type)
7949 op1->type->refCount++;
7950 }
7951 return 0x1;
7952 }
7953
7954 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7955 {
7956 unsigned short value2 = op2->us;
7957
7958 exp->type = 2;
7959 exp->string = PrintUShort(op1->us | value2);
7960 if(!exp->expType)
7961 {
7962 exp->expType = op1->type;
7963 if(op1->type)
7964 op1->type->refCount++;
7965 }
7966 return 0x1;
7967 }
7968
7969 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7970 {
7971 char value2 = op2->c;
7972
7973 exp->type = 2;
7974 exp->string = PrintChar(op1->c | value2);
7975 if(!exp->expType)
7976 {
7977 exp->expType = op1->type;
7978 if(op1->type)
7979 op1->type->refCount++;
7980 }
7981 return 0x1;
7982 }
7983
7984 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7985 {
7986 unsigned char value2 = op2->uc;
7987
7988 exp->type = 2;
7989 exp->string = PrintUChar(op1->uc | value2);
7990 if(!exp->expType)
7991 {
7992 exp->expType = op1->type;
7993 if(op1->type)
7994 op1->type->refCount++;
7995 }
7996 return 0x1;
7997 }
7998
7999 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8000 {
8001 int value2 = op2->i;
8002
8003 exp->type = 2;
8004 exp->string = PrintInt(op1->i ^ value2);
8005 if(!exp->expType)
8006 {
8007 exp->expType = op1->type;
8008 if(op1->type)
8009 op1->type->refCount++;
8010 }
8011 return 0x1;
8012 }
8013
8014 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8015 {
8016 unsigned int value2 = op2->ui;
8017
8018 exp->type = 2;
8019 exp->string = PrintUInt(op1->ui ^ value2);
8020 if(!exp->expType)
8021 {
8022 exp->expType = op1->type;
8023 if(op1->type)
8024 op1->type->refCount++;
8025 }
8026 return 0x1;
8027 }
8028
8029 static unsigned int Int64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8030 {
8031 long long value2 = op2->i64;
8032
8033 exp->type = 2;
8034 exp->string = PrintInt64(op1->i64 ^ value2);
8035 if(!exp->expType)
8036 {
8037 exp->expType = op1->type;
8038 if(op1->type)
8039 op1->type->refCount++;
8040 }
8041 return 0x1;
8042 }
8043
8044 static unsigned int UInt64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8045 {
8046 uint64 value2 = op2->ui64;
8047
8048 exp->type = 2;
8049 exp->string = PrintUInt64(op1->ui64 ^ value2);
8050 if(!exp->expType)
8051 {
8052 exp->expType = op1->type;
8053 if(op1->type)
8054 op1->type->refCount++;
8055 }
8056 return 0x1;
8057 }
8058
8059 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8060 {
8061 short value2 = op2->s;
8062
8063 exp->type = 2;
8064 exp->string = PrintShort(op1->s ^ value2);
8065 if(!exp->expType)
8066 {
8067 exp->expType = op1->type;
8068 if(op1->type)
8069 op1->type->refCount++;
8070 }
8071 return 0x1;
8072 }
8073
8074 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8075 {
8076 unsigned short value2 = op2->us;
8077
8078 exp->type = 2;
8079 exp->string = PrintUShort(op1->us ^ value2);
8080 if(!exp->expType)
8081 {
8082 exp->expType = op1->type;
8083 if(op1->type)
8084 op1->type->refCount++;
8085 }
8086 return 0x1;
8087 }
8088
8089 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8090 {
8091 char value2 = op2->c;
8092
8093 exp->type = 2;
8094 exp->string = PrintChar(op1->c ^ value2);
8095 if(!exp->expType)
8096 {
8097 exp->expType = op1->type;
8098 if(op1->type)
8099 op1->type->refCount++;
8100 }
8101 return 0x1;
8102 }
8103
8104 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8105 {
8106 unsigned char value2 = op2->uc;
8107
8108 exp->type = 2;
8109 exp->string = PrintUChar(op1->uc ^ value2);
8110 if(!exp->expType)
8111 {
8112 exp->expType = op1->type;
8113 if(op1->type)
8114 op1->type->refCount++;
8115 }
8116 return 0x1;
8117 }
8118
8119 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8120 {
8121 int value2 = op2->i;
8122
8123 exp->type = 2;
8124 exp->string = PrintInt(op1->i << value2);
8125 if(!exp->expType)
8126 {
8127 exp->expType = op1->type;
8128 if(op1->type)
8129 op1->type->refCount++;
8130 }
8131 return 0x1;
8132 }
8133
8134 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8135 {
8136 unsigned int value2 = op2->ui;
8137
8138 exp->type = 2;
8139 exp->string = PrintUInt(op1->ui << value2);
8140 if(!exp->expType)
8141 {
8142 exp->expType = op1->type;
8143 if(op1->type)
8144 op1->type->refCount++;
8145 }
8146 return 0x1;
8147 }
8148
8149 static unsigned int Int64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8150 {
8151 long long value2 = op2->i64;
8152
8153 exp->type = 2;
8154 exp->string = PrintInt64(op1->i64 << value2);
8155 if(!exp->expType)
8156 {
8157 exp->expType = op1->type;
8158 if(op1->type)
8159 op1->type->refCount++;
8160 }
8161 return 0x1;
8162 }
8163
8164 static unsigned int UInt64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8165 {
8166 uint64 value2 = op2->ui64;
8167
8168 exp->type = 2;
8169 exp->string = PrintUInt64(op1->ui64 << value2);
8170 if(!exp->expType)
8171 {
8172 exp->expType = op1->type;
8173 if(op1->type)
8174 op1->type->refCount++;
8175 }
8176 return 0x1;
8177 }
8178
8179 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8180 {
8181 short value2 = op2->s;
8182
8183 exp->type = 2;
8184 exp->string = PrintShort(op1->s << value2);
8185 if(!exp->expType)
8186 {
8187 exp->expType = op1->type;
8188 if(op1->type)
8189 op1->type->refCount++;
8190 }
8191 return 0x1;
8192 }
8193
8194 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8195 {
8196 unsigned short value2 = op2->us;
8197
8198 exp->type = 2;
8199 exp->string = PrintUShort(op1->us << value2);
8200 if(!exp->expType)
8201 {
8202 exp->expType = op1->type;
8203 if(op1->type)
8204 op1->type->refCount++;
8205 }
8206 return 0x1;
8207 }
8208
8209 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8210 {
8211 char value2 = op2->c;
8212
8213 exp->type = 2;
8214 exp->string = PrintChar(op1->c << value2);
8215 if(!exp->expType)
8216 {
8217 exp->expType = op1->type;
8218 if(op1->type)
8219 op1->type->refCount++;
8220 }
8221 return 0x1;
8222 }
8223
8224 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8225 {
8226 unsigned char value2 = op2->uc;
8227
8228 exp->type = 2;
8229 exp->string = PrintUChar(op1->uc << value2);
8230 if(!exp->expType)
8231 {
8232 exp->expType = op1->type;
8233 if(op1->type)
8234 op1->type->refCount++;
8235 }
8236 return 0x1;
8237 }
8238
8239 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8240 {
8241 int value2 = op2->i;
8242
8243 exp->type = 2;
8244 exp->string = PrintInt(op1->i >> value2);
8245 if(!exp->expType)
8246 {
8247 exp->expType = op1->type;
8248 if(op1->type)
8249 op1->type->refCount++;
8250 }
8251 return 0x1;
8252 }
8253
8254 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8255 {
8256 unsigned int value2 = op2->ui;
8257
8258 exp->type = 2;
8259 exp->string = PrintUInt(op1->ui >> value2);
8260 if(!exp->expType)
8261 {
8262 exp->expType = op1->type;
8263 if(op1->type)
8264 op1->type->refCount++;
8265 }
8266 return 0x1;
8267 }
8268
8269 static unsigned int Int64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8270 {
8271 long long value2 = op2->i64;
8272
8273 exp->type = 2;
8274 exp->string = PrintInt64(op1->i64 >> value2);
8275 if(!exp->expType)
8276 {
8277 exp->expType = op1->type;
8278 if(op1->type)
8279 op1->type->refCount++;
8280 }
8281 return 0x1;
8282 }
8283
8284 static unsigned int UInt64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8285 {
8286 uint64 value2 = op2->ui64;
8287
8288 exp->type = 2;
8289 exp->string = PrintUInt64(op1->ui64 >> value2);
8290 if(!exp->expType)
8291 {
8292 exp->expType = op1->type;
8293 if(op1->type)
8294 op1->type->refCount++;
8295 }
8296 return 0x1;
8297 }
8298
8299 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8300 {
8301 short value2 = op2->s;
8302
8303 exp->type = 2;
8304 exp->string = PrintShort(op1->s >> value2);
8305 if(!exp->expType)
8306 {
8307 exp->expType = op1->type;
8308 if(op1->type)
8309 op1->type->refCount++;
8310 }
8311 return 0x1;
8312 }
8313
8314 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8315 {
8316 unsigned short value2 = op2->us;
8317
8318 exp->type = 2;
8319 exp->string = PrintUShort(op1->us >> value2);
8320 if(!exp->expType)
8321 {
8322 exp->expType = op1->type;
8323 if(op1->type)
8324 op1->type->refCount++;
8325 }
8326 return 0x1;
8327 }
8328
8329 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8330 {
8331 char value2 = op2->c;
8332
8333 exp->type = 2;
8334 exp->string = PrintChar(op1->c >> value2);
8335 if(!exp->expType)
8336 {
8337 exp->expType = op1->type;
8338 if(op1->type)
8339 op1->type->refCount++;
8340 }
8341 return 0x1;
8342 }
8343
8344 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8345 {
8346 unsigned char value2 = op2->uc;
8347
8348 exp->type = 2;
8349 exp->string = PrintUChar(op1->uc >> value2);
8350 if(!exp->expType)
8351 {
8352 exp->expType = op1->type;
8353 if(op1->type)
8354 op1->type->refCount++;
8355 }
8356 return 0x1;
8357 }
8358
8359 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
8360 {
8361 exp->type = 2;
8362 exp->string = PrintInt((~op1->i));
8363 if(!exp->expType)
8364 {
8365 exp->expType = op1->type;
8366 if(op1->type)
8367 op1->type->refCount++;
8368 }
8369 return 0x1;
8370 }
8371
8372 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
8373 {
8374 exp->type = 2;
8375 exp->string = PrintUInt((unsigned int)(~op1->ui));
8376 if(!exp->expType)
8377 {
8378 exp->expType = op1->type;
8379 if(op1->type)
8380 op1->type->refCount++;
8381 }
8382 return 0x1;
8383 }
8384
8385 static unsigned int Int64BitNot(struct Expression * exp, struct Operand * op1)
8386 {
8387 exp->type = 2;
8388 exp->string = PrintInt64((long long)(~op1->i64));
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 UInt64BitNot(struct Expression * exp, struct Operand * op1)
8399 {
8400 exp->type = 2;
8401 exp->string = PrintUInt64((uint64)(~op1->ui64));
8402 if(!exp->expType)
8403 {
8404 exp->expType = op1->type;
8405 if(op1->type)
8406 op1->type->refCount++;
8407 }
8408 return 0x1;
8409 }
8410
8411 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
8412 {
8413 exp->type = 2;
8414 exp->string = PrintShort((short)(~op1->s));
8415 if(!exp->expType)
8416 {
8417 exp->expType = op1->type;
8418 if(op1->type)
8419 op1->type->refCount++;
8420 }
8421 return 0x1;
8422 }
8423
8424 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
8425 {
8426 exp->type = 2;
8427 exp->string = PrintUShort((unsigned short)(~op1->us));
8428 if(!exp->expType)
8429 {
8430 exp->expType = op1->type;
8431 if(op1->type)
8432 op1->type->refCount++;
8433 }
8434 return 0x1;
8435 }
8436
8437 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
8438 {
8439 exp->type = 2;
8440 exp->string = PrintChar((char)(~op1->c));
8441 if(!exp->expType)
8442 {
8443 exp->expType = op1->type;
8444 if(op1->type)
8445 op1->type->refCount++;
8446 }
8447 return 0x1;
8448 }
8449
8450 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
8451 {
8452 exp->type = 2;
8453 exp->string = PrintUChar((unsigned char)(~op1->uc));
8454 if(!exp->expType)
8455 {
8456 exp->expType = op1->type;
8457 if(op1->type)
8458 op1->type->refCount++;
8459 }
8460 return 0x1;
8461 }
8462
8463 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8464 {
8465 int value2 = op2->i;
8466
8467 exp->type = 2;
8468 exp->string = PrintInt(op1->i &= value2);
8469 if(!exp->expType)
8470 {
8471 exp->expType = op1->type;
8472 if(op1->type)
8473 op1->type->refCount++;
8474 }
8475 return 0x1;
8476 }
8477
8478 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8479 {
8480 unsigned int value2 = op2->ui;
8481
8482 exp->type = 2;
8483 exp->string = PrintUInt(op1->ui &= value2);
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 Int64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8494 {
8495 long long value2 = op2->i64;
8496
8497 exp->type = 2;
8498 exp->string = PrintInt64(op1->i64 &= value2);
8499 if(!exp->expType)
8500 {
8501 exp->expType = op1->type;
8502 if(op1->type)
8503 op1->type->refCount++;
8504 }
8505 return 0x1;
8506 }
8507
8508 static unsigned int UInt64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8509 {
8510 uint64 value2 = op2->ui64;
8511
8512 exp->type = 2;
8513 exp->string = PrintUInt64(op1->ui64 &= value2);
8514 if(!exp->expType)
8515 {
8516 exp->expType = op1->type;
8517 if(op1->type)
8518 op1->type->refCount++;
8519 }
8520 return 0x1;
8521 }
8522
8523 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8524 {
8525 short value2 = op2->s;
8526
8527 exp->type = 2;
8528 exp->string = PrintShort(op1->s &= value2);
8529 if(!exp->expType)
8530 {
8531 exp->expType = op1->type;
8532 if(op1->type)
8533 op1->type->refCount++;
8534 }
8535 return 0x1;
8536 }
8537
8538 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8539 {
8540 unsigned short value2 = op2->us;
8541
8542 exp->type = 2;
8543 exp->string = PrintUShort(op1->us &= value2);
8544 if(!exp->expType)
8545 {
8546 exp->expType = op1->type;
8547 if(op1->type)
8548 op1->type->refCount++;
8549 }
8550 return 0x1;
8551 }
8552
8553 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8554 {
8555 char value2 = op2->c;
8556
8557 exp->type = 2;
8558 exp->string = PrintChar(op1->c &= value2);
8559 if(!exp->expType)
8560 {
8561 exp->expType = op1->type;
8562 if(op1->type)
8563 op1->type->refCount++;
8564 }
8565 return 0x1;
8566 }
8567
8568 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8569 {
8570 unsigned char value2 = op2->uc;
8571
8572 exp->type = 2;
8573 exp->string = PrintUChar(op1->uc &= value2);
8574 if(!exp->expType)
8575 {
8576 exp->expType = op1->type;
8577 if(op1->type)
8578 op1->type->refCount++;
8579 }
8580 return 0x1;
8581 }
8582
8583 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8584 {
8585 int value2 = op2->i;
8586
8587 exp->type = 2;
8588 exp->string = PrintInt(op1->i |= value2);
8589 if(!exp->expType)
8590 {
8591 exp->expType = op1->type;
8592 if(op1->type)
8593 op1->type->refCount++;
8594 }
8595 return 0x1;
8596 }
8597
8598 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8599 {
8600 unsigned int value2 = op2->ui;
8601
8602 exp->type = 2;
8603 exp->string = PrintUInt(op1->ui |= value2);
8604 if(!exp->expType)
8605 {
8606 exp->expType = op1->type;
8607 if(op1->type)
8608 op1->type->refCount++;
8609 }
8610 return 0x1;
8611 }
8612
8613 static unsigned int Int64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8614 {
8615 long long value2 = op2->i64;
8616
8617 exp->type = 2;
8618 exp->string = PrintInt64(op1->i64 |= value2);
8619 if(!exp->expType)
8620 {
8621 exp->expType = op1->type;
8622 if(op1->type)
8623 op1->type->refCount++;
8624 }
8625 return 0x1;
8626 }
8627
8628 static unsigned int UInt64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8629 {
8630 uint64 value2 = op2->ui64;
8631
8632 exp->type = 2;
8633 exp->string = PrintUInt64(op1->ui64 |= value2);
8634 if(!exp->expType)
8635 {
8636 exp->expType = op1->type;
8637 if(op1->type)
8638 op1->type->refCount++;
8639 }
8640 return 0x1;
8641 }
8642
8643 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8644 {
8645 short value2 = op2->s;
8646
8647 exp->type = 2;
8648 exp->string = PrintShort(op1->s |= value2);
8649 if(!exp->expType)
8650 {
8651 exp->expType = op1->type;
8652 if(op1->type)
8653 op1->type->refCount++;
8654 }
8655 return 0x1;
8656 }
8657
8658 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8659 {
8660 unsigned short value2 = op2->us;
8661
8662 exp->type = 2;
8663 exp->string = PrintUShort(op1->us |= value2);
8664 if(!exp->expType)
8665 {
8666 exp->expType = op1->type;
8667 if(op1->type)
8668 op1->type->refCount++;
8669 }
8670 return 0x1;
8671 }
8672
8673 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8674 {
8675 char value2 = op2->c;
8676
8677 exp->type = 2;
8678 exp->string = PrintChar(op1->c |= value2);
8679 if(!exp->expType)
8680 {
8681 exp->expType = op1->type;
8682 if(op1->type)
8683 op1->type->refCount++;
8684 }
8685 return 0x1;
8686 }
8687
8688 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8689 {
8690 unsigned char value2 = op2->uc;
8691
8692 exp->type = 2;
8693 exp->string = PrintUChar(op1->uc |= value2);
8694 if(!exp->expType)
8695 {
8696 exp->expType = op1->type;
8697 if(op1->type)
8698 op1->type->refCount++;
8699 }
8700 return 0x1;
8701 }
8702
8703 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8704 {
8705 int value2 = op2->i;
8706
8707 exp->type = 2;
8708 exp->string = PrintInt(op1->i ^= value2);
8709 if(!exp->expType)
8710 {
8711 exp->expType = op1->type;
8712 if(op1->type)
8713 op1->type->refCount++;
8714 }
8715 return 0x1;
8716 }
8717
8718 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8719 {
8720 unsigned int value2 = op2->ui;
8721
8722 exp->type = 2;
8723 exp->string = PrintUInt(op1->ui ^= value2);
8724 if(!exp->expType)
8725 {
8726 exp->expType = op1->type;
8727 if(op1->type)
8728 op1->type->refCount++;
8729 }
8730 return 0x1;
8731 }
8732
8733 static unsigned int Int64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8734 {
8735 long long value2 = op2->i64;
8736
8737 exp->type = 2;
8738 exp->string = PrintInt64(op1->i64 ^= value2);
8739 if(!exp->expType)
8740 {
8741 exp->expType = op1->type;
8742 if(op1->type)
8743 op1->type->refCount++;
8744 }
8745 return 0x1;
8746 }
8747
8748 static unsigned int UInt64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8749 {
8750 uint64 value2 = op2->ui64;
8751
8752 exp->type = 2;
8753 exp->string = PrintUInt64(op1->ui64 ^= value2);
8754 if(!exp->expType)
8755 {
8756 exp->expType = op1->type;
8757 if(op1->type)
8758 op1->type->refCount++;
8759 }
8760 return 0x1;
8761 }
8762
8763 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8764 {
8765 short value2 = op2->s;
8766
8767 exp->type = 2;
8768 exp->string = PrintShort(op1->s ^= value2);
8769 if(!exp->expType)
8770 {
8771 exp->expType = op1->type;
8772 if(op1->type)
8773 op1->type->refCount++;
8774 }
8775 return 0x1;
8776 }
8777
8778 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8779 {
8780 unsigned short value2 = op2->us;
8781
8782 exp->type = 2;
8783 exp->string = PrintUShort(op1->us ^= value2);
8784 if(!exp->expType)
8785 {
8786 exp->expType = op1->type;
8787 if(op1->type)
8788 op1->type->refCount++;
8789 }
8790 return 0x1;
8791 }
8792
8793 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8794 {
8795 char value2 = op2->c;
8796
8797 exp->type = 2;
8798 exp->string = PrintChar(op1->c ^= value2);
8799 if(!exp->expType)
8800 {
8801 exp->expType = op1->type;
8802 if(op1->type)
8803 op1->type->refCount++;
8804 }
8805 return 0x1;
8806 }
8807
8808 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8809 {
8810 unsigned char value2 = op2->uc;
8811
8812 exp->type = 2;
8813 exp->string = PrintUChar(op1->uc ^= value2);
8814 if(!exp->expType)
8815 {
8816 exp->expType = op1->type;
8817 if(op1->type)
8818 op1->type->refCount++;
8819 }
8820 return 0x1;
8821 }
8822
8823 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8824 {
8825 int value2 = op2->i;
8826
8827 exp->type = 2;
8828 exp->string = PrintInt(op1->i <<= value2);
8829 if(!exp->expType)
8830 {
8831 exp->expType = op1->type;
8832 if(op1->type)
8833 op1->type->refCount++;
8834 }
8835 return 0x1;
8836 }
8837
8838 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8839 {
8840 unsigned int value2 = op2->ui;
8841
8842 exp->type = 2;
8843 exp->string = PrintUInt(op1->ui <<= value2);
8844 if(!exp->expType)
8845 {
8846 exp->expType = op1->type;
8847 if(op1->type)
8848 op1->type->refCount++;
8849 }
8850 return 0x1;
8851 }
8852
8853 static unsigned int Int64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8854 {
8855 long long value2 = op2->i64;
8856
8857 exp->type = 2;
8858 exp->string = PrintInt64(op1->i64 <<= value2);
8859 if(!exp->expType)
8860 {
8861 exp->expType = op1->type;
8862 if(op1->type)
8863 op1->type->refCount++;
8864 }
8865 return 0x1;
8866 }
8867
8868 static unsigned int UInt64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8869 {
8870 uint64 value2 = op2->ui64;
8871
8872 exp->type = 2;
8873 exp->string = PrintUInt64(op1->ui64 <<= value2);
8874 if(!exp->expType)
8875 {
8876 exp->expType = op1->type;
8877 if(op1->type)
8878 op1->type->refCount++;
8879 }
8880 return 0x1;
8881 }
8882
8883 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8884 {
8885 short value2 = op2->s;
8886
8887 exp->type = 2;
8888 exp->string = PrintShort(op1->s <<= value2);
8889 if(!exp->expType)
8890 {
8891 exp->expType = op1->type;
8892 if(op1->type)
8893 op1->type->refCount++;
8894 }
8895 return 0x1;
8896 }
8897
8898 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8899 {
8900 unsigned short value2 = op2->us;
8901
8902 exp->type = 2;
8903 exp->string = PrintUShort(op1->us <<= value2);
8904 if(!exp->expType)
8905 {
8906 exp->expType = op1->type;
8907 if(op1->type)
8908 op1->type->refCount++;
8909 }
8910 return 0x1;
8911 }
8912
8913 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8914 {
8915 char value2 = op2->c;
8916
8917 exp->type = 2;
8918 exp->string = PrintChar(op1->c <<= value2);
8919 if(!exp->expType)
8920 {
8921 exp->expType = op1->type;
8922 if(op1->type)
8923 op1->type->refCount++;
8924 }
8925 return 0x1;
8926 }
8927
8928 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8929 {
8930 unsigned char value2 = op2->uc;
8931
8932 exp->type = 2;
8933 exp->string = PrintUChar(op1->uc <<= value2);
8934 if(!exp->expType)
8935 {
8936 exp->expType = op1->type;
8937 if(op1->type)
8938 op1->type->refCount++;
8939 }
8940 return 0x1;
8941 }
8942
8943 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8944 {
8945 int value2 = op2->i;
8946
8947 exp->type = 2;
8948 exp->string = PrintInt(op1->i >>= value2);
8949 if(!exp->expType)
8950 {
8951 exp->expType = op1->type;
8952 if(op1->type)
8953 op1->type->refCount++;
8954 }
8955 return 0x1;
8956 }
8957
8958 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8959 {
8960 unsigned int value2 = op2->ui;
8961
8962 exp->type = 2;
8963 exp->string = PrintUInt(op1->ui >>= value2);
8964 if(!exp->expType)
8965 {
8966 exp->expType = op1->type;
8967 if(op1->type)
8968 op1->type->refCount++;
8969 }
8970 return 0x1;
8971 }
8972
8973 static unsigned int Int64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8974 {
8975 long long value2 = op2->i64;
8976
8977 exp->type = 2;
8978 exp->string = PrintInt64(op1->i64 >>= value2);
8979 if(!exp->expType)
8980 {
8981 exp->expType = op1->type;
8982 if(op1->type)
8983 op1->type->refCount++;
8984 }
8985 return 0x1;
8986 }
8987
8988 static unsigned int UInt64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8989 {
8990 uint64 value2 = op2->ui64;
8991
8992 exp->type = 2;
8993 exp->string = PrintUInt64(op1->ui64 >>= value2);
8994 if(!exp->expType)
8995 {
8996 exp->expType = op1->type;
8997 if(op1->type)
8998 op1->type->refCount++;
8999 }
9000 return 0x1;
9001 }
9002
9003 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9004 {
9005 short value2 = op2->s;
9006
9007 exp->type = 2;
9008 exp->string = PrintShort(op1->s >>= value2);
9009 if(!exp->expType)
9010 {
9011 exp->expType = op1->type;
9012 if(op1->type)
9013 op1->type->refCount++;
9014 }
9015 return 0x1;
9016 }
9017
9018 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9019 {
9020 unsigned short value2 = op2->us;
9021
9022 exp->type = 2;
9023 exp->string = PrintUShort(op1->us >>= value2);
9024 if(!exp->expType)
9025 {
9026 exp->expType = op1->type;
9027 if(op1->type)
9028 op1->type->refCount++;
9029 }
9030 return 0x1;
9031 }
9032
9033 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9034 {
9035 char value2 = op2->c;
9036
9037 exp->type = 2;
9038 exp->string = PrintChar(op1->c >>= value2);
9039 if(!exp->expType)
9040 {
9041 exp->expType = op1->type;
9042 if(op1->type)
9043 op1->type->refCount++;
9044 }
9045 return 0x1;
9046 }
9047
9048 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9049 {
9050 unsigned char value2 = op2->uc;
9051
9052 exp->type = 2;
9053 exp->string = PrintUChar(op1->uc >>= value2);
9054 if(!exp->expType)
9055 {
9056 exp->expType = op1->type;
9057 if(op1->type)
9058 op1->type->refCount++;
9059 }
9060 return 0x1;
9061 }
9062
9063 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
9064 {
9065 exp->type = 2;
9066 exp->string = PrintInt((int)(!op1->i));
9067 if(!exp->expType)
9068 {
9069 exp->expType = op1->type;
9070 if(op1->type)
9071 op1->type->refCount++;
9072 }
9073 return 0x1;
9074 }
9075
9076 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
9077 {
9078 exp->type = 2;
9079 exp->string = PrintUInt((unsigned int)(!op1->ui));
9080 if(!exp->expType)
9081 {
9082 exp->expType = op1->type;
9083 if(op1->type)
9084 op1->type->refCount++;
9085 }
9086 return 0x1;
9087 }
9088
9089 static unsigned int Int64Not(struct Expression * exp, struct Operand * op1)
9090 {
9091 exp->type = 2;
9092 exp->string = PrintInt64((long long)(!op1->i64));
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 UInt64Not(struct Expression * exp, struct Operand * op1)
9103 {
9104 exp->type = 2;
9105 exp->string = PrintUInt64((uint64)(!op1->ui64));
9106 if(!exp->expType)
9107 {
9108 exp->expType = op1->type;
9109 if(op1->type)
9110 op1->type->refCount++;
9111 }
9112 return 0x1;
9113 }
9114
9115 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
9116 {
9117 exp->type = 2;
9118 exp->string = PrintShort((short)(!op1->s));
9119 if(!exp->expType)
9120 {
9121 exp->expType = op1->type;
9122 if(op1->type)
9123 op1->type->refCount++;
9124 }
9125 return 0x1;
9126 }
9127
9128 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
9129 {
9130 exp->type = 2;
9131 exp->string = PrintUShort((unsigned short)(!op1->us));
9132 if(!exp->expType)
9133 {
9134 exp->expType = op1->type;
9135 if(op1->type)
9136 op1->type->refCount++;
9137 }
9138 return 0x1;
9139 }
9140
9141 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
9142 {
9143 exp->type = 2;
9144 exp->string = PrintChar((char)(!op1->c));
9145 if(!exp->expType)
9146 {
9147 exp->expType = op1->type;
9148 if(op1->type)
9149 op1->type->refCount++;
9150 }
9151 return 0x1;
9152 }
9153
9154 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
9155 {
9156 exp->type = 2;
9157 exp->string = PrintUChar((unsigned char)(!op1->uc));
9158 if(!exp->expType)
9159 {
9160 exp->expType = op1->type;
9161 if(op1->type)
9162 op1->type->refCount++;
9163 }
9164 return 0x1;
9165 }
9166
9167 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9168 {
9169 int value2 = op2->i;
9170
9171 exp->type = 2;
9172 exp->string = PrintInt(op1->i == value2);
9173 if(!exp->expType)
9174 {
9175 exp->expType = op1->type;
9176 if(op1->type)
9177 op1->type->refCount++;
9178 }
9179 return 0x1;
9180 }
9181
9182 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9183 {
9184 unsigned int value2 = op2->ui;
9185
9186 exp->type = 2;
9187 exp->string = PrintUInt(op1->ui == value2);
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 Int64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9198 {
9199 long long value2 = op2->i64;
9200
9201 exp->type = 2;
9202 exp->string = PrintInt64(op1->i64 == value2);
9203 if(!exp->expType)
9204 {
9205 exp->expType = op1->type;
9206 if(op1->type)
9207 op1->type->refCount++;
9208 }
9209 return 0x1;
9210 }
9211
9212 static unsigned int UInt64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9213 {
9214 uint64 value2 = op2->ui64;
9215
9216 exp->type = 2;
9217 exp->string = PrintUInt64(op1->ui64 == value2);
9218 if(!exp->expType)
9219 {
9220 exp->expType = op1->type;
9221 if(op1->type)
9222 op1->type->refCount++;
9223 }
9224 return 0x1;
9225 }
9226
9227 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9228 {
9229 short value2 = op2->s;
9230
9231 exp->type = 2;
9232 exp->string = PrintShort(op1->s == value2);
9233 if(!exp->expType)
9234 {
9235 exp->expType = op1->type;
9236 if(op1->type)
9237 op1->type->refCount++;
9238 }
9239 return 0x1;
9240 }
9241
9242 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9243 {
9244 unsigned short value2 = op2->us;
9245
9246 exp->type = 2;
9247 exp->string = PrintUShort(op1->us == value2);
9248 if(!exp->expType)
9249 {
9250 exp->expType = op1->type;
9251 if(op1->type)
9252 op1->type->refCount++;
9253 }
9254 return 0x1;
9255 }
9256
9257 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9258 {
9259 char value2 = op2->c;
9260
9261 exp->type = 2;
9262 exp->string = PrintChar(op1->c == value2);
9263 if(!exp->expType)
9264 {
9265 exp->expType = op1->type;
9266 if(op1->type)
9267 op1->type->refCount++;
9268 }
9269 return 0x1;
9270 }
9271
9272 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9273 {
9274 unsigned char value2 = op2->uc;
9275
9276 exp->type = 2;
9277 exp->string = PrintUChar(op1->uc == value2);
9278 if(!exp->expType)
9279 {
9280 exp->expType = op1->type;
9281 if(op1->type)
9282 op1->type->refCount++;
9283 }
9284 return 0x1;
9285 }
9286
9287 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9288 {
9289 float value2 = op2->f;
9290
9291 exp->type = 2;
9292 exp->string = PrintFloat(op1->f == value2);
9293 if(!exp->expType)
9294 {
9295 exp->expType = op1->type;
9296 if(op1->type)
9297 op1->type->refCount++;
9298 }
9299 return 0x1;
9300 }
9301
9302 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9303 {
9304 double value2 = op2->d;
9305
9306 exp->type = 2;
9307 exp->string = PrintDouble(op1->d == value2);
9308 if(!exp->expType)
9309 {
9310 exp->expType = op1->type;
9311 if(op1->type)
9312 op1->type->refCount++;
9313 }
9314 return 0x1;
9315 }
9316
9317 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9318 {
9319 int value2 = op2->i;
9320
9321 exp->type = 2;
9322 exp->string = PrintInt(op1->i != value2);
9323 if(!exp->expType)
9324 {
9325 exp->expType = op1->type;
9326 if(op1->type)
9327 op1->type->refCount++;
9328 }
9329 return 0x1;
9330 }
9331
9332 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9333 {
9334 unsigned int value2 = op2->ui;
9335
9336 exp->type = 2;
9337 exp->string = PrintUInt(op1->ui != value2);
9338 if(!exp->expType)
9339 {
9340 exp->expType = op1->type;
9341 if(op1->type)
9342 op1->type->refCount++;
9343 }
9344 return 0x1;
9345 }
9346
9347 static unsigned int Int64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9348 {
9349 long long value2 = op2->i64;
9350
9351 exp->type = 2;
9352 exp->string = PrintInt64(op1->i64 != value2);
9353 if(!exp->expType)
9354 {
9355 exp->expType = op1->type;
9356 if(op1->type)
9357 op1->type->refCount++;
9358 }
9359 return 0x1;
9360 }
9361
9362 static unsigned int UInt64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9363 {
9364 uint64 value2 = op2->ui64;
9365
9366 exp->type = 2;
9367 exp->string = PrintUInt64(op1->ui64 != value2);
9368 if(!exp->expType)
9369 {
9370 exp->expType = op1->type;
9371 if(op1->type)
9372 op1->type->refCount++;
9373 }
9374 return 0x1;
9375 }
9376
9377 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9378 {
9379 short value2 = op2->s;
9380
9381 exp->type = 2;
9382 exp->string = PrintShort(op1->s != value2);
9383 if(!exp->expType)
9384 {
9385 exp->expType = op1->type;
9386 if(op1->type)
9387 op1->type->refCount++;
9388 }
9389 return 0x1;
9390 }
9391
9392 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9393 {
9394 unsigned short value2 = op2->us;
9395
9396 exp->type = 2;
9397 exp->string = PrintUShort(op1->us != value2);
9398 if(!exp->expType)
9399 {
9400 exp->expType = op1->type;
9401 if(op1->type)
9402 op1->type->refCount++;
9403 }
9404 return 0x1;
9405 }
9406
9407 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9408 {
9409 char value2 = op2->c;
9410
9411 exp->type = 2;
9412 exp->string = PrintChar(op1->c != value2);
9413 if(!exp->expType)
9414 {
9415 exp->expType = op1->type;
9416 if(op1->type)
9417 op1->type->refCount++;
9418 }
9419 return 0x1;
9420 }
9421
9422 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9423 {
9424 unsigned char value2 = op2->uc;
9425
9426 exp->type = 2;
9427 exp->string = PrintUChar(op1->uc != value2);
9428 if(!exp->expType)
9429 {
9430 exp->expType = op1->type;
9431 if(op1->type)
9432 op1->type->refCount++;
9433 }
9434 return 0x1;
9435 }
9436
9437 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9438 {
9439 float value2 = op2->f;
9440
9441 exp->type = 2;
9442 exp->string = PrintFloat(op1->f != value2);
9443 if(!exp->expType)
9444 {
9445 exp->expType = op1->type;
9446 if(op1->type)
9447 op1->type->refCount++;
9448 }
9449 return 0x1;
9450 }
9451
9452 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9453 {
9454 double value2 = op2->d;
9455
9456 exp->type = 2;
9457 exp->string = PrintDouble(op1->d != value2);
9458 if(!exp->expType)
9459 {
9460 exp->expType = op1->type;
9461 if(op1->type)
9462 op1->type->refCount++;
9463 }
9464 return 0x1;
9465 }
9466
9467 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9468 {
9469 int value2 = op2->i;
9470
9471 exp->type = 2;
9472 exp->string = PrintInt(op1->i && value2);
9473 if(!exp->expType)
9474 {
9475 exp->expType = op1->type;
9476 if(op1->type)
9477 op1->type->refCount++;
9478 }
9479 return 0x1;
9480 }
9481
9482 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9483 {
9484 unsigned int value2 = op2->ui;
9485
9486 exp->type = 2;
9487 exp->string = PrintUInt(op1->ui && value2);
9488 if(!exp->expType)
9489 {
9490 exp->expType = op1->type;
9491 if(op1->type)
9492 op1->type->refCount++;
9493 }
9494 return 0x1;
9495 }
9496
9497 static unsigned int Int64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9498 {
9499 long long value2 = op2->i64;
9500
9501 exp->type = 2;
9502 exp->string = PrintInt64(op1->i64 && value2);
9503 if(!exp->expType)
9504 {
9505 exp->expType = op1->type;
9506 if(op1->type)
9507 op1->type->refCount++;
9508 }
9509 return 0x1;
9510 }
9511
9512 static unsigned int UInt64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9513 {
9514 uint64 value2 = op2->ui64;
9515
9516 exp->type = 2;
9517 exp->string = PrintUInt64(op1->ui64 && value2);
9518 if(!exp->expType)
9519 {
9520 exp->expType = op1->type;
9521 if(op1->type)
9522 op1->type->refCount++;
9523 }
9524 return 0x1;
9525 }
9526
9527 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9528 {
9529 short value2 = op2->s;
9530
9531 exp->type = 2;
9532 exp->string = PrintShort(op1->s && value2);
9533 if(!exp->expType)
9534 {
9535 exp->expType = op1->type;
9536 if(op1->type)
9537 op1->type->refCount++;
9538 }
9539 return 0x1;
9540 }
9541
9542 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9543 {
9544 unsigned short value2 = op2->us;
9545
9546 exp->type = 2;
9547 exp->string = PrintUShort(op1->us && value2);
9548 if(!exp->expType)
9549 {
9550 exp->expType = op1->type;
9551 if(op1->type)
9552 op1->type->refCount++;
9553 }
9554 return 0x1;
9555 }
9556
9557 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9558 {
9559 char value2 = op2->c;
9560
9561 exp->type = 2;
9562 exp->string = PrintChar(op1->c && value2);
9563 if(!exp->expType)
9564 {
9565 exp->expType = op1->type;
9566 if(op1->type)
9567 op1->type->refCount++;
9568 }
9569 return 0x1;
9570 }
9571
9572 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9573 {
9574 unsigned char value2 = op2->uc;
9575
9576 exp->type = 2;
9577 exp->string = PrintUChar(op1->uc && value2);
9578 if(!exp->expType)
9579 {
9580 exp->expType = op1->type;
9581 if(op1->type)
9582 op1->type->refCount++;
9583 }
9584 return 0x1;
9585 }
9586
9587 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9588 {
9589 float value2 = op2->f;
9590
9591 exp->type = 2;
9592 exp->string = PrintFloat(op1->f && value2);
9593 if(!exp->expType)
9594 {
9595 exp->expType = op1->type;
9596 if(op1->type)
9597 op1->type->refCount++;
9598 }
9599 return 0x1;
9600 }
9601
9602 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9603 {
9604 double value2 = op2->d;
9605
9606 exp->type = 2;
9607 exp->string = PrintDouble(op1->d && value2);
9608 if(!exp->expType)
9609 {
9610 exp->expType = op1->type;
9611 if(op1->type)
9612 op1->type->refCount++;
9613 }
9614 return 0x1;
9615 }
9616
9617 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9618 {
9619 int value2 = op2->i;
9620
9621 exp->type = 2;
9622 exp->string = PrintInt(op1->i || value2);
9623 if(!exp->expType)
9624 {
9625 exp->expType = op1->type;
9626 if(op1->type)
9627 op1->type->refCount++;
9628 }
9629 return 0x1;
9630 }
9631
9632 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9633 {
9634 unsigned int value2 = op2->ui;
9635
9636 exp->type = 2;
9637 exp->string = PrintUInt(op1->ui || value2);
9638 if(!exp->expType)
9639 {
9640 exp->expType = op1->type;
9641 if(op1->type)
9642 op1->type->refCount++;
9643 }
9644 return 0x1;
9645 }
9646
9647 static unsigned int Int64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9648 {
9649 long long value2 = op2->i64;
9650
9651 exp->type = 2;
9652 exp->string = PrintInt64(op1->i64 || value2);
9653 if(!exp->expType)
9654 {
9655 exp->expType = op1->type;
9656 if(op1->type)
9657 op1->type->refCount++;
9658 }
9659 return 0x1;
9660 }
9661
9662 static unsigned int UInt64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9663 {
9664 uint64 value2 = op2->ui64;
9665
9666 exp->type = 2;
9667 exp->string = PrintUInt64(op1->ui64 || value2);
9668 if(!exp->expType)
9669 {
9670 exp->expType = op1->type;
9671 if(op1->type)
9672 op1->type->refCount++;
9673 }
9674 return 0x1;
9675 }
9676
9677 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9678 {
9679 short value2 = op2->s;
9680
9681 exp->type = 2;
9682 exp->string = PrintShort(op1->s || value2);
9683 if(!exp->expType)
9684 {
9685 exp->expType = op1->type;
9686 if(op1->type)
9687 op1->type->refCount++;
9688 }
9689 return 0x1;
9690 }
9691
9692 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9693 {
9694 unsigned short value2 = op2->us;
9695
9696 exp->type = 2;
9697 exp->string = PrintUShort(op1->us || value2);
9698 if(!exp->expType)
9699 {
9700 exp->expType = op1->type;
9701 if(op1->type)
9702 op1->type->refCount++;
9703 }
9704 return 0x1;
9705 }
9706
9707 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9708 {
9709 char value2 = op2->c;
9710
9711 exp->type = 2;
9712 exp->string = PrintChar(op1->c || value2);
9713 if(!exp->expType)
9714 {
9715 exp->expType = op1->type;
9716 if(op1->type)
9717 op1->type->refCount++;
9718 }
9719 return 0x1;
9720 }
9721
9722 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9723 {
9724 unsigned char value2 = op2->uc;
9725
9726 exp->type = 2;
9727 exp->string = PrintUChar(op1->uc || value2);
9728 if(!exp->expType)
9729 {
9730 exp->expType = op1->type;
9731 if(op1->type)
9732 op1->type->refCount++;
9733 }
9734 return 0x1;
9735 }
9736
9737 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9738 {
9739 float value2 = op2->f;
9740
9741 exp->type = 2;
9742 exp->string = PrintFloat(op1->f || value2);
9743 if(!exp->expType)
9744 {
9745 exp->expType = op1->type;
9746 if(op1->type)
9747 op1->type->refCount++;
9748 }
9749 return 0x1;
9750 }
9751
9752 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9753 {
9754 double value2 = op2->d;
9755
9756 exp->type = 2;
9757 exp->string = PrintDouble(op1->d || value2);
9758 if(!exp->expType)
9759 {
9760 exp->expType = op1->type;
9761 if(op1->type)
9762 op1->type->refCount++;
9763 }
9764 return 0x1;
9765 }
9766
9767 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9768 {
9769 int value2 = op2->i;
9770
9771 exp->type = 2;
9772 exp->string = PrintInt(op1->i > value2);
9773 if(!exp->expType)
9774 {
9775 exp->expType = op1->type;
9776 if(op1->type)
9777 op1->type->refCount++;
9778 }
9779 return 0x1;
9780 }
9781
9782 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9783 {
9784 unsigned int value2 = op2->ui;
9785
9786 exp->type = 2;
9787 exp->string = PrintUInt(op1->ui > value2);
9788 if(!exp->expType)
9789 {
9790 exp->expType = op1->type;
9791 if(op1->type)
9792 op1->type->refCount++;
9793 }
9794 return 0x1;
9795 }
9796
9797 static unsigned int Int64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9798 {
9799 long long value2 = op2->i64;
9800
9801 exp->type = 2;
9802 exp->string = PrintInt64(op1->i64 > value2);
9803 if(!exp->expType)
9804 {
9805 exp->expType = op1->type;
9806 if(op1->type)
9807 op1->type->refCount++;
9808 }
9809 return 0x1;
9810 }
9811
9812 static unsigned int UInt64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9813 {
9814 uint64 value2 = op2->ui64;
9815
9816 exp->type = 2;
9817 exp->string = PrintUInt64(op1->ui64 > value2);
9818 if(!exp->expType)
9819 {
9820 exp->expType = op1->type;
9821 if(op1->type)
9822 op1->type->refCount++;
9823 }
9824 return 0x1;
9825 }
9826
9827 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9828 {
9829 short value2 = op2->s;
9830
9831 exp->type = 2;
9832 exp->string = PrintShort(op1->s > value2);
9833 if(!exp->expType)
9834 {
9835 exp->expType = op1->type;
9836 if(op1->type)
9837 op1->type->refCount++;
9838 }
9839 return 0x1;
9840 }
9841
9842 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9843 {
9844 unsigned short value2 = op2->us;
9845
9846 exp->type = 2;
9847 exp->string = PrintUShort(op1->us > value2);
9848 if(!exp->expType)
9849 {
9850 exp->expType = op1->type;
9851 if(op1->type)
9852 op1->type->refCount++;
9853 }
9854 return 0x1;
9855 }
9856
9857 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9858 {
9859 char value2 = op2->c;
9860
9861 exp->type = 2;
9862 exp->string = PrintChar(op1->c > value2);
9863 if(!exp->expType)
9864 {
9865 exp->expType = op1->type;
9866 if(op1->type)
9867 op1->type->refCount++;
9868 }
9869 return 0x1;
9870 }
9871
9872 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9873 {
9874 unsigned char value2 = op2->uc;
9875
9876 exp->type = 2;
9877 exp->string = PrintUChar(op1->uc > value2);
9878 if(!exp->expType)
9879 {
9880 exp->expType = op1->type;
9881 if(op1->type)
9882 op1->type->refCount++;
9883 }
9884 return 0x1;
9885 }
9886
9887 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9888 {
9889 float value2 = op2->f;
9890
9891 exp->type = 2;
9892 exp->string = PrintFloat(op1->f > value2);
9893 if(!exp->expType)
9894 {
9895 exp->expType = op1->type;
9896 if(op1->type)
9897 op1->type->refCount++;
9898 }
9899 return 0x1;
9900 }
9901
9902 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9903 {
9904 double value2 = op2->d;
9905
9906 exp->type = 2;
9907 exp->string = PrintDouble(op1->d > value2);
9908 if(!exp->expType)
9909 {
9910 exp->expType = op1->type;
9911 if(op1->type)
9912 op1->type->refCount++;
9913 }
9914 return 0x1;
9915 }
9916
9917 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9918 {
9919 int value2 = op2->i;
9920
9921 exp->type = 2;
9922 exp->string = PrintInt(op1->i < value2);
9923 if(!exp->expType)
9924 {
9925 exp->expType = op1->type;
9926 if(op1->type)
9927 op1->type->refCount++;
9928 }
9929 return 0x1;
9930 }
9931
9932 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9933 {
9934 unsigned int value2 = op2->ui;
9935
9936 exp->type = 2;
9937 exp->string = PrintUInt(op1->ui < value2);
9938 if(!exp->expType)
9939 {
9940 exp->expType = op1->type;
9941 if(op1->type)
9942 op1->type->refCount++;
9943 }
9944 return 0x1;
9945 }
9946
9947 static unsigned int Int64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9948 {
9949 long long value2 = op2->i64;
9950
9951 exp->type = 2;
9952 exp->string = PrintInt64(op1->i64 < value2);
9953 if(!exp->expType)
9954 {
9955 exp->expType = op1->type;
9956 if(op1->type)
9957 op1->type->refCount++;
9958 }
9959 return 0x1;
9960 }
9961
9962 static unsigned int UInt64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9963 {
9964 uint64 value2 = op2->ui64;
9965
9966 exp->type = 2;
9967 exp->string = PrintUInt64(op1->ui64 < value2);
9968 if(!exp->expType)
9969 {
9970 exp->expType = op1->type;
9971 if(op1->type)
9972 op1->type->refCount++;
9973 }
9974 return 0x1;
9975 }
9976
9977 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9978 {
9979 short value2 = op2->s;
9980
9981 exp->type = 2;
9982 exp->string = PrintShort(op1->s < value2);
9983 if(!exp->expType)
9984 {
9985 exp->expType = op1->type;
9986 if(op1->type)
9987 op1->type->refCount++;
9988 }
9989 return 0x1;
9990 }
9991
9992 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9993 {
9994 unsigned short value2 = op2->us;
9995
9996 exp->type = 2;
9997 exp->string = PrintUShort(op1->us < value2);
9998 if(!exp->expType)
9999 {
10000 exp->expType = op1->type;
10001 if(op1->type)
10002 op1->type->refCount++;
10003 }
10004 return 0x1;
10005 }
10006
10007 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10008 {
10009 char value2 = op2->c;
10010
10011 exp->type = 2;
10012 exp->string = PrintChar(op1->c < value2);
10013 if(!exp->expType)
10014 {
10015 exp->expType = op1->type;
10016 if(op1->type)
10017 op1->type->refCount++;
10018 }
10019 return 0x1;
10020 }
10021
10022 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10023 {
10024 unsigned char value2 = op2->uc;
10025
10026 exp->type = 2;
10027 exp->string = PrintUChar(op1->uc < value2);
10028 if(!exp->expType)
10029 {
10030 exp->expType = op1->type;
10031 if(op1->type)
10032 op1->type->refCount++;
10033 }
10034 return 0x1;
10035 }
10036
10037 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10038 {
10039 float value2 = op2->f;
10040
10041 exp->type = 2;
10042 exp->string = PrintFloat(op1->f < value2);
10043 if(!exp->expType)
10044 {
10045 exp->expType = op1->type;
10046 if(op1->type)
10047 op1->type->refCount++;
10048 }
10049 return 0x1;
10050 }
10051
10052 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10053 {
10054 double value2 = op2->d;
10055
10056 exp->type = 2;
10057 exp->string = PrintDouble(op1->d < value2);
10058 if(!exp->expType)
10059 {
10060 exp->expType = op1->type;
10061 if(op1->type)
10062 op1->type->refCount++;
10063 }
10064 return 0x1;
10065 }
10066
10067 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10068 {
10069 int value2 = op2->i;
10070
10071 exp->type = 2;
10072 exp->string = PrintInt(op1->i >= value2);
10073 if(!exp->expType)
10074 {
10075 exp->expType = op1->type;
10076 if(op1->type)
10077 op1->type->refCount++;
10078 }
10079 return 0x1;
10080 }
10081
10082 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10083 {
10084 unsigned int value2 = op2->ui;
10085
10086 exp->type = 2;
10087 exp->string = PrintUInt(op1->ui >= value2);
10088 if(!exp->expType)
10089 {
10090 exp->expType = op1->type;
10091 if(op1->type)
10092 op1->type->refCount++;
10093 }
10094 return 0x1;
10095 }
10096
10097 static unsigned int Int64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10098 {
10099 long long value2 = op2->i64;
10100
10101 exp->type = 2;
10102 exp->string = PrintInt64(op1->i64 >= value2);
10103 if(!exp->expType)
10104 {
10105 exp->expType = op1->type;
10106 if(op1->type)
10107 op1->type->refCount++;
10108 }
10109 return 0x1;
10110 }
10111
10112 static unsigned int UInt64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10113 {
10114 uint64 value2 = op2->ui64;
10115
10116 exp->type = 2;
10117 exp->string = PrintUInt64(op1->ui64 >= value2);
10118 if(!exp->expType)
10119 {
10120 exp->expType = op1->type;
10121 if(op1->type)
10122 op1->type->refCount++;
10123 }
10124 return 0x1;
10125 }
10126
10127 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10128 {
10129 short value2 = op2->s;
10130
10131 exp->type = 2;
10132 exp->string = PrintShort(op1->s >= value2);
10133 if(!exp->expType)
10134 {
10135 exp->expType = op1->type;
10136 if(op1->type)
10137 op1->type->refCount++;
10138 }
10139 return 0x1;
10140 }
10141
10142 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10143 {
10144 unsigned short value2 = op2->us;
10145
10146 exp->type = 2;
10147 exp->string = PrintUShort(op1->us >= value2);
10148 if(!exp->expType)
10149 {
10150 exp->expType = op1->type;
10151 if(op1->type)
10152 op1->type->refCount++;
10153 }
10154 return 0x1;
10155 }
10156
10157 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10158 {
10159 char value2 = op2->c;
10160
10161 exp->type = 2;
10162 exp->string = PrintChar(op1->c >= value2);
10163 if(!exp->expType)
10164 {
10165 exp->expType = op1->type;
10166 if(op1->type)
10167 op1->type->refCount++;
10168 }
10169 return 0x1;
10170 }
10171
10172 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10173 {
10174 unsigned char value2 = op2->uc;
10175
10176 exp->type = 2;
10177 exp->string = PrintUChar(op1->uc >= value2);
10178 if(!exp->expType)
10179 {
10180 exp->expType = op1->type;
10181 if(op1->type)
10182 op1->type->refCount++;
10183 }
10184 return 0x1;
10185 }
10186
10187 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10188 {
10189 float value2 = op2->f;
10190
10191 exp->type = 2;
10192 exp->string = PrintFloat(op1->f >= value2);
10193 if(!exp->expType)
10194 {
10195 exp->expType = op1->type;
10196 if(op1->type)
10197 op1->type->refCount++;
10198 }
10199 return 0x1;
10200 }
10201
10202 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10203 {
10204 double value2 = op2->d;
10205
10206 exp->type = 2;
10207 exp->string = PrintDouble(op1->d >= value2);
10208 if(!exp->expType)
10209 {
10210 exp->expType = op1->type;
10211 if(op1->type)
10212 op1->type->refCount++;
10213 }
10214 return 0x1;
10215 }
10216
10217 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10218 {
10219 int value2 = op2->i;
10220
10221 exp->type = 2;
10222 exp->string = PrintInt(op1->i <= value2);
10223 if(!exp->expType)
10224 {
10225 exp->expType = op1->type;
10226 if(op1->type)
10227 op1->type->refCount++;
10228 }
10229 return 0x1;
10230 }
10231
10232 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10233 {
10234 unsigned int value2 = op2->ui;
10235
10236 exp->type = 2;
10237 exp->string = PrintUInt(op1->ui <= value2);
10238 if(!exp->expType)
10239 {
10240 exp->expType = op1->type;
10241 if(op1->type)
10242 op1->type->refCount++;
10243 }
10244 return 0x1;
10245 }
10246
10247 static unsigned int Int64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10248 {
10249 long long value2 = op2->i64;
10250
10251 exp->type = 2;
10252 exp->string = PrintInt64(op1->i64 <= value2);
10253 if(!exp->expType)
10254 {
10255 exp->expType = op1->type;
10256 if(op1->type)
10257 op1->type->refCount++;
10258 }
10259 return 0x1;
10260 }
10261
10262 static unsigned int UInt64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10263 {
10264 uint64 value2 = op2->ui64;
10265
10266 exp->type = 2;
10267 exp->string = PrintUInt64(op1->ui64 <= value2);
10268 if(!exp->expType)
10269 {
10270 exp->expType = op1->type;
10271 if(op1->type)
10272 op1->type->refCount++;
10273 }
10274 return 0x1;
10275 }
10276
10277 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10278 {
10279 short value2 = op2->s;
10280
10281 exp->type = 2;
10282 exp->string = PrintShort(op1->s <= value2);
10283 if(!exp->expType)
10284 {
10285 exp->expType = op1->type;
10286 if(op1->type)
10287 op1->type->refCount++;
10288 }
10289 return 0x1;
10290 }
10291
10292 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10293 {
10294 unsigned short value2 = op2->us;
10295
10296 exp->type = 2;
10297 exp->string = PrintUShort(op1->us <= value2);
10298 if(!exp->expType)
10299 {
10300 exp->expType = op1->type;
10301 if(op1->type)
10302 op1->type->refCount++;
10303 }
10304 return 0x1;
10305 }
10306
10307 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10308 {
10309 char value2 = op2->c;
10310
10311 exp->type = 2;
10312 exp->string = PrintChar(op1->c <= value2);
10313 if(!exp->expType)
10314 {
10315 exp->expType = op1->type;
10316 if(op1->type)
10317 op1->type->refCount++;
10318 }
10319 return 0x1;
10320 }
10321
10322 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10323 {
10324 unsigned char value2 = op2->uc;
10325
10326 exp->type = 2;
10327 exp->string = PrintUChar(op1->uc <= value2);
10328 if(!exp->expType)
10329 {
10330 exp->expType = op1->type;
10331 if(op1->type)
10332 op1->type->refCount++;
10333 }
10334 return 0x1;
10335 }
10336
10337 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10338 {
10339 float value2 = op2->f;
10340
10341 exp->type = 2;
10342 exp->string = PrintFloat(op1->f <= value2);
10343 if(!exp->expType)
10344 {
10345 exp->expType = op1->type;
10346 if(op1->type)
10347 op1->type->refCount++;
10348 }
10349 return 0x1;
10350 }
10351
10352 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10353 {
10354 double value2 = op2->d;
10355
10356 exp->type = 2;
10357 exp->string = PrintDouble(op1->d <= value2);
10358 if(!exp->expType)
10359 {
10360 exp->expType = op1->type;
10361 if(op1->type)
10362 op1->type->refCount++;
10363 }
10364 return 0x1;
10365 }
10366
10367 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10368 {
10369 exp->type = 2;
10370 exp->string = PrintInt(op1->i ? op2->i : op3->i);
10371 if(!exp->expType)
10372 {
10373 exp->expType = op1->type;
10374 if(op1->type)
10375 op1->type->refCount++;
10376 }
10377 return 0x1;
10378 }
10379
10380 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10381 {
10382 exp->type = 2;
10383 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
10384 if(!exp->expType)
10385 {
10386 exp->expType = op1->type;
10387 if(op1->type)
10388 op1->type->refCount++;
10389 }
10390 return 0x1;
10391 }
10392
10393 static unsigned int Int64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10394 {
10395 exp->type = 2;
10396 exp->string = PrintInt64(op1->i64 ? op2->i64 : op3->i64);
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 UInt64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10407 {
10408 exp->type = 2;
10409 exp->string = PrintUInt64(op1->ui64 ? op2->ui64 : op3->ui64);
10410 if(!exp->expType)
10411 {
10412 exp->expType = op1->type;
10413 if(op1->type)
10414 op1->type->refCount++;
10415 }
10416 return 0x1;
10417 }
10418
10419 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10420 {
10421 exp->type = 2;
10422 exp->string = PrintShort(op1->s ? op2->s : op3->s);
10423 if(!exp->expType)
10424 {
10425 exp->expType = op1->type;
10426 if(op1->type)
10427 op1->type->refCount++;
10428 }
10429 return 0x1;
10430 }
10431
10432 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10433 {
10434 exp->type = 2;
10435 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
10436 if(!exp->expType)
10437 {
10438 exp->expType = op1->type;
10439 if(op1->type)
10440 op1->type->refCount++;
10441 }
10442 return 0x1;
10443 }
10444
10445 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10446 {
10447 exp->type = 2;
10448 exp->string = PrintChar(op1->c ? op2->c : op3->c);
10449 if(!exp->expType)
10450 {
10451 exp->expType = op1->type;
10452 if(op1->type)
10453 op1->type->refCount++;
10454 }
10455 return 0x1;
10456 }
10457
10458 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10459 {
10460 exp->type = 2;
10461 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
10462 if(!exp->expType)
10463 {
10464 exp->expType = op1->type;
10465 if(op1->type)
10466 op1->type->refCount++;
10467 }
10468 return 0x1;
10469 }
10470
10471 struct OpTable intOps = 
10472 {
10473 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
10474 };
10475
10476 struct OpTable uintOps = 
10477 {
10478 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
10479 };
10480
10481 struct OpTable int64Ops = 
10482 {
10483 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
10484 };
10485
10486 struct OpTable uint64Ops = 
10487 {
10488 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
10489 };
10490
10491 struct OpTable shortOps = 
10492 {
10493 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
10494 };
10495
10496 struct OpTable ushortOps = 
10497 {
10498 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
10499 };
10500
10501 struct OpTable floatOps = 
10502 {
10503 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
10504 };
10505
10506 struct OpTable doubleOps = 
10507 {
10508 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
10509 };
10510
10511 struct OpTable charOps = 
10512 {
10513 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
10514 };
10515
10516 struct OpTable ucharOps = 
10517 {
10518 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
10519 };
10520
10521 void ReadString(char * output, char * string)
10522 {
10523 int len = strlen(string);
10524 int c, d = 0;
10525 unsigned int quoted = 0x0, escaped = 0x0;
10526
10527 for(c = 0; c < len; c++)
10528 {
10529 char ch = string[c];
10530
10531 if(escaped)
10532 {
10533 switch(ch)
10534 {
10535 case 'n':
10536 output[d] = '\n';
10537 break;
10538 case 't':
10539 output[d] = '\t';
10540 break;
10541 case 'a':
10542 output[d] = '\a';
10543 break;
10544 case 'b':
10545 output[d] = '\b';
10546 break;
10547 case 'f':
10548 output[d] = '\f';
10549 break;
10550 case 'r':
10551 output[d] = '\r';
10552 break;
10553 case 'v':
10554 output[d] = '\v';
10555 break;
10556 case '\\':
10557 output[d] = '\\';
10558 break;
10559 case '\"':
10560 output[d] = '\"';
10561 break;
10562 case '\'':
10563 output[d] = '\'';
10564 break;
10565 default:
10566 output[d] = ch;
10567 }
10568 d++;
10569 escaped = 0x0;
10570 }
10571 else
10572 {
10573 if(ch == '\"')
10574 quoted ^= 0x1;
10575 else if(quoted)
10576 {
10577 if(ch == '\\')
10578 escaped = 0x1;
10579 else
10580 output[d++] = ch;
10581 }
10582 }
10583 }
10584 output[d] = '\0';
10585 }
10586
10587 int UnescapeString(char * d, char * s, int len)
10588 {
10589 int j = 0, k = 0;
10590 char ch;
10591
10592 while(j < len && (ch = s[j]))
10593 {
10594 switch(ch)
10595 {
10596 case '\\':
10597 switch((ch = s[++j]))
10598 {
10599 case 'n':
10600 d[k] = '\n';
10601 break;
10602 case 't':
10603 d[k] = '\t';
10604 break;
10605 case 'a':
10606 d[k] = '\a';
10607 break;
10608 case 'b':
10609 d[k] = '\b';
10610 break;
10611 case 'f':
10612 d[k] = '\f';
10613 break;
10614 case 'r':
10615 d[k] = '\r';
10616 break;
10617 case 'v':
10618 d[k] = '\v';
10619 break;
10620 case '\\':
10621 d[k] = '\\';
10622 break;
10623 case '\"':
10624 d[k] = '\"';
10625 break;
10626 case '\'':
10627 d[k] = '\'';
10628 break;
10629 default:
10630 d[k] = '\\';
10631 d[k] = ch;
10632 }
10633 break;
10634 default:
10635 d[k] = ch;
10636 }
10637 j++, k++;
10638 }
10639 d[k] = '\0';
10640 return k;
10641 }
10642
10643 char * OffsetEscapedString(char * s, int len, int offset)
10644 {
10645 char ch;
10646 int j = 0, k = 0;
10647
10648 while(j < len && k < offset && (ch = s[j]))
10649 {
10650 if(ch == '\\')
10651 ++j;
10652 j++, k++;
10653 }
10654 return (k == offset) ? s + j : (((void *)0));
10655 }
10656
10657 extern long long __ecereNameSpace__ecere__com___strtoi64(char *  string, char * *  endString, int base);
10658
10659 extern uint64 __ecereNameSpace__ecere__com___strtoui64(char *  string, char * *  endString, int base);
10660
10661 extern double strtod(char * , char * * );
10662
10663 extern float (* __ecereMethod_float_inf)(void);
10664
10665 extern float (* __ecereMethod_float_nan)(void);
10666
10667 extern double (* __ecereMethod_double_inf)(void);
10668
10669 extern double (* __ecereMethod_double_nan)(void);
10670
10671 struct Operand GetOperand(struct Expression * exp)
10672 {
10673 struct Operand op = 
10674 {
10675 0, 0, 0, 0, 
10676 {
10677 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10678 }
10679 };
10680 struct Type * type = exp->expType;
10681
10682 if(type)
10683 {
10684 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
10685 {
10686 if(!type->_class->registered->dataType)
10687 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
10688 type = type->_class->registered->dataType;
10689 }
10690 if(exp->type == 3 && op.kind == 13)
10691 {
10692 op.ui64 = (uint64)exp->string;
10693 op.kind = 13;
10694 op.ops = uint64Ops;
10695 }
10696 else if(exp->isConstant && exp->type == 2)
10697 {
10698 op.kind = type->kind;
10699 op.type = exp->expType;
10700 switch(op.kind)
10701 {
10702 case 24:
10703 case 1:
10704 {
10705 if(exp->constant[0] == '\'')
10706 {
10707 op.c = exp->constant[1];
10708 op.ops = charOps;
10709 }
10710 else if(type->isSigned)
10711 {
10712 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
10713 op.ops = charOps;
10714 }
10715 else
10716 {
10717 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
10718 op.ops = ucharOps;
10719 }
10720 break;
10721 }
10722 case 2:
10723 if(type->isSigned)
10724 {
10725 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
10726 op.ops = shortOps;
10727 }
10728 else
10729 {
10730 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
10731 op.ops = ushortOps;
10732 }
10733 break;
10734 case 3:
10735 case 5:
10736 if(type->isSigned)
10737 {
10738 op.i = strtol(exp->constant, (((void *)0)), 0);
10739 op.ops = intOps;
10740 }
10741 else
10742 {
10743 op.ui = strtoul(exp->constant, (((void *)0)), 0);
10744 op.ops = uintOps;
10745 }
10746 op.kind = 3;
10747 break;
10748 case 4:
10749 if(type->isSigned)
10750 {
10751 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10752 op.ops = int64Ops;
10753 }
10754 else
10755 {
10756 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10757 op.ops = uint64Ops;
10758 }
10759 op.kind = 4;
10760 break;
10761 case 22:
10762 if(type->isSigned)
10763 {
10764 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10765 op.ops = int64Ops;
10766 }
10767 else
10768 {
10769 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10770 op.ops = uint64Ops;
10771 }
10772 op.kind = 4;
10773 break;
10774 case 23:
10775 if(type->isSigned)
10776 {
10777 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10778 op.ops = int64Ops;
10779 }
10780 else
10781 {
10782 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10783 op.ops = uint64Ops;
10784 }
10785 op.kind = 4;
10786 break;
10787 case 6:
10788 if(!strcmp(exp->constant, "inf"))
10789 op.f = __ecereMethod_float_inf();
10790 else if(!strcmp(exp->constant, "-inf"))
10791 op.f = -__ecereMethod_float_inf();
10792 else if(!strcmp(exp->constant, "nan"))
10793 op.f = __ecereMethod_float_nan();
10794 else if(!strcmp(exp->constant, "-nan"))
10795 op.f = -__ecereMethod_float_nan();
10796 else
10797 op.f = (float)strtod(exp->constant, (((void *)0)));
10798 op.ops = floatOps;
10799 break;
10800 case 7:
10801 if(!strcmp(exp->constant, "inf"))
10802 op.d = __ecereMethod_double_inf();
10803 else if(!strcmp(exp->constant, "-inf"))
10804 op.d = -__ecereMethod_double_inf();
10805 else if(!strcmp(exp->constant, "nan"))
10806 op.d = __ecereMethod_double_nan();
10807 else if(!strcmp(exp->constant, "-nan"))
10808 op.d = -__ecereMethod_double_nan();
10809 else
10810 op.d = (double)strtod(exp->constant, (((void *)0)));
10811 op.ops = doubleOps;
10812 break;
10813 case 12:
10814 case 13:
10815 case 8:
10816 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10817 op.kind = 13;
10818 op.ops = uint64Ops;
10819 break;
10820 }
10821 }
10822 }
10823 return op;
10824 }
10825
10826 int __ecereVMethodID_class_OnGetString;
10827
10828 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
10829
10830 static void UnusedFunction()
10831 {
10832 int a;
10833
10834 ((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);
10835 }
10836
10837 extern int __ecereVMethodID_class_OnGetString;
10838
10839 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
10840 {
10841 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10842
10843 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
10844 {
10845 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
10846 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
10847 else
10848 {
10849 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10850 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
10851 struct Type * type;
10852 void * ptr = inst->data + dataMember->offset + offset;
10853 char * result = (((void *)0));
10854
10855 exp->loc = member->loc = inst->loc;
10856 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
10857 if(!dataMember->dataType)
10858 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
10859 type = dataMember->dataType;
10860 if(type->kind == 8)
10861 {
10862 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10863
10864 if(_class->type == 4)
10865 {
10866 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
10867
10868 if(enumClass)
10869 {
10870 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
10871 struct __ecereNameSpace__ecere__sys__NamedLink * item;
10872
10873 for(item = e->values.first; item; item = item->next)
10874 {
10875 if((int)item->data == *(int *)ptr)
10876 {
10877 result = item->name;
10878 break;
10879 }
10880 }
10881 if(result)
10882 {
10883 exp->identifier = MkIdentifier(result);
10884 exp->type = 0;
10885 exp->destType = MkClassType(_class->fullName);
10886 ProcessExpressionType(exp);
10887 }
10888 }
10889 }
10890 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
10891 {
10892 if(!_class->dataType)
10893 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10894 type = _class->dataType;
10895 }
10896 }
10897 if(!result)
10898 {
10899 switch(type->kind)
10900 {
10901 case 6:
10902 {
10903 FreeExpContents(exp);
10904 exp->constant = PrintFloat(*(float *)ptr);
10905 exp->type = 2;
10906 break;
10907 }
10908 case 7:
10909 {
10910 FreeExpContents(exp);
10911 exp->constant = PrintDouble(*(double *)ptr);
10912 exp->type = 2;
10913 break;
10914 }
10915 case 3:
10916 {
10917 FreeExpContents(exp);
10918 exp->constant = PrintInt(*(int *)ptr);
10919 exp->type = 2;
10920 break;
10921 }
10922 case 4:
10923 {
10924 FreeExpContents(exp);
10925 exp->constant = PrintInt64(*(long long *)ptr);
10926 exp->type = 2;
10927 break;
10928 }
10929 case 22:
10930 {
10931 FreeExpContents(exp);
10932 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
10933 exp->type = 2;
10934 break;
10935 }
10936 case 23:
10937 {
10938 FreeExpContents(exp);
10939 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
10940 exp->type = 2;
10941 break;
10942 }
10943 default:
10944 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
10945 }
10946 }
10947 ListAdd(memberList, member);
10948 }
10949 if(parentDataMember->type == 1)
10950 break;
10951 }
10952 }
10953
10954 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
10955
10956 void PopulateInstance(struct Instantiation * inst)
10957 {
10958 struct Symbol * classSym = inst->_class->symbol;
10959 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
10960 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10961 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
10962
10963 if(!inst->members)
10964 inst->members = MkListOne(MkMembersInitList(memberList));
10965 else
10966 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
10967 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
10968 {
10969 if(!dataMember->isProperty)
10970 {
10971 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
10972 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
10973 else
10974 {
10975 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10976 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
10977 struct Type * type;
10978 void * ptr = inst->data + dataMember->offset;
10979 char * result = (((void *)0));
10980
10981 exp->loc = member->loc = inst->loc;
10982 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
10983 if(!dataMember->dataType)
10984 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
10985 type = dataMember->dataType;
10986 if(type->kind == 8)
10987 {
10988 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10989
10990 if(_class->type == 4)
10991 {
10992 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
10993
10994 if(enumClass)
10995 {
10996 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
10997 struct __ecereNameSpace__ecere__sys__NamedLink * item;
10998
10999 for(item = e->values.first; item; item = item->next)
11000 {
11001 if((int)item->data == *(int *)ptr)
11002 {
11003 result = item->name;
11004 break;
11005 }
11006 }
11007 }
11008 if(result)
11009 {
11010 exp->identifier = MkIdentifier(result);
11011 exp->type = 0;
11012 exp->destType = MkClassType(_class->fullName);
11013 ProcessExpressionType(exp);
11014 }
11015 }
11016 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
11017 {
11018 if(!_class->dataType)
11019 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11020 type = _class->dataType;
11021 }
11022 }
11023 if(!result)
11024 {
11025 switch(type->kind)
11026 {
11027 case 6:
11028 {
11029 exp->constant = PrintFloat(*(float *)ptr);
11030 exp->type = 2;
11031 break;
11032 }
11033 case 7:
11034 {
11035 exp->constant = PrintDouble(*(double *)ptr);
11036 exp->type = 2;
11037 break;
11038 }
11039 case 3:
11040 {
11041 exp->constant = PrintInt(*(int *)ptr);
11042 exp->type = 2;
11043 break;
11044 }
11045 case 4:
11046 {
11047 exp->constant = PrintInt64(*(long long *)ptr);
11048 exp->type = 2;
11049 break;
11050 }
11051 case 22:
11052 {
11053 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
11054 exp->type = 2;
11055 break;
11056 }
11057 default:
11058 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
11059 }
11060 }
11061 ListAdd(memberList, member);
11062 }
11063 }
11064 }
11065 }
11066
11067 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);
11068
11069 extern void FreeInstance(struct Instantiation * inst);
11070
11071 void ComputeInstantiation(struct Expression * exp)
11072 {
11073 struct Instantiation * inst = exp->instance;
11074 struct MembersInit * members;
11075 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
11076 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
11077 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
11078 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
11079 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
11080 int subMemberStackPos = 0;
11081 uint64 bits = 0;
11082
11083 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11084 {
11085 if(inst->data)
11086 return ;
11087 if(_class->type == 0 || _class->type == 5)
11088 {
11089 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
11090 if(_class->type == 0)
11091 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)inst->data))->_refCount++;
11092 }
11093 else
11094 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11095 }
11096 if(inst->members)
11097 {
11098 for(members = (*inst->members).first; members; members = members->next)
11099 {
11100 switch(members->type)
11101 {
11102 case 0:
11103 {
11104 if(members->dataMembers)
11105 {
11106 struct MemberInit * member;
11107
11108 for(member = (*members->dataMembers).first; member; member = member->next)
11109 {
11110 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
11111 unsigned int found = 0x0;
11112 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11113 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
11114 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
11115 unsigned int dataMemberOffset;
11116
11117 if(!ident)
11118 {
11119 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
11120 if(curMember)
11121 {
11122 if(curMember->isProperty)
11123 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
11124 else
11125 {
11126 dataMember = curMember;
11127 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11128 if(_class->type == 0)
11129 dataMemberOffset += _class->base->structSize;
11130 }
11131 found = 0x1;
11132 }
11133 }
11134 else
11135 {
11136 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
11137 if(prop)
11138 {
11139 found = 0x1;
11140 if(prop->memberAccess == 1)
11141 {
11142 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
11143 curClass = prop->_class;
11144 }
11145 }
11146 else
11147 {
11148 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
11149 int _subMemberStackPos = 0;
11150
11151 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
11152 if(dataMember)
11153 {
11154 found = 0x1;
11155 if(dataMember->memberAccess == 1)
11156 {
11157 curMember = dataMember;
11158 curClass = dataMember->_class;
11159 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
11160 subMemberStackPos = _subMemberStackPos;
11161 }
11162 }
11163 }
11164 }
11165 if(found && member->initializer && member->initializer->type == 0)
11166 {
11167 struct Expression * value = member->initializer->exp;
11168 struct Type * type = (((void *)0));
11169 unsigned int deepMember = 0x0;
11170
11171 if(prop)
11172 {
11173 type = prop->dataType;
11174 }
11175 else if(dataMember)
11176 {
11177 if(!dataMember->dataType)
11178 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
11179 type = dataMember->dataType;
11180 }
11181 if(ident && ident->next)
11182 {
11183 deepMember = 0x1;
11184 for(ident = ident->next; ident && type; ident = ident->next)
11185 {
11186 if(type->kind == 8)
11187 {
11188 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
11189 if(prop)
11190 type = prop->dataType;
11191 else
11192 {
11193 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11194 if(dataMember)
11195 type = dataMember->dataType;
11196 }
11197 }
11198 else if(type->kind == 9 || type->kind == 10)
11199 {
11200 struct Type * memberType;
11201
11202 for(memberType = type->members.first; memberType; memberType = memberType->next)
11203 {
11204 if(!strcmp(memberType->name, ident->string))
11205 {
11206 type = memberType;
11207 break;
11208 }
11209 }
11210 }
11211 }
11212 }
11213 if(value)
11214 {
11215 FreeType(value->destType);
11216 value->destType = type;
11217 if(type)
11218 type->refCount++;
11219 ComputeExpression(value);
11220 }
11221 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11222 {
11223 if(type->kind == 8)
11224 {
11225 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11226
11227 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
11228 {
11229 if(!_class->dataType)
11230 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11231 type = _class->dataType;
11232 }
11233 }
11234 if(dataMember)
11235 {
11236 void * ptr = inst->data + dataMemberOffset;
11237
11238 if(value->type == 2)
11239 {
11240 switch(type->kind)
11241 {
11242 case 3:
11243 {
11244 GetInt(value, (int *)ptr);
11245 break;
11246 }
11247 case 4:
11248 {
11249 GetInt64(value, (long long *)ptr);
11250 break;
11251 }
11252 case 22:
11253 {
11254 GetIntPtr(value, (intptr_t *)ptr);
11255 break;
11256 }
11257 case 23:
11258 {
11259 GetIntSize(value, (ssize_t *)ptr);
11260 break;
11261 }
11262 case 6:
11263 {
11264 GetFloat(value, (float *)ptr);
11265 break;
11266 }
11267 case 7:
11268 {
11269 GetDouble(value, (double *)ptr);
11270 break;
11271 }
11272 }
11273 }
11274 else if(value->type == 1)
11275 {
11276 if(type->kind == 8)
11277 {
11278 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11279
11280 if(_class->type == 1)
11281 {
11282 ComputeTypeSize(type);
11283 if(value->instance->data)
11284 memcpy(ptr, value->instance->data, type->size);
11285 }
11286 }
11287 }
11288 }
11289 else if(prop)
11290 {
11291 if(value->type == 1 && value->instance->data)
11292 {
11293 if(type->kind == 8)
11294 {
11295 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11296
11297 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)))
11298 {
11299 void (* Set)(void *, void *) = (void *)prop->Set;
11300
11301 Set(inst->data, value->instance->data);
11302 PopulateInstance(inst);
11303 }
11304 }
11305 }
11306 else if(value->type == 2)
11307 {
11308 switch(type->kind)
11309 {
11310 case 7:
11311 {
11312 void (* Set)(void *, double) = (void *)prop->Set;
11313
11314 Set(inst->data, strtod(value->constant, (((void *)0))));
11315 break;
11316 }
11317 case 6:
11318 {
11319 void (* Set)(void *, float) = (void *)prop->Set;
11320
11321 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
11322 break;
11323 }
11324 case 3:
11325 {
11326 void (* Set)(void *, int) = (void *)prop->Set;
11327
11328 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
11329 break;
11330 }
11331 case 4:
11332 {
11333 void (* Set)(void *, long long) = (void *)prop->Set;
11334
11335 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11336 break;
11337 }
11338 case 22:
11339 {
11340 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11341
11342 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11343 break;
11344 }
11345 case 23:
11346 {
11347 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11348
11349 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11350 break;
11351 }
11352 }
11353 }
11354 else if(value->type == 3)
11355 {
11356 char temp[1024];
11357
11358 ReadString(temp, value->string);
11359 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
11360 }
11361 }
11362 }
11363 else if(!deepMember && type && _class->type == 3)
11364 {
11365 if(prop)
11366 {
11367 if(value->type == 2)
11368 {
11369 if(type->kind == 8)
11370 {
11371 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11372
11373 if(_class->type == 3)
11374 {
11375 if(!_class->dataType)
11376 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11377 type = _class->dataType;
11378 }
11379 }
11380 switch(type->kind)
11381 {
11382 case 6:
11383 {
11384 float fValue;
11385 float (* Set)(float) = (void *)prop->Set;
11386
11387 GetFloat(member->initializer->exp, &fValue);
11388 exp->constant = PrintFloat(Set(fValue));
11389 exp->type = 2;
11390 break;
11391 }
11392 case 7:
11393 {
11394 double dValue;
11395 double (* Set)(double) = (void *)prop->Set;
11396
11397 GetDouble(member->initializer->exp, &dValue);
11398 exp->constant = PrintDouble(Set(dValue));
11399 exp->type = 2;
11400 break;
11401 }
11402 }
11403 }
11404 }
11405 }
11406 else if(!deepMember && type && _class->type == 2)
11407 {
11408 if(prop)
11409 {
11410 if(value->type == 1 && value->instance->data)
11411 {
11412 unsigned int (* Set)(void *) = (void *)prop->Set;
11413
11414 bits = Set(value->instance->data);
11415 }
11416 else if(value->type == 2)
11417 {
11418 }
11419 }
11420 else if(dataMember)
11421 {
11422 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
11423 struct Type * type;
11424 uint64 part;
11425
11426 bits = (bits & ~bitMember->mask);
11427 if(!bitMember->dataType)
11428 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
11429 type = bitMember->dataType;
11430 if(type->kind == 8 && type->_class && type->_class->registered)
11431 {
11432 if(!type->_class->registered->dataType)
11433 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
11434 type = type->_class->registered->dataType;
11435 }
11436 switch(type->kind)
11437 {
11438 case 24:
11439 case 1:
11440 {
11441 unsigned char v;
11442
11443 type->isSigned ? GetChar(value, &v) : GetUChar(value, &v);
11444 part = (uint64)v;
11445 break;
11446 }
11447 case 2:
11448 {
11449 unsigned short v;
11450
11451 type->isSigned ? GetShort(value, &v) : GetUShort(value, &v);
11452 part = (uint64)v;
11453 break;
11454 }
11455 case 3:
11456 case 5:
11457 {
11458 unsigned int v;
11459
11460 type->isSigned ? GetInt(value, &v) : GetUInt(value, &v);
11461 part = (uint64)v;
11462 break;
11463 }
11464 case 4:
11465 {
11466 uint64 v;
11467
11468 type->isSigned ? GetInt64(value, &v) : GetUInt64(value, &v);
11469 part = v;
11470 break;
11471 }
11472 case 22:
11473 {
11474 intptr_t v;
11475
11476 type->isSigned ? GetIntPtr(value, &v) : GetUIntPtr(value, &v);
11477 part = (uint64)v;
11478 break;
11479 }
11480 case 23:
11481 {
11482 ssize_t v;
11483
11484 type->isSigned ? GetIntSize(value, &v) : GetUIntSize(value, &v);
11485 part = (uint64)v;
11486 break;
11487 }
11488 }
11489 bits += part << bitMember->pos;
11490 }
11491 }
11492 }
11493 else
11494 {
11495 if(_class && _class->type == 3)
11496 {
11497 ComputeExpression(member->initializer->exp);
11498 exp->constant = member->initializer->exp->constant;
11499 exp->type = 2;
11500 member->initializer->exp->constant = (((void *)0));
11501 }
11502 }
11503 }
11504 }
11505 break;
11506 }
11507 }
11508 }
11509 }
11510 if(_class && _class->type == 2)
11511 {
11512 exp->constant = PrintHexUInt(bits);
11513 exp->type = 2;
11514 }
11515 if(exp->type != 1)
11516 {
11517 FreeInstance(inst);
11518 }
11519 }
11520
11521 static unsigned int Promote(struct Operand * op, int kind, unsigned int isSigned)
11522 {
11523 unsigned int result = 0x0;
11524
11525 switch(kind)
11526 {
11527 case 2:
11528 if(op->kind == 1 || op->kind == 15 || op->kind == 24)
11529 result = isSigned ? GetOpShort(op, &op->s) : GetOpUShort(op, &op->us);
11530 break;
11531 case 3:
11532 case 5:
11533 if(op->kind == 1 || op->kind == 2 || op->kind == 15 || op->kind == 24)
11534 result = isSigned ? GetOpInt(op, &op->i) : GetOpUInt(op, &op->ui);
11535 break;
11536 case 4:
11537 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)
11538 result = isSigned ? GetOpInt64(op, &op->i64) : GetOpUInt64(op, &op->ui64);
11539 break;
11540 case 6:
11541 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)
11542 result = GetOpFloat(op, &op->f);
11543 break;
11544 case 7:
11545 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)
11546 result = GetOpDouble(op, &op->d);
11547 break;
11548 case 13:
11549 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)
11550 result = GetOpUIntPtr(op, &op->ui64);
11551 break;
11552 case 15:
11553 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)
11554 result = isSigned ? GetOpInt(op, &op->i) : GetOpUInt(op, &op->ui);
11555 break;
11556 case 22:
11557 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11558 result = isSigned ? GetOpIntPtr(op, &op->i64) : GetOpUIntPtr(op, &op->i64);
11559 break;
11560 case 23:
11561 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11562 result = isSigned ? GetOpIntSize(op, &op->ui64) : GetOpUIntSize(op, &op->ui64);
11563 break;
11564 }
11565 return result;
11566 }
11567
11568 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
11569 {
11570 if(exp->op.op == SIZEOF)
11571 {
11572 FreeExpContents(exp);
11573 exp->type = 2;
11574 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
11575 }
11576 else
11577 {
11578 if(!exp->op.exp1)
11579 {
11580 switch(exp->op.op)
11581 {
11582 case '+':
11583 {
11584 struct Expression * exp2 = exp->op.exp2;
11585
11586 exp->op.exp2 = (((void *)0));
11587 FreeExpContents(exp);
11588 FreeType(exp->expType);
11589 FreeType(exp->destType);
11590 *exp = *exp2;
11591 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
11592 break;
11593 }
11594 case '-':
11595 if(op1->ops.Neg)
11596 {
11597 FreeExpContents(exp);
11598 op1->ops.Neg(exp, op1);
11599 }
11600 break;
11601 case '~':
11602 if(op1->ops.BitNot)
11603 {
11604 FreeExpContents(exp);
11605 op1->ops.BitNot(exp, op1);
11606 }
11607 break;
11608 case '!':
11609 if(op1->ops.Not)
11610 {
11611 FreeExpContents(exp);
11612 op1->ops.Not(exp, op1);
11613 }
11614 break;
11615 }
11616 }
11617 else
11618 {
11619 if(op1 && op2 && op1->type && op2->type && op1->kind != op2->kind)
11620 {
11621 if(Promote(op2, op1->kind, op1->type->isSigned))
11622 op2->kind = op1->kind, op2->ops = op1->ops;
11623 else if(Promote(op1, op2->kind, op2->type->isSigned))
11624 op1->kind = op2->kind, op1->ops = op2->ops;
11625 }
11626 switch(exp->op.op)
11627 {
11628 case '+':
11629 if(op1->ops.Add)
11630 {
11631 FreeExpContents(exp);
11632 op1->ops.Add(exp, op1, op2);
11633 }
11634 break;
11635 case '-':
11636 if(op1->ops.Sub)
11637 {
11638 FreeExpContents(exp);
11639 op1->ops.Sub(exp, op1, op2);
11640 }
11641 break;
11642 case '*':
11643 if(op1->ops.Mul)
11644 {
11645 FreeExpContents(exp);
11646 op1->ops.Mul(exp, op1, op2);
11647 }
11648 break;
11649 case '/':
11650 if(op1->ops.Div)
11651 {
11652 FreeExpContents(exp);
11653 op1->ops.Div(exp, op1, op2);
11654 }
11655 break;
11656 case '%':
11657 if(op1->ops.Mod)
11658 {
11659 FreeExpContents(exp);
11660 op1->ops.Mod(exp, op1, op2);
11661 }
11662 break;
11663 case '&':
11664 if(exp->op.exp2)
11665 {
11666 if(op1->ops.BitAnd)
11667 {
11668 FreeExpContents(exp);
11669 op1->ops.BitAnd(exp, op1, op2);
11670 }
11671 }
11672 break;
11673 case '|':
11674 if(op1->ops.BitOr)
11675 {
11676 FreeExpContents(exp);
11677 op1->ops.BitOr(exp, op1, op2);
11678 }
11679 break;
11680 case '^':
11681 if(op1->ops.BitXor)
11682 {
11683 FreeExpContents(exp);
11684 op1->ops.BitXor(exp, op1, op2);
11685 }
11686 break;
11687 case LEFT_OP:
11688 if(op1->ops.LShift)
11689 {
11690 FreeExpContents(exp);
11691 op1->ops.LShift(exp, op1, op2);
11692 }
11693 break;
11694 case RIGHT_OP:
11695 if(op1->ops.RShift)
11696 {
11697 FreeExpContents(exp);
11698 op1->ops.RShift(exp, op1, op2);
11699 }
11700 break;
11701 case EQ_OP:
11702 if(op1->ops.Equ)
11703 {
11704 FreeExpContents(exp);
11705 op1->ops.Equ(exp, op1, op2);
11706 }
11707 break;
11708 case NE_OP:
11709 if(op1->ops.Nqu)
11710 {
11711 FreeExpContents(exp);
11712 op1->ops.Nqu(exp, op1, op2);
11713 }
11714 break;
11715 case AND_OP:
11716 if(op1->ops.And)
11717 {
11718 FreeExpContents(exp);
11719 op1->ops.And(exp, op1, op2);
11720 }
11721 break;
11722 case OR_OP:
11723 if(op1->ops.Or)
11724 {
11725 FreeExpContents(exp);
11726 op1->ops.Or(exp, op1, op2);
11727 }
11728 break;
11729 case '>':
11730 if(op1->ops.Grt)
11731 {
11732 FreeExpContents(exp);
11733 op1->ops.Grt(exp, op1, op2);
11734 }
11735 break;
11736 case '<':
11737 if(op1->ops.Sma)
11738 {
11739 FreeExpContents(exp);
11740 op1->ops.Sma(exp, op1, op2);
11741 }
11742 break;
11743 case GE_OP:
11744 if(op1->ops.GrtEqu)
11745 {
11746 FreeExpContents(exp);
11747 op1->ops.GrtEqu(exp, op1, op2);
11748 }
11749 break;
11750 case LE_OP:
11751 if(op1->ops.SmaEqu)
11752 {
11753 FreeExpContents(exp);
11754 op1->ops.SmaEqu(exp, op1, op2);
11755 }
11756 break;
11757 }
11758 }
11759 }
11760 }
11761
11762 void PrintTypeNoConst(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
11763
11764 extern struct Expression * MkExpIdentifier(struct Identifier * id);
11765
11766 void ComputeExpression(struct Expression * exp)
11767 {
11768 char expString[10240];
11769
11770 expString[0] = '\0';
11771 switch(exp->type)
11772 {
11773 case 1:
11774 {
11775 ComputeInstantiation(exp);
11776 break;
11777 }
11778 case 4:
11779 {
11780 struct Expression * exp1, * exp2 = (((void *)0));
11781 struct Operand op1 = 
11782 {
11783 0, 0, 0, 0, 
11784 {
11785 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11786 }
11787 };
11788 struct Operand op2 = 
11789 {
11790 0, 0, 0, 0, 
11791 {
11792 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11793 }
11794 };
11795
11796 if(exp->op.exp2)
11797 {
11798 struct Expression * e = exp->op.exp2;
11799
11800 while((e->type == 5 || e->type == 32 || e->type == 23) && e->list)
11801 {
11802 if(e->type == 5 || e->type == 32 || e->type == 23)
11803 {
11804 if(e->type == 23)
11805 e = (*((struct Statement *)(*e->compound->compound.statements).last)->expressions).last;
11806 else
11807 e = (*e->list).last;
11808 }
11809 }
11810 if(exp->op.op == 261 && e && e->expType)
11811 {
11812 if(e->type == 3 && e->string)
11813 {
11814 char * string = e->string;
11815 int len = strlen(string);
11816 char * tmp = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (len - 2 + 1));
11817
11818 len = UnescapeString(tmp, string + 1, len - 2);
11819 (__ecereNameSpace__ecere__com__eSystem_Delete(tmp), tmp = 0);
11820 FreeExpContents(exp);
11821 exp->type = 2;
11822 exp->constant = PrintUInt(len + 1);
11823 }
11824 else
11825 {
11826 struct Type * type = e->expType;
11827
11828 type->refCount++;
11829 FreeExpContents(exp);
11830 exp->type = 2;
11831 exp->constant = PrintUInt(ComputeTypeSize(type));
11832 FreeType(type);
11833 }
11834 break;
11835 }
11836 else
11837 ComputeExpression(exp->op.exp2);
11838 }
11839 if(exp->op.exp1)
11840 {
11841 ComputeExpression(exp->op.exp1);
11842 exp1 = exp->op.exp1;
11843 exp2 = exp->op.exp2;
11844 op1 = GetOperand(exp1);
11845 if(op1.type)
11846 op1.type->refCount++;
11847 if(exp2)
11848 {
11849 op2 = GetOperand(exp2);
11850 if(op2.type)
11851 op2.type->refCount++;
11852 }
11853 }
11854 else
11855 {
11856 exp1 = exp->op.exp2;
11857 op1 = GetOperand(exp1);
11858 if(op1.type)
11859 op1.type->refCount++;
11860 }
11861 CallOperator(exp, exp1, exp2, &op1, &op2);
11862 if(op1.type)
11863 FreeType(op1.type);
11864 if(op2.type)
11865 FreeType(op2.type);
11866 break;
11867 }
11868 case 5:
11869 case 32:
11870 {
11871 struct Expression * e, * n;
11872
11873 for(e = (*exp->list).first; e; e = n)
11874 {
11875 n = e->next;
11876 if(!n)
11877 {
11878 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
11879
11880 ComputeExpression(e);
11881 FreeType(exp->expType);
11882 FreeType(exp->destType);
11883 *exp = *e;
11884 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
11885 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
11886 }
11887 else
11888 {
11889 FreeExpression(e);
11890 }
11891 }
11892 break;
11893 }
11894 case 8:
11895 {
11896 struct Expression * memberExp = exp->member.exp;
11897 struct Identifier * memberID = exp->member.member;
11898 struct Type * type;
11899
11900 ComputeExpression(exp->member.exp);
11901 type = exp->member.exp->expType;
11902 if(type)
11903 {
11904 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)));
11905 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11906 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11907 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
11908
11909 if(type->kind == 19 && exp->member.exp->type == 24)
11910 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
11911 if(!_class)
11912 {
11913 char string[256];
11914 struct Symbol * classSym;
11915
11916 string[0] = '\0';
11917 PrintTypeNoConst(type, string, 0x0, 0x1);
11918 classSym = FindClass(string);
11919 _class = classSym ? classSym->registered : (((void *)0));
11920 }
11921 if(exp->member.member)
11922 {
11923 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
11924 if(!prop)
11925 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
11926 }
11927 if(!prop && !member && _class && exp->member.member)
11928 {
11929 struct Symbol * classSym = FindClass(exp->member.member->string);
11930
11931 convertTo = _class;
11932 _class = classSym ? classSym->registered : (((void *)0));
11933 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
11934 }
11935 if(prop)
11936 {
11937 if(prop->compiled)
11938 {
11939 struct Type * type = prop->dataType;
11940
11941 if(_class->type == 3)
11942 {
11943 if(type->kind == 8)
11944 {
11945 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11946
11947 if(_class->type == 3)
11948 {
11949 if(!_class->dataType)
11950 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11951 type = _class->dataType;
11952 }
11953 }
11954 switch(type->kind)
11955 {
11956 case 6:
11957 {
11958 float value;
11959 float (* Get)(float) = (void *)prop->Get;
11960
11961 GetFloat(exp->member.exp, &value);
11962 exp->constant = PrintFloat(Get ? Get(value) : value);
11963 exp->type = 2;
11964 break;
11965 }
11966 case 7:
11967 {
11968 double value;
11969 double (* Get)(double);
11970
11971 GetDouble(exp->member.exp, &value);
11972 if(convertTo)
11973 Get = (void *)prop->Set;
11974 else
11975 Get = (void *)prop->Get;
11976 exp->constant = PrintDouble(Get ? Get(value) : value);
11977 exp->type = 2;
11978 break;
11979 }
11980 }
11981 }
11982 else
11983 {
11984 if(convertTo)
11985 {
11986 struct Expression * value = exp->member.exp;
11987 struct Type * type;
11988
11989 if(!prop->dataType)
11990 ProcessPropertyType(prop);
11991 type = prop->dataType;
11992 if(!type)
11993 {
11994 }
11995 else if(_class->type == 1)
11996 {
11997 switch(type->kind)
11998 {
11999 case 8:
12000 {
12001 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
12002
12003 if(propertyClass->type == 1 && value->type == 1)
12004 {
12005 void (* Set)(void *, void *) = (void *)prop->Set;
12006
12007 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12008 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12009 exp->instance->_class = MkSpecifierName(_class->fullName);
12010 exp->instance->loc = exp->loc;
12011 exp->type = 1;
12012 Set(exp->instance->data, value->instance->data);
12013 PopulateInstance(exp->instance);
12014 }
12015 break;
12016 }
12017 case 3:
12018 {
12019 int intValue;
12020 void (* Set)(void *, int) = (void *)prop->Set;
12021
12022 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12023 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12024 exp->instance->_class = MkSpecifierName(_class->fullName);
12025 exp->instance->loc = exp->loc;
12026 exp->type = 1;
12027 GetInt(value, &intValue);
12028 Set(exp->instance->data, intValue);
12029 PopulateInstance(exp->instance);
12030 break;
12031 }
12032 case 4:
12033 {
12034 long long intValue;
12035 void (* Set)(void *, long long) = (void *)prop->Set;
12036
12037 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12038 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12039 exp->instance->_class = MkSpecifierName(_class->fullName);
12040 exp->instance->loc = exp->loc;
12041 exp->type = 1;
12042 GetInt64(value, &intValue);
12043 Set(exp->instance->data, intValue);
12044 PopulateInstance(exp->instance);
12045 break;
12046 }
12047 case 22:
12048 {
12049 intptr_t intValue;
12050 void (* Set)(void *, intptr_t) = (void *)prop->Set;
12051
12052 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12053 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12054 exp->instance->_class = MkSpecifierName(_class->fullName);
12055 exp->instance->loc = exp->loc;
12056 exp->type = 1;
12057 GetIntPtr(value, &intValue);
12058 Set(exp->instance->data, intValue);
12059 PopulateInstance(exp->instance);
12060 break;
12061 }
12062 case 23:
12063 {
12064 ssize_t intValue;
12065 void (* Set)(void *, ssize_t) = (void *)prop->Set;
12066
12067 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12068 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12069 exp->instance->_class = MkSpecifierName(_class->fullName);
12070 exp->instance->loc = exp->loc;
12071 exp->type = 1;
12072 GetIntSize(value, &intValue);
12073 Set(exp->instance->data, intValue);
12074 PopulateInstance(exp->instance);
12075 break;
12076 }
12077 case 6:
12078 {
12079 float floatValue;
12080 void (* Set)(void *, float) = (void *)prop->Set;
12081
12082 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12083 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12084 exp->instance->_class = MkSpecifierName(_class->fullName);
12085 exp->instance->loc = exp->loc;
12086 exp->type = 1;
12087 GetFloat(value, &floatValue);
12088 Set(exp->instance->data, floatValue);
12089 PopulateInstance(exp->instance);
12090 break;
12091 }
12092 case 7:
12093 {
12094 double doubleValue;
12095 void (* Set)(void *, double) = (void *)prop->Set;
12096
12097 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12098 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12099 exp->instance->_class = MkSpecifierName(_class->fullName);
12100 exp->instance->loc = exp->loc;
12101 exp->type = 1;
12102 GetDouble(value, &doubleValue);
12103 Set(exp->instance->data, doubleValue);
12104 PopulateInstance(exp->instance);
12105 break;
12106 }
12107 }
12108 }
12109 else if(_class->type == 2)
12110 {
12111 switch(type->kind)
12112 {
12113 case 8:
12114 {
12115 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
12116
12117 if(propertyClass->type == 1 && value->instance->data)
12118 {
12119 unsigned int (* Set)(void *) = (void *)prop->Set;
12120 unsigned int bits = Set(value->instance->data);
12121
12122 exp->constant = PrintHexUInt(bits);
12123 exp->type = 2;
12124 break;
12125 }
12126 else if(_class->type == 2)
12127 {
12128 unsigned int value;
12129 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
12130 unsigned int bits;
12131
12132 GetUInt(exp->member.exp, &value);
12133 bits = Set(value);
12134 exp->constant = PrintHexUInt(bits);
12135 exp->type = 2;
12136 }
12137 }
12138 }
12139 }
12140 }
12141 else
12142 {
12143 if(_class->type == 2)
12144 {
12145 unsigned int value;
12146
12147 GetUInt(exp->member.exp, &value);
12148 switch(type->kind)
12149 {
12150 case 8:
12151 {
12152 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12153
12154 if(_class->type == 1)
12155 {
12156 void (* Get)(unsigned int, void *) = (void *)prop->Get;
12157
12158 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12159 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12160 exp->instance->_class = MkSpecifierName(_class->fullName);
12161 exp->instance->loc = exp->loc;
12162 exp->type = 1;
12163 Get(value, exp->instance->data);
12164 PopulateInstance(exp->instance);
12165 }
12166 else if(_class->type == 2)
12167 {
12168 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
12169 uint64 bits = Get(value);
12170
12171 exp->constant = PrintHexUInt64(bits);
12172 exp->type = 2;
12173 }
12174 break;
12175 }
12176 }
12177 }
12178 else if(_class->type == 1)
12179 {
12180 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
12181
12182 switch(type->kind)
12183 {
12184 case 8:
12185 {
12186 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12187
12188 if(_class->type == 1 && value)
12189 {
12190 void (* Get)(void *, void *) = (void *)prop->Get;
12191
12192 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12193 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12194 exp->instance->_class = MkSpecifierName(_class->fullName);
12195 exp->instance->loc = exp->loc;
12196 exp->type = 1;
12197 Get(value, exp->instance->data);
12198 PopulateInstance(exp->instance);
12199 }
12200 break;
12201 }
12202 }
12203 }
12204 }
12205 }
12206 }
12207 else
12208 {
12209 exp->isConstant = 0x0;
12210 }
12211 }
12212 else if(member)
12213 {
12214 }
12215 }
12216 if(exp->type != 8)
12217 {
12218 FreeExpression(memberExp);
12219 FreeIdentifier(memberID);
12220 }
12221 break;
12222 }
12223 case 10:
12224 {
12225 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
12226
12227 FreeExpContents(exp);
12228 exp->constant = PrintUInt(ComputeTypeSize(type));
12229 exp->type = 2;
12230 FreeType(type);
12231 break;
12232 }
12233 case 15:
12234 {
12235 struct Symbol * classSym = exp->_class->symbol;
12236
12237 if(classSym && classSym->registered)
12238 {
12239 if(classSym->registered->fixed)
12240 {
12241 FreeSpecifier(exp->_class);
12242 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
12243 exp->type = 2;
12244 }
12245 else
12246 {
12247 char className[1024];
12248
12249 strcpy(className, "__ecereClass_");
12250 FullClassNameCat(className, classSym->string, 0x1);
12251 MangleClassName(className);
12252 DeclareClass(classSym, className);
12253 FreeExpContents(exp);
12254 exp->type = 9;
12255 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
12256 exp->member.member = MkIdentifier("structSize");
12257 }
12258 }
12259 break;
12260 }
12261 case 11:
12262 {
12263 struct Type * type;
12264 struct Expression * e = exp;
12265
12266 if(exp->type == 11)
12267 {
12268 if(exp->cast.exp)
12269 ComputeExpression(exp->cast.exp);
12270 e = exp->cast.exp;
12271 }
12272 if(e && exp->expType)
12273 {
12274 type = exp->expType;
12275 if(type->kind == 8)
12276 {
12277 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12278
12279 if(_class && (_class->type == 3 || _class->type == 2))
12280 {
12281 if(!_class->dataType)
12282 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
12283 type = _class->dataType;
12284 }
12285 }
12286 switch(type->kind)
12287 {
12288 case 24:
12289 case 1:
12290 if(type->isSigned)
12291 {
12292 char value = (char)0;
12293
12294 if(GetChar(e, &value))
12295 {
12296 FreeExpContents(exp);
12297 exp->constant = PrintChar(value);
12298 exp->type = 2;
12299 }
12300 }
12301 else
12302 {
12303 unsigned char value = (unsigned char)0;
12304
12305 if(GetUChar(e, &value))
12306 {
12307 FreeExpContents(exp);
12308 exp->constant = PrintUChar(value);
12309 exp->type = 2;
12310 }
12311 }
12312 break;
12313 case 2:
12314 if(type->isSigned)
12315 {
12316 short value = (short)0;
12317
12318 if(GetShort(e, &value))
12319 {
12320 FreeExpContents(exp);
12321 exp->constant = PrintShort(value);
12322 exp->type = 2;
12323 }
12324 }
12325 else
12326 {
12327 unsigned short value = (unsigned short)0;
12328
12329 if(GetUShort(e, &value))
12330 {
12331 FreeExpContents(exp);
12332 exp->constant = PrintUShort(value);
12333 exp->type = 2;
12334 }
12335 }
12336 break;
12337 case 3:
12338 if(type->isSigned)
12339 {
12340 int value = 0;
12341
12342 if(GetInt(e, &value))
12343 {
12344 FreeExpContents(exp);
12345 exp->constant = PrintInt(value);
12346 exp->type = 2;
12347 }
12348 }
12349 else
12350 {
12351 unsigned int value = 0;
12352
12353 if(GetUInt(e, &value))
12354 {
12355 FreeExpContents(exp);
12356 exp->constant = PrintUInt(value);
12357 exp->type = 2;
12358 }
12359 }
12360 break;
12361 case 4:
12362 if(type->isSigned)
12363 {
12364 long long value = 0;
12365
12366 if(GetInt64(e, &value))
12367 {
12368 FreeExpContents(exp);
12369 exp->constant = PrintInt64(value);
12370 exp->type = 2;
12371 }
12372 }
12373 else
12374 {
12375 uint64 value = 0;
12376
12377 if(GetUInt64(e, &value))
12378 {
12379 FreeExpContents(exp);
12380 exp->constant = PrintUInt64(value);
12381 exp->type = 2;
12382 }
12383 }
12384 break;
12385 case 22:
12386 if(type->isSigned)
12387 {
12388 intptr_t value = 0;
12389
12390 if(GetIntPtr(e, &value))
12391 {
12392 FreeExpContents(exp);
12393 exp->constant = PrintInt64((long long)value);
12394 exp->type = 2;
12395 }
12396 }
12397 else
12398 {
12399 uintptr_t value = 0;
12400
12401 if(GetUIntPtr(e, &value))
12402 {
12403 FreeExpContents(exp);
12404 exp->constant = PrintUInt64((uint64)value);
12405 exp->type = 2;
12406 }
12407 }
12408 break;
12409 case 23:
12410 if(type->isSigned)
12411 {
12412 ssize_t value = 0;
12413
12414 if(GetIntSize(e, &value))
12415 {
12416 FreeExpContents(exp);
12417 exp->constant = PrintInt64((long long)value);
12418 exp->type = 2;
12419 }
12420 }
12421 else
12422 {
12423 size_t value = 0;
12424
12425 if(GetUIntSize(e, &value))
12426 {
12427 FreeExpContents(exp);
12428 exp->constant = PrintUInt64((uint64)value);
12429 exp->type = 2;
12430 }
12431 }
12432 break;
12433 case 6:
12434 {
12435 float value = 0;
12436
12437 if(GetFloat(e, &value))
12438 {
12439 FreeExpContents(exp);
12440 exp->constant = PrintFloat(value);
12441 exp->type = 2;
12442 }
12443 break;
12444 }
12445 case 7:
12446 {
12447 double value = 0;
12448
12449 if(GetDouble(e, &value))
12450 {
12451 FreeExpContents(exp);
12452 exp->constant = PrintDouble(value);
12453 exp->type = 2;
12454 }
12455 break;
12456 }
12457 }
12458 }
12459 break;
12460 }
12461 case 12:
12462 {
12463 struct Operand op1 = 
12464 {
12465 0, 0, 0, 0, 
12466 {
12467 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12468 }
12469 };
12470 struct Operand op2 = 
12471 {
12472 0, 0, 0, 0, 
12473 {
12474 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12475 }
12476 };
12477 struct Operand op3 = 
12478 {
12479 0, 0, 0, 0, 
12480 {
12481 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12482 }
12483 };
12484
12485 if(exp->cond.exp)
12486 ComputeExpression((*exp->cond.exp).last);
12487 if(exp->cond.elseExp)
12488 ComputeExpression(exp->cond.elseExp);
12489 if(exp->cond.cond)
12490 ComputeExpression(exp->cond.cond);
12491 op1 = GetOperand(exp->cond.cond);
12492 if(op1.type)
12493 op1.type->refCount++;
12494 op2 = GetOperand((*exp->cond.exp).last);
12495 if(op2.type)
12496 op2.type->refCount++;
12497 op3 = GetOperand(exp->cond.elseExp);
12498 if(op3.type)
12499 op3.type->refCount++;
12500 if(op1.ops.Cond)
12501 {
12502 FreeExpContents(exp);
12503 op1.ops.Cond(exp, &op1, &op2, &op3);
12504 }
12505 if(op1.type)
12506 FreeType(op1.type);
12507 if(op2.type)
12508 FreeType(op2.type);
12509 if(op3.type)
12510 FreeType(op3.type);
12511 break;
12512 }
12513 }
12514 }
12515
12516 void ApplyAnyObjectLogic(struct Expression * e);
12517
12518 extern void CopyTypeInto(struct Type * type, struct Type * src);
12519
12520 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
12521 {
12522 unsigned int result = 0x1;
12523
12524 if(destType)
12525 {
12526 struct __ecereNameSpace__ecere__sys__OldList converts = 
12527 {
12528 0, 0, 0, 0, 0
12529 };
12530 struct Conversion * convert;
12531
12532 if(destType->kind == 0)
12533 return 0x0;
12534 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
12535 result = 0x0;
12536 if(converts.count)
12537 {
12538 for(convert = converts.first; convert; convert = convert->next)
12539 {
12540 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
12541
12542 if(!empty)
12543 {
12544 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12545 int objectType = exp->expType ? exp->expType->classObjectType : 0;
12546
12547 *newExp = *exp;
12548 newExp->destType = (((void *)0));
12549 if(convert->isGet)
12550 {
12551 exp->type = 8;
12552 exp->addedThis = 0x1;
12553 exp->member.exp = newExp;
12554 FreeType(exp->member.exp->expType);
12555 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
12556 exp->member.exp->expType->classObjectType = objectType;
12557 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
12558 exp->member.memberType = 1;
12559 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12560 exp->needCast = 0x1;
12561 if(exp->expType)
12562 exp->expType->refCount++;
12563 ApplyAnyObjectLogic(exp->member.exp);
12564 }
12565 else
12566 {
12567 {
12568 exp->type = 8;
12569 exp->addedThis = 0x1;
12570 exp->member.exp = newExp;
12571 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
12572 {
12573 newExp->byReference = 0x1;
12574 }
12575 FreeType(exp->member.exp->expType);
12576 exp->member.exp->expType = (((void *)0));
12577 if(convert->convert->dataType)
12578 {
12579 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12580 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
12581 exp->member.exp->expType->refCount = 1;
12582 exp->member.exp->expType->classObjectType = objectType;
12583 ApplyAnyObjectLogic(exp->member.exp);
12584 }
12585 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
12586 exp->member.memberType = 4;
12587 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12588 exp->needCast = 0x1;
12589 if(convert->resultType)
12590 convert->resultType->refCount++;
12591 }
12592 }
12593 }
12594 else
12595 {
12596 FreeType(exp->expType);
12597 if(convert->isGet)
12598 {
12599 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12600 exp->needCast = 0x1;
12601 if(exp->expType)
12602 exp->expType->refCount++;
12603 }
12604 else
12605 {
12606 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12607 exp->needCast = 0x1;
12608 if(convert->resultType)
12609 convert->resultType->refCount++;
12610 }
12611 }
12612 }
12613 if(exp->isConstant && inCompiler)
12614 ComputeExpression(exp);
12615 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
12616 }
12617 if(!result && exp->expType && converts.count)
12618 {
12619 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
12620 }
12621 if(!result && exp->expType && exp->destType)
12622 {
12623 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))
12624 result = 0x1;
12625 }
12626 }
12627 return result;
12628 }
12629
12630 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
12631
12632 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
12633
12634 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
12635
12636 void CheckTemplateTypes(struct Expression * exp)
12637 {
12638 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
12639 {
12640 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12641 struct Statement * compound;
12642 struct Context * context;
12643
12644 *newExp = *exp;
12645 if(exp->destType)
12646 exp->destType->refCount++;
12647 if(exp->expType)
12648 exp->expType->refCount++;
12649 newExp->prev = (((void *)0));
12650 newExp->next = (((void *)0));
12651 switch(exp->expType->kind)
12652 {
12653 case 7:
12654 if(exp->destType->classObjectType)
12655 {
12656 if(exp->destType)
12657 exp->destType->refCount--;
12658 if(exp->expType)
12659 exp->expType->refCount--;
12660 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12661 }
12662 else
12663 {
12664 struct __ecereNameSpace__ecere__sys__OldList * specs;
12665 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12666 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12667
12668 context = PushContext();
12669 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12670 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12671 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12672 exp->type = 23;
12673 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12674 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
12675 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
12676 exp->compound->compound.context = context;
12677 PopContext(context);
12678 }
12679 break;
12680 default:
12681 exp->type = 11;
12682 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
12683 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12684 break;
12685 }
12686 }
12687 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
12688 {
12689 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12690 struct Statement * compound;
12691 struct Context * context;
12692
12693 *newExp = *exp;
12694 if(exp->destType)
12695 exp->destType->refCount++;
12696 if(exp->expType)
12697 exp->expType->refCount++;
12698 newExp->prev = (((void *)0));
12699 newExp->next = (((void *)0));
12700 switch(exp->expType->kind)
12701 {
12702 case 7:
12703 if(exp->destType->classObjectType)
12704 {
12705 if(exp->destType)
12706 exp->destType->refCount--;
12707 if(exp->expType)
12708 exp->expType->refCount--;
12709 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12710 }
12711 else
12712 {
12713 struct __ecereNameSpace__ecere__sys__OldList * specs;
12714 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12715 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12716
12717 context = PushContext();
12718 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12719 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12720 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12721 exp->type = 23;
12722 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12723 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
12724 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
12725 exp->compound->compound.context = context;
12726 PopContext(context);
12727 }
12728 break;
12729 case 8:
12730 {
12731 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
12732 {
12733 exp->type = 5;
12734 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
12735 ProcessExpressionType((*exp->list).first);
12736 break;
12737 }
12738 else
12739 {
12740 exp->type = 5;
12741 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
12742 newExp->needCast = 0x1;
12743 ProcessExpressionType((*exp->list).first);
12744 break;
12745 }
12746 }
12747 default:
12748 {
12749 if(exp->expType->kind == 20)
12750 {
12751 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
12752
12753 if(type)
12754 {
12755 FreeType(exp->destType);
12756 FreeType(exp->expType);
12757 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12758 break;
12759 }
12760 }
12761 if(newExp->type == 8 && newExp->member.memberType == 3)
12762 {
12763 exp->type = 4;
12764 exp->op.op = '*';
12765 exp->op.exp1 = (((void *)0));
12766 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
12767 }
12768 else
12769 {
12770 char typeString[1024];
12771 struct Declarator * decl;
12772 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12773
12774 typeString[0] = '\0';
12775 PrintType(exp->expType, typeString, 0x0, 0x0);
12776 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12777 exp->type = 11;
12778 exp->cast.typeName = MkTypeName(specs, decl);
12779 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12780 exp->cast.exp->needCast = 0x1;
12781 }
12782 break;
12783 }
12784 }
12785 }
12786 }
12787
12788 extern int strncmp(const char * , const char * , size_t n);
12789
12790 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char *  key);
12791
12792 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
12793 {
12794 int nsLen = strlen(nameSpace);
12795 struct Symbol * symbol;
12796
12797 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)))
12798 {
12799 char * s = symbol->string;
12800
12801 if(!strncmp(s, nameSpace, nsLen))
12802 {
12803 int c;
12804 char * namePart;
12805
12806 for(c = strlen(s) - 1; c >= 0; c--)
12807 if(s[c] == ':')
12808 break;
12809 namePart = s + c + 1;
12810 if(!strcmp(namePart, name))
12811 {
12812 return symbol;
12813 }
12814 }
12815 else
12816 break;
12817 }
12818 return (((void *)0));
12819 }
12820
12821 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
12822 {
12823 int c;
12824 char nameSpace[1024];
12825 char * namePart;
12826 unsigned int gotColon = 0x0;
12827
12828 nameSpace[0] = '\0';
12829 for(c = strlen(name) - 1; c >= 0; c--)
12830 if(name[c] == ':')
12831 {
12832 gotColon = 0x1;
12833 break;
12834 }
12835 namePart = name + c + 1;
12836 while(c >= 0 && name[c] == ':')
12837 c--;
12838 if(c >= 0)
12839 {
12840 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
12841
12842 if(symbol)
12843 return symbol;
12844 memcpy(nameSpace, name, c + 1);
12845 nameSpace[c + 1] = (char)0;
12846 return ScanWithNameSpace(tree, nameSpace, namePart);
12847 }
12848 else if(gotColon)
12849 {
12850 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12851
12852 return symbol;
12853 }
12854 else
12855 {
12856 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12857
12858 if(symbol)
12859 return symbol;
12860 return ScanWithNameSpace(tree, "", namePart);
12861 }
12862 return (((void *)0));
12863 }
12864
12865 static void ProcessDeclaration(struct Declaration * decl);
12866
12867 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
12868 {
12869 struct Context * ctx;
12870 struct Symbol * symbol = (((void *)0));
12871
12872 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
12873 {
12874 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
12875 {
12876 symbol = (((void *)0));
12877 if(thisNameSpace)
12878 {
12879 char curName[1024];
12880
12881 strcpy(curName, thisNameSpace);
12882 strcat(curName, "::");
12883 strcat(curName, name);
12884 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
12885 }
12886 if(!symbol)
12887 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
12888 }
12889 else
12890 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
12891 if(symbol || ctx == endContext)
12892 break;
12893 }
12894 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
12895 {
12896 if(symbol->pointerExternal->type == 0)
12897 {
12898 struct FunctionDefinition * function = symbol->pointerExternal->function;
12899 struct Context * tmpContext = curContext;
12900
12901 curContext = (((void *)0));
12902 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
12903 curContext = tmpContext;
12904 symbol->pointerExternal->symbol = symbol;
12905 DeclareType(symbol->type, 0x1, 0x1);
12906 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
12907 symbol->id = curExternal->symbol->idCode;
12908 }
12909 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
12910 {
12911 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
12912 symbol->id = curExternal->symbol->idCode;
12913 }
12914 }
12915 return symbol;
12916 }
12917
12918 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
12919 {
12920 if(!type->isSigned && type->kind != 22 && type->kind != 23)
12921 ListAdd(specs, MkSpecifier(UNSIGNED));
12922 switch(type->kind)
12923 {
12924 case 8:
12925 {
12926 if(type->_class->registered)
12927 {
12928 if(!type->_class->registered->dataType)
12929 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
12930 GetTypeSpecs(type->_class->registered->dataType, specs);
12931 }
12932 break;
12933 }
12934 case 7:
12935 ListAdd(specs, MkSpecifier(DOUBLE));
12936 break;
12937 case 6:
12938 ListAdd(specs, MkSpecifier(FLOAT));
12939 break;
12940 case 1:
12941 ListAdd(specs, MkSpecifier(CHAR));
12942 break;
12943 case 24:
12944 ListAdd(specs, MkSpecifier(_BOOL));
12945 break;
12946 case 2:
12947 ListAdd(specs, MkSpecifier(SHORT));
12948 break;
12949 case 4:
12950 ListAdd(specs, MkSpecifier(INT64));
12951 break;
12952 case 22:
12953 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
12954 break;
12955 case 23:
12956 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
12957 break;
12958 case 3:
12959 default:
12960 ListAdd(specs, MkSpecifier(INT));
12961 break;
12962 }
12963 }
12964
12965 static void PrintArraySize(struct Type * arrayType, char * string)
12966 {
12967 char size[256];
12968
12969 size[0] = '\0';
12970 strcat(size, "[");
12971 if(arrayType->enumClass)
12972 strcat(size, arrayType->enumClass->string);
12973 else if(arrayType->arraySizeExp)
12974 PrintExpression(arrayType->arraySizeExp, size);
12975 strcat(size, "]");
12976 strcat(string, size);
12977 }
12978
12979 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
12980 {
12981 if(type)
12982 {
12983 if(printConst && type->constant)
12984 strcat(string, "const ");
12985 switch(type->kind)
12986 {
12987 case 8:
12988 {
12989 struct Symbol * c = type->_class;
12990
12991 if(type->classObjectType == 2)
12992 strcat(string, "typed_object");
12993 else if(type->classObjectType == 3)
12994 strcat(string, "any_object");
12995 else
12996 {
12997 if(c && c->string)
12998 strcat(string, (fullName || !c->registered) ? c->string : c->registered->name);
12999 }
13000 if(type->byReference)
13001 strcat(string, " &");
13002 break;
13003 }
13004 case 0:
13005 strcat(string, "void");
13006 break;
13007 case 3:
13008 strcat(string, type->isSigned ? "int" : "uint");
13009 break;
13010 case 4:
13011 strcat(string, type->isSigned ? "int64" : "uint64");
13012 break;
13013 case 22:
13014 strcat(string, type->isSigned ? "intptr" : "uintptr");
13015 break;
13016 case 23:
13017 strcat(string, type->isSigned ? "intsize" : "uintsize");
13018 break;
13019 case 1:
13020 strcat(string, type->isSigned ? "char" : "byte");
13021 break;
13022 case 24:
13023 strcat(string, "_Bool");
13024 break;
13025 case 2:
13026 strcat(string, type->isSigned ? "short" : "uint16");
13027 break;
13028 case 6:
13029 strcat(string, "float");
13030 break;
13031 case 7:
13032 strcat(string, "double");
13033 break;
13034 case 9:
13035 if(type->enumName)
13036 {
13037 strcat(string, "struct ");
13038 strcat(string, type->enumName);
13039 }
13040 else if(type->typeName)
13041 strcat(string, type->typeName);
13042 else
13043 {
13044 struct Type * member;
13045
13046 strcat(string, "struct { ");
13047 for(member = type->members.first; member; member = member->next)
13048 {
13049 PrintType(member, string, 0x1, fullName);
13050 strcat(string, "; ");
13051 }
13052 strcat(string, "}");
13053 }
13054 break;
13055 case 10:
13056 if(type->enumName)
13057 {
13058 strcat(string, "union ");
13059 strcat(string, type->enumName);
13060 }
13061 else if(type->typeName)
13062 strcat(string, type->typeName);
13063 else
13064 {
13065 strcat(string, "union ");
13066 strcat(string, "(unnamed)");
13067 }
13068 break;
13069 case 15:
13070 if(type->enumName)
13071 {
13072 strcat(string, "enum ");
13073 strcat(string, type->enumName);
13074 }
13075 else if(type->typeName)
13076 strcat(string, type->typeName);
13077 else
13078 strcat(string, "int");
13079 break;
13080 case 14:
13081 strcat(string, "...");
13082 break;
13083 case 19:
13084 strcat(string, "subclass(");
13085 strcat(string, type->_class ? type->_class->string : "int");
13086 strcat(string, ")");
13087 break;
13088 case 20:
13089 strcat(string, type->templateParameter->identifier->string);
13090 break;
13091 case 21:
13092 strcat(string, "thisclass");
13093 break;
13094 case 17:
13095 strcat(string, "__builtin_va_list");
13096 break;
13097 }
13098 }
13099 }
13100
13101 extern char *  __ecereNameSpace__ecere__sys__RSearchString(char *  buffer, char *  subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
13102
13103 static void PrintName(struct Type * type, char * string, unsigned int fullName)
13104 {
13105 if(type->name && type->name[0])
13106 {
13107 if(fullName)
13108 strcat(string, type->name);
13109 else
13110 {
13111 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
13112
13113 if(name)
13114 name += 2;
13115 else
13116 name = type->name;
13117 strcat(string, name);
13118 }
13119 }
13120 }
13121
13122 static void PrintAttribs(struct Type * type, char * string)
13123 {
13124 if(type)
13125 {
13126 if(type->dllExport)
13127 strcat(string, "dllexport ");
13128 if(type->attrStdcall)
13129 strcat(string, "stdcall ");
13130 }
13131 }
13132
13133 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
13134 {
13135 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13136 {
13137 struct Type * attrType = (((void *)0));
13138
13139 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
13140 PrintAttribs(type, string);
13141 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
13142 strcat(string, " const");
13143 PrePrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName, type, printConst);
13144 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
13145 strcat(string, " (");
13146 if(type->kind == 13)
13147 {
13148 if(type->type->kind == 11 || type->type->kind == 16)
13149 PrintAttribs(type->type, string);
13150 }
13151 if(type->kind == 13)
13152 {
13153 if(type->type->kind == 11 || type->type->kind == 16 || type->type->kind == 12)
13154 strcat(string, "*");
13155 else
13156 strcat(string, " *");
13157 }
13158 if(printConst && type->constant && type->kind == 13)
13159 strcat(string, " const");
13160 }
13161 else
13162 PrintTypeSpecs(type, string, fullName, printConst);
13163 }
13164
13165 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
13166 {
13167 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
13168 strcat(string, ")");
13169 if(type->kind == 12)
13170 PrintArraySize(type, string);
13171 else if(type->kind == 11)
13172 {
13173 struct Type * param;
13174
13175 strcat(string, "(");
13176 for(param = type->params.first; param; param = param->next)
13177 {
13178 PrintType(param, string, 0x1, fullName);
13179 if(param->next)
13180 strcat(string, ", ");
13181 }
13182 strcat(string, ")");
13183 }
13184 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13185 PostPrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName);
13186 }
13187
13188 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
13189 {
13190 PrePrintType(type, string, fullName, (((void *)0)), printConst);
13191 if(type->thisClass || (printName && type->name && type->name[0]))
13192 strcat(string, " ");
13193 if((type->thisClass || type->staticMethod))
13194 {
13195 struct Symbol * _class = type->thisClass;
13196
13197 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
13198 {
13199 if(type->classObjectType == 1)
13200 strcat(string, "class");
13201 else
13202 strcat(string, type->byReference ? "typed_object&" : "typed_object");
13203 }
13204 else if(_class && _class->string)
13205 {
13206 char * s = _class->string;
13207
13208 if(fullName)
13209 strcat(string, s);
13210 else
13211 {
13212 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 0x1, 0x0);
13213
13214 if(name)
13215 name += 2;
13216 else
13217 name = s;
13218 strcat(string, name);
13219 }
13220 }
13221 strcat(string, "::");
13222 }
13223 if(printName && type->name)
13224 PrintName(type, string, fullName);
13225 PostPrintType(type, string, fullName);
13226 if(type->bitFieldCount)
13227 {
13228 char count[100];
13229
13230 sprintf(count, ":%d", type->bitFieldCount);
13231 strcat(string, count);
13232 }
13233 }
13234
13235 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13236 {
13237 _PrintType(type, string, printName, fullName, 0x1);
13238 }
13239
13240 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13241 {
13242 _PrintType(type, string, printName, fullName, 0x0);
13243 }
13244
13245 static struct Type * FindMember(struct Type * type, char * string)
13246 {
13247 struct Type * memberType;
13248
13249 for(memberType = type->members.first; memberType; memberType = memberType->next)
13250 {
13251 if(!memberType->name)
13252 {
13253 struct Type * subType = FindMember(memberType, string);
13254
13255 if(subType)
13256 return subType;
13257 }
13258 else if(!strcmp(memberType->name, string))
13259 return memberType;
13260 }
13261 return (((void *)0));
13262 }
13263
13264 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
13265 {
13266 struct Type * memberType;
13267
13268 for(memberType = type->members.first; memberType; memberType = memberType->next)
13269 {
13270 if(!memberType->name)
13271 {
13272 struct Type * subType = FindMember(memberType, string);
13273
13274 if(subType)
13275 {
13276 *offset += memberType->offset;
13277 return subType;
13278 }
13279 }
13280 else if(!strcmp(memberType->name, string))
13281 {
13282 *offset += memberType->offset;
13283 return memberType;
13284 }
13285 }
13286 return (((void *)0));
13287 }
13288
13289 extern unsigned int parseError;
13290
13291 unsigned int GetParseError()
13292 {
13293 return parseError;
13294 }
13295
13296 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
13297
13298 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
13299
13300 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
13301
13302 struct Expression * ParseExpressionString(char * expression)
13303 {
13304 parseError = 0x0;
13305 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13306 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__extension__ ({
13307 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13308
13309 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13310 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
13311 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13312 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13313
13314 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13315 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13316 echoOn = 0x0;
13317 parsedExpression = (((void *)0));
13318 resetScanner();
13319 expression_yyparse();
13320 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13321 return parsedExpression;
13322 }
13323
13324 extern char *  QMkString(char *  source);
13325
13326 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
13327 {
13328 struct Identifier * id = exp->identifier;
13329 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13330 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13331 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13332 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13333
13334 if(_class && _class->type == 4)
13335 {
13336 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
13337 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
13338
13339 if(enumClass)
13340 {
13341 struct __ecereNameSpace__ecere__com__Class * baseClass;
13342
13343 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
13344 {
13345 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
13346
13347 for(value = e->values.first; value; value = value->next)
13348 {
13349 if(!strcmp(value->name, id->string))
13350 break;
13351 }
13352 if(value)
13353 {
13354 char constant[256];
13355
13356 FreeExpContents(exp);
13357 exp->type = 2;
13358 exp->isConstant = 0x1;
13359 if(!strcmp(baseClass->dataTypeString, "int"))
13360 sprintf(constant, "%d", (int)value->data);
13361 else
13362 sprintf(constant, "0x%X", (int)value->data);
13363 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13364 exp->expType = MkClassType(baseClass->fullName);
13365 break;
13366 }
13367 }
13368 }
13369 if(value)
13370 return 0x1;
13371 }
13372 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
13373 {
13374 ProcessMethodType(method);
13375 exp->expType = __extension__ ({
13376 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13377
13378 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1->methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
13379 });
13380 return 0x1;
13381 }
13382 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
13383 {
13384 if(!prop->dataType)
13385 ProcessPropertyType(prop);
13386 exp->expType = prop->dataType;
13387 if(prop->dataType)
13388 prop->dataType->refCount++;
13389 return 0x1;
13390 }
13391 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
13392 {
13393 if(!member->dataType)
13394 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13395 exp->expType = member->dataType;
13396 if(member->dataType)
13397 member->dataType->refCount++;
13398 return 0x1;
13399 }
13400 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
13401 {
13402 if(!classProp->dataType)
13403 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
13404 if(classProp->constant)
13405 {
13406 FreeExpContents(exp);
13407 exp->isConstant = 0x1;
13408 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
13409 {
13410 exp->type = 3;
13411 exp->constant = QMkString((char *)classProp->Get(_class));
13412 }
13413 else
13414 {
13415 char constant[256];
13416
13417 exp->type = 2;
13418 sprintf(constant, "%d", (int)classProp->Get(_class));
13419 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13420 }
13421 }
13422 else
13423 {
13424 }
13425 exp->expType = classProp->dataType;
13426 if(classProp->dataType)
13427 classProp->dataType->refCount++;
13428 return 0x1;
13429 }
13430 return 0x0;
13431 }
13432
13433 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
13434 {
13435 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
13436 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
13437 struct __ecereNameSpace__ecere__com__NameSpace * child;
13438
13439 if(!data)
13440 {
13441 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)))
13442 {
13443 data = ScanGlobalData(child, name);
13444 if(data)
13445 break;
13446 }
13447 }
13448 return data;
13449 }
13450
13451 extern struct __ecereNameSpace__ecere__com__NameSpace *  globalData;
13452
13453 extern char *  strncpy(char * , const char * , size_t n);
13454
13455 static struct GlobalData * FindGlobalData(char * name)
13456 {
13457 int start = 0, c;
13458 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13459
13460 nameSpace = globalData;
13461 for(c = 0; name[c]; c++)
13462 {
13463 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
13464 {
13465 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
13466 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
13467
13468 strncpy(spaceName, name + start, c - start);
13469 spaceName[c - start] = '\0';
13470 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
13471 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
13472 if(!newSpace)
13473 return (((void *)0));
13474 nameSpace = newSpace;
13475 if(name[c] == ':')
13476 c++;
13477 start = c + 1;
13478 }
13479 }
13480 if(c - start)
13481 {
13482 return ScanGlobalData(nameSpace, name + start);
13483 }
13484 return (((void *)0));
13485 }
13486
13487 static int definedExpStackPos;
13488
13489 static void * definedExpStack[512];
13490
13491 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
13492 {
13493 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
13494
13495 FreeExpContents(checkedExp);
13496 FreeType(checkedExp->expType);
13497 FreeType(checkedExp->destType);
13498 *checkedExp = *newExp;
13499 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13500 checkedExp->prev = prev;
13501 checkedExp->next = next;
13502 }
13503
13504 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
13505
13506 extern int printf(char * , ...);
13507
13508 void __ecereMethod_Expression_Clear();
13509
13510 void ApplyAnyObjectLogic(struct Expression * e)
13511 {
13512 struct Type * destType = e->destType;
13513
13514 if(destType && (destType->classObjectType == 3))
13515 {
13516 if(e && e->expType)
13517 {
13518 struct Type * type = e->expType;
13519 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
13520
13521 if(type->kind == 8 && type->_class && type->_class->registered)
13522 {
13523 _class = type->_class->registered;
13524 }
13525 else if(type->kind == 19)
13526 {
13527 _class = FindClass("ecere::com::Class")->registered;
13528 }
13529 else
13530 {
13531 char string[1024] = "";
13532 struct Symbol * classSym;
13533
13534 PrintTypeNoConst(type, string, 0x0, 0x1);
13535 classSym = FindClass(string);
13536 if(classSym)
13537 _class = classSym->registered;
13538 }
13539 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)))
13540 {
13541 if(!_class || strcmp(_class->fullName, "char *"))
13542 {
13543 struct Expression * checkedExp = e, * newExp;
13544
13545 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->list) || checkedExp->type == 11)
13546 {
13547 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13548 {
13549 if(checkedExp->type == 23)
13550 {
13551 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13552 }
13553 else
13554 checkedExp = (*checkedExp->list).last;
13555 }
13556 else if(checkedExp->type == 11)
13557 checkedExp = checkedExp->cast.exp;
13558 }
13559 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
13560 {
13561 newExp = checkedExp->op.exp2;
13562 checkedExp->op.exp2 = (((void *)0));
13563 FreeExpContents(checkedExp);
13564 if(e->expType && e->expType->passAsTemplate)
13565 {
13566 char size[100];
13567
13568 ComputeTypeSize(e->expType);
13569 sprintf(size, "%d", e->expType->size);
13570 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))))));
13571 }
13572 ReplaceExpContents(checkedExp, newExp);
13573 e->byReference = 0x1;
13574 }
13575 else if(!e->byReference || (_class && _class->type == 5))
13576 {
13577 struct Expression * checkedExp, * newExp;
13578
13579 {
13580 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;
13581
13582 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
13583 {
13584 struct Context * context = PushContext();
13585 struct Declarator * decl;
13586 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13587 char typeString[1024];
13588 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13589
13590 typeString[0] = '\0';
13591 *newExp = *e;
13592 newExp->prev = (((void *)0));
13593 newExp->next = (((void *)0));
13594 newExp->expType = (((void *)0));
13595 PrintTypeNoConst(e->expType, typeString, 0x0, 0x1);
13596 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13597 newExp->destType = ProcessType(specs, decl);
13598 curContext = context;
13599 if(curCompound)
13600 {
13601 char name[100];
13602 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
13603
13604 e->type = 23;
13605 sprintf(name, "__internalValue%03X", internalValueCounter++);
13606 if(!curCompound->compound.declarations)
13607 curCompound->compound.declarations = MkList();
13608 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
13609 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
13610 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
13611 e->compound = MkCompoundStmt((((void *)0)), stmts);
13612 }
13613 else
13614 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
13615 {
13616 struct Type * type = e->destType;
13617
13618 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13619 CopyTypeInto(e->destType, type);
13620 e->destType->refCount = 1;
13621 e->destType->classObjectType = 0;
13622 FreeType(type);
13623 }
13624 e->compound->compound.context = context;
13625 PopContext(context);
13626 curContext = context->parent;
13627 }
13628 }
13629 checkedExp = e;
13630 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->list) || checkedExp->type == 11)
13631 {
13632 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13633 {
13634 if(checkedExp->type == 23)
13635 {
13636 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13637 }
13638 else
13639 checkedExp = (*checkedExp->list).last;
13640 }
13641 else if(checkedExp->type == 11)
13642 checkedExp = checkedExp->cast.exp;
13643 }
13644 {
13645 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13646
13647 *operand = *checkedExp;
13648 checkedExp->destType = (((void *)0));
13649 checkedExp->expType = (((void *)0));
13650 __ecereMethod_Expression_Clear(checkedExp);
13651 checkedExp->type = 4;
13652 checkedExp->op.op = '&';
13653 checkedExp->op.exp1 = (((void *)0));
13654 checkedExp->op.exp2 = operand;
13655 }
13656 }
13657 }
13658 }
13659 }
13660 }
13661 {
13662 }
13663 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))))
13664 {
13665 if(e->expType->classObjectType && destType && destType->classObjectType)
13666 {
13667 return ;
13668 }
13669 else
13670 {
13671 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13672
13673 *thisExp = *e;
13674 thisExp->prev = (((void *)0));
13675 thisExp->next = (((void *)0));
13676 __ecereMethod_Expression_Clear(e);
13677 e->type = 5;
13678 e->list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
13679 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
13680 ((struct Expression *)(*e->list).first)->byReference = 0x1;
13681 {
13682 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13683 CopyTypeInto(e->expType, thisExp->expType);
13684 e->expType->byReference = 0x0;
13685 e->expType->refCount = 1;
13686 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))
13687 {
13688 e->expType->classObjectType = 0;
13689 }
13690 }
13691 }
13692 }
13693 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
13694 {
13695 if(destType->kind == 14)
13696 {
13697 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unspecified type\n", (((void *)0))));
13698 }
13699 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
13700 {
13701 unsigned int byReference = e->expType->byReference;
13702 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13703 struct Declarator * decl;
13704 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13705 char typeString[1024];
13706 struct Type * type;
13707 int backupClassObjectType;
13708 unsigned int backupByReference;
13709
13710 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
13711 type = e->expType;
13712 else
13713 type = destType;
13714 backupClassObjectType = type->classObjectType;
13715 backupByReference = type->byReference;
13716 type->classObjectType = 0;
13717 type->byReference = 0x0;
13718 typeString[0] = '\0';
13719 PrintType(type, typeString, 0x0, 0x1);
13720 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13721 type->classObjectType = backupClassObjectType;
13722 type->byReference = backupByReference;
13723 *thisExp = *e;
13724 thisExp->prev = (((void *)0));
13725 thisExp->next = (((void *)0));
13726 __ecereMethod_Expression_Clear(e);
13727 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)))
13728 {
13729 e->type = 4;
13730 e->op.op = '*';
13731 e->op.exp1 = (((void *)0));
13732 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
13733 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13734 CopyTypeInto(e->expType, type);
13735 e->expType->byReference = 0x0;
13736 e->expType->refCount = 1;
13737 }
13738 else
13739 {
13740 e->type = 11;
13741 e->cast.typeName = MkTypeName(specs, decl);
13742 e->cast.exp = thisExp;
13743 e->byReference = 0x1;
13744 e->expType = type;
13745 type->refCount++;
13746 }
13747 e->destType = destType;
13748 destType->refCount++;
13749 }
13750 }
13751 }
13752
13753 extern char *  strstr(const char * , const char * );
13754
13755 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
13756
13757 struct __ecereNameSpace__ecere__com__DefinedExpression
13758 {
13759 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
13760 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
13761 char *  name;
13762 char *  value;
13763 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
13764 } __attribute__ ((gcc_struct));
13765
13766 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
13767
13768 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
13769
13770 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char *  string, int *  numBytes);
13771
13772 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
13773
13774 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
13775
13776 extern struct Expression * CopyExpression(struct Expression * exp);
13777
13778 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
13779
13780 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList *  specifiers, struct Declarator * decl);
13781
13782 static void ProcessStatement(struct Statement * stmt);
13783
13784 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
13785
13786 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
13787
13788 extern char *  __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, void * object, ...);
13789
13790 extern char *  sourceFile;
13791
13792 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
13793
13794 void ProcessExpressionType(struct Expression * exp)
13795 {
13796 unsigned int unresolved = 0x0;
13797 struct Location oldyylloc = yylloc;
13798 unsigned int notByReference = 0x0;
13799
13800 if(!exp || exp->expType)
13801 return ;
13802 yylloc = exp->loc;
13803 switch(exp->type)
13804 {
13805 case 0:
13806 {
13807 struct Identifier * id = exp->identifier;
13808
13809 if(!id || !topContext)
13810 return ;
13811 if(id->_class && id->_class->name)
13812 {
13813 id->classSym = id->_class->symbol;
13814 }
13815 if(strstr(id->string, "__ecereClass") == id->string)
13816 {
13817 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
13818 break;
13819 }
13820 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
13821 {
13822 ReplaceClassMembers(exp, thisClass);
13823 if(exp->type != 0)
13824 {
13825 ProcessExpressionType(exp);
13826 break;
13827 }
13828 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
13829 break;
13830 }
13831 else
13832 {
13833 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13834
13835 if(!symbol)
13836 {
13837 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
13838 break;
13839 else
13840 {
13841 if(thisClass)
13842 {
13843 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
13844 if(exp->type != 0)
13845 {
13846 ProcessExpressionType(exp);
13847 break;
13848 }
13849 }
13850 else if(currentClass && !id->_class)
13851 {
13852 if(ResolveIdWithClass(exp, currentClass, 0x1))
13853 break;
13854 }
13855 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13856 }
13857 }
13858 if(symbol)
13859 {
13860 struct Type * type = symbol->type;
13861 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
13862
13863 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
13864 {
13865 struct Context * context = SetupTemplatesContext(_class);
13866
13867 type = ReplaceThisClassType(_class);
13868 FinishTemplatesContext(context);
13869 if(type)
13870 type->refCount = 0;
13871 }
13872 FreeSpecifier(id->_class);
13873 id->_class = (((void *)0));
13874 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13875 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
13876 id->classSym = (((void *)0));
13877 exp->expType = type;
13878 if(type)
13879 type->refCount++;
13880 if(type && (type->kind == 15 || (_class && _class->type == 4)))
13881 exp->isConstant = 0x1;
13882 if(symbol->isParam || !strcmp(id->string, "this"))
13883 {
13884 if(_class && _class->type == 1 && !type->declaredWithStruct)
13885 exp->byReference = 0x1;
13886 }
13887 if(symbol->isIterator)
13888 {
13889 if(symbol->isIterator == 3)
13890 {
13891 exp->type = 5;
13892 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
13893 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
13894 exp->expType = (((void *)0));
13895 ProcessExpressionType(exp);
13896 }
13897 else if(symbol->isIterator != 4)
13898 {
13899 exp->type = 8;
13900 exp->member.exp = MkExpIdentifier(exp->identifier);
13901 exp->member.exp->expType = exp->expType;
13902 exp->member.member = MkIdentifier("data");
13903 exp->expType = (((void *)0));
13904 ProcessExpressionType(exp);
13905 }
13906 }
13907 break;
13908 }
13909 else
13910 {
13911 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
13912
13913 if(thisNameSpace && !(id->_class && !id->_class->name))
13914 {
13915 char name[1024];
13916
13917 strcpy(name, thisNameSpace);
13918 strcat(name, "::");
13919 strcat(name, id->string);
13920 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
13921 }
13922 if(!definedExp)
13923 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
13924 if(definedExp)
13925 {
13926 int c;
13927
13928 for(c = 0; c < definedExpStackPos; c++)
13929 if(definedExpStack[c] == definedExp)
13930 break;
13931 if(c == definedExpStackPos && c < sizeof (definedExpStack) / sizeof(void *))
13932 {
13933 struct Location backupYylloc = yylloc;
13934 struct __ecereNameSpace__ecere__com__Instance * backInput = fileInput;
13935
13936 definedExpStack[definedExpStackPos++] = definedExp;
13937 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13938 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__extension__ ({
13939 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13940
13941 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13942 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
13943 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13944 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13945
13946 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13947 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13948 echoOn = 0x0;
13949 parsedExpression = (((void *)0));
13950 resetScanner();
13951 expression_yyparse();
13952 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13953 if(backInput)
13954 fileInput = backInput;
13955 yylloc = backupYylloc;
13956 if(parsedExpression)
13957 {
13958 FreeIdentifier(id);
13959 exp->type = 5;
13960 exp->list = MkListOne(parsedExpression);
13961 parsedExpression->loc = yylloc;
13962 ProcessExpressionType(exp);
13963 definedExpStackPos--;
13964 return ;
13965 }
13966 definedExpStackPos--;
13967 }
13968 else
13969 {
13970 if(inCompiler)
13971 {
13972 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Recursion in defined expression %s\n", (((void *)0))), id->string);
13973 }
13974 }
13975 }
13976 else
13977 {
13978 struct GlobalData * data = (((void *)0));
13979
13980 if(thisNameSpace && !(id->_class && !id->_class->name))
13981 {
13982 char name[1024];
13983
13984 strcpy(name, thisNameSpace);
13985 strcat(name, "::");
13986 strcat(name, id->string);
13987 data = FindGlobalData(name);
13988 }
13989 if(!data)
13990 data = FindGlobalData(id->string);
13991 if(data)
13992 {
13993 DeclareGlobalData(data);
13994 exp->expType = data->dataType;
13995 if(data->dataType)
13996 data->dataType->refCount++;
13997 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13998 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
13999 FreeSpecifier(id->_class);
14000 id->_class = (((void *)0));
14001 break;
14002 }
14003 else
14004 {
14005 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
14006
14007 if(thisNameSpace && !(id->_class && !id->_class->name))
14008 {
14009 char name[1024];
14010
14011 strcpy(name, thisNameSpace);
14012 strcat(name, "::");
14013 strcat(name, id->string);
14014 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
14015 }
14016 if(!function)
14017 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
14018 if(function)
14019 {
14020 char name[1024];
14021
14022 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14023 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
14024 name[0] = (char)0;
14025 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
14026 strcpy(name, "__ecereFunction_");
14027 FullClassNameCat(name, id->string, 0x0);
14028 if(DeclareFunction(function, name))
14029 {
14030 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14031 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
14032 }
14033 exp->expType = function->dataType;
14034 if(function->dataType)
14035 function->dataType->refCount++;
14036 FreeSpecifier(id->_class);
14037 id->_class = (((void *)0));
14038 break;
14039 }
14040 }
14041 }
14042 }
14043 }
14044 unresolved = 0x1;
14045 break;
14046 }
14047 case 1:
14048 {
14049 struct __ecereNameSpace__ecere__com__Class * _class;
14050
14051 if(!exp->instance->_class)
14052 {
14053 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
14054 {
14055 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
14056 }
14057 }
14058 ProcessInstantiationType(exp->instance);
14059 exp->isConstant = exp->instance->isConstant;
14060 if(exp->instance->_class)
14061 {
14062 exp->expType = MkClassType(exp->instance->_class->name);
14063 }
14064 break;
14065 }
14066 case 2:
14067 {
14068 if(!exp->expType)
14069 {
14070 char * constant = exp->constant;
14071 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
14072
14073 exp->expType = type;
14074 if(constant[0] == '\'')
14075 {
14076 if((int)((unsigned char *)constant)[1] > 127)
14077 {
14078 int nb;
14079 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
14080
14081 if(nb < 2)
14082 ch = constant[1];
14083 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
14084 exp->constant = PrintUInt(ch);
14085 type->kind = 8;
14086 type->_class = FindClass("unichar");
14087 type->isSigned = 0x0;
14088 }
14089 else
14090 {
14091 type->kind = 1;
14092 type->isSigned = 0x1;
14093 }
14094 }
14095 else
14096 {
14097 char * dot = strchr(constant, '.');
14098 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
14099 char * exponent;
14100
14101 if(isHex)
14102 {
14103 exponent = strchr(constant, 'p');
14104 if(!exponent)
14105 exponent = strchr(constant, 'P');
14106 }
14107 else
14108 {
14109 exponent = strchr(constant, 'e');
14110 if(!exponent)
14111 exponent = strchr(constant, 'E');
14112 }
14113 if(dot || exponent)
14114 {
14115 if(strchr(constant, 'f') || strchr(constant, 'F'))
14116 type->kind = 6;
14117 else
14118 type->kind = 7;
14119 type->isSigned = 0x1;
14120 }
14121 else
14122 {
14123 unsigned int isSigned = constant[0] == '-';
14124 char * endP = (((void *)0));
14125 long long i64 = strtoll(constant, &endP, 0);
14126 uint64 ui64 = strtoull(constant, &endP, 0);
14127 unsigned int is64Bit = endP && (!strcmp(endP, "LL") || !strcmp(endP, "ll"));
14128
14129 if(isSigned)
14130 {
14131 if(i64 < (((int)0x80000000)))
14132 is64Bit = 0x1;
14133 }
14134 else
14135 {
14136 if(ui64 > (((int)0x7fffffff)))
14137 {
14138 if(ui64 > (0xffffffff))
14139 {
14140 is64Bit = 0x1;
14141 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
14142 isSigned = 0x1;
14143 }
14144 }
14145 else if(constant[0] != '0' || !constant[1])
14146 isSigned = 0x1;
14147 }
14148 type->kind = is64Bit ? 4 : 3;
14149 type->isSigned = isSigned;
14150 }
14151 }
14152 exp->isConstant = 0x1;
14153 if(exp->destType && exp->destType->kind == 7)
14154 type->kind = 7;
14155 else if(exp->destType && exp->destType->kind == 6)
14156 type->kind = 6;
14157 else if(exp->destType && exp->destType->kind == 4)
14158 type->kind = 4;
14159 }
14160 break;
14161 }
14162 case 3:
14163 {
14164 exp->isConstant = 0x1;
14165 exp->expType = __extension__ ({
14166 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14167
14168 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
14169 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14170
14171 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 1, __ecereInstance1->constant = 0x1, __ecereInstance1->isSigned = 0x1, __ecereInstance1;
14172 }), __ecereInstance2;
14173 });
14174 break;
14175 }
14176 case 13:
14177 case 26:
14178 ProcessExpressionType(exp->_new.size);
14179 exp->expType = __extension__ ({
14180 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14181
14182 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_new.typeName->qualifiers, exp->_new.typeName->declarator), __ecereInstance1;
14183 });
14184 DeclareType(exp->expType->type, 0x0, 0x0);
14185 break;
14186 case 14:
14187 case 27:
14188 ProcessExpressionType(exp->_renew.size);
14189 ProcessExpressionType(exp->_renew.exp);
14190 exp->expType = __extension__ ({
14191 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14192
14193 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_renew.typeName->qualifiers, exp->_renew.typeName->declarator), __ecereInstance1;
14194 });
14195 DeclareType(exp->expType->type, 0x0, 0x0);
14196 break;
14197 case 4:
14198 {
14199 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
14200 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
14201 unsigned int useDestType = 0x0, useSideType = 0x0;
14202 struct Location oldyylloc = yylloc;
14203 unsigned int useSideUnit = 0x0;
14204 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
14205
14206 switch(exp->op.op)
14207 {
14208 case '=':
14209 case MUL_ASSIGN:
14210 case DIV_ASSIGN:
14211 case MOD_ASSIGN:
14212 case ADD_ASSIGN:
14213 case SUB_ASSIGN:
14214 case LEFT_ASSIGN:
14215 case RIGHT_ASSIGN:
14216 case AND_ASSIGN:
14217 case XOR_ASSIGN:
14218 case OR_ASSIGN:
14219 assign = 0x1;
14220 break;
14221 case '!':
14222 break;
14223 case AND_OP:
14224 case OR_OP:
14225 boolOps = 0x1;
14226 boolResult = 0x1;
14227 break;
14228 case EQ_OP:
14229 case '<':
14230 case '>':
14231 case LE_OP:
14232 case GE_OP:
14233 case NE_OP:
14234 boolResult = 0x1;
14235 useSideType = 0x1;
14236 break;
14237 case '+':
14238 case '-':
14239 useSideUnit = 0x1;
14240 case '|':
14241 case '&':
14242 case '^':
14243 case '/':
14244 case '%':
14245 case '*':
14246 if(exp->op.op != '*' || exp->op.exp1)
14247 {
14248 useSideType = 0x1;
14249 useDestType = 0x1;
14250 }
14251 break;
14252 }
14253 if(exp->op.op == '&')
14254 {
14255 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
14256 {
14257 struct Identifier * id = exp->op.exp2->identifier;
14258 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
14259
14260 if(symbol && symbol->isIterator == 2)
14261 {
14262 exp->type = 8;
14263 exp->member.exp = exp->op.exp2;
14264 exp->member.member = MkIdentifier("key");
14265 exp->expType = (((void *)0));
14266 exp->op.exp2->expType = symbol->type;
14267 symbol->type->refCount++;
14268 ProcessExpressionType(exp);
14269 FreeType(dummy);
14270 break;
14271 }
14272 }
14273 }
14274 if(exp->op.exp1)
14275 {
14276 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class && exp->destType->_class->registered && useDestType && ((exp->destType->_class->registered->type == 3 && useSideUnit) || exp->destType->_class->registered->type == 4 || exp->destType->_class->registered->type == 2))
14277 {
14278 if(exp->op.exp1->destType)
14279 FreeType(exp->op.exp1->destType);
14280 exp->op.exp1->destType = exp->destType;
14281 if(exp->destType)
14282 exp->destType->refCount++;
14283 }
14284 else if(!assign)
14285 {
14286 if(exp->op.exp1->destType)
14287 FreeType(exp->op.exp1->destType);
14288 exp->op.exp1->destType = dummy;
14289 dummy->refCount++;
14290 }
14291 if(exp->op.exp1->destType && exp->op.op != '=')
14292 exp->op.exp1->destType->count++;
14293 ProcessExpressionType(exp->op.exp1);
14294 if(exp->op.exp1->destType && exp->op.op != '=')
14295 exp->op.exp1->destType->count--;
14296 if(exp->op.exp1->destType == dummy)
14297 {
14298 FreeType(dummy);
14299 exp->op.exp1->destType = (((void *)0));
14300 }
14301 type1 = exp->op.exp1->expType;
14302 }
14303 if(exp->op.exp2)
14304 {
14305 char expString[10240];
14306
14307 expString[0] = '\0';
14308 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
14309 {
14310 if(exp->op.exp1)
14311 {
14312 exp->op.exp2->destType = exp->op.exp1->expType;
14313 if(exp->op.exp1->expType)
14314 exp->op.exp1->expType->refCount++;
14315 }
14316 else
14317 {
14318 exp->op.exp2->destType = exp->destType;
14319 if(exp->destType)
14320 exp->destType->refCount++;
14321 }
14322 if(type1)
14323 type1->refCount++;
14324 exp->expType = type1;
14325 }
14326 else if(assign)
14327 {
14328 if(inCompiler)
14329 PrintExpression(exp->op.exp2, expString);
14330 if(type1 && type1->kind == 13)
14331 {
14332 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)
14333 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
14334 else if(exp->op.op == '=')
14335 {
14336 if(exp->op.exp2->destType)
14337 FreeType(exp->op.exp2->destType);
14338 exp->op.exp2->destType = type1;
14339 if(type1)
14340 type1->refCount++;
14341 }
14342 }
14343 else
14344 {
14345 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)
14346 ;
14347 else
14348 {
14349 if(exp->op.exp2->destType)
14350 FreeType(exp->op.exp2->destType);
14351 exp->op.exp2->destType = type1;
14352 if(type1)
14353 type1->refCount++;
14354 }
14355 }
14356 if(type1)
14357 type1->refCount++;
14358 exp->expType = type1;
14359 }
14360 else if(exp->destType && exp->destType->kind == 8 && exp->destType->_class && exp->destType->_class->registered && ((exp->destType->_class->registered->type == 3 && useDestType && useSideUnit) || (exp->destType->_class->registered->type == 4 && useDestType)))
14361 {
14362 if(exp->op.exp2->destType)
14363 FreeType(exp->op.exp2->destType);
14364 exp->op.exp2->destType = exp->destType;
14365 if(exp->destType)
14366 exp->destType->refCount++;
14367 }
14368 else
14369 {
14370 if(exp->op.exp2->destType)
14371 FreeType(exp->op.exp2->destType);
14372 exp->op.exp2->destType = dummy;
14373 dummy->refCount++;
14374 }
14375 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
14376 {
14377 FreeType(exp->op.exp2->destType);
14378 exp->op.exp2->destType = type1;
14379 type1->refCount++;
14380 }
14381 if(exp->op.exp2->destType && exp->op.op != '=')
14382 exp->op.exp2->destType->count++;
14383 if(exp->op.op == SIZEOF)
14384 {
14385 struct Expression * e = exp->op.exp2;
14386
14387 while((e->type == 5 || e->type == 32 || e->type == 23) && e->list)
14388 {
14389 if(e->type == 5 || e->type == 32 || e->type == 23)
14390 {
14391 if(e->type == 23)
14392 e = (*((struct Statement *)(*e->compound->compound.statements).last)->expressions).last;
14393 else
14394 e = (*e->list).last;
14395 }
14396 }
14397 if(e->type == 11 && e->cast.exp)
14398 e->cast.exp->needCast = 0x1;
14399 }
14400 ProcessExpressionType(exp->op.exp2);
14401 if(exp->op.exp2->destType && exp->op.op != '=')
14402 exp->op.exp2->destType->count--;
14403 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
14404 {
14405 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)
14406 {
14407 if(exp->op.op != '=' && type1->type->kind == 0)
14408 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14409 }
14410 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)))
14411 {
14412 if(exp->op.op == ADD_ASSIGN)
14413 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14414 }
14415 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))
14416 {
14417 if(exp->op.op == ADD_ASSIGN)
14418 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14419 }
14420 else if(inCompiler)
14421 {
14422 char type1String[1024];
14423 char type2String[1024];
14424
14425 type1String[0] = '\0';
14426 type2String[0] = '\0';
14427 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
14428 PrintType(type1, type2String, 0x0, 0x1);
14429 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14430 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
14431 }
14432 }
14433 if(exp->op.exp2->destType == dummy)
14434 {
14435 FreeType(dummy);
14436 exp->op.exp2->destType = (((void *)0));
14437 }
14438 if(exp->op.op == '-' && !exp->op.exp1 && exp->op.exp2->expType && !exp->op.exp2->expType->isSigned)
14439 {
14440 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14441 type2->refCount = 1;
14442 CopyTypeInto(type2, exp->op.exp2->expType);
14443 type2->isSigned = 0x1;
14444 }
14445 else if(exp->op.op == '~' && !exp->op.exp1 && exp->op.exp2->expType && (!exp->op.exp2->expType->isSigned || exp->op.exp2->expType->kind != 3))
14446 {
14447 type2 = __extension__ ({
14448 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14449
14450 __ecereInstance1->kind = 3, __ecereInstance1;
14451 });
14452 type2->refCount = 1;
14453 type2->isSigned = 0x1;
14454 }
14455 else
14456 {
14457 type2 = exp->op.exp2->expType;
14458 if(type2)
14459 type2->refCount++;
14460 }
14461 }
14462 dummy->kind = 0;
14463 if(exp->op.op == SIZEOF)
14464 {
14465 exp->expType = __extension__ ({
14466 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14467
14468 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
14469 });
14470 exp->isConstant = 0x1;
14471 }
14472 else if(exp->op.op == '*' && !exp->op.exp1)
14473 {
14474 exp->expType = Dereference(type2);
14475 if(type2 && type2->kind == 8)
14476 notByReference = 0x1;
14477 }
14478 else if(exp->op.op == '&' && !exp->op.exp1)
14479 exp->expType = Reference(type2);
14480 else if(!assign)
14481 {
14482 if(boolOps)
14483 {
14484 if(exp->op.exp1)
14485 {
14486 if(exp->op.exp1->destType)
14487 FreeType(exp->op.exp1->destType);
14488 exp->op.exp1->destType = MkClassType("bool");
14489 exp->op.exp1->destType->truth = 0x1;
14490 if(!exp->op.exp1->expType)
14491 ProcessExpressionType(exp->op.exp1);
14492 else
14493 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14494 FreeType(exp->op.exp1->expType);
14495 exp->op.exp1->expType = MkClassType("bool");
14496 exp->op.exp1->expType->truth = 0x1;
14497 }
14498 if(exp->op.exp2)
14499 {
14500 if(exp->op.exp2->destType)
14501 FreeType(exp->op.exp2->destType);
14502 exp->op.exp2->destType = MkClassType("bool");
14503 exp->op.exp2->destType->truth = 0x1;
14504 if(!exp->op.exp2->expType)
14505 ProcessExpressionType(exp->op.exp2);
14506 else
14507 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14508 FreeType(exp->op.exp2->expType);
14509 exp->op.exp2->expType = MkClassType("bool");
14510 exp->op.exp2->expType->truth = 0x1;
14511 }
14512 }
14513 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")))))
14514 {
14515 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
14516 {
14517 if(exp->op.exp2->destType)
14518 FreeType(exp->op.exp2->destType);
14519 exp->op.exp2->destType = type1;
14520 type1->refCount++;
14521 if(exp->op.exp1->destType)
14522 FreeType(exp->op.exp1->destType);
14523 exp->op.exp1->destType = type2;
14524 type2->refCount++;
14525 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)
14526 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);
14527 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
14528 {
14529 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14530
14531 if(argExp)
14532 {
14533 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14534
14535 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
14536 ProcessExpressionType(exp->op.exp1);
14537 if(type2->kind != 13)
14538 {
14539 ProcessExpressionType(classExp);
14540 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"))))))));
14541 if(!exp->op.exp2->expType)
14542 {
14543 if(type2)
14544 FreeType(type2);
14545 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
14546 type2->refCount++;
14547 }
14548 ProcessExpressionType(exp->op.exp2);
14549 }
14550 }
14551 }
14552 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)))
14553 {
14554 if(type1->kind != 8 && type1->type->kind == 0)
14555 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14556 exp->expType = type1;
14557 if(type1)
14558 type1->refCount++;
14559 }
14560 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)))
14561 {
14562 if(type2->kind != 8 && type2->type->kind == 0)
14563 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14564 exp->expType = type2;
14565 if(type2)
14566 type2->refCount++;
14567 }
14568 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))
14569 {
14570 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "different levels of indirection\n", (((void *)0))));
14571 }
14572 else
14573 {
14574 unsigned int success = 0x0;
14575
14576 if(type1->kind == 13 && type2->kind == 13)
14577 {
14578 if(exp->op.op == '+')
14579 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14580 else if(exp->op.op == '-')
14581 {
14582 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
14583 {
14584 exp->expType = __extension__ ({
14585 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14586
14587 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
14588 });
14589 success = 0x1;
14590 if(type1->type->kind == 20)
14591 {
14592 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14593
14594 if(argExp)
14595 {
14596 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14597
14598 ProcessExpressionType(classExp);
14599 exp->type = 5;
14600 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")))))));
14601 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
14602 FreeType(dummy);
14603 return ;
14604 }
14605 }
14606 }
14607 }
14608 }
14609 if(!success && exp->op.exp1->type == 2)
14610 {
14611 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14612 {
14613 if(exp->expType)
14614 FreeType(exp->expType);
14615 exp->expType = exp->op.exp1->destType;
14616 if(exp->op.exp1->destType)
14617 exp->op.exp1->destType->refCount++;
14618 success = 0x1;
14619 }
14620 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14621 {
14622 if(exp->expType)
14623 FreeType(exp->expType);
14624 exp->expType = exp->op.exp2->destType;
14625 if(exp->op.exp2->destType)
14626 exp->op.exp2->destType->refCount++;
14627 success = 0x1;
14628 }
14629 }
14630 else if(!success)
14631 {
14632 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14633 {
14634 if(exp->expType)
14635 FreeType(exp->expType);
14636 exp->expType = exp->op.exp2->destType;
14637 if(exp->op.exp2->destType)
14638 exp->op.exp2->destType->refCount++;
14639 success = 0x1;
14640 }
14641 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14642 {
14643 if(exp->expType)
14644 FreeType(exp->expType);
14645 exp->expType = exp->op.exp1->destType;
14646 if(exp->op.exp1->destType)
14647 exp->op.exp1->destType->refCount++;
14648 success = 0x1;
14649 }
14650 }
14651 if(!success)
14652 {
14653 char expString1[10240];
14654 char expString2[10240];
14655 char type1[1024];
14656 char type2[1024];
14657
14658 expString1[0] = '\0';
14659 expString2[0] = '\0';
14660 type1[0] = '\0';
14661 type2[0] = '\0';
14662 if(inCompiler)
14663 {
14664 PrintExpression(exp->op.exp1, expString1);
14665 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
14666 PrintExpression(exp->op.exp2, expString2);
14667 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
14668 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
14669 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
14670 }
14671 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
14672 }
14673 }
14674 }
14675 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
14676 {
14677 if(exp->op.exp1->destType)
14678 FreeType(exp->op.exp1->destType);
14679 exp->op.exp1->destType = type2->_class->registered->dataType;
14680 if(type2->_class->registered->dataType)
14681 type2->_class->registered->dataType->refCount++;
14682 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14683 exp->expType = type2;
14684 if(type2)
14685 type2->refCount++;
14686 }
14687 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
14688 {
14689 if(exp->op.exp2->destType)
14690 FreeType(exp->op.exp2->destType);
14691 exp->op.exp2->destType = type1->_class->registered->dataType;
14692 if(type1->_class->registered->dataType)
14693 type1->_class->registered->dataType->refCount++;
14694 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14695 exp->expType = type1;
14696 if(type1)
14697 type1->refCount++;
14698 }
14699 else if(type1)
14700 {
14701 unsigned int valid = 0x0;
14702
14703 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
14704 {
14705 if(exp->op.exp2->destType)
14706 FreeType(exp->op.exp2->destType);
14707 if(!type1->_class->registered->dataType)
14708 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
14709 exp->op.exp2->destType = type1->_class->registered->dataType;
14710 exp->op.exp2->destType->refCount++;
14711 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14712 if(type2)
14713 FreeType(type2);
14714 type2 = exp->op.exp2->destType;
14715 if(type2)
14716 type2->refCount++;
14717 exp->expType = type2;
14718 type2->refCount++;
14719 }
14720 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
14721 {
14722 if(exp->op.exp1->destType)
14723 FreeType(exp->op.exp1->destType);
14724 if(!type2->_class->registered->dataType)
14725 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
14726 exp->op.exp1->destType = type2->_class->registered->dataType;
14727 exp->op.exp1->destType->refCount++;
14728 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14729 type1 = exp->op.exp1->destType;
14730 exp->expType = type1;
14731 type1->refCount++;
14732 }
14733 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
14734 {
14735 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
14736 {
14737 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
14738 {
14739 if(exp->expType)
14740 FreeType(exp->expType);
14741 exp->expType = exp->op.exp1->expType;
14742 if(exp->op.exp2->expType)
14743 exp->op.exp1->expType->refCount++;
14744 valid = 0x1;
14745 }
14746 }
14747 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
14748 {
14749 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
14750 {
14751 if(exp->expType)
14752 FreeType(exp->expType);
14753 exp->expType = exp->op.exp2->expType;
14754 if(exp->op.exp2->expType)
14755 exp->op.exp2->expType->refCount++;
14756 valid = 0x1;
14757 }
14758 }
14759 }
14760 if(!valid)
14761 {
14762 if(exp->op.exp2->destType)
14763 FreeType(exp->op.exp2->destType);
14764 exp->op.exp2->destType = type1;
14765 type1->refCount++;
14766 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14767 {
14768 if(exp->expType)
14769 FreeType(exp->expType);
14770 exp->expType = exp->op.exp2->destType;
14771 if(exp->op.exp2->destType)
14772 exp->op.exp2->destType->refCount++;
14773 }
14774 else if(type1 && type2)
14775 {
14776 char expString1[10240];
14777 char expString2[10240];
14778 char type1String[1024];
14779 char type2String[1024];
14780
14781 expString1[0] = '\0';
14782 expString2[0] = '\0';
14783 type1String[0] = '\0';
14784 type2String[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, type1String, 0x0, 0x1);
14792 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
14793 }
14794 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
14795 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
14796 {
14797 exp->expType = exp->op.exp1->expType;
14798 if(exp->op.exp1->expType)
14799 exp->op.exp1->expType->refCount++;
14800 }
14801 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
14802 {
14803 exp->expType = exp->op.exp2->expType;
14804 if(exp->op.exp2->expType)
14805 exp->op.exp2->expType->refCount++;
14806 }
14807 }
14808 }
14809 }
14810 else if(type2)
14811 {
14812 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
14813 {
14814 struct Type * oldType = exp->op.exp1->expType;
14815
14816 exp->op.exp1->expType = (((void *)0));
14817 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14818 FreeType(oldType);
14819 else
14820 exp->op.exp1->expType = oldType;
14821 }
14822 if(exp->op.exp1->destType)
14823 FreeType(exp->op.exp1->destType);
14824 exp->op.exp1->destType = type2;
14825 type2->refCount++;
14826 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14827 {
14828 if(exp->expType)
14829 FreeType(exp->expType);
14830 exp->expType = exp->op.exp1->destType;
14831 if(exp->op.exp1->destType)
14832 exp->op.exp1->destType->refCount++;
14833 }
14834 }
14835 }
14836 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
14837 {
14838 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
14839 {
14840 if(exp->op.exp1->destType)
14841 FreeType(exp->op.exp1->destType);
14842 exp->op.exp1->destType = type2->_class->registered->dataType;
14843 if(type2->_class->registered->dataType)
14844 type2->_class->registered->dataType->refCount++;
14845 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14846 }
14847 if(exp->op.op == '!')
14848 {
14849 exp->expType = MkClassType("bool");
14850 exp->expType->truth = 0x1;
14851 }
14852 else
14853 {
14854 exp->expType = type2;
14855 if(type2)
14856 type2->refCount++;
14857 }
14858 }
14859 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
14860 {
14861 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
14862 {
14863 if(exp->op.exp2->destType)
14864 FreeType(exp->op.exp2->destType);
14865 exp->op.exp2->destType = type1->_class->registered->dataType;
14866 if(type1->_class->registered->dataType)
14867 type1->_class->registered->dataType->refCount++;
14868 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14869 }
14870 exp->expType = type1;
14871 if(type1)
14872 type1->refCount++;
14873 }
14874 }
14875 yylloc = exp->loc;
14876 if(exp->op.exp1 && !exp->op.exp1->expType)
14877 {
14878 char expString[10000];
14879
14880 expString[0] = '\0';
14881 if(inCompiler)
14882 {
14883 PrintExpression(exp->op.exp1, expString);
14884 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14885 }
14886 if(expString[0])
14887 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
14888 }
14889 if(exp->op.exp2 && !exp->op.exp2->expType)
14890 {
14891 char expString[10240];
14892
14893 expString[0] = '\0';
14894 if(inCompiler)
14895 {
14896 PrintExpression(exp->op.exp2, expString);
14897 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14898 }
14899 if(expString[0])
14900 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
14901 }
14902 if(boolResult)
14903 {
14904 FreeType(exp->expType);
14905 exp->expType = MkClassType("bool");
14906 exp->expType->truth = 0x1;
14907 }
14908 if(exp->op.op != SIZEOF)
14909 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
14910 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
14911 {
14912 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
14913 }
14914 yylloc = oldyylloc;
14915 FreeType(dummy);
14916 if(type2)
14917 FreeType(type2);
14918 break;
14919 }
14920 case 5:
14921 case 32:
14922 {
14923 struct Expression * e;
14924
14925 exp->isConstant = 0x1;
14926 for(e = (*exp->list).first; e; e = e->next)
14927 {
14928 unsigned int inced = 0x0;
14929
14930 if(!e->next)
14931 {
14932 FreeType(e->destType);
14933 e->destType = exp->destType;
14934 if(e->destType)
14935 {
14936 exp->destType->refCount++;
14937 e->destType->count++;
14938 inced = 0x1;
14939 }
14940 }
14941 ProcessExpressionType(e);
14942 if(inced)
14943 exp->destType->count--;
14944 if(!exp->expType && !e->next)
14945 {
14946 exp->expType = e->expType;
14947 if(e->expType)
14948 e->expType->refCount++;
14949 }
14950 if(!e->isConstant)
14951 exp->isConstant = 0x0;
14952 }
14953 e = (*exp->list).first;
14954 if(!e->next && e->type == 8)
14955 {
14956 struct Expression * next = exp->next, * prev = exp->prev;
14957
14958 FreeType(exp->expType);
14959 FreeType(exp->destType);
14960 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14961 *exp = *e;
14962 exp->prev = prev;
14963 exp->next = next;
14964 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
14965 ProcessExpressionType(exp);
14966 }
14967 break;
14968 }
14969 case 6:
14970 {
14971 struct Expression * e;
14972
14973 exp->isConstant = 0x1;
14974 ProcessExpressionType(exp->index.exp);
14975 if(!exp->index.exp->isConstant)
14976 exp->isConstant = 0x0;
14977 if(exp->index.exp->expType)
14978 {
14979 struct Type * source = exp->index.exp->expType;
14980
14981 if(source->kind == 8 && source->_class && source->_class->registered)
14982 {
14983 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
14984 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
14985
14986 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
14987 {
14988 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
14989 if(exp->index.index && (*exp->index.index).last)
14990 {
14991 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
14992 }
14993 }
14994 }
14995 }
14996 for(e = (*exp->index.index).first; e; e = e->next)
14997 {
14998 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
14999 {
15000 if(e->destType)
15001 FreeType(e->destType);
15002 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
15003 }
15004 ProcessExpressionType(e);
15005 if(!e->next)
15006 {
15007 }
15008 if(!e->isConstant)
15009 exp->isConstant = 0x0;
15010 }
15011 if(!exp->expType)
15012 exp->expType = Dereference(exp->index.exp->expType);
15013 if(exp->expType)
15014 DeclareType(exp->expType, 0x0, 0x0);
15015 break;
15016 }
15017 case 7:
15018 {
15019 struct Expression * e;
15020 struct Type * functionType;
15021 struct Type * methodType = (((void *)0));
15022 char name[1024];
15023
15024 name[0] = '\0';
15025 if(inCompiler)
15026 {
15027 PrintExpression(exp->call.exp, name);
15028 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
15029 {
15030 PrintExpression(exp->call.exp, name);
15031 }
15032 }
15033 if(exp->call.exp->type == 0)
15034 {
15035 struct Expression * idExp = exp->call.exp;
15036 struct Identifier * id = idExp->identifier;
15037
15038 if(!strcmp(id->string, "__builtin_frame_address"))
15039 {
15040 exp->expType = ProcessTypeString("void *", 0x1);
15041 if(exp->call.arguments && (*exp->call.arguments).first)
15042 ProcessExpressionType((*exp->call.arguments).first);
15043 break;
15044 }
15045 else if(!strcmp(id->string, "__ENDIAN_PAD"))
15046 {
15047 exp->expType = ProcessTypeString("int", 0x1);
15048 if(exp->call.arguments && (*exp->call.arguments).first)
15049 ProcessExpressionType((*exp->call.arguments).first);
15050 break;
15051 }
15052 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
15053 {
15054 struct Expression * a = (((void *)0));
15055 struct Expression * b = (((void *)0));
15056 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
15057
15058 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
15059 {
15060 a = (*exp->call.arguments).first;
15061 b = (*exp->call.arguments).last;
15062 tempExp1 = a;
15063 tempExp2 = b;
15064 }
15065 else if((*exp->call.arguments).count == 1)
15066 {
15067 a = (*exp->call.arguments).first;
15068 tempExp1 = a;
15069 }
15070 if(a)
15071 {
15072 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
15073 idExp->identifier = (((void *)0));
15074 FreeExpContents(exp);
15075 ProcessExpressionType(a);
15076 if(b)
15077 ProcessExpressionType(b);
15078 exp->type = 5;
15079 exp->list = MkList();
15080 if(a->expType && (!b || b->expType))
15081 {
15082 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
15083 {
15084 if(inCompiler)
15085 {
15086 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15087 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
15088 struct Declaration * decl;
15089 char temp1[1024], temp2[1024];
15090
15091 GetTypeSpecs(a->expType, specs);
15092 if(a && !a->isConstant && a->type != 0)
15093 {
15094 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
15095 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
15096 tempExp1 = QMkExpId(temp1);
15097 tempExp1->expType = a->expType;
15098 if(a->expType)
15099 a->expType->refCount++;
15100 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
15101 }
15102 if(b && !b->isConstant && b->type != 0)
15103 {
15104 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
15105 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
15106 tempExp2 = QMkExpId(temp2);
15107 tempExp2->expType = b->expType;
15108 if(b->expType)
15109 b->expType->refCount++;
15110 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
15111 }
15112 decl = MkDeclaration(specs, decls);
15113 if(!curCompound->compound.declarations)
15114 curCompound->compound.declarations = MkList();
15115 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
15116 }
15117 }
15118 }
15119 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
15120 {
15121 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
15122
15123 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
15124 exp->expType = a->expType;
15125 if(a->expType)
15126 a->expType->refCount++;
15127 }
15128 else if(!strcmp(id->string, "Abs"))
15129 {
15130 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
15131 exp->expType = a->expType;
15132 if(a->expType)
15133 a->expType->refCount++;
15134 }
15135 else if(!strcmp(id->string, "Sgn"))
15136 {
15137 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"))))));
15138 exp->expType = ProcessTypeString("int", 0x0);
15139 }
15140 FreeExpression(tempExp1);
15141 if(tempExp2)
15142 FreeExpression(tempExp2);
15143 FreeIdentifier(id);
15144 break;
15145 }
15146 }
15147 }
15148 {
15149 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
15150
15151 if(!exp->call.exp->destType)
15152 {
15153 exp->call.exp->destType = dummy;
15154 dummy->refCount++;
15155 }
15156 ProcessExpressionType(exp->call.exp);
15157 if(exp->call.exp->destType == dummy)
15158 {
15159 FreeType(dummy);
15160 exp->call.exp->destType = (((void *)0));
15161 }
15162 FreeType(dummy);
15163 }
15164 functionType = exp->call.exp->expType;
15165 if(functionType && functionType->kind == 16)
15166 {
15167 methodType = functionType;
15168 functionType = methodType->method->dataType;
15169 if(exp->call.exp->expType->usedClass)
15170 {
15171 char typeString[1024];
15172
15173 typeString[0] = '\0';
15174 {
15175 struct Symbol * back = functionType->thisClass;
15176
15177 functionType->thisClass = (((void *)0));
15178 PrintType(functionType, typeString, 0x1, 0x1);
15179 functionType->thisClass = back;
15180 }
15181 if(strstr(typeString, "thisclass"))
15182 {
15183 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15184 struct Declarator * decl;
15185
15186 {
15187 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
15188
15189 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
15190 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
15191 thisClassParams = 0x0;
15192 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
15193 {
15194 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
15195
15196 thisClass = exp->call.exp->expType->usedClass;
15197 ProcessDeclarator(decl);
15198 thisClass = backupThisClass;
15199 }
15200 thisClassParams = 0x1;
15201 functionType = ProcessType(specs, decl);
15202 functionType->refCount = 0;
15203 FinishTemplatesContext(context);
15204 }
15205 FreeList(specs, FreeSpecifier);
15206 FreeDeclarator(decl);
15207 }
15208 }
15209 }
15210 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
15211 {
15212 struct Type * type = functionType->type;
15213
15214 if(!functionType->refCount)
15215 {
15216 functionType->type = (((void *)0));
15217 FreeType(functionType);
15218 }
15219 functionType = type;
15220 }
15221 if(functionType && functionType->kind != 11)
15222 {
15223 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "called object %s is not a function\n", (((void *)0))), name);
15224 }
15225 else if(functionType)
15226 {
15227 unsigned int emptyParams = 0x0, noParams = 0x0;
15228 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
15229 struct Type * type = functionType->params.first;
15230 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
15231 int extra = 0;
15232 struct Location oldyylloc = yylloc;
15233
15234 if(!type)
15235 emptyParams = 0x1;
15236 if(functionType->extraParam && e && functionType->thisClass)
15237 {
15238 e->destType = MkClassType(functionType->thisClass->string);
15239 e = e->next;
15240 }
15241 if(!functionType->staticMethod && !functionType->extraParam)
15242 {
15243 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
15244 {
15245 type = MkClassType(memberExp->member.exp->expType->_class->string);
15246 if(e)
15247 {
15248 e->destType = type;
15249 e = e->next;
15250 type = functionType->params.first;
15251 }
15252 else
15253 type->refCount = 0;
15254 }
15255 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
15256 {
15257 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
15258 type->byReference = functionType->byReference;
15259 type->typedByReference = functionType->typedByReference;
15260 if(e)
15261 {
15262 if(e->next && type->kind == 8 && (functionType && functionType->thisClass) && functionType->classObjectType == 2)
15263 e = e->next;
15264 e->destType = type;
15265 e = e->next;
15266 type = functionType->params.first;
15267 }
15268 else
15269 type->refCount = 0;
15270 }
15271 }
15272 if(type && type->kind == 0)
15273 {
15274 noParams = 0x1;
15275 if(!type->refCount)
15276 FreeType(type);
15277 type = (((void *)0));
15278 }
15279 for(; e; e = e->next)
15280 {
15281 if(!type && !emptyParams)
15282 {
15283 yylloc = e->loc;
15284 if(methodType && methodType->methodClass)
15285 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);
15286 else
15287 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);
15288 break;
15289 }
15290 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
15291 {
15292 struct Type * templatedType = (((void *)0));
15293 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
15294 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15295 int id = 0;
15296
15297 if(_class && _class->templateArgs)
15298 {
15299 struct __ecereNameSpace__ecere__com__Class * sClass;
15300
15301 for(sClass = _class; sClass; sClass = sClass->base)
15302 {
15303 if(sClass->templateClass)
15304 sClass = sClass->templateClass;
15305 id = 0;
15306 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15307 {
15308 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
15309 {
15310 struct __ecereNameSpace__ecere__com__Class * nextClass;
15311
15312 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15313 {
15314 if(nextClass->templateClass)
15315 nextClass = nextClass->templateClass;
15316 id += nextClass->templateParams.count;
15317 }
15318 break;
15319 }
15320 id++;
15321 }
15322 if(curParam)
15323 break;
15324 }
15325 }
15326 if(curParam && _class->templateArgs[id].dataTypeString)
15327 {
15328 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
15329
15330 {
15331 struct Context * context = SetupTemplatesContext(_class);
15332
15333 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
15334 FinishTemplatesContext(context);
15335 }
15336 e->destType = templatedType;
15337 if(templatedType)
15338 {
15339 templatedType->passAsTemplate = 0x1;
15340 }
15341 }
15342 else
15343 {
15344 e->destType = type;
15345 if(type)
15346 type->refCount++;
15347 }
15348 }
15349 else
15350 {
15351 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
15352 {
15353 e->destType = type->prev;
15354 e->destType->refCount++;
15355 }
15356 else
15357 {
15358 e->destType = type;
15359 if(type)
15360 type->refCount++;
15361 }
15362 }
15363 if(type && type->kind != 14)
15364 {
15365 struct Type * next = type->next;
15366
15367 if(!type->refCount)
15368 FreeType(type);
15369 type = next;
15370 }
15371 }
15372 if(type && type->kind != 14)
15373 {
15374 if(methodType && methodType->methodClass)
15375 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);
15376 else
15377 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);
15378 }
15379 yylloc = oldyylloc;
15380 if(type && !type->refCount)
15381 FreeType(type);
15382 }
15383 else
15384 {
15385 functionType = __extension__ ({
15386 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15387
15388 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
15389 });
15390 if(exp->call.exp->type == 0)
15391 {
15392 char * string = exp->call.exp->identifier->string;
15393
15394 if(inCompiler)
15395 {
15396 struct Symbol * symbol;
15397 struct Location oldyylloc = yylloc;
15398
15399 yylloc = exp->call.exp->identifier->loc;
15400 if(strstr(string, "__builtin_") == string)
15401 {
15402 if(exp->destType)
15403 {
15404 functionType->returnType = exp->destType;
15405 exp->destType->refCount++;
15406 }
15407 }
15408 else
15409 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s undefined; assuming extern returning int\n", (((void *)0))), string);
15410 symbol = __extension__ ({
15411 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
15412
15413 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 0x1), __ecereInstance1;
15414 });
15415 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
15416 if(strstr(symbol->string, "::"))
15417 globalContext->hasNameSpace = 0x1;
15418 yylloc = oldyylloc;
15419 }
15420 }
15421 else if(exp->call.exp->type == 8)
15422 {
15423 }
15424 else
15425 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "callable object undefined; extern assuming returning int\n", (((void *)0))));
15426 if(!functionType->returnType)
15427 {
15428 functionType->returnType = __extension__ ({
15429 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15430
15431 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15432 });
15433 }
15434 }
15435 if(functionType && functionType->kind == 11)
15436 {
15437 exp->expType = functionType->returnType;
15438 if(functionType->returnType)
15439 functionType->returnType->refCount++;
15440 if(!functionType->refCount)
15441 FreeType(functionType);
15442 }
15443 if(exp->call.arguments)
15444 {
15445 for(e = (*exp->call.arguments).first; e; e = e->next)
15446 {
15447 struct Type * destType = e->destType;
15448
15449 ProcessExpressionType(e);
15450 }
15451 }
15452 break;
15453 }
15454 case 8:
15455 {
15456 struct Type * type;
15457 struct Location oldyylloc = yylloc;
15458 unsigned int thisPtr;
15459 struct Expression * checkExp = exp->member.exp;
15460
15461 while(checkExp)
15462 {
15463 if(checkExp->type == 11)
15464 checkExp = checkExp->cast.exp;
15465 else if(checkExp->type == 5)
15466 checkExp = checkExp->list ? (*checkExp->list).first : (((void *)0));
15467 else
15468 break;
15469 }
15470 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->identifier->string, "this"));
15471 exp->thisPtr = thisPtr;
15472 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
15473 {
15474 exp->member.member->classSym = exp->member.member->_class->symbol;
15475 }
15476 ProcessExpressionType(exp->member.exp);
15477 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)
15478 {
15479 exp->isConstant = 0x0;
15480 }
15481 else
15482 exp->isConstant = exp->member.exp->isConstant;
15483 type = exp->member.exp->expType;
15484 yylloc = exp->loc;
15485 if(type && (type->kind == 20))
15486 {
15487 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
15488 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
15489
15490 if(_class)
15491 {
15492 for(param = _class->templateParams.first; param; param = param->next)
15493 {
15494 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
15495 break;
15496 }
15497 }
15498 if(param && param->defaultArg.member)
15499 {
15500 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
15501
15502 if(argExp)
15503 {
15504 struct Expression * expMember = exp->member.exp;
15505 struct Declarator * decl;
15506 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15507 char thisClassTypeString[1024];
15508
15509 FreeIdentifier(exp->member.member);
15510 ProcessExpressionType(argExp);
15511 {
15512 char * colon = strstr(param->defaultArg.memberString, "::");
15513
15514 if(colon)
15515 {
15516 char className[1024];
15517 struct __ecereNameSpace__ecere__com__Class * sClass;
15518
15519 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
15520 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
15521 }
15522 else
15523 strcpy(thisClassTypeString, _class->fullName);
15524 }
15525 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
15526 exp->expType = ProcessType(specs, decl);
15527 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
15528 {
15529 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
15530 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
15531 int c;
15532 int paramCount = 0;
15533 int lastParam = -1;
15534 char templateString[1024];
15535 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
15536
15537 sprintf(templateString, "%s<", expClass->templateClass->fullName);
15538 for(cClass = expClass; cClass; cClass = cClass->base)
15539 {
15540 int p = 0;
15541
15542 for(param = cClass->templateParams.first; param; param = param->next)
15543 {
15544 int id = p;
15545 struct __ecereNameSpace__ecere__com__Class * sClass;
15546 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
15547
15548 for(sClass = cClass->base; sClass; sClass = sClass->base)
15549 id += sClass->templateParams.count;
15550 arg = expClass->templateArgs[id];
15551 for(sClass = _class; sClass; sClass = sClass->base)
15552 {
15553 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
15554 int p = 0;
15555 struct __ecereNameSpace__ecere__com__Class * nextClass;
15556
15557 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15558 p += nextClass->templateParams.count;
15559 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
15560 {
15561 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
15562 {
15563 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15564 {
15565 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
15566 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
15567 break;
15568 }
15569 }
15570 }
15571 }
15572 {
15573 char argument[256];
15574
15575 argument[0] = '\0';
15576 switch(param->type)
15577 {
15578 case 2:
15579 {
15580 char expString[1024];
15581 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15582 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
15583 struct Expression * exp;
15584 char * string = PrintHexUInt64(arg.expression.ui64);
15585
15586 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
15587 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
15588 ProcessExpressionType(exp);
15589 ComputeExpression(exp);
15590 expString[0] = '\0';
15591 PrintExpression(exp, expString);
15592 strcat(argument, expString);
15593 FreeExpression(exp);
15594 break;
15595 }
15596 case 1:
15597 {
15598 strcat(argument, arg.member->name);
15599 break;
15600 }
15601 case 0:
15602 {
15603 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15604 {
15605 if(!strcmp(arg.dataTypeString, "thisclass"))
15606 strcat(argument, thisClassTypeString);
15607 else
15608 strcat(argument, arg.dataTypeString);
15609 }
15610 break;
15611 }
15612 }
15613 if(argument[0])
15614 {
15615 if(paramCount)
15616 strcat(templateString, ", ");
15617 if(lastParam != p - 1)
15618 {
15619 strcat(templateString, param->name);
15620 strcat(templateString, " = ");
15621 }
15622 strcat(templateString, argument);
15623 paramCount++;
15624 lastParam = p;
15625 }
15626 p++;
15627 }
15628 }
15629 }
15630 {
15631 int len = strlen(templateString);
15632
15633 if(templateString[len - 1] == '>')
15634 templateString[len++] = ' ';
15635 templateString[len++] = '>';
15636 templateString[len++] = '\0';
15637 }
15638 {
15639 struct Context * context = SetupTemplatesContext(_class);
15640
15641 FreeType(exp->expType);
15642 exp->expType = ProcessTypeString(templateString, 0x0);
15643 FinishTemplatesContext(context);
15644 }
15645 }
15646 exp->type = 5;
15647 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")))))))));
15648 }
15649 }
15650 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
15651 {
15652 type = ProcessTemplateParameterType(type->templateParameter);
15653 }
15654 }
15655 if(type && (type->kind == 20))
15656 ;
15657 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)))
15658 {
15659 struct Identifier * id = exp->member.member;
15660 int typeKind = type->kind;
15661 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));
15662
15663 if(typeKind == 19 && exp->member.exp->type == 24)
15664 {
15665 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
15666 typeKind = 8;
15667 }
15668 if(id)
15669 {
15670 if(typeKind == 3 || typeKind == 15)
15671 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
15672 else if(!_class)
15673 {
15674 if(type->kind == 8 && type->_class && type->_class->registered)
15675 {
15676 _class = type->_class->registered;
15677 }
15678 else if((type->kind == 12 || type->kind == 13) && type->type && type->type->kind == 1)
15679 {
15680 _class = FindClass("char *")->registered;
15681 }
15682 else if(type->kind == 13)
15683 {
15684 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
15685 FreeType(exp->expType);
15686 exp->expType = ProcessTypeString("uintptr", 0x0);
15687 exp->byReference = 0x1;
15688 }
15689 else
15690 {
15691 char string[1024] = "";
15692 struct Symbol * classSym;
15693
15694 PrintTypeNoConst(type, string, 0x0, 0x1);
15695 classSym = FindClass(string);
15696 if(classSym)
15697 _class = classSym->registered;
15698 }
15699 }
15700 }
15701 if(_class && id)
15702 {
15703 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
15704 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
15705 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
15706 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
15707 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
15708
15709 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
15710 exp->member.memberType = 1;
15711 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
15712 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
15713 if(typeKind != 19)
15714 {
15715 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
15716 {
15717 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
15718 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
15719 {
15720 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15721 if(prop)
15722 member = (((void *)0));
15723 }
15724 if(!member && !prop)
15725 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15726 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
15727 exp->member.thisPtr = 0x1;
15728 }
15729 else
15730 {
15731 if(!id->classSym)
15732 {
15733 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
15734 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
15735 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
15736 }
15737 if(!prop && !member)
15738 {
15739 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
15740 if(!method)
15741 {
15742 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15743 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
15744 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
15745 }
15746 }
15747 if(member && prop)
15748 {
15749 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
15750 prop = (((void *)0));
15751 else
15752 member = (((void *)0));
15753 }
15754 }
15755 }
15756 if(!prop && !member && !method)
15757 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
15758 if(!prop && !member && !method)
15759 {
15760 if(typeKind == 19)
15761 {
15762 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
15763 if(classProp)
15764 {
15765 exp->member.memberType = 5;
15766 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
15767 }
15768 else
15769 {
15770 char structName[1024];
15771 struct Identifier * id = exp->member.member;
15772 struct Expression * classExp = exp->member.exp;
15773
15774 type->refCount++;
15775 FreeType(classExp->expType);
15776 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
15777 strcpy(structName, "__ecereClassData_");
15778 FullClassNameCat(structName, type->_class->string, 0x0);
15779 exp->type = 9;
15780 exp->member.member = id;
15781 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"))))))));
15782 FreeType(type);
15783 ProcessExpressionType(exp);
15784 return ;
15785 }
15786 }
15787 else
15788 {
15789 struct Symbol * classSym = FindClass(id->string);
15790
15791 if(classSym)
15792 {
15793 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
15794
15795 if(convertClass)
15796 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
15797 }
15798 }
15799 }
15800 if(prop)
15801 {
15802 exp->member.memberType = 1;
15803 if(!prop->dataType)
15804 ProcessPropertyType(prop);
15805 exp->expType = prop->dataType;
15806 if(prop->dataType)
15807 prop->dataType->refCount++;
15808 }
15809 else if(member)
15810 {
15811 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
15812 {
15813 FreeExpContents(exp);
15814 exp->type = 0;
15815 exp->identifier = MkIdentifier("class");
15816 ProcessExpressionType(exp);
15817 return ;
15818 }
15819 exp->member.memberType = 3;
15820 DeclareStruct(_class->fullName, 0x0);
15821 if(!member->dataType)
15822 {
15823 struct Context * context = SetupTemplatesContext(_class);
15824
15825 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
15826 FinishTemplatesContext(context);
15827 }
15828 exp->expType = member->dataType;
15829 if(member->dataType)
15830 member->dataType->refCount++;
15831 }
15832 else if(revConvert)
15833 {
15834 exp->member.memberType = 4;
15835 exp->expType = MkClassType(revConvert->_class->fullName);
15836 }
15837 else if(method)
15838 {
15839 {
15840 exp->member.memberType = 2;
15841 }
15842 if(!method->dataType)
15843 ProcessMethodType(method);
15844 exp->expType = __extension__ ({
15845 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15846
15847 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1;
15848 });
15849 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
15850 exp->expType->usedClass = _class;
15851 }
15852 else if(!classProp)
15853 {
15854 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
15855 {
15856 FreeExpContents(exp);
15857 exp->type = 0;
15858 exp->identifier = MkIdentifier("class");
15859 FreeType(exp->expType);
15860 exp->expType = MkClassType("ecere::com::Class");
15861 return ;
15862 }
15863 yylloc = exp->member.member->loc;
15864 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
15865 if(inCompiler)
15866 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
15867 }
15868 if(_class && exp->expType)
15869 {
15870 struct __ecereNameSpace__ecere__com__Class * tClass;
15871
15872 tClass = _class;
15873 while(tClass && !tClass->templateClass)
15874 tClass = tClass->base;
15875 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
15876 {
15877 int id = 0;
15878 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15879 struct __ecereNameSpace__ecere__com__Class * sClass;
15880
15881 for(sClass = tClass; sClass; sClass = sClass->base)
15882 {
15883 id = 0;
15884 if(sClass->templateClass)
15885 sClass = sClass->templateClass;
15886 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15887 {
15888 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
15889 {
15890 for(sClass = sClass->base; sClass; sClass = sClass->base)
15891 id += sClass->templateParams.count;
15892 break;
15893 }
15894 id++;
15895 }
15896 if(curParam)
15897 break;
15898 }
15899 if(curParam && tClass->templateArgs[id].dataTypeString)
15900 {
15901 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
15902 struct Context * context = SetupTemplatesContext(tClass);
15903
15904 FreeType(exp->expType);
15905 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
15906 if(exp->expType)
15907 {
15908 if(exp->expType->kind == 21)
15909 {
15910 FreeType(exp->expType);
15911 exp->expType = ReplaceThisClassType(_class);
15912 }
15913 if(tClass->templateClass)
15914 exp->expType->passAsTemplate = 0x1;
15915 if(!exp->destType)
15916 {
15917 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
15918 if(exp->destType->kind == 21)
15919 {
15920 FreeType(exp->destType);
15921 exp->destType = ReplaceThisClassType(_class);
15922 }
15923 }
15924 }
15925 FinishTemplatesContext(context);
15926 }
15927 }
15928 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
15929 {
15930 int id = 0;
15931 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15932 struct __ecereNameSpace__ecere__com__Class * sClass;
15933
15934 for(sClass = tClass; sClass; sClass = sClass->base)
15935 {
15936 id = 0;
15937 if(sClass->templateClass)
15938 sClass = sClass->templateClass;
15939 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15940 {
15941 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
15942 {
15943 for(sClass = sClass->base; sClass; sClass = sClass->base)
15944 id += sClass->templateParams.count;
15945 break;
15946 }
15947 id++;
15948 }
15949 if(curParam)
15950 break;
15951 }
15952 if(curParam)
15953 {
15954 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
15955 struct Context * context = SetupTemplatesContext(tClass);
15956 struct Type * basicType;
15957
15958 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
15959 if(basicType)
15960 {
15961 if(basicType->kind == 21)
15962 {
15963 FreeType(basicType);
15964 basicType = ReplaceThisClassType(_class);
15965 }
15966 FreeType(exp->expType);
15967 exp->expType = __extension__ ({
15968 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15969
15970 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = basicType, __ecereInstance1;
15971 });
15972 if(!exp->destType)
15973 {
15974 exp->destType = exp->expType;
15975 exp->destType->refCount++;
15976 }
15977 {
15978 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
15979 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15980 struct Declarator * decl;
15981
15982 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
15983 *newExp = *exp;
15984 if(exp->destType)
15985 exp->destType->refCount++;
15986 if(exp->expType)
15987 exp->expType->refCount++;
15988 exp->type = 11;
15989 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
15990 exp->cast.exp = newExp;
15991 }
15992 }
15993 FinishTemplatesContext(context);
15994 }
15995 }
15996 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
15997 {
15998 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
15999
16000 if(expClass)
16001 {
16002 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
16003 int c;
16004 int p = 0;
16005 int paramCount = 0;
16006 int lastParam = -1;
16007 char templateString[1024];
16008 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
16009
16010 sprintf(templateString, "%s<", expClass->templateClass->fullName);
16011 while(cClass != expClass)
16012 {
16013 struct __ecereNameSpace__ecere__com__Class * sClass;
16014
16015 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
16016 ;
16017 cClass = sClass;
16018 for(param = cClass->templateParams.first; param; param = param->next)
16019 {
16020 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
16021 int c;
16022 int cp = 0;
16023 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
16024 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
16025
16026 while(cClassCur != tClass && !paramCur)
16027 {
16028 struct __ecereNameSpace__ecere__com__Class * sClassCur;
16029
16030 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
16031 ;
16032 cClassCur = sClassCur;
16033 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
16034 {
16035 if(!strcmp(paramCur->name, param->name))
16036 {
16037 break;
16038 }
16039 cp++;
16040 }
16041 }
16042 if(paramCur && paramCur->type == 0)
16043 arg = tClass->templateArgs[cp];
16044 else
16045 arg = expClass->templateArgs[p];
16046 {
16047 char argument[256];
16048
16049 argument[0] = '\0';
16050 switch(param->type)
16051 {
16052 case 2:
16053 {
16054 char expString[1024];
16055 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16056 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
16057 struct Expression * exp;
16058 char * string = PrintHexUInt64(arg.expression.ui64);
16059
16060 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
16061 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
16062 ProcessExpressionType(exp);
16063 ComputeExpression(exp);
16064 expString[0] = '\0';
16065 PrintExpression(exp, expString);
16066 strcat(argument, expString);
16067 FreeExpression(exp);
16068 break;
16069 }
16070 case 1:
16071 {
16072 strcat(argument, arg.member->name);
16073 break;
16074 }
16075 case 0:
16076 {
16077 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
16078 strcat(argument, arg.dataTypeString);
16079 break;
16080 }
16081 }
16082 if(argument[0])
16083 {
16084 if(paramCount)
16085 strcat(templateString, ", ");
16086 if(lastParam != p - 1)
16087 {
16088 strcat(templateString, param->name);
16089 strcat(templateString, " = ");
16090 }
16091 strcat(templateString, argument);
16092 paramCount++;
16093 lastParam = p;
16094 }
16095 }
16096 p++;
16097 }
16098 }
16099 {
16100 int len = strlen(templateString);
16101
16102 if(templateString[len - 1] == '>')
16103 templateString[len++] = ' ';
16104 templateString[len++] = '>';
16105 templateString[len++] = '\0';
16106 }
16107 FreeType(exp->expType);
16108 {
16109 struct Context * context = SetupTemplatesContext(tClass);
16110
16111 exp->expType = ProcessTypeString(templateString, 0x0);
16112 FinishTemplatesContext(context);
16113 }
16114 }
16115 }
16116 }
16117 }
16118 else
16119 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)");
16120 }
16121 else if(type && (type->kind == 9 || type->kind == 10))
16122 {
16123 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
16124
16125 if(memberType)
16126 {
16127 exp->expType = memberType;
16128 if(memberType)
16129 memberType->refCount++;
16130 }
16131 }
16132 else
16133 {
16134 char expString[10240];
16135
16136 expString[0] = '\0';
16137 if(inCompiler)
16138 {
16139 PrintExpression(exp, expString);
16140 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16141 }
16142 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "member operator on non-structure type expression %s\n", (((void *)0))), expString);
16143 }
16144 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
16145 {
16146 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
16147 {
16148 struct Identifier * id = exp->member.member;
16149 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));
16150
16151 if(_class)
16152 {
16153 FreeType(exp->expType);
16154 exp->expType = ReplaceThisClassType(_class);
16155 }
16156 }
16157 }
16158 yylloc = oldyylloc;
16159 break;
16160 }
16161 case 9:
16162 {
16163 struct Type * destType = exp->destType;
16164
16165 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
16166 {
16167 exp->member.member->classSym = exp->member.member->_class->symbol;
16168 }
16169 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
16170 exp->type = 8;
16171 if(destType)
16172 destType->count++;
16173 ProcessExpressionType(exp);
16174 if(destType)
16175 destType->count--;
16176 break;
16177 }
16178 case 15:
16179 {
16180 struct Symbol * classSym = exp->_class->symbol;
16181
16182 if(classSym && classSym->registered)
16183 {
16184 if(classSym->registered->type == 5)
16185 {
16186 char name[1024];
16187
16188 name[0] = '\0';
16189 DeclareStruct(classSym->string, 0x0);
16190 FreeSpecifier(exp->_class);
16191 exp->type = 10;
16192 FullClassNameCat(name, classSym->string, 0x0);
16193 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
16194 }
16195 else
16196 {
16197 if(classSym->registered->fixed)
16198 {
16199 FreeSpecifier(exp->_class);
16200 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
16201 exp->type = 2;
16202 }
16203 else
16204 {
16205 char className[1024];
16206
16207 strcpy(className, "__ecereClass_");
16208 FullClassNameCat(className, classSym->string, 0x1);
16209 MangleClassName(className);
16210 DeclareClass(classSym, className);
16211 FreeExpContents(exp);
16212 exp->type = 9;
16213 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
16214 exp->member.member = MkIdentifier("structSize");
16215 }
16216 }
16217 }
16218 exp->expType = __extension__ ({
16219 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16220
16221 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
16222 });
16223 break;
16224 }
16225 case 10:
16226 {
16227 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
16228
16229 exp->expType = __extension__ ({
16230 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16231
16232 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
16233 });
16234 exp->isConstant = 0x1;
16235 DeclareType(type, 0x0, 0x0);
16236 FreeType(type);
16237 break;
16238 }
16239 case 11:
16240 {
16241 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
16242
16243 type->count = 1;
16244 FreeType(exp->cast.exp->destType);
16245 exp->cast.exp->destType = type;
16246 type->refCount++;
16247 ProcessExpressionType(exp->cast.exp);
16248 type->count = 0;
16249 exp->expType = type;
16250 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
16251 {
16252 void * prev = exp->prev, * next = exp->next;
16253 struct Type * expType = exp->cast.exp->destType;
16254 struct Expression * castExp = exp->cast.exp;
16255 struct Type * destType = exp->destType;
16256
16257 if(expType)
16258 expType->refCount++;
16259 FreeType(exp->expType);
16260 FreeTypeName(exp->cast.typeName);
16261 *exp = *castExp;
16262 FreeType(exp->expType);
16263 FreeType(exp->destType);
16264 exp->expType = expType;
16265 exp->destType = destType;
16266 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
16267 exp->prev = prev;
16268 exp->next = next;
16269 }
16270 else
16271 {
16272 exp->isConstant = exp->cast.exp->isConstant;
16273 }
16274 break;
16275 }
16276 case 33:
16277 {
16278 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
16279
16280 exp->expType = type;
16281 break;
16282 }
16283 case 34:
16284 {
16285 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
16286
16287 ProcessExpressionType(exp->vaArg.exp);
16288 exp->expType = type;
16289 break;
16290 }
16291 case 12:
16292 {
16293 struct Expression * e;
16294
16295 exp->isConstant = 0x1;
16296 FreeType(exp->cond.cond->destType);
16297 exp->cond.cond->destType = MkClassType("bool");
16298 exp->cond.cond->destType->truth = 0x1;
16299 ProcessExpressionType(exp->cond.cond);
16300 if(!exp->cond.cond->isConstant)
16301 exp->isConstant = 0x0;
16302 for(e = (*exp->cond.exp).first; e; e = e->next)
16303 {
16304 if(!e->next)
16305 {
16306 FreeType(e->destType);
16307 e->destType = exp->destType;
16308 if(e->destType)
16309 e->destType->refCount++;
16310 }
16311 ProcessExpressionType(e);
16312 if(!e->next)
16313 {
16314 exp->expType = e->expType;
16315 if(e->expType)
16316 e->expType->refCount++;
16317 }
16318 if(!e->isConstant)
16319 exp->isConstant = 0x0;
16320 }
16321 FreeType(exp->cond.elseExp->destType);
16322 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
16323 if(exp->cond.elseExp->destType)
16324 exp->cond.elseExp->destType->refCount++;
16325 ProcessExpressionType(exp->cond.elseExp);
16326 if(!exp->cond.elseExp->isConstant)
16327 exp->isConstant = 0x0;
16328 break;
16329 }
16330 case 23:
16331 {
16332 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
16333 {
16334 struct Statement * last = (*exp->compound->compound.statements).last;
16335
16336 if(last->type == 3 && last->expressions && (*last->expressions).last)
16337 {
16338 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
16339 if(exp->destType)
16340 exp->destType->refCount++;
16341 }
16342 ProcessStatement(exp->compound);
16343 exp->expType = (last->expressions && (*last->expressions).last) ? ((struct Expression *)(*last->expressions).last)->expType : (((void *)0));
16344 if(exp->expType)
16345 exp->expType->refCount++;
16346 }
16347 break;
16348 }
16349 case 24:
16350 {
16351 struct Specifier * spec = (*exp->_classExp.specifiers).first;
16352
16353 if(spec && spec->type == 1)
16354 {
16355 exp->expType = MkClassType(spec->name);
16356 exp->expType->kind = 19;
16357 exp->byReference = 0x1;
16358 }
16359 else
16360 {
16361 exp->expType = MkClassType("ecere::com::Class");
16362 exp->byReference = 0x1;
16363 }
16364 break;
16365 }
16366 case 25:
16367 {
16368 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
16369
16370 if(_class)
16371 {
16372 struct Identifier * id = exp->classData.id;
16373 char structName[1024];
16374 struct Expression * classExp;
16375
16376 strcpy(structName, "__ecereClassData_");
16377 FullClassNameCat(structName, _class->fullName, 0x0);
16378 exp->type = 9;
16379 exp->member.member = id;
16380 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
16381 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
16382 else
16383 classExp = MkExpIdentifier(MkIdentifier("class"));
16384 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"))))))));
16385 ProcessExpressionType(exp);
16386 return ;
16387 }
16388 break;
16389 }
16390 case 35:
16391 {
16392 struct Type * type = (((void *)0));
16393 char * typeString = (((void *)0));
16394 char typeStringBuf[1024];
16395
16396 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))
16397 {
16398 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
16399
16400 typeString = templateClass->templateArgs[2].dataTypeString;
16401 }
16402 else if(exp->list)
16403 {
16404 struct Expression * e;
16405
16406 for(e = (*exp->list).first; e; e = e->next)
16407 {
16408 ProcessExpressionType(e);
16409 if(e->expType)
16410 {
16411 if(!type)
16412 {
16413 type = e->expType;
16414 type->refCount++;
16415 }
16416 else
16417 {
16418 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
16419 {
16420 FreeType(type);
16421 type = e->expType;
16422 e->expType = (((void *)0));
16423 e = (*exp->list).first;
16424 ProcessExpressionType(e);
16425 if(e->expType)
16426 {
16427 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
16428 {
16429 FreeType(e->expType);
16430 e->expType = (((void *)0));
16431 FreeType(type);
16432 type = (((void *)0));
16433 break;
16434 }
16435 }
16436 }
16437 }
16438 if(e->expType)
16439 {
16440 FreeType(e->expType);
16441 e->expType = (((void *)0));
16442 }
16443 }
16444 }
16445 if(type)
16446 {
16447 typeStringBuf[0] = '\0';
16448 PrintTypeNoConst(type, typeStringBuf, 0x0, 0x1);
16449 typeString = typeStringBuf;
16450 FreeType(type);
16451 type = (((void *)0));
16452 }
16453 }
16454 if(typeString)
16455 {
16456 char templateString[1024];
16457 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
16458 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
16459 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16460 struct Expression * expExt;
16461 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16462
16463 sprintf(templateString, "Container<%s>", typeString);
16464 if(exp->list)
16465 {
16466 struct Expression * e;
16467
16468 type = ProcessTypeString(typeString, 0x0);
16469 while(e = (*exp->list).first)
16470 {
16471 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
16472 e->destType = type;
16473 type->refCount++;
16474 ProcessExpressionType(e);
16475 ListAdd(initializers, MkInitializerAssignment(e));
16476 }
16477 FreeType(type);
16478 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
16479 }
16480 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
16481 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
16482 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16483 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
16484 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16485 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
16486 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16487 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
16488 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16489 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
16490 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16491
16492 __ecereInstance1->type = 2, __ecereInstance1->constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, (void *)0), __ecereInstance1;
16493 })));
16494 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16495 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
16496 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16497 exp->expType = ProcessTypeString(templateString, 0x0);
16498 exp->type = 5;
16499 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
16500 ProcessExpressionType(expExt);
16501 }
16502 else
16503 {
16504 exp->expType = ProcessTypeString("Container", 0x0);
16505 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
16506 }
16507 break;
16508 }
16509 }
16510 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
16511 {
16512 FreeType(exp->expType);
16513 exp->expType = ReplaceThisClassType(thisClass);
16514 }
16515 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
16516 {
16517 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
16518
16519 if(symbol)
16520 {
16521 if(exp->expType->kind != 15)
16522 {
16523 struct Type * member;
16524 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
16525
16526 FreeType(exp->expType);
16527 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16528 exp->expType->kind = symbol->type->kind;
16529 exp->expType->refCount++;
16530 exp->expType->enumName = enumName;
16531 exp->expType->members = symbol->type->members;
16532 for(member = symbol->type->members.first; member; member = member->next)
16533 member->refCount++;
16534 }
16535 else
16536 {
16537 struct __ecereNameSpace__ecere__sys__NamedLink * member;
16538
16539 for(member = symbol->type->members.first; member; member = member->next)
16540 {
16541 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(structSize_NamedLink), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
16542
16543 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
16544 }
16545 }
16546 }
16547 }
16548 yylloc = exp->loc;
16549 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
16550 ;
16551 else if(exp->destType && !exp->destType->keepCast)
16552 {
16553 if(!CheckExpressionType(exp, exp->destType, 0x0))
16554 {
16555 if(!exp->destType->count || unresolved)
16556 {
16557 if(!exp->expType)
16558 {
16559 yylloc = exp->loc;
16560 if(exp->destType->kind != 14)
16561 {
16562 char type2[1024];
16563
16564 type2[0] = '\0';
16565 if(inCompiler)
16566 {
16567 char expString[10240];
16568
16569 expString[0] = '\0';
16570 PrintType(exp->destType, type2, 0x0, 0x1);
16571 if(inCompiler)
16572 {
16573 PrintExpression(exp, expString);
16574 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16575 }
16576 if(unresolved)
16577 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
16578 else if(exp->type != 16)
16579 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
16580 }
16581 }
16582 else
16583 {
16584 char expString[10240];
16585
16586 expString[0] = '\0';
16587 if(inCompiler)
16588 {
16589 PrintExpression(exp, expString);
16590 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16591 }
16592 if(unresolved)
16593 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), expString);
16594 else if(exp->type != 16)
16595 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16596 }
16597 }
16598 else
16599 {
16600 char type1[1024];
16601 char type2[1024];
16602
16603 type1[0] = '\0';
16604 type2[0] = '\0';
16605 if(inCompiler)
16606 {
16607 PrintType(exp->expType, type1, 0x0, 0x1);
16608 PrintType(exp->destType, type2, 0x0, 0x1);
16609 }
16610 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)))
16611 ;
16612 else
16613 {
16614 char expString[10240];
16615
16616 expString[0] = '\0';
16617 if(inCompiler)
16618 {
16619 PrintExpression(exp, expString);
16620 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16621 }
16622 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
16623 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
16624 FreeType(exp->expType);
16625 exp->destType->refCount++;
16626 exp->expType = exp->destType;
16627 }
16628 }
16629 }
16630 }
16631 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
16632 {
16633 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16634 char typeString[1024];
16635 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16636 struct Declarator * decl;
16637
16638 typeString[0] = '\0';
16639 *newExp = *exp;
16640 if(exp->expType)
16641 exp->expType->refCount++;
16642 if(exp->expType)
16643 exp->expType->refCount++;
16644 exp->type = 11;
16645 newExp->destType = exp->expType;
16646 PrintType(exp->expType, typeString, 0x0, 0x0);
16647 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16648 exp->cast.typeName = MkTypeName(specs, decl);
16649 exp->cast.exp = newExp;
16650 }
16651 }
16652 else if(unresolved)
16653 {
16654 if(exp->identifier->_class && exp->identifier->_class->name)
16655 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
16656 else if(exp->identifier->string && exp->identifier->string[0])
16657 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
16658 }
16659 else if(!exp->expType && exp->type != 16)
16660 {
16661 char expString[10240];
16662
16663 expString[0] = '\0';
16664 if(inCompiler)
16665 {
16666 PrintExpression(exp, expString);
16667 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16668 }
16669 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16670 }
16671 if(inCompiler)
16672 ApplyAnyObjectLogic(exp);
16673 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)))
16674 {
16675 exp->byReference = 0x1;
16676 }
16677 yylloc = oldyylloc;
16678 }
16679
16680 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)
16681 {
16682 if(*curMember)
16683 {
16684 *curMember = (*curMember)->next;
16685 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
16686 {
16687 *curMember = subMemberStack[--(*subMemberStackPos)];
16688 *curMember = (*curMember)->next;
16689 }
16690 while((*curMember) && (*curMember)->isProperty)
16691 *curMember = (*curMember)->next;
16692 if(subMemberStackPos)
16693 {
16694 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
16695 {
16696 subMemberStack[(*subMemberStackPos)++] = *curMember;
16697 *curMember = (*curMember)->members.first;
16698 while(*curMember && (*curMember)->isProperty)
16699 *curMember = (*curMember)->next;
16700 }
16701 }
16702 }
16703 while(!*curMember)
16704 {
16705 if(!*curMember)
16706 {
16707 if(subMemberStackPos && *subMemberStackPos)
16708 {
16709 *curMember = subMemberStack[--(*subMemberStackPos)];
16710 *curMember = (*curMember)->next;
16711 }
16712 else
16713 {
16714 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
16715
16716 if(*curClass == _class)
16717 break;
16718 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
16719 ;
16720 *curMember = (*curClass)->membersAndProperties.first;
16721 }
16722 while((*curMember) && (*curMember)->isProperty)
16723 *curMember = (*curMember)->next;
16724 if(subMemberStackPos)
16725 {
16726 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
16727 {
16728 subMemberStack[(*subMemberStackPos)++] = *curMember;
16729 *curMember = (*curMember)->members.first;
16730 while(*curMember && (*curMember)->isProperty)
16731 *curMember = (*curMember)->next;
16732 }
16733 }
16734 }
16735 }
16736 }
16737
16738 static void ProcessInitializer(struct Initializer * init, struct Type * type)
16739 {
16740 switch(init->type)
16741 {
16742 case 0:
16743 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
16744 {
16745 if(init->exp && !init->exp->destType)
16746 {
16747 FreeType(init->exp->destType);
16748 init->exp->destType = type;
16749 if(type)
16750 type->refCount++;
16751 }
16752 if(init->exp)
16753 {
16754 ProcessExpressionType(init->exp);
16755 init->isConstant = init->exp->isConstant;
16756 }
16757 break;
16758 }
16759 else
16760 {
16761 struct Expression * exp = init->exp;
16762 struct Instantiation * inst = exp->instance;
16763 struct MembersInit * members;
16764
16765 init->type = 1;
16766 init->list = MkList();
16767 if(inst->members)
16768 {
16769 for(members = (*inst->members).first; members; members = members->next)
16770 {
16771 if(members->type == 0)
16772 {
16773 struct MemberInit * member;
16774
16775 for(member = (*members->dataMembers).first; member; member = member->next)
16776 {
16777 ListAdd(init->list, member->initializer);
16778 member->initializer = (((void *)0));
16779 }
16780 }
16781 }
16782 }
16783 FreeExpression(exp);
16784 }
16785 case 1:
16786 {
16787 struct Initializer * i;
16788 struct Type * initializerType = (((void *)0));
16789 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
16790 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
16791 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
16792 int subMemberStackPos = 0;
16793
16794 if(type && type->kind == 12)
16795 initializerType = Dereference(type);
16796 else if(type && (type->kind == 9 || type->kind == 10))
16797 initializerType = type->members.first;
16798 for(i = (*init->list).first; i; i = i->next)
16799 {
16800 if(type && type->kind == 8 && type->_class && type->_class->registered)
16801 {
16802 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
16803 if(curMember)
16804 {
16805 if(!curMember->dataType)
16806 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
16807 initializerType = curMember->dataType;
16808 }
16809 }
16810 ProcessInitializer(i, initializerType);
16811 if(initializerType && type && (type->kind == 9 || type->kind == 10))
16812 initializerType = initializerType->next;
16813 if(!i->isConstant)
16814 init->isConstant = 0x0;
16815 }
16816 if(type && type->kind == 12)
16817 FreeType(initializerType);
16818 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
16819 {
16820 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Assigning list initializer to non list\n", (((void *)0))));
16821 }
16822 break;
16823 }
16824 }
16825 }
16826
16827 extern struct Symbol * FindType(struct Context * ctx, char *  name);
16828
16829 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
16830
16831 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
16832 {
16833 switch(spec->type)
16834 {
16835 case 0:
16836 {
16837 if(spec->specifier == THISCLASS)
16838 {
16839 if(thisClass)
16840 {
16841 spec->type = 1;
16842 spec->name = ReplaceThisClass(thisClass);
16843 spec->symbol = FindClass(spec->name);
16844 ProcessSpecifier(spec, declareStruct);
16845 }
16846 }
16847 break;
16848 }
16849 case 1:
16850 {
16851 struct Symbol * symbol = FindType(curContext, spec->name);
16852
16853 if(symbol)
16854 DeclareType(symbol->type, 0x1, 0x1);
16855 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
16856 DeclareStruct(spec->name, 0x0);
16857 break;
16858 }
16859 case 2:
16860 {
16861 struct Enumerator * e;
16862
16863 if(spec->list)
16864 {
16865 for(e = (*spec->list).first; e; e = e->next)
16866 {
16867 if(e->exp)
16868 ProcessExpressionType(e->exp);
16869 }
16870 }
16871 break;
16872 }
16873 case 3:
16874 case 4:
16875 {
16876 if(spec->definitions)
16877 {
16878 struct ClassDef * def;
16879 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
16880
16881 ProcessClass(spec->definitions, symbol);
16882 }
16883 break;
16884 }
16885 }
16886 }
16887
16888 static void ProcessDeclarator(struct Declarator * decl)
16889 {
16890 switch(decl->type)
16891 {
16892 case 1:
16893 if(decl->identifier->classSym)
16894 {
16895 FreeSpecifier(decl->identifier->_class);
16896 decl->identifier->_class = (((void *)0));
16897 }
16898 break;
16899 case 3:
16900 if(decl->array.exp)
16901 ProcessExpressionType(decl->array.exp);
16902 case 0:
16903 case 2:
16904 case 4:
16905 case 5:
16906 case 6:
16907 case 7:
16908 if(decl->declarator)
16909 ProcessDeclarator(decl->declarator);
16910 if(decl->type == 4)
16911 {
16912 struct Identifier * id = GetDeclId(decl);
16913
16914 if(id && id->_class)
16915 {
16916 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
16917
16918 if(!decl->function.parameters)
16919 decl->function.parameters = MkList();
16920 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
16921 id->_class = (((void *)0));
16922 }
16923 if(decl->function.parameters)
16924 {
16925 struct TypeName * param;
16926
16927 for(param = (*decl->function.parameters).first; param; param = param->next)
16928 {
16929 if(param->qualifiers && (*param->qualifiers).first)
16930 {
16931 struct Specifier * spec = (*param->qualifiers).first;
16932
16933 if(spec && spec->specifier == TYPED_OBJECT)
16934 {
16935 struct Declarator * d = param->declarator;
16936 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);
16937
16938 FreeList(param->qualifiers, FreeSpecifier);
16939 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
16940 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
16941 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
16942 param = newParam;
16943 }
16944 else if(spec && spec->specifier == ANY_OBJECT)
16945 {
16946 struct Declarator * d = param->declarator;
16947
16948 FreeList(param->qualifiers, FreeSpecifier);
16949 param->qualifiers = MkListOne(MkSpecifier(VOID));
16950 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
16951 }
16952 else if(spec->specifier == THISCLASS)
16953 {
16954 if(thisClass)
16955 {
16956 spec->type = 1;
16957 spec->name = ReplaceThisClass(thisClass);
16958 spec->symbol = FindClass(spec->name);
16959 ProcessSpecifier(spec, 0x0);
16960 }
16961 }
16962 }
16963 if(param->declarator)
16964 ProcessDeclarator(param->declarator);
16965 }
16966 }
16967 }
16968 break;
16969 }
16970 }
16971
16972 extern struct Identifier * CopyIdentifier(struct Identifier * id);
16973
16974 extern void FreeInitDeclarator(struct InitDeclarator * decl);
16975
16976 static void ProcessDeclaration(struct Declaration * decl)
16977 {
16978 yylloc = decl->loc;
16979 switch(decl->type)
16980 {
16981 case 1:
16982 {
16983 unsigned int declareStruct = 0x0;
16984
16985 if(decl->declarators)
16986 {
16987 struct InitDeclarator * d;
16988
16989 for(d = (*decl->declarators).first; d; d = d->next)
16990 {
16991 struct Type * type, * subType;
16992
16993 ProcessDeclarator(d->declarator);
16994 type = ProcessType(decl->specifiers, d->declarator);
16995 if(d->initializer)
16996 {
16997 ProcessInitializer(d->initializer, type);
16998 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
16999 {
17000 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
17001 {
17002 struct Instantiation * inst = d->initializer->exp->instance;
17003
17004 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
17005 d->initializer->exp->instance = (((void *)0));
17006 if(decl->specifiers)
17007 FreeList(decl->specifiers, FreeSpecifier);
17008 FreeList(decl->declarators, FreeInitDeclarator);
17009 d = (((void *)0));
17010 decl->type = 2;
17011 decl->inst = inst;
17012 }
17013 }
17014 }
17015 for(subType = type; subType; )
17016 {
17017 if(subType->kind == 8)
17018 {
17019 declareStruct = 0x1;
17020 break;
17021 }
17022 else if(subType->kind == 13)
17023 break;
17024 else if(subType->kind == 12)
17025 subType = subType->arrayType;
17026 else
17027 break;
17028 }
17029 FreeType(type);
17030 if(!d)
17031 break;
17032 }
17033 }
17034 if(decl->specifiers)
17035 {
17036 struct Specifier * s;
17037
17038 for(s = (*decl->specifiers).first; s; s = s->next)
17039 {
17040 ProcessSpecifier(s, declareStruct);
17041 }
17042 }
17043 break;
17044 }
17045 case 2:
17046 {
17047 ProcessInstantiationType(decl->inst);
17048 break;
17049 }
17050 case 0:
17051 {
17052 struct Specifier * spec;
17053 struct Declarator * d;
17054 unsigned int declareStruct = 0x0;
17055
17056 if(decl->declarators)
17057 {
17058 for(d = (*decl->declarators).first; d; d = d->next)
17059 {
17060 struct Type * type = ProcessType(decl->specifiers, d->declarator);
17061 struct Type * subType;
17062
17063 ProcessDeclarator(d);
17064 for(subType = type; subType; )
17065 {
17066 if(subType->kind == 8)
17067 {
17068 declareStruct = 0x1;
17069 break;
17070 }
17071 else if(subType->kind == 13)
17072 break;
17073 else if(subType->kind == 12)
17074 subType = subType->arrayType;
17075 else
17076 break;
17077 }
17078 FreeType(type);
17079 }
17080 }
17081 if(decl->specifiers)
17082 {
17083 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
17084 ProcessSpecifier(spec, declareStruct);
17085 }
17086 break;
17087 }
17088 }
17089 }
17090
17091 static struct FunctionDefinition * curFunction;
17092
17093 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
17094 {
17095 char propName[1024], propNameM[1024];
17096 char getName[1024], setName[1024];
17097 struct __ecereNameSpace__ecere__sys__OldList * args;
17098
17099 DeclareProperty(prop, setName, getName);
17100 strcpy(propName, "__ecereProp_");
17101 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17102 strcat(propName, "_");
17103 FullClassNameCat(propName, prop->name, 0x1);
17104 MangleClassName(propName);
17105 strcpy(propNameM, "__ecerePropM_");
17106 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
17107 strcat(propNameM, "_");
17108 FullClassNameCat(propNameM, prop->name, 0x1);
17109 MangleClassName(propNameM);
17110 if(prop->isWatchable)
17111 {
17112 args = MkList();
17113 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17114 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17115 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17116 args = MkList();
17117 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17118 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17119 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17120 }
17121 {
17122 args = MkList();
17123 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17124 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17125 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17126 args = MkList();
17127 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17128 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17129 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17130 }
17131 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
17132 curFunction->propSet->fireWatchersDone = 0x1;
17133 }
17134
17135 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
17136
17137 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
17138
17139 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
17140
17141 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
17142
17143 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
17144
17145 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
17146
17147 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
17148
17149 extern void FreePropertyWatch(struct PropertyWatch * watcher);
17150
17151 static void ProcessStatement(struct Statement * stmt)
17152 {
17153 yylloc = stmt->loc;
17154 switch(stmt->type)
17155 {
17156 case 0:
17157 ProcessStatement(stmt->labeled.stmt);
17158 break;
17159 case 1:
17160 if(stmt->caseStmt.exp)
17161 {
17162 FreeType(stmt->caseStmt.exp->destType);
17163 stmt->caseStmt.exp->destType = curSwitchType;
17164 if(curSwitchType)
17165 curSwitchType->refCount++;
17166 ProcessExpressionType(stmt->caseStmt.exp);
17167 ComputeExpression(stmt->caseStmt.exp);
17168 }
17169 if(stmt->caseStmt.stmt)
17170 ProcessStatement(stmt->caseStmt.stmt);
17171 break;
17172 case 2:
17173 {
17174 if(stmt->compound.context)
17175 {
17176 struct Declaration * decl;
17177 struct Statement * s;
17178 struct Statement * prevCompound = curCompound;
17179 struct Context * prevContext = curContext;
17180
17181 if(!stmt->compound.isSwitch)
17182 curCompound = stmt;
17183 curContext = stmt->compound.context;
17184 if(stmt->compound.declarations)
17185 {
17186 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
17187 ProcessDeclaration(decl);
17188 }
17189 if(stmt->compound.statements)
17190 {
17191 for(s = (*stmt->compound.statements).first; s; s = s->next)
17192 ProcessStatement(s);
17193 }
17194 curContext = prevContext;
17195 curCompound = prevCompound;
17196 }
17197 break;
17198 }
17199 case 3:
17200 {
17201 struct Expression * exp;
17202
17203 if(stmt->expressions)
17204 {
17205 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
17206 ProcessExpressionType(exp);
17207 }
17208 break;
17209 }
17210 case 4:
17211 {
17212 struct Expression * exp;
17213
17214 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
17215 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
17216 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
17217 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
17218 {
17219 ProcessExpressionType(exp);
17220 }
17221 if(stmt->ifStmt.stmt)
17222 ProcessStatement(stmt->ifStmt.stmt);
17223 if(stmt->ifStmt.elseStmt)
17224 ProcessStatement(stmt->ifStmt.elseStmt);
17225 break;
17226 }
17227 case 5:
17228 {
17229 struct Type * oldSwitchType = curSwitchType;
17230
17231 if(stmt->switchStmt.exp)
17232 {
17233 struct Expression * exp;
17234
17235 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
17236 {
17237 if(!exp->next)
17238 {
17239 ProcessExpressionType(exp);
17240 }
17241 if(!exp->next)
17242 curSwitchType = exp->expType;
17243 }
17244 }
17245 ProcessStatement(stmt->switchStmt.stmt);
17246 curSwitchType = oldSwitchType;
17247 break;
17248 }
17249 case 6:
17250 {
17251 if(stmt->whileStmt.exp)
17252 {
17253 struct Expression * exp;
17254
17255 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
17256 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
17257 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
17258 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
17259 {
17260 ProcessExpressionType(exp);
17261 }
17262 }
17263 if(stmt->whileStmt.stmt)
17264 ProcessStatement(stmt->whileStmt.stmt);
17265 break;
17266 }
17267 case 7:
17268 {
17269 if(stmt->doWhile.exp)
17270 {
17271 struct Expression * exp;
17272
17273 if((*stmt->doWhile.exp).last)
17274 {
17275 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
17276 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
17277 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
17278 }
17279 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
17280 {
17281 ProcessExpressionType(exp);
17282 }
17283 }
17284 if(stmt->doWhile.stmt)
17285 ProcessStatement(stmt->doWhile.stmt);
17286 break;
17287 }
17288 case 8:
17289 {
17290 struct Expression * exp;
17291
17292 if(stmt->forStmt.init)
17293 ProcessStatement(stmt->forStmt.init);
17294 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
17295 {
17296 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
17297 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
17298 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
17299 }
17300 if(stmt->forStmt.check)
17301 ProcessStatement(stmt->forStmt.check);
17302 if(stmt->forStmt.increment)
17303 {
17304 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
17305 ProcessExpressionType(exp);
17306 }
17307 if(stmt->forStmt.stmt)
17308 ProcessStatement(stmt->forStmt.stmt);
17309 break;
17310 }
17311 case 18:
17312 {
17313 struct Identifier * id = stmt->forEachStmt.id;
17314 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
17315 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
17316 struct Statement * block = stmt->forEachStmt.stmt;
17317 char iteratorType[1024];
17318 struct Type * source;
17319 struct Expression * e;
17320 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));
17321 struct Expression * arrayExp;
17322 char * typeString = (((void *)0));
17323 int builtinCount = 0;
17324
17325 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
17326 {
17327 if(!e->next)
17328 {
17329 FreeType(e->destType);
17330 e->destType = ProcessTypeString("Container", 0x0);
17331 }
17332 if(!isBuiltin || e->next)
17333 ProcessExpressionType(e);
17334 }
17335 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
17336 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
17337 {
17338 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
17339 struct Symbol * symbol;
17340 struct Expression * expIt = (((void *)0));
17341 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
17342 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
17343 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
17344 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
17345
17346 stmt->type = 2;
17347 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
17348 stmt->compound.context->parent = curContext;
17349 curContext = stmt->compound.context;
17350 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
17351 {
17352 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
17353 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
17354
17355 isCustomAVLTree = 0x1;
17356 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
17357 isAVLTree = 0x1;
17358 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
17359 isMap = 0x1;
17360 }
17361 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
17362 isArray = 0x1;
17363 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
17364 {
17365 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
17366
17367 isLinkList = 0x1;
17368 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
17369 }
17370 if(isArray)
17371 {
17372 struct Declarator * decl;
17373 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17374
17375 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
17376 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17377 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
17378 }
17379 else if(isBuiltin)
17380 {
17381 struct Type * type = (((void *)0));
17382 char typeStringBuf[1024];
17383
17384 arrayExp = (((struct Expression *)(*exp).last)->type == 35) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
17385 if(((struct Expression *)(*exp).last)->type == 11)
17386 {
17387 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
17388
17389 if(typeName)
17390 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
17391 }
17392 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)
17393 {
17394 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
17395
17396 typeString = templateClass->templateArgs[2].dataTypeString;
17397 }
17398 else if(arrayExp->list)
17399 {
17400 struct Expression * e;
17401
17402 for(e = (*arrayExp->list).first; e; e = e->next)
17403 {
17404 ProcessExpressionType(e);
17405 if(e->expType)
17406 {
17407 if(!type)
17408 {
17409 type = e->expType;
17410 type->refCount++;
17411 }
17412 else
17413 {
17414 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
17415 {
17416 FreeType(type);
17417 type = e->expType;
17418 e->expType = (((void *)0));
17419 e = (*arrayExp->list).first;
17420 ProcessExpressionType(e);
17421 if(e->expType)
17422 {
17423 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
17424 {
17425 FreeType(e->expType);
17426 e->expType = (((void *)0));
17427 FreeType(type);
17428 type = (((void *)0));
17429 break;
17430 }
17431 }
17432 }
17433 }
17434 if(e->expType)
17435 {
17436 FreeType(e->expType);
17437 e->expType = (((void *)0));
17438 }
17439 }
17440 }
17441 if(type)
17442 {
17443 typeStringBuf[0] = '\0';
17444 PrintType(type, typeStringBuf, 0x0, 0x1);
17445 typeString = typeStringBuf;
17446 FreeType(type);
17447 }
17448 }
17449 if(typeString)
17450 {
17451 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
17452 struct Declarator * decl;
17453 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17454
17455 if(arrayExp->list)
17456 {
17457 struct Expression * e;
17458
17459 builtinCount = (*arrayExp->list).count;
17460 type = ProcessTypeString(typeString, 0x0);
17461 while(e = (*arrayExp->list).first)
17462 {
17463 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
17464 e->destType = type;
17465 type->refCount++;
17466 ProcessExpressionType(e);
17467 ListAdd(initializers, MkInitializerAssignment(e));
17468 }
17469 FreeType(type);
17470 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
17471 }
17472 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
17473 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
17474 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
17475 FreeList(exp, FreeExpression);
17476 }
17477 else
17478 {
17479 arrayExp->expType = ProcessTypeString("Container", 0x0);
17480 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
17481 }
17482 }
17483 else if(isLinkList && !isList)
17484 {
17485 struct Declarator * decl;
17486 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17487
17488 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
17489 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17490 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
17491 }
17492 else if(_class->templateArgs)
17493 {
17494 if(isMap)
17495 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
17496 else
17497 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
17498 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
17499 }
17500 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
17501 if(block)
17502 {
17503 switch(block->type)
17504 {
17505 case 2:
17506 if(block->compound.context)
17507 block->compound.context->parent = stmt->compound.context;
17508 break;
17509 case 4:
17510 if(block->ifStmt.stmt && block->ifStmt.stmt->type == 2 && block->ifStmt.stmt->compound.context)
17511 block->ifStmt.stmt->compound.context->parent = stmt->compound.context;
17512 if(block->ifStmt.elseStmt && block->ifStmt.elseStmt->type == 2 && block->ifStmt.elseStmt->compound.context)
17513 block->ifStmt.elseStmt->compound.context->parent = stmt->compound.context;
17514 break;
17515 case 5:
17516 if(block->switchStmt.stmt && block->switchStmt.stmt->type == 2 && block->switchStmt.stmt->compound.context)
17517 block->switchStmt.stmt->compound.context->parent = stmt->compound.context;
17518 break;
17519 case 6:
17520 if(block->whileStmt.stmt && block->whileStmt.stmt->type == 2 && block->whileStmt.stmt->compound.context)
17521 block->whileStmt.stmt->compound.context->parent = stmt->compound.context;
17522 break;
17523 case 7:
17524 if(block->doWhile.stmt && block->doWhile.stmt->type == 2 && block->doWhile.stmt->compound.context)
17525 block->doWhile.stmt->compound.context->parent = stmt->compound.context;
17526 break;
17527 case 8:
17528 if(block->forStmt.stmt && block->forStmt.stmt->type == 2 && block->forStmt.stmt->compound.context)
17529 block->forStmt.stmt->compound.context->parent = stmt->compound.context;
17530 break;
17531 case 18:
17532 if(block->forEachStmt.stmt && block->forEachStmt.stmt->type == 2 && block->forEachStmt.stmt->compound.context)
17533 block->forEachStmt.stmt->compound.context->parent = stmt->compound.context;
17534 break;
17535 }
17536 }
17537 if(filter)
17538 {
17539 block = MkIfStmt(filter, block, (((void *)0)));
17540 }
17541 if(isArray)
17542 {
17543 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));
17544 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17545 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17546 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17547 }
17548 else if(isBuiltin)
17549 {
17550 char count[128];
17551
17552 sprintf(count, "%d", builtinCount);
17553 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));
17554 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17555 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17556 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17557 }
17558 else if(isLinkList && !isList)
17559 {
17560 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
17561 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
17562
17563 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
17564 {
17565 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));
17566 }
17567 else
17568 {
17569 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17570 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
17571
17572 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));
17573 }
17574 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17575 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17576 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17577 }
17578 else
17579 {
17580 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
17581 }
17582 ProcessExpressionType(expIt);
17583 if((*stmt->compound.declarations).first)
17584 ProcessDeclaration((*stmt->compound.declarations).first);
17585 if(symbol)
17586 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
17587 ProcessStatement(stmt);
17588 curContext = stmt->compound.context->parent;
17589 break;
17590 }
17591 else
17592 {
17593 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Expression is not a container\n", (((void *)0))));
17594 }
17595 break;
17596 }
17597 case 9:
17598 break;
17599 case 10:
17600 break;
17601 case 11:
17602 break;
17603 case 12:
17604 {
17605 struct Expression * exp;
17606
17607 if(stmt->expressions)
17608 {
17609 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
17610 {
17611 if(!exp->next)
17612 {
17613 if(curFunction && !curFunction->type)
17614 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
17615 FreeType(exp->destType);
17616 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
17617 if(exp->destType)
17618 exp->destType->refCount++;
17619 }
17620 ProcessExpressionType(exp);
17621 }
17622 }
17623 break;
17624 }
17625 case 14:
17626 {
17627 ProcessDeclaration(stmt->decl);
17628 break;
17629 }
17630 case 13:
17631 {
17632 struct AsmField * field;
17633
17634 if(stmt->asmStmt.inputFields)
17635 {
17636 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
17637 if(field->expression)
17638 ProcessExpressionType(field->expression);
17639 }
17640 if(stmt->asmStmt.outputFields)
17641 {
17642 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
17643 if(field->expression)
17644 ProcessExpressionType(field->expression);
17645 }
17646 if(stmt->asmStmt.clobberedFields)
17647 {
17648 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
17649 {
17650 if(field->expression)
17651 ProcessExpressionType(field->expression);
17652 }
17653 }
17654 break;
17655 }
17656 case 17:
17657 {
17658 struct PropertyWatch * propWatch;
17659 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17660 struct Expression * object = stmt->_watch.object;
17661 struct Expression * watcher = stmt->_watch.watcher;
17662
17663 if(watcher)
17664 ProcessExpressionType(watcher);
17665 if(object)
17666 ProcessExpressionType(object);
17667 if(inCompiler)
17668 {
17669 if(watcher || thisClass)
17670 {
17671 struct External * external = curExternal;
17672 struct Context * context = curContext;
17673
17674 stmt->type = 3;
17675 stmt->expressions = MkList();
17676 curExternal = external->prev;
17677 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
17678 {
17679 struct ClassFunction * func;
17680 char watcherName[1024];
17681 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
17682 struct External * createdExternal;
17683 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
17684
17685 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
17686 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
17687 if(propWatch->deleteWatch)
17688 strcat(watcherName, "_delete");
17689 else
17690 {
17691 struct Identifier * propID;
17692
17693 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
17694 {
17695 strcat(watcherName, "_");
17696 strcat(watcherName, propID->string);
17697 }
17698 }
17699 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
17700 {
17701 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
17702 ProcessClassFunctionBody(func, propWatch->compound);
17703 propWatch->compound = (((void *)0));
17704 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
17705 createdExternal->symbol->idCode = external->symbol->idCode;
17706 curExternal = createdExternal;
17707 ProcessFunction(createdExternal->function);
17708 {
17709 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
17710
17711 externalDecl->declaration = decl;
17712 if(decl->symbol && !decl->symbol->pointerExternal)
17713 decl->symbol->pointerExternal = externalDecl;
17714 }
17715 if(propWatch->deleteWatch)
17716 {
17717 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17718
17719 ListAdd(args, CopyExpression(object));
17720 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17721 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
17722 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
17723 }
17724 else
17725 {
17726 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
17727 struct Identifier * propID;
17728
17729 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
17730 {
17731 char propName[1024];
17732 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17733
17734 if(prop)
17735 {
17736 char getName[1024], setName[1024];
17737 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17738
17739 DeclareProperty(prop, setName, getName);
17740 strcpy(propName, "__ecereProp_");
17741 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17742 strcat(propName, "_");
17743 FullClassNameCat(propName, prop->name, 0x1);
17744 ListAdd(args, CopyExpression(object));
17745 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17746 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17747 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
17748 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
17749 }
17750 else
17751 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
17752 }
17753 }
17754 }
17755 else
17756 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid watched object\n", (((void *)0))));
17757 }
17758 curExternal = external;
17759 curContext = context;
17760 if(watcher)
17761 FreeExpression(watcher);
17762 if(object)
17763 FreeExpression(object);
17764 FreeList(watches, FreePropertyWatch);
17765 }
17766 else
17767 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a _class\n", (((void *)0))));
17768 }
17769 else
17770 {
17771 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
17772 {
17773 ProcessStatement(propWatch->compound);
17774 }
17775 }
17776 break;
17777 }
17778 case 15:
17779 {
17780 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17781 struct Expression * object = stmt->_watch.object;
17782 struct __ecereNameSpace__ecere__com__Class * _class;
17783
17784 if(object)
17785 ProcessExpressionType(object);
17786 if(inCompiler)
17787 {
17788 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
17789 if(_class)
17790 {
17791 struct Identifier * propID;
17792
17793 stmt->type = 3;
17794 stmt->expressions = MkList();
17795 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
17796 {
17797 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
17798 }
17799 else if(!watches)
17800 {
17801 }
17802 if(watches)
17803 {
17804 for(propID = (*watches).first; propID; propID = propID->next)
17805 {
17806 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17807
17808 if(prop)
17809 {
17810 CreateFireWatcher(prop, object, stmt);
17811 }
17812 else
17813 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
17814 }
17815 }
17816 else
17817 {
17818 struct __ecereNameSpace__ecere__com__Property * prop;
17819 struct __ecereNameSpace__ecere__com__Class * base;
17820
17821 for(base = _class; base; base = base->base)
17822 {
17823 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
17824 {
17825 if(prop->isProperty && prop->isWatchable)
17826 {
17827 CreateFireWatcher(prop, object, stmt);
17828 }
17829 }
17830 }
17831 }
17832 if(object)
17833 FreeExpression(object);
17834 FreeList(watches, FreeIdentifier);
17835 }
17836 else
17837 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
17838 }
17839 break;
17840 }
17841 case 16:
17842 {
17843 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17844 struct Expression * object = stmt->_watch.object;
17845 struct Expression * watcher = stmt->_watch.watcher;
17846 struct __ecereNameSpace__ecere__com__Class * _class;
17847
17848 if(object)
17849 ProcessExpressionType(object);
17850 if(watcher)
17851 ProcessExpressionType(watcher);
17852 if(inCompiler)
17853 {
17854 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
17855 if(watcher || thisClass)
17856 {
17857 if(_class)
17858 {
17859 struct Identifier * propID;
17860
17861 stmt->type = 3;
17862 stmt->expressions = MkList();
17863 if(!watches)
17864 {
17865 struct __ecereNameSpace__ecere__sys__OldList * args;
17866
17867 args = MkList();
17868 ListAdd(args, CopyExpression(object));
17869 ListAdd(args, MkExpConstant("0"));
17870 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17871 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
17872 }
17873 else
17874 {
17875 for(propID = (*watches).first; propID; propID = propID->next)
17876 {
17877 char propName[1024];
17878 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17879
17880 if(prop)
17881 {
17882 char getName[1024], setName[1024];
17883 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17884
17885 DeclareProperty(prop, setName, getName);
17886 strcpy(propName, "__ecereProp_");
17887 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17888 strcat(propName, "_");
17889 FullClassNameCat(propName, prop->name, 0x1);
17890 MangleClassName(propName);
17891 ListAdd(args, CopyExpression(object));
17892 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17893 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17894 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
17895 }
17896 else
17897 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
17898 }
17899 }
17900 if(object)
17901 FreeExpression(object);
17902 if(watcher)
17903 FreeExpression(watcher);
17904 FreeList(watches, FreeIdentifier);
17905 }
17906 else
17907 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
17908 }
17909 else
17910 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
17911 }
17912 break;
17913 }
17914 }
17915 }
17916
17917 extern struct Expression * QBrackets(struct Expression * exp);
17918
17919 extern struct TypeName * QMkType(char *  spec, struct Declarator * decl);
17920
17921 extern struct Declarator * QMkPtrDecl(char *  id);
17922
17923 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
17924
17925 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
17926
17927 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
17928
17929 static void ProcessFunction(struct FunctionDefinition * function)
17930 {
17931 struct Identifier * id = GetDeclId(function->declarator);
17932 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
17933 struct Type * type = symbol ? symbol->type : (((void *)0));
17934 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
17935 struct Context * oldTopContext = topContext;
17936
17937 yylloc = function->loc;
17938 if(type && type->thisClass)
17939 {
17940 struct Symbol * classSym = type->thisClass;
17941 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
17942 char className[1024];
17943 char structName[1024];
17944 struct Declarator * funcDecl;
17945 struct Symbol * thisSymbol;
17946 unsigned int typedObject = 0x0;
17947
17948 if(_class && !_class->base)
17949 {
17950 _class = currentClass;
17951 if(_class && !_class->symbol)
17952 _class->symbol = FindClass(_class->fullName);
17953 classSym = _class ? _class->symbol : (((void *)0));
17954 typedObject = 0x1;
17955 }
17956 thisClass = _class;
17957 if(inCompiler && _class)
17958 {
17959 if(type->kind == 11)
17960 {
17961 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
17962 {
17963 struct Type * param = symbol->type->params.first;
17964
17965 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
17966 FreeType(param);
17967 }
17968 if(type->classObjectType != 1)
17969 {
17970 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
17971 symbol->type->staticMethod = 0x1;
17972 symbol->type->thisClass = (((void *)0));
17973 symbol->type->extraParam = 0x0;
17974 }
17975 }
17976 strcpy(className, "__ecereClass_");
17977 FullClassNameCat(className, _class->fullName, 0x1);
17978 MangleClassName(className);
17979 structName[0] = (char)0;
17980 FullClassNameCat(structName, _class->fullName, 0x0);
17981 funcDecl = GetFuncDecl(function->declarator);
17982 if(funcDecl)
17983 {
17984 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
17985 {
17986 struct TypeName * param = (*funcDecl->function.parameters).first;
17987
17988 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
17989 {
17990 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
17991 FreeTypeName(param);
17992 }
17993 }
17994 if(!function->propertyNoThis)
17995 {
17996 struct TypeName * thisParam;
17997
17998 if(type->classObjectType != 1)
17999 {
18000 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18001 if(!funcDecl->function.parameters)
18002 funcDecl->function.parameters = MkList();
18003 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
18004 }
18005 if(typedObject)
18006 {
18007 if(type->classObjectType != 1)
18008 {
18009 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
18010 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
18011 }
18012 thisParam = __extension__ ({
18013 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
18014
18015 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
18016 });
18017 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
18018 }
18019 }
18020 }
18021 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
18022 {
18023 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
18024
18025 funcDecl = GetFuncDecl(initDecl->declarator);
18026 if(funcDecl)
18027 {
18028 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
18029 {
18030 struct TypeName * param = (*funcDecl->function.parameters).first;
18031
18032 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
18033 {
18034 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
18035 FreeTypeName(param);
18036 }
18037 }
18038 if(type->classObjectType != 1)
18039 {
18040 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
18041 {
18042 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18043
18044 if(!funcDecl->function.parameters)
18045 funcDecl->function.parameters = MkList();
18046 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
18047 }
18048 }
18049 }
18050 }
18051 }
18052 if(function->body)
18053 {
18054 if(type->classObjectType != 1)
18055 {
18056 thisSymbol = __extension__ ({
18057 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18058
18059 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
18060 });
18061 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18062 if(typedObject && thisSymbol->type)
18063 {
18064 thisSymbol->type->classObjectType = 2;
18065 thisSymbol->type->byReference = type->byReference;
18066 thisSymbol->type->typedByReference = type->byReference;
18067 }
18068 }
18069 }
18070 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
18071 {
18072 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
18073
18074 {
18075 struct __ecereNameSpace__ecere__com__Class * base;
18076
18077 for(base = _class; base && base->type != 1000; base = base->next)
18078 {
18079 for(member = base->membersAndProperties.first; member; member = member->next)
18080 if(!member->isProperty)
18081 break;
18082 if(member)
18083 break;
18084 }
18085 }
18086 for(member = _class->membersAndProperties.first; member; member = member->next)
18087 if(!member->isProperty)
18088 break;
18089 if(member)
18090 {
18091 char pointerName[1024];
18092 struct Declaration * decl;
18093 struct Initializer * initializer;
18094 struct Expression * exp, * bytePtr;
18095
18096 strcpy(pointerName, "__ecerePointer_");
18097 FullClassNameCat(pointerName, _class->fullName, 0x0);
18098 {
18099 char className[1024];
18100
18101 strcpy(className, "__ecereClass_");
18102 FullClassNameCat(className, classSym->string, 0x1);
18103 MangleClassName(className);
18104 DeclareClass(classSym, className);
18105 }
18106 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
18107 if(_class->fixed)
18108 {
18109 char string[256];
18110
18111 sprintf(string, "%d", _class->offset);
18112 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
18113 }
18114 else
18115 {
18116 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
18117 }
18118 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
18119 exp->expType = __extension__ ({
18120 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18121
18122 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
18123 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18124
18125 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
18126 }), __ecereInstance2;
18127 });
18128 if(function->body)
18129 {
18130 yylloc = function->body->loc;
18131 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
18132 {
18133 struct Context * prevContext = curContext;
18134
18135 curContext = function->body->compound.context;
18136 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
18137 curContext = prevContext;
18138 }
18139 decl->symbol = (((void *)0));
18140 if(!function->body->compound.declarations)
18141 function->body->compound.declarations = MkList();
18142 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
18143 }
18144 }
18145 }
18146 }
18147 else
18148 thisClass = (((void *)0));
18149 if(id)
18150 {
18151 FreeSpecifier(id->_class);
18152 id->_class = (((void *)0));
18153 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
18154 {
18155 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
18156
18157 id = GetDeclId(initDecl->declarator);
18158 FreeSpecifier(id->_class);
18159 id->_class = (((void *)0));
18160 }
18161 }
18162 if(function->body)
18163 topContext = function->body->compound.context;
18164 {
18165 struct FunctionDefinition * oldFunction = curFunction;
18166
18167 curFunction = function;
18168 if(function->body)
18169 ProcessStatement(function->body);
18170 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
18171 {
18172 struct Statement * prevCompound = curCompound;
18173 struct Context * prevContext = curContext;
18174 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
18175
18176 if(!function->body->compound.statements)
18177 function->body->compound.statements = MkList();
18178 ListAdd(function->body->compound.statements, fireWatchers);
18179 curCompound = function->body;
18180 curContext = function->body->compound.context;
18181 ProcessStatement(fireWatchers);
18182 curContext = prevContext;
18183 curCompound = prevCompound;
18184 }
18185 curFunction = oldFunction;
18186 }
18187 if(function->declarator)
18188 {
18189 ProcessDeclarator(function->declarator);
18190 }
18191 topContext = oldTopContext;
18192 thisClass = oldThisClass;
18193 }
18194
18195 extern void FreeSymbol(struct Symbol * symbol);
18196
18197 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
18198
18199 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
18200 {
18201 struct ClassDef * def;
18202 struct External * external = curExternal;
18203 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
18204
18205 for(def = definitions->first; def; def = def->next)
18206 {
18207 if(def->type == 0)
18208 {
18209 if(def->function->declarator)
18210 curExternal = def->function->declarator->symbol->pointerExternal;
18211 else
18212 curExternal = external;
18213 ProcessFunction((struct FunctionDefinition *)def->function);
18214 }
18215 else if(def->type == 2)
18216 {
18217 if(def->decl->type == 2)
18218 {
18219 thisClass = regClass;
18220 ProcessInstantiationType(def->decl->inst);
18221 thisClass = (((void *)0));
18222 }
18223 else
18224 {
18225 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
18226
18227 if(regClass)
18228 thisClass = regClass;
18229 ProcessDeclaration(def->decl);
18230 thisClass = backThisClass;
18231 }
18232 }
18233 else if(def->type == 1 && def->defProperties)
18234 {
18235 struct MemberInit * defProperty;
18236 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);
18237
18238 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18239 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
18240 {
18241 thisClass = regClass;
18242 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
18243 thisClass = (((void *)0));
18244 }
18245 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18246 FreeSymbol(thisSymbol);
18247 }
18248 else if(def->type == 3 && def->propertyDef)
18249 {
18250 struct PropertyDef * prop = def->propertyDef;
18251
18252 thisClass = regClass;
18253 if(prop->setStmt)
18254 {
18255 if(regClass)
18256 {
18257 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18258
18259 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18260 }
18261 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
18262 ProcessStatement(prop->setStmt);
18263 }
18264 if(prop->getStmt)
18265 {
18266 if(regClass)
18267 {
18268 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18269
18270 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18271 }
18272 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
18273 ProcessStatement(prop->getStmt);
18274 }
18275 if(prop->issetStmt)
18276 {
18277 if(regClass)
18278 {
18279 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18280
18281 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18282 }
18283 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
18284 ProcessStatement(prop->issetStmt);
18285 }
18286 thisClass = (((void *)0));
18287 }
18288 else if(def->type == 4 && def->propertyWatch)
18289 {
18290 struct PropertyWatch * propertyWatch = def->propertyWatch;
18291
18292 thisClass = regClass;
18293 if(propertyWatch->compound)
18294 {
18295 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);
18296
18297 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18298 curExternal = (((void *)0));
18299 ProcessStatement(propertyWatch->compound);
18300 }
18301 thisClass = (((void *)0));
18302 }
18303 }
18304 }
18305
18306 void DeclareFunctionUtil(char * s)
18307 {
18308 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
18309
18310 if(function)
18311 {
18312 char name[1024];
18313
18314 name[0] = (char)0;
18315 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
18316 strcpy(name, "__ecereFunction_");
18317 FullClassNameCat(name, s, 0x0);
18318 DeclareFunction(function, name);
18319 }
18320 }
18321
18322 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
18323
18324 void ComputeDataTypes()
18325 {
18326 struct External * external;
18327 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
18328 struct External * after = (((void *)0));
18329
18330 currentClass = (((void *)0));
18331 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
18332 for(external = (*ast).first; external; external = external->next)
18333 {
18334 if(external->type == 1)
18335 {
18336 struct Declaration * decl = external->declaration;
18337
18338 if(decl)
18339 {
18340 struct __ecereNameSpace__ecere__sys__OldList * decls = decl->declarators;
18341
18342 if(decls)
18343 {
18344 struct InitDeclarator * initDecl = (*decls).first;
18345
18346 if(initDecl)
18347 {
18348 struct Declarator * declarator = initDecl->declarator;
18349
18350 if(declarator && declarator->type == 1)
18351 {
18352 struct Identifier * id = declarator->identifier;
18353
18354 if(id && id->string)
18355 {
18356 if(!strcmp(id->string, "uintptr_t") || !strcmp(id->string, "intptr_t") || !strcmp(id->string, "size_t") || !strcmp(id->string, "ssize_t"))
18357 {
18358 external->symbol->id = -1001, external->symbol->idCode = -1001;
18359 after = external;
18360 }
18361 }
18362 }
18363 }
18364 }
18365 }
18366 }
18367 }
18368 temp->symbol = __extension__ ({
18369 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18370
18371 __ecereInstance1->id = -1000, __ecereInstance1->idCode = -1000, __ecereInstance1;
18372 });
18373 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
18374 curExternal = temp;
18375 DeclareFunctionUtil("eSystem_New");
18376 DeclareFunctionUtil("eSystem_New0");
18377 DeclareFunctionUtil("eSystem_Renew");
18378 DeclareFunctionUtil("eSystem_Renew0");
18379 DeclareFunctionUtil("eSystem_Delete");
18380 DeclareFunctionUtil("eClass_GetProperty");
18381 DeclareFunctionUtil("eInstance_FireSelfWatchers");
18382 DeclareStruct("ecere::com::Class", 0x0);
18383 DeclareStruct("ecere::com::Instance", 0x0);
18384 DeclareStruct("ecere::com::Property", 0x0);
18385 DeclareStruct("ecere::com::DataMember", 0x0);
18386 DeclareStruct("ecere::com::Method", 0x0);
18387 DeclareStruct("ecere::com::SerialBuffer", 0x0);
18388 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
18389 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
18390 for(external = (*ast).first; external; external = external->next)
18391 {
18392 afterExternal = curExternal = external;
18393 if(external->type == 0)
18394 {
18395 currentClass = external->function->_class;
18396 ProcessFunction(external->function);
18397 }
18398 else if(external->type == 1)
18399 {
18400 currentClass = (((void *)0));
18401 ProcessDeclaration(external->declaration);
18402 }
18403 else if(external->type == 2)
18404 {
18405 struct ClassDefinition * _class = external->_class;
18406
18407 currentClass = external->symbol->registered;
18408 if(_class->definitions)
18409 {
18410 ProcessClass(_class->definitions, _class->symbol);
18411 }
18412 if(inCompiler)
18413 {
18414 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
18415 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
18416 }
18417 }
18418 else if(external->type == 4)
18419 {
18420 thisNameSpace = external->id->string;
18421 }
18422 }
18423 currentClass = (((void *)0));
18424 thisNameSpace = (((void *)0));
18425 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
18426 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
18427 }
18428
18429 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);
18430
18431 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);
18432
18433 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
18434
18435 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
18436 {
18437 struct __ecereNameSpace__ecere__com__Class * class;
18438
18439 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
18440 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
18441 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
18442 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
18443 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
18444 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
18445 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
18446 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
18447 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
18448 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
18449 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
18450 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
18451 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
18452 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
18453 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
18454 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
18455 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
18456 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
18457 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt", "bool GetOpInt(Operand op2, int * value2)", GetOpInt, module, 1);
18458 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
18459 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt", "bool GetOpUInt(Operand op2, uint * value2)", GetOpUInt, module, 1);
18460 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
18461 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt64", "bool GetOpInt64(Operand op2, int64 * value2)", GetOpInt64, module, 1);
18462 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
18463 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt64", "bool GetOpUInt64(Operand op2, uint64 * value2)", GetOpUInt64, module, 1);
18464 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
18465 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntPtr", "bool GetOpIntPtr(Operand op2, intptr * value2)", GetOpIntPtr, module, 1);
18466 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
18467 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntPtr", "bool GetOpUIntPtr(Operand op2, uintptr * value2)", GetOpUIntPtr, module, 1);
18468 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
18469 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntSize", "bool GetOpIntSize(Operand op2, intsize * value2)", GetOpIntSize, module, 1);
18470 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
18471 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntSize", "bool GetOpUIntSize(Operand op2, uintsize * value2)", GetOpUIntSize, module, 1);
18472 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
18473 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpShort", "bool GetOpShort(Operand op2, short * value2)", GetOpShort, module, 1);
18474 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
18475 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUShort", "bool GetOpUShort(Operand op2, uint16 * value2)", GetOpUShort, module, 1);
18476 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
18477 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpChar", "bool GetOpChar(Operand op2, char * value2)", GetOpChar, module, 1);
18478 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
18479 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUChar", "bool GetOpUChar(Operand op2, byte * value2)", GetOpUChar, module, 1);
18480 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
18481 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpFloat", "bool GetOpFloat(Operand op2, float * value2)", GetOpFloat, module, 1);
18482 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
18483 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpDouble", "bool GetOpDouble(Operand op2, double * value2)", GetOpDouble, module, 1);
18484 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
18485 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
18486 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
18487 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
18488 __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);
18489 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
18490 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
18491 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
18492 __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);
18493 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
18494 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
18495 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
18496 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
18497 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
18498 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
18499 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
18500 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
18501 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
18502 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
18503 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
18504 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
18505 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
18506 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
18507 __ecereClass_Conversion = class;
18508 __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);
18509 __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);
18510 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
18511 __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);
18512 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
18513 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
18514 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("UnescapeString", "int UnescapeString(char * d, char * s, int len)", UnescapeString, module, 1);
18515 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("OffsetEscapedString", "char * OffsetEscapedString(char * s, int len, int offset)", OffsetEscapedString, module, 1);
18516 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
18517 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
18518 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
18519 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
18520 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
18521 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
18522 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
18523 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
18524 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
18525 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
18526 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetParseError", "bool GetParseError(void)", GetParseError, module, 1);
18527 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
18528 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
18529 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
18530 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
18531 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(String s)", DeclareFunctionUtil, module, 1);
18532 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
18533 }
18534
18535 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
18536 {
18537
18538 }
18539