ide/debugger: (#456) Fixed more leaks in watch evaluation
[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%I64XLL" : "0x%llXLL"), result);
1530 else
1531 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1532 return __ecereNameSpace__ecere__sys__CopyString(temp);
1533 }
1534
1535 char * PrintHexUInt64(uint64 result)
1536 {
1537 char temp[100];
1538
1539 if(result > (0xffffffff))
1540 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1541 else
1542 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1543 return __ecereNameSpace__ecere__sys__CopyString(temp);
1544 }
1545
1546 char * PrintShort(short result)
1547 {
1548 char temp[100];
1549
1550 sprintf(temp, "%d", (unsigned short)result);
1551 return __ecereNameSpace__ecere__sys__CopyString(temp);
1552 }
1553
1554 char * PrintUShort(unsigned short result)
1555 {
1556 char temp[100];
1557
1558 if(result > (unsigned short)32767)
1559 sprintf(temp, "0x%X", (int)result);
1560 else
1561 sprintf(temp, "%d", (int)result);
1562 return __ecereNameSpace__ecere__sys__CopyString(temp);
1563 }
1564
1565 extern int isprint(int c);
1566
1567 char * PrintChar(char result)
1568 {
1569 char temp[100];
1570
1571 if(result > (char)0 && isprint(result))
1572 sprintf(temp, "'%c'", result);
1573 else if(result < (char)0)
1574 sprintf(temp, "%d", (int)result);
1575 else
1576 sprintf(temp, "0x%X", (unsigned char)result);
1577 return __ecereNameSpace__ecere__sys__CopyString(temp);
1578 }
1579
1580 char * PrintUChar(unsigned char result)
1581 {
1582 char temp[100];
1583
1584 sprintf(temp, "0x%X", result);
1585 return __ecereNameSpace__ecere__sys__CopyString(temp);
1586 }
1587
1588 extern char *  strcpy(char * , const char * );
1589
1590 extern unsigned int (* __ecereProp_float_Get_isInf)(float this);
1591
1592 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_isInf;
1593
1594 extern int (* __ecereProp_float_Get_signBit)(float this);
1595
1596 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_signBit;
1597
1598 extern unsigned int (* __ecereProp_float_Get_isNan)(float this);
1599
1600 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_isNan;
1601
1602 char * PrintFloat(float result)
1603 {
1604 char temp[350];
1605
1606 if(__ecereProp_float_Get_isInf(result))
1607 {
1608 if(__ecereProp_float_Get_signBit(result))
1609 strcpy(temp, "-inf");
1610 else
1611 strcpy(temp, "inf");
1612 }
1613 else if(__ecereProp_float_Get_isNan(result))
1614 {
1615 if(__ecereProp_float_Get_signBit(result))
1616 strcpy(temp, "-nan");
1617 else
1618 strcpy(temp, "nan");
1619 }
1620 else
1621 sprintf(temp, "%.16ff", result);
1622 return __ecereNameSpace__ecere__sys__CopyString(temp);
1623 }
1624
1625 extern unsigned int (* __ecereProp_double_Get_isInf)(double this);
1626
1627 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_isInf;
1628
1629 extern int (* __ecereProp_double_Get_signBit)(double this);
1630
1631 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_signBit;
1632
1633 extern unsigned int (* __ecereProp_double_Get_isNan)(double this);
1634
1635 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_isNan;
1636
1637 char * PrintDouble(double result)
1638 {
1639 char temp[350];
1640
1641 if(__ecereProp_double_Get_isInf(result))
1642 {
1643 if(__ecereProp_double_Get_signBit(result))
1644 strcpy(temp, "-inf");
1645 else
1646 strcpy(temp, "inf");
1647 }
1648 else if(__ecereProp_double_Get_isNan(result))
1649 {
1650 if(__ecereProp_double_Get_signBit(result))
1651 strcpy(temp, "-nan");
1652 else
1653 strcpy(temp, "nan");
1654 }
1655 else
1656 sprintf(temp, "%.16f", result);
1657 return __ecereNameSpace__ecere__sys__CopyString(temp);
1658 }
1659
1660 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1661
1662 struct OpTable
1663 {
1664 unsigned int (*  Add)(struct Expression *, struct Operand *, struct Operand *);
1665 unsigned int (*  Sub)(struct Expression *, struct Operand *, struct Operand *);
1666 unsigned int (*  Mul)(struct Expression *, struct Operand *, struct Operand *);
1667 unsigned int (*  Div)(struct Expression *, struct Operand *, struct Operand *);
1668 unsigned int (*  Mod)(struct Expression *, struct Operand *, struct Operand *);
1669 unsigned int (*  Neg)(struct Expression *, struct Operand *);
1670 unsigned int (*  Inc)(struct Expression *, struct Operand *);
1671 unsigned int (*  Dec)(struct Expression *, struct Operand *);
1672 unsigned int (*  Asign)(struct Expression *, struct Operand *, struct Operand *);
1673 unsigned int (*  AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1674 unsigned int (*  SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1675 unsigned int (*  MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1676 unsigned int (*  DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1677 unsigned int (*  ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1678 unsigned int (*  BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1679 unsigned int (*  BitOr)(struct Expression *, struct Operand *, struct Operand *);
1680 unsigned int (*  BitXor)(struct Expression *, struct Operand *, struct Operand *);
1681 unsigned int (*  LShift)(struct Expression *, struct Operand *, struct Operand *);
1682 unsigned int (*  RShift)(struct Expression *, struct Operand *, struct Operand *);
1683 unsigned int (*  BitNot)(struct Expression *, struct Operand *);
1684 unsigned int (*  AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1685 unsigned int (*  OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1686 unsigned int (*  XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1687 unsigned int (*  LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1688 unsigned int (*  RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1689 unsigned int (*  Not)(struct Expression *, struct Operand *);
1690 unsigned int (*  Equ)(struct Expression *, struct Operand *, struct Operand *);
1691 unsigned int (*  Nqu)(struct Expression *, struct Operand *, struct Operand *);
1692 unsigned int (*  And)(struct Expression *, struct Operand *, struct Operand *);
1693 unsigned int (*  Or)(struct Expression *, struct Operand *, struct Operand *);
1694 unsigned int (*  Grt)(struct Expression *, struct Operand *, struct Operand *);
1695 unsigned int (*  Sma)(struct Expression *, struct Operand *, struct Operand *);
1696 unsigned int (*  GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1697 unsigned int (*  SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1698 unsigned int (*  Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1699 } __attribute__ ((gcc_struct));
1700
1701 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1702
1703 struct Operand
1704 {
1705 int kind;
1706 struct Type * type;
1707 unsigned int ptrSize;
1708 union
1709 {
1710 char c;
1711 unsigned char uc;
1712 short s;
1713 unsigned short us;
1714 int i;
1715 unsigned int ui;
1716 float f;
1717 double d;
1718 long long i64;
1719 uint64 ui64;
1720 } __attribute__ ((gcc_struct));
1721 struct OpTable ops;
1722 } __attribute__ ((gcc_struct));
1723
1724 unsigned int GetOpInt(struct Operand * op2, int * value2)
1725 {
1726 if(op2->kind == 3 && op2->type->isSigned)
1727 *value2 = op2->i;
1728 else if(op2->kind == 3)
1729 *value2 = (int)op2->ui;
1730 else if(op2->kind == 4 && op2->type->isSigned)
1731 *value2 = (int)op2->i64;
1732 else if(op2->kind == 4)
1733 *value2 = (int)op2->ui64;
1734 else if(op2->kind == 23 && op2->type->isSigned)
1735 *value2 = (int)op2->i64;
1736 else if(op2->kind == 23)
1737 *value2 = (int)op2->ui64;
1738 else if(op2->kind == 22 && op2->type->isSigned)
1739 *value2 = (int)op2->i64;
1740 else if(op2->kind == 22)
1741 *value2 = (int)op2->ui64;
1742 else if(op2->kind == 2 && op2->type->isSigned)
1743 *value2 = (int)op2->s;
1744 else if(op2->kind == 2)
1745 *value2 = (int)op2->us;
1746 else if(op2->kind == 1 && op2->type->isSigned)
1747 *value2 = (int)op2->c;
1748 else if(op2->kind == 24 || op2->kind == 1)
1749 *value2 = (int)op2->uc;
1750 else if(op2->kind == 6)
1751 *value2 = (int)op2->f;
1752 else if(op2->kind == 7)
1753 *value2 = (int)op2->d;
1754 else if(op2->kind == 13)
1755 *value2 = (int)op2->ui64;
1756 else
1757 return 0x0;
1758 return 0x1;
1759 }
1760
1761 struct Operand GetOperand(struct Expression * exp);
1762
1763 unsigned int GetInt(struct Expression * exp, int * value2)
1764 {
1765 struct Operand op2 = GetOperand(exp);
1766
1767 return GetOpInt(&op2, value2);
1768 }
1769
1770 unsigned int GetOpUInt(struct Operand * op2, unsigned int * value2)
1771 {
1772 if(op2->kind == 3 && op2->type->isSigned)
1773 *value2 = (unsigned int)op2->i;
1774 else if(op2->kind == 3)
1775 *value2 = op2->ui;
1776 else if(op2->kind == 4 && op2->type->isSigned)
1777 *value2 = (unsigned int)op2->i64;
1778 else if(op2->kind == 4)
1779 *value2 = (unsigned int)op2->ui64;
1780 else if(op2->kind == 23 && op2->type->isSigned)
1781 *value2 = (unsigned int)op2->i64;
1782 else if(op2->kind == 23)
1783 *value2 = (unsigned int)op2->ui64;
1784 else if(op2->kind == 22 && op2->type->isSigned)
1785 *value2 = (unsigned int)op2->i64;
1786 else if(op2->kind == 22)
1787 *value2 = (unsigned int)op2->ui64;
1788 else if(op2->kind == 2 && op2->type->isSigned)
1789 *value2 = (unsigned int)op2->s;
1790 else if(op2->kind == 2)
1791 *value2 = (unsigned int)op2->us;
1792 else if(op2->kind == 1 && op2->type->isSigned)
1793 *value2 = (unsigned int)op2->c;
1794 else if(op2->kind == 24 || op2->kind == 1)
1795 *value2 = (unsigned int)op2->uc;
1796 else if(op2->kind == 6)
1797 *value2 = (unsigned int)op2->f;
1798 else if(op2->kind == 7)
1799 *value2 = (unsigned int)op2->d;
1800 else if(op2->kind == 13)
1801 *value2 = (unsigned int)op2->ui64;
1802 else
1803 return 0x0;
1804 return 0x1;
1805 }
1806
1807 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1808 {
1809 struct Operand op2 = GetOperand(exp);
1810
1811 return GetOpUInt(&op2, value2);
1812 }
1813
1814 unsigned int GetOpInt64(struct Operand * op2, long long * value2)
1815 {
1816 if(op2->kind == 3 && op2->type->isSigned)
1817 *value2 = (long long)op2->i;
1818 else if(op2->kind == 3)
1819 *value2 = (long long)op2->ui;
1820 else if(op2->kind == 4 && op2->type->isSigned)
1821 *value2 = op2->i64;
1822 else if(op2->kind == 4)
1823 *value2 = (long long)op2->ui64;
1824 else if(op2->kind == 23 && op2->type->isSigned)
1825 *value2 = op2->i64;
1826 else if(op2->kind == 23)
1827 *value2 = (long long)op2->ui64;
1828 else if(op2->kind == 22 && op2->type->isSigned)
1829 *value2 = op2->i64;
1830 else if(op2->kind == 22)
1831 *value2 = (long long)op2->ui64;
1832 else if(op2->kind == 2 && op2->type->isSigned)
1833 *value2 = (long long)op2->s;
1834 else if(op2->kind == 2)
1835 *value2 = (long long)op2->us;
1836 else if(op2->kind == 1 && op2->type->isSigned)
1837 *value2 = (long long)op2->c;
1838 else if(op2->kind == 24 || op2->kind == 1)
1839 *value2 = (long long)op2->uc;
1840 else if(op2->kind == 6)
1841 *value2 = (long long)op2->f;
1842 else if(op2->kind == 7)
1843 *value2 = (long long)op2->d;
1844 else if(op2->kind == 13)
1845 *value2 = (long long)op2->ui64;
1846 else
1847 return 0x0;
1848 return 0x1;
1849 }
1850
1851 unsigned int GetInt64(struct Expression * exp, long long * value2)
1852 {
1853 struct Operand op2 = GetOperand(exp);
1854
1855 return GetOpInt64(&op2, value2);
1856 }
1857
1858 unsigned int GetOpUInt64(struct Operand * op2, uint64 * value2)
1859 {
1860 if(op2->kind == 3 && op2->type->isSigned)
1861 *value2 = (uint64)op2->i;
1862 else if(op2->kind == 3)
1863 *value2 = (uint64)op2->ui;
1864 else if(op2->kind == 4 && op2->type->isSigned)
1865 *value2 = (uint64)op2->i64;
1866 else if(op2->kind == 4)
1867 *value2 = op2->ui64;
1868 else if(op2->kind == 23 && op2->type->isSigned)
1869 *value2 = (uint64)op2->i64;
1870 else if(op2->kind == 23)
1871 *value2 = op2->ui64;
1872 else if(op2->kind == 22 && op2->type->isSigned)
1873 *value2 = (uint64)op2->i64;
1874 else if(op2->kind == 22)
1875 *value2 = op2->ui64;
1876 else if(op2->kind == 2 && op2->type->isSigned)
1877 *value2 = (uint64)op2->s;
1878 else if(op2->kind == 2)
1879 *value2 = (uint64)op2->us;
1880 else if(op2->kind == 1 && op2->type->isSigned)
1881 *value2 = (uint64)op2->c;
1882 else if(op2->kind == 24 || op2->kind == 1)
1883 *value2 = (uint64)op2->uc;
1884 else if(op2->kind == 6)
1885 *value2 = (uint64)op2->f;
1886 else if(op2->kind == 7)
1887 *value2 = (uint64)op2->d;
1888 else if(op2->kind == 13)
1889 *value2 = op2->ui64;
1890 else
1891 return 0x0;
1892 return 0x1;
1893 }
1894
1895 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1896 {
1897 struct Operand op2 = GetOperand(exp);
1898
1899 return GetOpUInt64(&op2, value2);
1900 }
1901
1902 unsigned int GetOpIntPtr(struct Operand * op2, intptr_t * value2)
1903 {
1904 if(op2->kind == 3 && op2->type->isSigned)
1905 *value2 = (intptr_t)op2->i;
1906 else if(op2->kind == 3)
1907 *value2 = (intptr_t)op2->ui;
1908 else if(op2->kind == 4 && op2->type->isSigned)
1909 *value2 = (intptr_t)op2->i64;
1910 else if(op2->kind == 4)
1911 *value2 = (intptr_t)op2->ui64;
1912 else if(op2->kind == 23 && op2->type->isSigned)
1913 *value2 = (intptr_t)op2->i64;
1914 else if(op2->kind == 23)
1915 *value2 = (intptr_t)op2->ui64;
1916 else if(op2->kind == 22 && op2->type->isSigned)
1917 *value2 = (intptr_t)op2->i64;
1918 else if(op2->kind == 22)
1919 *value2 = (intptr_t)op2->ui64;
1920 else if(op2->kind == 2 && op2->type->isSigned)
1921 *value2 = (intptr_t)op2->s;
1922 else if(op2->kind == 2)
1923 *value2 = (intptr_t)op2->us;
1924 else if(op2->kind == 1 && op2->type->isSigned)
1925 *value2 = (intptr_t)op2->c;
1926 else if(op2->kind == 24 || op2->kind == 1)
1927 *value2 = (intptr_t)op2->uc;
1928 else if(op2->kind == 6)
1929 *value2 = (intptr_t)op2->f;
1930 else if(op2->kind == 7)
1931 *value2 = (intptr_t)op2->d;
1932 else if(op2->kind == 13)
1933 *value2 = (intptr_t)op2->ui64;
1934 else
1935 return 0x0;
1936 return 0x1;
1937 }
1938
1939 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
1940 {
1941 struct Operand op2 = GetOperand(exp);
1942
1943 return GetOpIntPtr(&op2, value2);
1944 }
1945
1946 unsigned int GetOpUIntPtr(struct Operand * op2, uintptr_t * value2)
1947 {
1948 if(op2->kind == 3 && op2->type->isSigned)
1949 *value2 = (uintptr_t)op2->i;
1950 else if(op2->kind == 3)
1951 *value2 = (uintptr_t)op2->ui;
1952 else if(op2->kind == 4 && op2->type->isSigned)
1953 *value2 = (uintptr_t)op2->i64;
1954 else if(op2->kind == 4)
1955 *value2 = (uintptr_t)op2->ui64;
1956 else if(op2->kind == 23 && op2->type->isSigned)
1957 *value2 = (uintptr_t)op2->i64;
1958 else if(op2->kind == 23)
1959 *value2 = (uintptr_t)op2->ui64;
1960 else if(op2->kind == 22 && op2->type->isSigned)
1961 *value2 = (uintptr_t)op2->i64;
1962 else if(op2->kind == 22)
1963 *value2 = (uintptr_t)op2->ui64;
1964 else if(op2->kind == 2 && op2->type->isSigned)
1965 *value2 = (uintptr_t)op2->s;
1966 else if(op2->kind == 2)
1967 *value2 = (uintptr_t)op2->us;
1968 else if(op2->kind == 1 && op2->type->isSigned)
1969 *value2 = (uintptr_t)op2->c;
1970 else if(op2->kind == 24 || op2->kind == 1)
1971 *value2 = (uintptr_t)op2->uc;
1972 else if(op2->kind == 6)
1973 *value2 = (uintptr_t)op2->f;
1974 else if(op2->kind == 7)
1975 *value2 = (uintptr_t)op2->d;
1976 else if(op2->kind == 13)
1977 *value2 = (uintptr_t)op2->ui64;
1978 else
1979 return 0x0;
1980 return 0x1;
1981 }
1982
1983 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
1984 {
1985 struct Operand op2 = GetOperand(exp);
1986
1987 return GetOpUIntPtr(&op2, value2);
1988 }
1989
1990 unsigned int GetOpIntSize(struct Operand * op2, ssize_t * value2)
1991 {
1992 if(op2->kind == 3 && op2->type->isSigned)
1993 *value2 = (ssize_t)op2->i;
1994 else if(op2->kind == 3)
1995 *value2 = (ssize_t)op2->ui;
1996 else if(op2->kind == 4 && op2->type->isSigned)
1997 *value2 = (ssize_t)op2->i64;
1998 else if(op2->kind == 4)
1999 *value2 = (ssize_t)op2->ui64;
2000 else if(op2->kind == 23 && op2->type->isSigned)
2001 *value2 = (ssize_t)op2->i64;
2002 else if(op2->kind == 23)
2003 *value2 = (ssize_t)op2->ui64;
2004 else if(op2->kind == 22 && op2->type->isSigned)
2005 *value2 = (ssize_t)op2->i64;
2006 else if(op2->kind == 22)
2007 *value2 = (ssize_t)op2->ui64;
2008 else if(op2->kind == 2 && op2->type->isSigned)
2009 *value2 = (ssize_t)op2->s;
2010 else if(op2->kind == 2)
2011 *value2 = (ssize_t)op2->us;
2012 else if(op2->kind == 1 && op2->type->isSigned)
2013 *value2 = (ssize_t)op2->c;
2014 else if(op2->kind == 24 || op2->kind == 1)
2015 *value2 = (ssize_t)op2->uc;
2016 else if(op2->kind == 6)
2017 *value2 = (ssize_t)op2->f;
2018 else if(op2->kind == 7)
2019 *value2 = (ssize_t)op2->d;
2020 else if(op2->kind == 13)
2021 *value2 = (ssize_t)op2->ui64;
2022 else
2023 return 0x0;
2024 return 0x1;
2025 }
2026
2027 unsigned int GetIntSize(struct Expression * exp, ssize_t * value2)
2028 {
2029 struct Operand op2 = GetOperand(exp);
2030
2031 return GetOpIntSize(&op2, value2);
2032 }
2033
2034 unsigned int GetOpUIntSize(struct Operand * op2, size_t * value2)
2035 {
2036 if(op2->kind == 3 && op2->type->isSigned)
2037 *value2 = (size_t)op2->i;
2038 else if(op2->kind == 3)
2039 *value2 = (size_t)op2->ui;
2040 else if(op2->kind == 4 && op2->type->isSigned)
2041 *value2 = (size_t)op2->i64;
2042 else if(op2->kind == 4)
2043 *value2 = (size_t)op2->ui64;
2044 else if(op2->kind == 23 && op2->type->isSigned)
2045 *value2 = (size_t)op2->i64;
2046 else if(op2->kind == 23)
2047 *value2 = (size_t)op2->ui64;
2048 else if(op2->kind == 22 && op2->type->isSigned)
2049 *value2 = (size_t)op2->i64;
2050 else if(op2->kind == 22)
2051 *value2 = (size_t)op2->ui64;
2052 else if(op2->kind == 2 && op2->type->isSigned)
2053 *value2 = (size_t)op2->s;
2054 else if(op2->kind == 2)
2055 *value2 = (size_t)op2->us;
2056 else if(op2->kind == 1 && op2->type->isSigned)
2057 *value2 = (size_t)op2->c;
2058 else if(op2->kind == 24 || op2->kind == 1)
2059 *value2 = (size_t)op2->uc;
2060 else if(op2->kind == 6)
2061 *value2 = (size_t)op2->f;
2062 else if(op2->kind == 7)
2063 *value2 = (size_t)op2->d;
2064 else if(op2->kind == 13)
2065 *value2 = (size_t)op2->ui64;
2066 else
2067 return 0x0;
2068 return 0x1;
2069 }
2070
2071 unsigned int GetUIntSize(struct Expression * exp, size_t * value2)
2072 {
2073 struct Operand op2 = GetOperand(exp);
2074
2075 return GetOpUIntSize(&op2, value2);
2076 }
2077
2078 unsigned int GetOpShort(struct Operand * op2, short * value2)
2079 {
2080 if(op2->kind == 3 && op2->type->isSigned)
2081 *value2 = (short)op2->i;
2082 else if(op2->kind == 3)
2083 *value2 = (short)op2->ui;
2084 else if(op2->kind == 4 && op2->type->isSigned)
2085 *value2 = (short)op2->i64;
2086 else if(op2->kind == 4)
2087 *value2 = (short)op2->ui64;
2088 else if(op2->kind == 23 && op2->type->isSigned)
2089 *value2 = (short)op2->i64;
2090 else if(op2->kind == 23)
2091 *value2 = (short)op2->ui64;
2092 else if(op2->kind == 22 && op2->type->isSigned)
2093 *value2 = (short)op2->i64;
2094 else if(op2->kind == 22)
2095 *value2 = (short)op2->ui64;
2096 else if(op2->kind == 2 && op2->type->isSigned)
2097 *value2 = op2->s;
2098 else if(op2->kind == 2)
2099 *value2 = (short)op2->us;
2100 else if(op2->kind == 1 && op2->type->isSigned)
2101 *value2 = (short)op2->c;
2102 else if(op2->kind == 24 || op2->kind == 1)
2103 *value2 = (short)op2->uc;
2104 else if(op2->kind == 6)
2105 *value2 = (short)op2->f;
2106 else if(op2->kind == 7)
2107 *value2 = (short)op2->d;
2108 else if(op2->kind == 13)
2109 *value2 = (short)op2->ui64;
2110 else
2111 return 0x0;
2112 return 0x1;
2113 }
2114
2115 unsigned int GetShort(struct Expression * exp, short * value2)
2116 {
2117 struct Operand op2 = GetOperand(exp);
2118
2119 return GetOpShort(&op2, value2);
2120 }
2121
2122 unsigned int GetOpUShort(struct Operand * op2, unsigned short * value2)
2123 {
2124 if(op2->kind == 3 && op2->type->isSigned)
2125 *value2 = (unsigned short)op2->i;
2126 else if(op2->kind == 3)
2127 *value2 = (unsigned short)op2->ui;
2128 else if(op2->kind == 4 && op2->type->isSigned)
2129 *value2 = (unsigned short)op2->i64;
2130 else if(op2->kind == 4)
2131 *value2 = (unsigned short)op2->ui64;
2132 else if(op2->kind == 23 && op2->type->isSigned)
2133 *value2 = (unsigned short)op2->i64;
2134 else if(op2->kind == 23)
2135 *value2 = (unsigned short)op2->ui64;
2136 else if(op2->kind == 22 && op2->type->isSigned)
2137 *value2 = (unsigned short)op2->i64;
2138 else if(op2->kind == 22)
2139 *value2 = (unsigned short)op2->ui64;
2140 else if(op2->kind == 2 && op2->type->isSigned)
2141 *value2 = (unsigned short)op2->s;
2142 else if(op2->kind == 2)
2143 *value2 = op2->us;
2144 else if(op2->kind == 1 && op2->type->isSigned)
2145 *value2 = (unsigned short)op2->c;
2146 else if(op2->kind == 24 || op2->kind == 1)
2147 *value2 = (unsigned short)op2->uc;
2148 else if(op2->kind == 6)
2149 *value2 = (unsigned short)op2->f;
2150 else if(op2->kind == 7)
2151 *value2 = (unsigned short)op2->d;
2152 else if(op2->kind == 13)
2153 *value2 = (unsigned short)op2->ui64;
2154 else
2155 return 0x0;
2156 return 0x1;
2157 }
2158
2159 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
2160 {
2161 struct Operand op2 = GetOperand(exp);
2162
2163 return GetOpUShort(&op2, value2);
2164 }
2165
2166 unsigned int GetOpChar(struct Operand * op2, char * value2)
2167 {
2168 if(op2->kind == 3 && op2->type->isSigned)
2169 *value2 = (char)op2->i;
2170 else if(op2->kind == 3)
2171 *value2 = (char)op2->ui;
2172 else if(op2->kind == 4 && op2->type->isSigned)
2173 *value2 = (char)op2->i64;
2174 else if(op2->kind == 4)
2175 *value2 = (char)op2->ui64;
2176 else if(op2->kind == 23 && op2->type->isSigned)
2177 *value2 = (char)op2->i64;
2178 else if(op2->kind == 23)
2179 *value2 = (char)op2->ui64;
2180 else if(op2->kind == 22 && op2->type->isSigned)
2181 *value2 = (char)op2->i64;
2182 else if(op2->kind == 22)
2183 *value2 = (char)op2->ui64;
2184 else if(op2->kind == 2 && op2->type->isSigned)
2185 *value2 = (char)op2->s;
2186 else if(op2->kind == 2)
2187 *value2 = (char)op2->us;
2188 else if(op2->kind == 1 && op2->type->isSigned)
2189 *value2 = op2->c;
2190 else if(op2->kind == 24 || op2->kind == 1)
2191 *value2 = (char)op2->uc;
2192 else if(op2->kind == 6)
2193 *value2 = (char)op2->f;
2194 else if(op2->kind == 7)
2195 *value2 = (char)op2->d;
2196 else if(op2->kind == 13)
2197 *value2 = (char)op2->ui64;
2198 else
2199 return 0x0;
2200 return 0x1;
2201 }
2202
2203 unsigned int GetChar(struct Expression * exp, char * value2)
2204 {
2205 struct Operand op2 = GetOperand(exp);
2206
2207 return GetOpChar(&op2, value2);
2208 }
2209
2210 unsigned int GetOpUChar(struct Operand * op2, unsigned char * value2)
2211 {
2212 if(op2->kind == 3 && op2->type->isSigned)
2213 *value2 = (unsigned char)op2->i;
2214 else if(op2->kind == 3)
2215 *value2 = (unsigned char)op2->ui;
2216 else if(op2->kind == 4 && op2->type->isSigned)
2217 *value2 = (unsigned char)op2->i64;
2218 else if(op2->kind == 4)
2219 *value2 = (unsigned char)op2->ui64;
2220 else if(op2->kind == 23 && op2->type->isSigned)
2221 *value2 = (unsigned char)op2->i64;
2222 else if(op2->kind == 23)
2223 *value2 = (unsigned char)op2->ui64;
2224 else if(op2->kind == 22 && op2->type->isSigned)
2225 *value2 = (unsigned char)op2->i64;
2226 else if(op2->kind == 22)
2227 *value2 = (unsigned char)op2->ui64;
2228 else if(op2->kind == 2 && op2->type->isSigned)
2229 *value2 = (unsigned char)op2->s;
2230 else if(op2->kind == 2)
2231 *value2 = (unsigned char)op2->us;
2232 else if(op2->kind == 1 && op2->type->isSigned)
2233 *value2 = (unsigned char)op2->c;
2234 else if(op2->kind == 24 || op2->kind == 1)
2235 *value2 = op2->uc;
2236 else if(op2->kind == 6)
2237 *value2 = (unsigned char)op2->f;
2238 else if(op2->kind == 7)
2239 *value2 = (unsigned char)op2->d;
2240 else if(op2->kind == 13)
2241 *value2 = (unsigned char)op2->ui64;
2242 else
2243 return 0x0;
2244 return 0x1;
2245 }
2246
2247 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
2248 {
2249 struct Operand op2 = GetOperand(exp);
2250
2251 return GetOpUChar(&op2, value2);
2252 }
2253
2254 unsigned int GetOpFloat(struct Operand * op2, float * value2)
2255 {
2256 if(op2->kind == 3 && op2->type->isSigned)
2257 *value2 = (float)(float)op2->i;
2258 else if(op2->kind == 3)
2259 *value2 = (float)(float)op2->ui;
2260 else if(op2->kind == 4 && op2->type->isSigned)
2261 *value2 = (float)(float)op2->i64;
2262 else if(op2->kind == 4)
2263 *value2 = (float)(float)op2->ui64;
2264 else if(op2->kind == 23 && op2->type->isSigned)
2265 *value2 = (float)(float)op2->i64;
2266 else if(op2->kind == 23)
2267 *value2 = (float)(float)op2->ui64;
2268 else if(op2->kind == 22 && op2->type->isSigned)
2269 *value2 = (float)(float)op2->i64;
2270 else if(op2->kind == 22)
2271 *value2 = (float)(float)op2->ui64;
2272 else if(op2->kind == 2 && op2->type->isSigned)
2273 *value2 = (float)(float)op2->s;
2274 else if(op2->kind == 2)
2275 *value2 = (float)(float)op2->us;
2276 else if(op2->kind == 1 && op2->type->isSigned)
2277 *value2 = (float)(float)op2->c;
2278 else if(op2->kind == 24 || op2->kind == 1)
2279 *value2 = (float)(float)op2->uc;
2280 else if(op2->kind == 6)
2281 *value2 = (float)op2->f;
2282 else if(op2->kind == 7)
2283 *value2 = (float)op2->d;
2284 else if(op2->kind == 13)
2285 *value2 = (float)(float)op2->ui64;
2286 else
2287 return 0x0;
2288 return 0x1;
2289 }
2290
2291 unsigned int GetFloat(struct Expression * exp, float * value2)
2292 {
2293 struct Operand op2 = GetOperand(exp);
2294
2295 return GetOpFloat(&op2, value2);
2296 }
2297
2298 unsigned int GetOpDouble(struct Operand * op2, double * value2)
2299 {
2300 if(op2->kind == 3 && op2->type->isSigned)
2301 *value2 = (double)(double)op2->i;
2302 else if(op2->kind == 3)
2303 *value2 = (double)(double)op2->ui;
2304 else if(op2->kind == 4 && op2->type->isSigned)
2305 *value2 = (double)(double)op2->i64;
2306 else if(op2->kind == 4)
2307 *value2 = (double)(double)op2->ui64;
2308 else if(op2->kind == 23 && op2->type->isSigned)
2309 *value2 = (double)(double)op2->i64;
2310 else if(op2->kind == 23)
2311 *value2 = (double)(double)op2->ui64;
2312 else if(op2->kind == 22 && op2->type->isSigned)
2313 *value2 = (double)(double)op2->i64;
2314 else if(op2->kind == 22)
2315 *value2 = (double)(double)op2->ui64;
2316 else if(op2->kind == 2 && op2->type->isSigned)
2317 *value2 = (double)(double)op2->s;
2318 else if(op2->kind == 2)
2319 *value2 = (double)(double)op2->us;
2320 else if(op2->kind == 1 && op2->type->isSigned)
2321 *value2 = (double)(double)op2->c;
2322 else if(op2->kind == 24 || op2->kind == 1)
2323 *value2 = (double)(double)op2->uc;
2324 else if(op2->kind == 6)
2325 *value2 = (double)op2->f;
2326 else if(op2->kind == 7)
2327 *value2 = (double)op2->d;
2328 else if(op2->kind == 13)
2329 *value2 = (double)(double)op2->ui64;
2330 else
2331 return 0x0;
2332 return 0x1;
2333 }
2334
2335 unsigned int GetDouble(struct Expression * exp, double * value2)
2336 {
2337 struct Operand op2 = GetOperand(exp);
2338
2339 return GetOpDouble(&op2, value2);
2340 }
2341
2342 void ComputeExpression(struct Expression * exp);
2343
2344 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2345
2346 extern int targetBits;
2347
2348 int ComputeTypeSize(struct Type * type);
2349
2350 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2351
2352 struct __ecereNameSpace__ecere__com__BitMember
2353 {
2354 struct __ecereNameSpace__ecere__com__BitMember * prev;
2355 struct __ecereNameSpace__ecere__com__BitMember * next;
2356 char *  name;
2357 unsigned int isProperty;
2358 int memberAccess;
2359 int id;
2360 struct __ecereNameSpace__ecere__com__Class * _class;
2361 char *  dataTypeString;
2362 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2363 struct Type * dataType;
2364 int type;
2365 int size;
2366 int pos;
2367 uint64 mask;
2368 } __attribute__ ((gcc_struct));
2369
2370 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2371
2372 struct __ecereNameSpace__ecere__sys__OldLink
2373 {
2374 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2375 struct __ecereNameSpace__ecere__sys__OldLink * next;
2376 void *  data;
2377 } __attribute__ ((gcc_struct));
2378
2379 void FinishTemplatesContext(struct Context * context);
2380
2381 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2382 {
2383 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2384 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2385
2386 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))
2387 {
2388 int c;
2389 int unionMemberOffset = 0;
2390 int bitFields = 0;
2391
2392 if(member)
2393 {
2394 member->memberOffset = 0;
2395 if(targetBits < sizeof(void *) * 8)
2396 member->structAlignment = 0;
2397 }
2398 else if(targetBits < sizeof(void *) * 8)
2399 _class->structAlignment = 0;
2400 if(!member && ((_class->type == 0 || _class->type == 5) || (_class->type == 1 && _class->memberOffset && _class->memberOffset > _class->base->structSize)))
2401 _class->memberOffset = (_class->base && _class->type == 1) ? _class->base->structSize : 0;
2402 if(!member && _class->destructionWatchOffset)
2403 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2404 {
2405 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2406
2407 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2408 {
2409 if(!dataMember->isProperty)
2410 {
2411 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2412 {
2413 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
2414 }
2415 }
2416 }
2417 }
2418 {
2419 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2420
2421 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2422 {
2423 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2424 {
2425 if(!isMember && _class->type == 2 && dataMember->dataType)
2426 {
2427 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2428 uint64 mask = 0;
2429 int d;
2430
2431 ComputeTypeSize(dataMember->dataType);
2432 if(bitMember->pos == -1)
2433 bitMember->pos = _class->memberOffset;
2434 if(!bitMember->size)
2435 bitMember->size = dataMember->dataType->size * 8;
2436 _class->memberOffset = bitMember->pos + bitMember->size;
2437 for(d = 0; d < bitMember->size; d++)
2438 {
2439 if(d)
2440 mask <<= 1;
2441 mask |= 1;
2442 }
2443 bitMember->mask = mask << bitMember->pos;
2444 }
2445 else if(dataMember->type == 0 && dataMember->dataType)
2446 {
2447 int size;
2448 int alignment = 0;
2449
2450 if(dataMember->dataType->kind != 8 || ((!dataMember->dataType->_class || !dataMember->dataType->_class->registered || dataMember->dataType->_class->registered != _class || _class->type != 1)))
2451 ComputeTypeSize(dataMember->dataType);
2452 if(dataMember->dataType->bitFieldCount)
2453 {
2454 bitFields += dataMember->dataType->bitFieldCount;
2455 size = 0;
2456 }
2457 else
2458 {
2459 if(bitFields)
2460 {
2461 int size = (bitFields + 7) / 8;
2462
2463 if(isMember)
2464 {
2465 int __simpleStruct0;
2466
2467 if(alignment)
2468 {
2469 int __simpleStruct0;
2470
2471 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2472 if(member->memberOffset % alignment)
2473 member->memberOffset += alignment - (member->memberOffset % alignment);
2474 }
2475 dataMember->offset = member->memberOffset;
2476 if(member->type == 1)
2477 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2478 else
2479 {
2480 member->memberOffset += size;
2481 }
2482 }
2483 else
2484 {
2485 if(alignment)
2486 {
2487 int __simpleStruct0;
2488
2489 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2490 if(_class->memberOffset % alignment)
2491 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2492 }
2493 dataMember->offset = _class->memberOffset;
2494 _class->memberOffset += size;
2495 }
2496 bitFields = 0;
2497 }
2498 size = dataMember->dataType->size;
2499 alignment = dataMember->dataType->alignment;
2500 }
2501 if(isMember)
2502 {
2503 int __simpleStruct0;
2504
2505 if(alignment)
2506 {
2507 int __simpleStruct0;
2508
2509 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2510 if(member->memberOffset % alignment)
2511 member->memberOffset += alignment - (member->memberOffset % alignment);
2512 }
2513 dataMember->offset = member->memberOffset;
2514 if(member->type == 1)
2515 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2516 else
2517 {
2518 member->memberOffset += size;
2519 }
2520 }
2521 else
2522 {
2523 if(alignment)
2524 {
2525 int __simpleStruct0;
2526
2527 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2528 if(_class->memberOffset % alignment)
2529 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2530 }
2531 dataMember->offset = _class->memberOffset;
2532 _class->memberOffset += size;
2533 }
2534 }
2535 else
2536 {
2537 int alignment;
2538
2539 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 0x1);
2540 alignment = dataMember->structAlignment;
2541 if(isMember)
2542 {
2543 int __simpleStruct0;
2544
2545 if(alignment)
2546 {
2547 int __simpleStruct0;
2548
2549 if(member->memberOffset % alignment)
2550 member->memberOffset += alignment - (member->memberOffset % alignment);
2551 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2552 }
2553 dataMember->offset = member->memberOffset;
2554 if(member->type == 1)
2555 unionMemberOffset = (__simpleStruct0 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2556 else
2557 member->memberOffset += dataMember->memberOffset;
2558 }
2559 else
2560 {
2561 if(alignment)
2562 {
2563 int __simpleStruct0;
2564
2565 if(_class->memberOffset % alignment)
2566 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2567 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2568 }
2569 dataMember->offset = _class->memberOffset;
2570 _class->memberOffset += dataMember->memberOffset;
2571 }
2572 }
2573 }
2574 }
2575 if(bitFields)
2576 {
2577 int alignment = 0;
2578 int size = (bitFields + 7) / 8;
2579
2580 if(isMember)
2581 {
2582 int __simpleStruct0;
2583
2584 if(alignment)
2585 {
2586 int __simpleStruct0;
2587
2588 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2589 if(member->memberOffset % alignment)
2590 member->memberOffset += alignment - (member->memberOffset % alignment);
2591 }
2592 if(member->type == 1)
2593 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2594 else
2595 {
2596 member->memberOffset += size;
2597 }
2598 }
2599 else
2600 {
2601 if(alignment)
2602 {
2603 int __simpleStruct0;
2604
2605 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2606 if(_class->memberOffset % alignment)
2607 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2608 }
2609 _class->memberOffset += size;
2610 }
2611 bitFields = 0;
2612 }
2613 }
2614 if(member && member->type == 1)
2615 {
2616 member->memberOffset = unionMemberOffset;
2617 }
2618 if(!isMember)
2619 {
2620 if(_class->type != 2)
2621 {
2622 int extra = 0;
2623
2624 if(_class->structAlignment)
2625 {
2626 if(_class->memberOffset % _class->structAlignment)
2627 extra += _class->structAlignment - (_class->memberOffset % _class->structAlignment);
2628 }
2629 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset + extra;
2630 if(!member)
2631 {
2632 struct __ecereNameSpace__ecere__com__Property * prop;
2633
2634 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2635 {
2636 if(prop->isProperty && prop->isWatchable)
2637 {
2638 prop->watcherOffset = _class->structSize;
2639 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2640 }
2641 }
2642 }
2643 {
2644 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2645
2646 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2647 {
2648 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2649
2650 if(deriv->computeSize)
2651 {
2652 deriv->offset = _class->structSize;
2653 deriv->memberOffset = 0;
2654 deriv->structSize = deriv->offset;
2655 ComputeClassMembers(deriv, 0x0);
2656 }
2657 }
2658 }
2659 }
2660 }
2661 }
2662 if(context)
2663 FinishTemplatesContext(context);
2664 }
2665
2666 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2667
2668 struct __ecereNameSpace__ecere__com__NameSpace
2669 {
2670 char *  name;
2671 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
2672 struct __ecereNameSpace__ecere__com__NameSpace *  left;
2673 struct __ecereNameSpace__ecere__com__NameSpace *  right;
2674 int depth;
2675 struct __ecereNameSpace__ecere__com__NameSpace *  parent;
2676 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2677 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2678 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2679 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2680 } __attribute__ ((gcc_struct));
2681
2682 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2683
2684 struct __ecereNameSpace__ecere__com__Module
2685 {
2686 struct __ecereNameSpace__ecere__com__Instance * application;
2687 struct __ecereNameSpace__ecere__sys__OldList classes;
2688 struct __ecereNameSpace__ecere__sys__OldList defines;
2689 struct __ecereNameSpace__ecere__sys__OldList functions;
2690 struct __ecereNameSpace__ecere__sys__OldList modules;
2691 struct __ecereNameSpace__ecere__com__Instance * prev;
2692 struct __ecereNameSpace__ecere__com__Instance * next;
2693 char *  name;
2694 void *  library;
2695 void *  Unload;
2696 int importType;
2697 int origImportType;
2698 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2699 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2700 } __attribute__ ((gcc_struct));
2701
2702 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2703 {
2704 struct __ecereNameSpace__ecere__com__Class * _class;
2705 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2706
2707 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
2708 ComputeModuleClasses(subModule->data);
2709 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->classes.first; _class; _class = _class->next)
2710 ComputeClassMembers(_class, 0x0);
2711 }
2712
2713 extern unsigned int inCompiler;
2714
2715 extern void Compiler_Error(char *  format, ...);
2716
2717 extern char *  __ecereNameSpace__ecere__GetTranslatedString(char * name, char *  string, char *  stringAndContext);
2718
2719 int ComputeTypeSize(struct Type * type)
2720 {
2721 unsigned int size = type ? type->size : 0;
2722
2723 if(!size && type && !type->computing)
2724 {
2725 type->computing = 0x1;
2726 switch(type->kind)
2727 {
2728 case 24:
2729 type->alignment = size = sizeof(char);
2730 break;
2731 case 1:
2732 type->alignment = size = sizeof(char);
2733 break;
2734 case 3:
2735 type->alignment = size = sizeof(int);
2736 break;
2737 case 4:
2738 type->alignment = size = sizeof(long long);
2739 break;
2740 case 22:
2741 type->alignment = size = targetBits / 8;
2742 break;
2743 case 23:
2744 type->alignment = size = targetBits / 8;
2745 break;
2746 case 5:
2747 type->alignment = size = sizeof(long);
2748 break;
2749 case 2:
2750 type->alignment = size = sizeof(short);
2751 break;
2752 case 6:
2753 type->alignment = size = sizeof(float);
2754 break;
2755 case 7:
2756 type->alignment = size = sizeof(double);
2757 break;
2758 case 8:
2759 {
2760 struct __ecereNameSpace__ecere__com__Class * _class = type->_class ? type->_class->registered : (((void *)0));
2761
2762 if(_class && _class->type == 1)
2763 {
2764 ComputeClassMembers(_class, 0x0);
2765 type->alignment = _class->structAlignment;
2766 size = _class->structSize;
2767 if(type->alignment && size % type->alignment)
2768 size += type->alignment - (size % type->alignment);
2769 }
2770 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2771 {
2772 if(!_class->dataType)
2773 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2774 size = type->alignment = ComputeTypeSize(_class->dataType);
2775 }
2776 else
2777 size = type->alignment = targetBits / 8;
2778 break;
2779 }
2780 case 13:
2781 case 19:
2782 size = type->alignment = targetBits / 8;
2783 break;
2784 case 12:
2785 if(type->arraySizeExp)
2786 {
2787 ProcessExpressionType(type->arraySizeExp);
2788 ComputeExpression(type->arraySizeExp);
2789 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)))
2790 {
2791 struct Location oldLoc = yylloc;
2792 char expression[10240];
2793
2794 expression[0] = '\0';
2795 type->arraySizeExp->expType = (((void *)0));
2796 yylloc = type->arraySizeExp->loc;
2797 if(inCompiler)
2798 PrintExpression(type->arraySizeExp, expression);
2799 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Array size not constant int (%s)\n", (((void *)0))), expression);
2800 yylloc = oldLoc;
2801 }
2802 GetInt(type->arraySizeExp, &type->arraySize);
2803 }
2804 else if(type->enumClass)
2805 {
2806 if(type->enumClass && type->enumClass->registered && type->enumClass->registered->type == 4)
2807 {
2808 type->arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->enumClass->registered, "enumSize");
2809 }
2810 else
2811 type->arraySize = 0;
2812 }
2813 else
2814 {
2815 type->arraySize = 0;
2816 }
2817 size = ComputeTypeSize(type->type) * type->arraySize;
2818 if(type->type)
2819 type->alignment = type->type->alignment;
2820 break;
2821 case 9:
2822 {
2823 struct Type * member;
2824
2825 for(member = type->members.first; member; member = member->next)
2826 {
2827 int __simpleStruct0, __simpleStruct1;
2828 unsigned int addSize = ComputeTypeSize(member);
2829
2830 member->offset = size;
2831 if(member->alignment && size % member->alignment)
2832 member->offset += member->alignment - (size % member->alignment);
2833 size = member->offset;
2834 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2835 size += addSize;
2836 }
2837 if(type->alignment && size % type->alignment)
2838 size += type->alignment - (size % type->alignment);
2839 break;
2840 }
2841 case 10:
2842 {
2843 struct Type * member;
2844
2845 for(member = type->members.first; member; member = member->next)
2846 {
2847 int __simpleStruct0, __simpleStruct1;
2848 unsigned int addSize = ComputeTypeSize(member);
2849
2850 member->offset = size;
2851 if(member->alignment && size % member->alignment)
2852 member->offset += member->alignment - (size % member->alignment);
2853 size = member->offset;
2854 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2855 size = ((size > addSize) ? size : addSize);
2856 }
2857 if(type->alignment && size % type->alignment)
2858 size += type->alignment - (size % type->alignment);
2859 break;
2860 }
2861 case 20:
2862 {
2863 struct TemplateParameter * param = type->templateParameter;
2864 struct Type * baseType = ProcessTemplateParameterType(param);
2865
2866 if(baseType)
2867 {
2868 size = ComputeTypeSize(baseType);
2869 type->alignment = baseType->alignment;
2870 }
2871 else
2872 type->alignment = size = sizeof(uint64);
2873 break;
2874 }
2875 case 15:
2876 {
2877 type->alignment = size = sizeof(enum
2878 {
2879 test
2880 });
2881 break;
2882 }
2883 case 21:
2884 {
2885 type->alignment = size = targetBits / 8;
2886 break;
2887 }
2888 }
2889 type->size = size;
2890 type->computing = 0x0;
2891 }
2892 return size;
2893 }
2894
2895 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2896
2897 extern struct Identifier * MkIdentifier(char *  string);
2898
2899 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void *  item);
2900
2901 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2902
2903 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2904
2905 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2906
2907 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2908
2909 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2910
2911 extern void FreeType(struct Type * type);
2912
2913 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2914
2915 extern struct Specifier * MkSpecifier(int specifier);
2916
2917 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2918
2919 extern struct Expression * MkExpConstant(char *  string);
2920
2921 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)
2922 {
2923 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2924 unsigned int totalSize = 0;
2925 unsigned int maxSize = 0;
2926 int alignment, size;
2927 struct __ecereNameSpace__ecere__com__DataMember * member;
2928 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2929
2930 if(addedPadding)
2931 *addedPadding = 0x0;
2932 if(!isMember && _class->base)
2933 {
2934 maxSize = _class->structSize;
2935 {
2936 if(_class->type == 1 || _class->type == 5)
2937 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass, (((void *)0)));
2938 else
2939 {
2940 unsigned int baseSize = _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2941
2942 if(maxSize > baseSize)
2943 maxSize -= baseSize;
2944 else
2945 maxSize = 0;
2946 }
2947 }
2948 }
2949 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2950 {
2951 if(!member->isProperty)
2952 {
2953 switch(member->type)
2954 {
2955 case 0:
2956 {
2957 if(member->dataTypeString)
2958 {
2959 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2960 struct Declarator * decl;
2961
2962 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2963 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2964 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2965 if(!member->dataType)
2966 member->dataType = ProcessType(specs, decl);
2967 ReplaceThisClassSpecifiers(specs, topClass);
2968 {
2969 struct Type * type = ProcessType(specs, decl);
2970
2971 DeclareType(member->dataType, 0x0, 0x0);
2972 FreeType(type);
2973 }
2974 ComputeTypeSize(member->dataType);
2975 size = member->dataType->size;
2976 alignment = member->dataType->alignment;
2977 if(alignment)
2978 {
2979 if(totalSize % alignment)
2980 totalSize += alignment - (totalSize % alignment);
2981 }
2982 totalSize += size;
2983 }
2984 break;
2985 }
2986 case 1:
2987 case 2:
2988 {
2989 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
2990
2991 size = 0;
2992 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass, (((void *)0)));
2993 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
2994 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, (((void *)0)), (((void *)0)))));
2995 alignment = member->structAlignment;
2996 if(alignment)
2997 {
2998 if(totalSize % alignment)
2999 totalSize += alignment - (totalSize % alignment);
3000 }
3001 totalSize += size;
3002 break;
3003 }
3004 }
3005 }
3006 }
3007 if(retSize)
3008 {
3009 unsigned int __simpleStruct0;
3010
3011 if(topMember && topMember->type == 1)
3012 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
3013 else
3014 *retSize += totalSize;
3015 }
3016 else if(totalSize < maxSize && _class->type != 1000)
3017 {
3018 int autoPadding = 0;
3019
3020 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
3021 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
3022 if(totalSize + autoPadding < maxSize)
3023 {
3024 char sizeString[50];
3025
3026 sprintf(sizeString, "%d", maxSize - totalSize);
3027 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
3028 if(addedPadding)
3029 *addedPadding = 0x1;
3030 }
3031 }
3032 if(context)
3033 FinishTemplatesContext(context);
3034 return topMember ? topMember->memberID : _class->memberID;
3035 }
3036
3037 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
3038 {
3039 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
3040 unsigned int totalSize = 0;
3041 struct __ecereNameSpace__ecere__com__DataMember * member;
3042 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
3043
3044 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
3045 DeclareMembers(_class->base, 0x0);
3046 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
3047 {
3048 if(!member->isProperty)
3049 {
3050 switch(member->type)
3051 {
3052 case 0:
3053 {
3054 if(!member->dataType && member->dataTypeString)
3055 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
3056 if(member->dataType)
3057 DeclareType(member->dataType, 0x0, 0x0);
3058 break;
3059 }
3060 case 1:
3061 case 2:
3062 {
3063 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
3064 break;
3065 }
3066 }
3067 }
3068 }
3069 if(context)
3070 FinishTemplatesContext(context);
3071 return topMember ? topMember->memberID : _class->memberID;
3072 }
3073
3074 extern struct Symbol * FindClass(char *  name);
3075
3076 extern char *  strchr(const char * , int);
3077
3078 extern void FullClassNameCat(char *  output, char *  className, unsigned int includeTemplateParams);
3079
3080 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (*  FreeFunction)(void * ));
3081
3082 extern void FreeClassDef(struct ClassDef * def);
3083
3084 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
3085
3086 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
3087
3088 extern void MangleClassName(char *  className);
3089
3090 extern void DeclareClass(struct Symbol * classSym, char *  className);
3091
3092 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item, void *  prevItem);
3093
3094 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void *  prevItem, void *  item);
3095
3096 void DeclareStruct(char * name, unsigned int skipNoHead)
3097 {
3098 struct External * external = (((void *)0));
3099 struct Symbol * classSym = FindClass(name);
3100
3101 if(!inCompiler || !classSym)
3102 return ;
3103 if(classSym->registered && (classSym->registered->type == 2 || classSym->registered->type == 3 || classSym->registered->type == 4))
3104 return ;
3105 if(classSym->registered && classSym->imported && !classSym->declaredStructSym)
3106 {
3107 struct Declaration * decl;
3108 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3109 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
3110 char structName[1024];
3111
3112 external = (classSym->registered && classSym->registered->type == 1) ? classSym->pointerExternal : classSym->structExternal;
3113 classSym->declaring++;
3114 if(strchr(classSym->string, '<'))
3115 {
3116 if(classSym->registered->templateClass)
3117 {
3118 DeclareStruct(classSym->registered->templateClass->fullName, skipNoHead);
3119 classSym->declaring--;
3120 }
3121 return ;
3122 }
3123 DeclareMembers(classSym->registered, 0x0);
3124 structName[0] = (char)0;
3125 FullClassNameCat(structName, name, 0x0);
3126 if(!skipNoHead)
3127 {
3128 unsigned int addedPadding = 0x0;
3129
3130 classSym->declaredStructSym = 0x1;
3131 declarations = MkList();
3132 AddMembers(declarations, classSym->registered, 0x0, (((void *)0)), classSym->registered, &addedPadding);
3133 if(!(*declarations).count || ((*declarations).count == 1 && addedPadding))
3134 {
3135 FreeList(declarations, FreeClassDef);
3136 declarations = (((void *)0));
3137 }
3138 }
3139 if(skipNoHead || declarations)
3140 {
3141 if(external && external->declaration)
3142 {
3143 ((struct Specifier *)(*external->declaration->specifiers).first)->definitions = declarations;
3144 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3145 {
3146 if(classSym->structExternal)
3147 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3148 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3149 classSym->id = curExternal->symbol->idCode;
3150 classSym->idCode = curExternal->symbol->idCode;
3151 }
3152 }
3153 else
3154 {
3155 if(!external)
3156 external = MkExternalDeclaration((((void *)0)));
3157 specifiers = MkList();
3158 declarators = MkList();
3159 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
3160 external->declaration = decl = MkDeclaration(specifiers, declarators);
3161 if(decl->symbol && !decl->symbol->pointerExternal)
3162 decl->symbol->pointerExternal = external;
3163 if(classSym->registered && classSym->registered->type == 1)
3164 {
3165 char className[1024];
3166
3167 strcpy(className, "__ecereClass_");
3168 FullClassNameCat(className, classSym->string, 0x1);
3169 MangleClassName(className);
3170 DeclareClass(classSym, className);
3171 external->symbol = classSym;
3172 classSym->pointerExternal = external;
3173 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3174 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3175 }
3176 else
3177 {
3178 char className[1024];
3179
3180 strcpy(className, "__ecereClass_");
3181 FullClassNameCat(className, classSym->string, 0x1);
3182 MangleClassName(className);
3183 classSym->structExternal = external;
3184 DeclareClass(classSym, className);
3185 external->symbol = classSym;
3186 }
3187 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
3188 }
3189 }
3190 classSym->declaring--;
3191 }
3192 else if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3193 {
3194 classSym->declaring++;
3195 {
3196 if(classSym->registered)
3197 DeclareMembers(classSym->registered, 0x0);
3198 }
3199 if(classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 5))
3200 {
3201 if(classSym->structExternal)
3202 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3203 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3204 classSym->id = curExternal->symbol->idCode;
3205 classSym->idCode = curExternal->symbol->idCode;
3206 }
3207 classSym->declaring--;
3208 }
3209 }
3210
3211 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
3212
3213 extern struct ModuleImport * mainModule;
3214
3215 extern struct Specifier * MkSpecifierName(char *  name);
3216
3217 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
3218
3219 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
3220
3221 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
3222
3223 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
3224
3225 extern void FreeDeclarator(struct Declarator * decl);
3226
3227 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
3228
3229 struct PropertyImport
3230 {
3231 struct PropertyImport * prev;
3232 struct PropertyImport * next;
3233 char *  name;
3234 unsigned int isVirtual;
3235 unsigned int hasSet;
3236 unsigned int hasGet;
3237 } __attribute__ ((gcc_struct));
3238
3239 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
3240
3241 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
3242 {
3243 struct Symbol * symbol = prop->symbol;
3244 char propName[1024];
3245
3246 strcpy(setName, "__ecereProp_");
3247 FullClassNameCat(setName, prop->_class->fullName, 0x0);
3248 strcat(setName, "_Set_");
3249 FullClassNameCat(setName, prop->name, 0x1);
3250 strcpy(getName, "__ecereProp_");
3251 FullClassNameCat(getName, prop->_class->fullName, 0x0);
3252 strcat(getName, "_Get_");
3253 FullClassNameCat(getName, prop->name, 0x1);
3254 strcpy(propName, "__ecereProp_");
3255 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3256 strcat(propName, "_");
3257 FullClassNameCat(propName, prop->name, 0x1);
3258 MangleClassName(getName);
3259 MangleClassName(setName);
3260 MangleClassName(propName);
3261 if(prop->_class->type == 1)
3262 DeclareStruct(prop->_class->fullName, 0x0);
3263 if(!symbol || curExternal->symbol->idCode < symbol->id)
3264 {
3265 unsigned int imported = 0x0;
3266 unsigned int dllImport = 0x0;
3267
3268 if(!symbol || symbol->_import)
3269 {
3270 if(!symbol)
3271 {
3272 struct Symbol * classSym;
3273
3274 if(!prop->_class->symbol)
3275 prop->_class->symbol = FindClass(prop->_class->fullName);
3276 classSym = prop->_class->symbol;
3277 if(classSym && !classSym->_import)
3278 {
3279 struct ModuleImport * module;
3280
3281 if(prop->_class->module)
3282 module = FindModule(prop->_class->module);
3283 else
3284 module = mainModule;
3285 classSym->_import = __extension__ ({
3286 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
3287
3288 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
3289 });
3290 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3291 }
3292 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3293 symbol->_import = (struct ClassImport *)__extension__ ({
3294 struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
3295
3296 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0x0, __ecereInstance1->hasSet = prop->Set ? 0x1 : 0x0, __ecereInstance1->hasGet = prop->Get ? 0x1 : 0x0, __ecereInstance1;
3297 });
3298 if(classSym)
3299 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3300 }
3301 imported = 0x1;
3302 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)
3303 dllImport = 0x1;
3304 }
3305 if(!symbol->type)
3306 {
3307 struct Context * context = SetupTemplatesContext(prop->_class);
3308
3309 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
3310 FinishTemplatesContext(context);
3311 }
3312 if(prop->Get)
3313 {
3314 if(!symbol->externalGet || symbol->externalGet->type == 0)
3315 {
3316 struct Declaration * decl;
3317 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3318 struct Declarator * d;
3319 struct __ecereNameSpace__ecere__sys__OldList * params;
3320 struct Specifier * spec;
3321 struct External * external;
3322 struct Declarator * typeDecl;
3323 unsigned int simple = 0x0;
3324
3325 specifiers = MkList();
3326 declarators = MkList();
3327 params = MkList();
3328 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3329 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3330 if(dllImport)
3331 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3332 {
3333 struct Context * context = SetupTemplatesContext(prop->_class);
3334
3335 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3336 FinishTemplatesContext(context);
3337 }
3338 for(spec = (*specifiers).first; spec; spec = spec->next)
3339 {
3340 if(spec->type == 1)
3341 {
3342 if((!typeDecl || typeDecl->type == 1))
3343 {
3344 struct Symbol * classSym = spec->symbol;
3345
3346 symbol->_class = classSym->registered;
3347 if(classSym->registered && classSym->registered->type == 1)
3348 {
3349 DeclareStruct(spec->name, 0x0);
3350 simple = 0x1;
3351 }
3352 }
3353 }
3354 }
3355 if(!simple)
3356 d = PlugDeclarator(typeDecl, d);
3357 else
3358 {
3359 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3360 specifiers = MkList();
3361 }
3362 d = MkDeclaratorFunction(d, params);
3363 if(dllImport)
3364 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3365 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3366 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3367 if(simple)
3368 ListAdd(specifiers, MkSpecifier(VOID));
3369 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3370 decl = MkDeclaration(specifiers, declarators);
3371 external = MkExternalDeclaration(decl);
3372 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3373 external->symbol = symbol;
3374 symbol->externalGet = external;
3375 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3376 if(typeDecl)
3377 FreeDeclarator(typeDecl);
3378 }
3379 else
3380 {
3381 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
3382 }
3383 }
3384 if(prop->Set)
3385 {
3386 if(!symbol->externalSet || symbol->externalSet->type == 0)
3387 {
3388 struct Declaration * decl;
3389 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3390 struct Declarator * d;
3391 struct __ecereNameSpace__ecere__sys__OldList * params;
3392 struct Specifier * spec;
3393 struct External * external;
3394 struct Declarator * typeDecl;
3395
3396 declarators = MkList();
3397 params = MkList();
3398 if(!prop->conversion || prop->_class->type == 1)
3399 {
3400 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3401 }
3402 specifiers = MkList();
3403 {
3404 struct Context * context = SetupTemplatesContext(prop->_class);
3405
3406 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3407 FinishTemplatesContext(context);
3408 }
3409 ListAdd(params, MkTypeName(specifiers, d));
3410 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3411 if(dllImport)
3412 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3413 d = MkDeclaratorFunction(d, params);
3414 for(spec = (*specifiers).first; spec; spec = spec->next)
3415 {
3416 if(spec->type == 1)
3417 {
3418 if((!typeDecl || typeDecl->type == 1))
3419 {
3420 struct Symbol * classSym = spec->symbol;
3421
3422 symbol->_class = classSym->registered;
3423 if(classSym->registered && classSym->registered->type == 1)
3424 DeclareStruct(spec->name, 0x0);
3425 }
3426 }
3427 }
3428 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3429 specifiers = MkList();
3430 if(dllImport)
3431 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3432 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3433 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3434 if(!prop->conversion || prop->_class->type == 1)
3435 ListAdd(specifiers, MkSpecifier(VOID));
3436 else
3437 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3438 decl = MkDeclaration(specifiers, declarators);
3439 external = MkExternalDeclaration(decl);
3440 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3441 external->symbol = symbol;
3442 symbol->externalSet = external;
3443 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3444 }
3445 else
3446 {
3447 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3448 }
3449 }
3450 if(!symbol->externalPtr)
3451 {
3452 struct Declaration * decl;
3453 struct External * external;
3454 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3455
3456 if(imported)
3457 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3458 else
3459 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3460 ListAdd(specifiers, MkSpecifierName("Property"));
3461 {
3462 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3463
3464 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3465 if(!imported)
3466 {
3467 strcpy(propName, "__ecerePropM_");
3468 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3469 strcat(propName, "_");
3470 FullClassNameCat(propName, prop->name, 0x1);
3471 MangleClassName(propName);
3472 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3473 }
3474 decl = MkDeclaration(specifiers, list);
3475 }
3476 external = MkExternalDeclaration(decl);
3477 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3478 external->symbol = symbol;
3479 symbol->externalPtr = external;
3480 }
3481 else
3482 {
3483 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3484 }
3485 symbol->id = curExternal->symbol->idCode;
3486 }
3487 }
3488
3489 struct Type * Dereference(struct Type * source)
3490 {
3491 struct Type * type = (((void *)0));
3492
3493 if(source)
3494 {
3495 if(source->kind == 13 || source->kind == 12)
3496 {
3497 type = source->type;
3498 source->type->refCount++;
3499 }
3500 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3501 {
3502 type = __extension__ ({
3503 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3504
3505 __ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
3506 });
3507 }
3508 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3509 {
3510 type = source;
3511 source->refCount++;
3512 }
3513 else
3514 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot dereference type\n", (((void *)0))));
3515 }
3516 return type;
3517 }
3518
3519 static struct Type * Reference(struct Type * source)
3520 {
3521 struct Type * type = (((void *)0));
3522
3523 if(source)
3524 {
3525 type = __extension__ ({
3526 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3527
3528 __ecereInstance1->kind = 13, __ecereInstance1->type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
3529 });
3530 source->refCount++;
3531 }
3532 return type;
3533 }
3534
3535 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);
3536
3537 extern void *  memcpy(void * , const void * , size_t size);
3538
3539 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3540
3541 extern void FreeExpression(struct Expression * exp);
3542
3543 extern void __ecereNameSpace__ecere__sys__ChangeCh(char *  string, char ch1, char ch2);
3544
3545 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);
3546
3547 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3548
3549 extern struct Type * MkClassType(char *  name);
3550
3551 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);
3552
3553 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)
3554 {
3555 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3556 unsigned int found = 0x0;
3557 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3558 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3559 unsigned int freeType = 0x0;
3560
3561 yylloc = member->loc;
3562 if(!ident)
3563 {
3564 if(curMember)
3565 {
3566 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3567 if(*curMember)
3568 {
3569 found = 0x1;
3570 dataMember = *curMember;
3571 }
3572 }
3573 }
3574 else
3575 {
3576 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3577 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3578 int _subMemberStackPos = 0;
3579
3580 if(!thisMember)
3581 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3582 if(thisMember)
3583 {
3584 dataMember = thisMember;
3585 if(curMember && thisMember->memberAccess == 1)
3586 {
3587 *curMember = thisMember;
3588 *curClass = thisMember->_class;
3589 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
3590 *subMemberStackPos = _subMemberStackPos;
3591 }
3592 found = 0x1;
3593 }
3594 else
3595 {
3596 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3597 if(method && method->type == 1)
3598 found = 0x1;
3599 else
3600 method = (((void *)0));
3601 }
3602 }
3603 if(found)
3604 {
3605 struct Type * type = (((void *)0));
3606
3607 if(dataMember)
3608 {
3609 if(!dataMember->dataType && dataMember->dataTypeString)
3610 {
3611 struct Context * context = SetupTemplatesContext(_class);
3612
3613 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3614 FinishTemplatesContext(context);
3615 }
3616 type = dataMember->dataType;
3617 }
3618 else if(method)
3619 {
3620 if(!method->dataType)
3621 ProcessMethodType(method);
3622 type = method->dataType;
3623 }
3624 if(ident && ident->next)
3625 {
3626 for(ident = ident->next; ident && type; ident = ident->next)
3627 {
3628 if(type->kind == 8)
3629 {
3630 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3631 if(!dataMember)
3632 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3633 if(dataMember)
3634 type = dataMember->dataType;
3635 }
3636 else if(type->kind == 9 || type->kind == 10)
3637 {
3638 struct Type * memberType;
3639
3640 for(memberType = type->members.first; memberType; memberType = memberType->next)
3641 {
3642 if(!strcmp(memberType->name, ident->string))
3643 {
3644 type = memberType;
3645 break;
3646 }
3647 }
3648 }
3649 }
3650 }
3651 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3652 {
3653 int id = 0;
3654 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3655 struct __ecereNameSpace__ecere__com__Class * sClass;
3656
3657 for(sClass = _class; sClass; sClass = sClass->base)
3658 {
3659 id = 0;
3660 if(sClass->templateClass)
3661 sClass = sClass->templateClass;
3662 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3663 {
3664 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3665 {
3666 for(sClass = sClass->base; sClass; sClass = sClass->base)
3667 {
3668 if(sClass->templateClass)
3669 sClass = sClass->templateClass;
3670 id += sClass->templateParams.count;
3671 }
3672 break;
3673 }
3674 id++;
3675 }
3676 if(curParam)
3677 break;
3678 }
3679 if(curParam)
3680 {
3681 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3682
3683 if(arg.dataTypeString)
3684 {
3685 type = ProcessTypeString(arg.dataTypeString, 0x0);
3686 freeType = 0x1;
3687 if(type && _class->templateClass)
3688 type->passAsTemplate = 0x1;
3689 if(type)
3690 {
3691 }
3692 }
3693 }
3694 }
3695 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3696 {
3697 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3698 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3699 int c;
3700 int paramCount = 0;
3701 int lastParam = -1;
3702 char templateString[1024];
3703 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3704
3705 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3706 for(cClass = expClass; cClass; cClass = cClass->base)
3707 {
3708 int p = 0;
3709
3710 if(cClass->templateClass)
3711 cClass = cClass->templateClass;
3712 for(param = cClass->templateParams.first; param; param = param->next)
3713 {
3714 int id = p;
3715 struct __ecereNameSpace__ecere__com__Class * sClass;
3716 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3717
3718 for(sClass = cClass->base; sClass; sClass = sClass->base)
3719 {
3720 if(sClass->templateClass)
3721 sClass = sClass->templateClass;
3722 id += sClass->templateParams.count;
3723 }
3724 arg = expClass->templateArgs[id];
3725 for(sClass = _class; sClass; sClass = sClass->base)
3726 {
3727 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3728 int p = 0;
3729 struct __ecereNameSpace__ecere__com__Class * nextClass;
3730
3731 if(sClass->templateClass)
3732 sClass = sClass->templateClass;
3733 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3734 {
3735 if(nextClass->templateClass)
3736 nextClass = nextClass->templateClass;
3737 p += nextClass->templateParams.count;
3738 }
3739 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3740 {
3741 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3742 {
3743 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3744 {
3745 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3746 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3747 break;
3748 }
3749 }
3750 }
3751 }
3752 {
3753 char argument[256];
3754
3755 argument[0] = '\0';
3756 switch(param->type)
3757 {
3758 case 2:
3759 {
3760 char expString[1024];
3761 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3762 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3763 struct Expression * exp;
3764 char * string = PrintHexUInt64(arg.expression.ui64);
3765
3766 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3767 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
3768 ProcessExpressionType(exp);
3769 ComputeExpression(exp);
3770 expString[0] = '\0';
3771 PrintExpression(exp, expString);
3772 strcat(argument, expString);
3773 FreeExpression(exp);
3774 break;
3775 }
3776 case 1:
3777 {
3778 strcat(argument, arg.member->name);
3779 break;
3780 }
3781 case 0:
3782 {
3783 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3784 strcat(argument, arg.dataTypeString);
3785 break;
3786 }
3787 }
3788 if(argument[0])
3789 {
3790 if(paramCount)
3791 strcat(templateString, ", ");
3792 if(lastParam != p - 1)
3793 {
3794 strcat(templateString, param->name);
3795 strcat(templateString, " = ");
3796 }
3797 strcat(templateString, argument);
3798 paramCount++;
3799 lastParam = p;
3800 }
3801 p++;
3802 }
3803 }
3804 }
3805 {
3806 int len = strlen(templateString);
3807
3808 if(templateString[len - 1] == '<')
3809 len--;
3810 else
3811 {
3812 if(templateString[len - 1] == '>')
3813 templateString[len++] = ' ';
3814 templateString[len++] = '>';
3815 }
3816 templateString[len++] = '\0';
3817 }
3818 {
3819 struct Context * context = SetupTemplatesContext(_class);
3820
3821 if(freeType)
3822 FreeType(type);
3823 type = ProcessTypeString(templateString, 0x0);
3824 freeType = 0x1;
3825 FinishTemplatesContext(context);
3826 }
3827 }
3828 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3829 {
3830 ProcessExpressionType(member->initializer->exp);
3831 if(!member->initializer->exp->expType)
3832 {
3833 if(inCompiler)
3834 {
3835 char expString[10240];
3836
3837 expString[0] = '\0';
3838 PrintExpression(member->initializer->exp, expString);
3839 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3840 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3841 }
3842 }
3843 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0))
3844 {
3845 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible instance method %s\n", (((void *)0))), ident->string);
3846 }
3847 }
3848 else if(member->initializer)
3849 {
3850 ProcessInitializer(member->initializer, type);
3851 }
3852 if(freeType)
3853 FreeType(type);
3854 }
3855 else
3856 {
3857 if(_class && _class->type == 3)
3858 {
3859 if(member->initializer)
3860 {
3861 struct Type * type = MkClassType(_class->fullName);
3862
3863 ProcessInitializer(member->initializer, type);
3864 FreeType(type);
3865 }
3866 }
3867 else
3868 {
3869 if(member->initializer)
3870 {
3871 ProcessInitializer(member->initializer, (((void *)0)));
3872 }
3873 if(ident)
3874 {
3875 if(method)
3876 {
3877 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3878 }
3879 else if(_class)
3880 {
3881 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3882 if(inCompiler)
3883 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3884 }
3885 }
3886 else if(_class)
3887 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3888 }
3889 }
3890 }
3891
3892 extern struct Identifier * GetDeclId(struct Declarator * decl);
3893
3894 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);
3895
3896 extern void FreeSpecifier(struct Specifier * spec);
3897
3898 static void ProcessFunction(struct FunctionDefinition * function);
3899
3900 extern struct __ecereNameSpace__ecere__sys__OldList *  CopyList(struct __ecereNameSpace__ecere__sys__OldList *  source, void *  (*  CopyFunction)(void * ));
3901
3902 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3903
3904 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3905
3906 extern void FreeClassFunction(struct ClassFunction * func);
3907
3908 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3909
3910 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3911
3912 void ProcessInstantiationType(struct Instantiation * inst)
3913 {
3914 yylloc = inst->loc;
3915 if(inst->_class)
3916 {
3917 struct MembersInit * members;
3918 struct Symbol * classSym;
3919 struct __ecereNameSpace__ecere__com__Class * _class;
3920
3921 classSym = inst->_class->symbol;
3922 _class = classSym ? classSym->registered : (((void *)0));
3923 if(!_class || _class->type != 5)
3924 DeclareStruct(inst->_class->name, 0x0);
3925 afterExternal = afterExternal ? afterExternal : curExternal;
3926 if(inst->exp)
3927 ProcessExpressionType(inst->exp);
3928 inst->isConstant = 0x1;
3929 if(inst->members)
3930 {
3931 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3932 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3933 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3934 int subMemberStackPos = 0;
3935
3936 for(members = (*inst->members).first; members; members = members->next)
3937 {
3938 switch(members->type)
3939 {
3940 case 1:
3941 {
3942 char name[1024];
3943 static unsigned int instMethodID = 0;
3944 struct External * external = curExternal;
3945 struct Context * context = curContext;
3946 struct Declarator * declarator = members->function->declarator;
3947 struct Identifier * nameID = GetDeclId(declarator);
3948 char * unmangled = nameID ? nameID->string : (((void *)0));
3949 struct Expression * exp;
3950 struct External * createdExternal = (((void *)0));
3951
3952 if(inCompiler)
3953 {
3954 char number[16];
3955
3956 strcpy(name, "__ecereInstMeth_");
3957 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
3958 strcat(name, "_");
3959 strcat(name, nameID->string);
3960 strcat(name, "_");
3961 sprintf(number, "_%08d", instMethodID++);
3962 strcat(name, number);
3963 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
3964 }
3965 if(declarator)
3966 {
3967 struct Symbol * symbol = declarator->symbol;
3968 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
3969
3970 if(method && method->type == 1)
3971 {
3972 symbol->method = method;
3973 ProcessMethodType(method);
3974 if(!symbol->type->thisClass)
3975 {
3976 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
3977 {
3978 if(!currentClass->symbol)
3979 currentClass->symbol = FindClass(currentClass->fullName);
3980 symbol->type->thisClass = currentClass->symbol;
3981 }
3982 else
3983 {
3984 if(!_class->symbol)
3985 _class->symbol = FindClass(_class->fullName);
3986 symbol->type->thisClass = _class->symbol;
3987 }
3988 }
3989 DeclareType(symbol->type, 0x1, 0x1);
3990 }
3991 else if(classSym)
3992 {
3993 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
3994 }
3995 }
3996 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
3997 if(nameID)
3998 {
3999 FreeSpecifier(nameID->_class);
4000 nameID->_class = (((void *)0));
4001 }
4002 if(inCompiler)
4003 {
4004 struct Type * type = declarator->symbol->type;
4005 struct External * oldExternal = curExternal;
4006
4007 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
4008 {
4009 struct External * externalDecl;
4010
4011 externalDecl = MkExternalDeclaration((((void *)0)));
4012 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
4013 if(createdExternal->function)
4014 {
4015 ProcessFunction(createdExternal->function);
4016 {
4017 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
4018
4019 externalDecl->declaration = decl;
4020 if(decl->symbol && !decl->symbol->pointerExternal)
4021 decl->symbol->pointerExternal = externalDecl;
4022 declarator->symbol->pointerExternal = externalDecl;
4023 }
4024 }
4025 }
4026 }
4027 else if(declarator)
4028 {
4029 curExternal = declarator->symbol->pointerExternal;
4030 ProcessFunction((struct FunctionDefinition *)members->function);
4031 }
4032 curExternal = external;
4033 curContext = context;
4034 if(inCompiler)
4035 {
4036 FreeClassFunction(members->function);
4037 exp = QMkExpId(name);
4038 members->type = 0;
4039 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
4040 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
4041 }
4042 break;
4043 }
4044 case 0:
4045 {
4046 if(members->dataMembers && classSym)
4047 {
4048 struct MemberInit * member;
4049 struct Location oldyyloc = yylloc;
4050
4051 for(member = (*members->dataMembers).first; member; member = member->next)
4052 {
4053 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
4054 if(member->initializer && !member->initializer->isConstant)
4055 inst->isConstant = 0x0;
4056 }
4057 yylloc = oldyyloc;
4058 }
4059 break;
4060 }
4061 }
4062 }
4063 }
4064 }
4065 }
4066
4067 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
4068 {
4069 if(inCompiler)
4070 {
4071 if(type->kind == 11)
4072 {
4073 struct Type * param;
4074
4075 if(declareParams)
4076 {
4077 for(param = type->params.first; param; param = param->next)
4078 DeclareType(param, declarePointers, 0x1);
4079 }
4080 DeclareType(type->returnType, declarePointers, 0x1);
4081 }
4082 else if(type->kind == 13 && declarePointers)
4083 DeclareType(type->type, declarePointers, 0x0);
4084 else if(type->kind == 8)
4085 {
4086 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
4087 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
4088 }
4089 else if(type->kind == 9 || type->kind == 10)
4090 {
4091 struct Type * member;
4092
4093 for(member = type->members.first; member; member = member->next)
4094 DeclareType(member, 0x0, 0x0);
4095 }
4096 else if(type->kind == 12)
4097 DeclareType(type->arrayType, declarePointers, 0x0);
4098 }
4099 }
4100
4101 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
4102
4103 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
4104 {
4105 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
4106 int id = 0;
4107 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4108 struct __ecereNameSpace__ecere__com__Class * sClass;
4109
4110 for(sClass = _class; sClass; sClass = sClass->base)
4111 {
4112 id = 0;
4113 if(sClass->templateClass)
4114 sClass = sClass->templateClass;
4115 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4116 {
4117 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
4118 {
4119 for(sClass = sClass->base; sClass; sClass = sClass->base)
4120 {
4121 if(sClass->templateClass)
4122 sClass = sClass->templateClass;
4123 id += sClass->templateParams.count;
4124 }
4125 break;
4126 }
4127 id++;
4128 }
4129 if(curParam)
4130 break;
4131 }
4132 if(curParam)
4133 {
4134 arg = &_class->templateArgs[id];
4135 if(arg && param->type == 0)
4136 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
4137 }
4138 return arg;
4139 }
4140
4141 extern struct Context * PushContext(void);
4142
4143 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
4144
4145 struct TemplatedType
4146 {
4147 uintptr_t key;
4148 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4149 struct __ecereNameSpace__ecere__sys__BTNode * left;
4150 struct __ecereNameSpace__ecere__sys__BTNode * right;
4151 int depth;
4152 struct TemplateParameter * param;
4153 } __attribute__ ((gcc_struct));
4154
4155 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
4156
4157 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
4158 {
4159 struct Context * context = PushContext();
4160
4161 context->templateTypesOnly = 0x1;
4162 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
4163 {
4164 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
4165
4166 for(; param; param = param->next)
4167 {
4168 if(param->type == 0 && param->identifier)
4169 {
4170 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
4171
4172 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4173 }
4174 }
4175 }
4176 else if(_class)
4177 {
4178 struct __ecereNameSpace__ecere__com__Class * sClass;
4179
4180 for(sClass = _class; sClass; sClass = sClass->base)
4181 {
4182 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
4183
4184 for(p = sClass->templateParams.first; p; p = p->next)
4185 {
4186 if(p->type == 0)
4187 {
4188 struct TemplateParameter * param = p->param;
4189 struct TemplatedType * type;
4190
4191 if(!param)
4192 {
4193 p->param = param = __extension__ ({
4194 struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
4195
4196 __ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->dataTypeString, __ecereInstance1;
4197 });
4198 }
4199 type = __extension__ ({
4200 struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
4201
4202 __ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
4203 });
4204 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4205 }
4206 }
4207 }
4208 }
4209 return context;
4210 }
4211
4212 extern void PopContext(struct Context * ctx);
4213
4214 extern void FreeContext(struct Context * context);
4215
4216 void FinishTemplatesContext(struct Context * context)
4217 {
4218 PopContext(context);
4219 FreeContext(context);
4220 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
4221 }
4222
4223 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
4224 {
4225 if(!method->dataType)
4226 {
4227 struct Context * context = SetupTemplatesContext(method->_class);
4228
4229 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4230 FinishTemplatesContext(context);
4231 if(method->type != 1 && method->dataType)
4232 {
4233 if(!method->dataType->thisClass && !method->dataType->staticMethod)
4234 {
4235 if(!method->_class->symbol)
4236 method->_class->symbol = FindClass(method->_class->fullName);
4237 method->dataType->thisClass = method->_class->symbol;
4238 }
4239 }
4240 }
4241 }
4242
4243 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
4244 {
4245 if(!prop->dataType)
4246 {
4247 struct Context * context = SetupTemplatesContext(prop->_class);
4248
4249 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
4250 FinishTemplatesContext(context);
4251 }
4252 }
4253
4254 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4255
4256 extern void FreeTypeName(struct TypeName * typeName);
4257
4258 static void ProcessDeclarator(struct Declarator * decl);
4259
4260 extern struct __ecereNameSpace__ecere__sys__OldList *  excludedSymbols;
4261
4262 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4263
4264 struct MethodImport
4265 {
4266 struct MethodImport * prev;
4267 struct MethodImport * next;
4268 char *  name;
4269 unsigned int isVirtual;
4270 } __attribute__ ((gcc_struct));
4271
4272 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
4273
4274 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
4275 {
4276 struct Symbol * symbol = method->symbol;
4277
4278 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4279 {
4280 unsigned int imported = 0x0;
4281 unsigned int dllImport = 0x0;
4282
4283 if(!method->dataType)
4284 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4285 if(!symbol || symbol->_import || method->type == 1)
4286 {
4287 if(!symbol || method->type == 1)
4288 {
4289 struct Symbol * classSym;
4290
4291 if(!method->_class->symbol)
4292 method->_class->symbol = FindClass(method->_class->fullName);
4293 classSym = method->_class->symbol;
4294 if(!classSym->_import)
4295 {
4296 struct ModuleImport * module;
4297
4298 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->name)
4299 module = FindModule(method->_class->module);
4300 else
4301 module = mainModule;
4302 classSym->_import = __extension__ ({
4303 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
4304
4305 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
4306 });
4307 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4308 }
4309 if(!symbol)
4310 {
4311 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4312 }
4313 if(!symbol->_import)
4314 {
4315 symbol->_import = (struct ClassImport *)__extension__ ({
4316 struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
4317
4318 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
4319 });
4320 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4321 }
4322 if(!symbol)
4323 {
4324 symbol->type = method->dataType;
4325 if(symbol->type)
4326 symbol->type->refCount++;
4327 }
4328 }
4329 if(!method->dataType->dllExport)
4330 {
4331 imported = 0x1;
4332 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)
4333 dllImport = 0x1;
4334 }
4335 }
4336 if(method->type != 1 && method->dataType)
4337 DeclareType(method->dataType, 0x1, 0x1);
4338 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4339 {
4340 struct Declaration * decl;
4341 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4342 struct Declarator * d;
4343 struct Declarator * funcDecl;
4344 struct External * external;
4345
4346 specifiers = MkList();
4347 declarators = MkList();
4348 if(dllImport)
4349 ListAdd(specifiers, MkSpecifier(EXTERN));
4350 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4351 ListAdd(specifiers, MkSpecifier(STATIC));
4352 if(method->type == 1)
4353 {
4354 ListAdd(specifiers, MkSpecifier(INT));
4355 d = MkDeclaratorIdentifier(MkIdentifier(name));
4356 }
4357 else
4358 {
4359 d = MkDeclaratorIdentifier(MkIdentifier(name));
4360 if(dllImport)
4361 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4362 {
4363 struct Context * context = SetupTemplatesContext(method->_class);
4364
4365 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4366 FinishTemplatesContext(context);
4367 }
4368 funcDecl = GetFuncDecl(d);
4369 if(dllImport)
4370 {
4371 struct Specifier * spec, * next;
4372
4373 for(spec = (*specifiers).first; spec; spec = next)
4374 {
4375 next = spec->next;
4376 if(spec->type == 5)
4377 {
4378 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4379 FreeSpecifier(spec);
4380 }
4381 }
4382 }
4383 if(method->dataType && !method->dataType->staticMethod)
4384 {
4385 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
4386 {
4387 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
4388 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")));
4389 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
4390 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4391
4392 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
4393 {
4394 struct TypeName * param = (*funcDecl->function.parameters).first;
4395
4396 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
4397 FreeTypeName(param);
4398 }
4399 if(!funcDecl->function.parameters)
4400 funcDecl->function.parameters = MkList();
4401 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
4402 }
4403 }
4404 }
4405 ProcessDeclarator(d);
4406 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4407 decl = MkDeclaration(specifiers, declarators);
4408 ReplaceThisClassSpecifiers(specifiers, method->_class);
4409 if(symbol->pointerExternal)
4410 {
4411 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4412
4413 {
4414 *functionSymbol = *symbol;
4415 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4416 if(functionSymbol->type)
4417 functionSymbol->type->refCount++;
4418 }
4419 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4420 symbol->pointerExternal->symbol = functionSymbol;
4421 }
4422 external = MkExternalDeclaration(decl);
4423 if(curExternal)
4424 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4425 external->symbol = symbol;
4426 symbol->pointerExternal = external;
4427 }
4428 else if(ast)
4429 {
4430 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4431 }
4432 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4433 }
4434 }
4435
4436 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4437 {
4438 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4439 {
4440 unsigned int first = 0x1;
4441 int p = 0;
4442 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4443 int lastParam = -1;
4444 char className[1024];
4445
4446 strcpy(className, _class->fullName);
4447 for(param = _class->templateParams.first; param; param = param->next)
4448 {
4449 {
4450 if(first)
4451 strcat(className, "<");
4452 if(!first)
4453 strcat(className, ", ");
4454 if(lastParam + 1 != p)
4455 {
4456 strcat(className, param->name);
4457 strcat(className, " = ");
4458 }
4459 strcat(className, param->name);
4460 first = 0x0;
4461 lastParam = p;
4462 }
4463 p++;
4464 }
4465 if(!first)
4466 {
4467 int len = strlen(className);
4468
4469 if(className[len - 1] == '>')
4470 className[len++] = ' ';
4471 className[len++] = '>';
4472 className[len++] = '\0';
4473 }
4474 return __ecereNameSpace__ecere__sys__CopyString(className);
4475 }
4476 else
4477 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4478 }
4479
4480 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4481 {
4482 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4483 {
4484 unsigned int first = 0x1;
4485 int p = 0;
4486 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4487 int lastParam = -1;
4488 char className[1024];
4489
4490 strcpy(className, _class->fullName);
4491 for(param = _class->templateParams.first; param; param = param->next)
4492 {
4493 {
4494 if(first)
4495 strcat(className, "<");
4496 if(!first)
4497 strcat(className, ", ");
4498 if(lastParam + 1 != p)
4499 {
4500 strcat(className, param->name);
4501 strcat(className, " = ");
4502 }
4503 strcat(className, param->name);
4504 first = 0x0;
4505 lastParam = p;
4506 }
4507 p++;
4508 }
4509 if(!first)
4510 {
4511 int len = strlen(className);
4512
4513 if(className[len - 1] == '>')
4514 className[len++] = ' ';
4515 className[len++] = '>';
4516 className[len++] = '\0';
4517 }
4518 return MkClassType(className);
4519 }
4520 else
4521 {
4522 return MkClassType(_class->fullName);
4523 }
4524 }
4525
4526 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4527 {
4528 if(specs != (((void *)0)) && _class)
4529 {
4530 struct Specifier * spec;
4531
4532 for(spec = specs->first; spec; spec = spec->next)
4533 {
4534 if(spec->type == 0 && spec->specifier == THISCLASS)
4535 {
4536 spec->type = 1;
4537 spec->name = ReplaceThisClass(_class);
4538 spec->symbol = FindClass(spec->name);
4539 }
4540 }
4541 }
4542 }
4543
4544 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4545
4546 struct __ecereNameSpace__ecere__com__GlobalFunction
4547 {
4548 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4549 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4550 char *  name;
4551 int (*  function)();
4552 struct __ecereNameSpace__ecere__com__Instance * module;
4553 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
4554 char *  dataTypeString;
4555 struct Type * dataType;
4556 void *  symbol;
4557 } __attribute__ ((gcc_struct));
4558
4559 extern struct Context * globalContext;
4560
4561 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4562
4563 struct FunctionImport
4564 {
4565 struct FunctionImport * prev;
4566 struct FunctionImport * next;
4567 char *  name;
4568 } __attribute__ ((gcc_struct));
4569
4570 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4571 {
4572 struct Symbol * symbol = function->symbol;
4573
4574 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4575 {
4576 unsigned int imported = 0x0;
4577 unsigned int dllImport = 0x0;
4578
4579 if(!function->dataType)
4580 {
4581 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4582 if(!function->dataType->thisClass)
4583 function->dataType->staticMethod = 0x1;
4584 }
4585 if(inCompiler)
4586 {
4587 if(!symbol)
4588 {
4589 struct ModuleImport * module = FindModule(function->module);
4590
4591 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4592 if(module->name)
4593 {
4594 if(!function->dataType->dllExport)
4595 {
4596 symbol->_import = (struct ClassImport *)__extension__ ({
4597 struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
4598
4599 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
4600 });
4601 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4602 }
4603 }
4604 {
4605 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4606 if(!symbol->type->thisClass)
4607 symbol->type->staticMethod = 0x1;
4608 }
4609 }
4610 imported = symbol->_import ? 0x1 : 0x0;
4611 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1)
4612 dllImport = 0x1;
4613 }
4614 DeclareType(function->dataType, 0x1, 0x1);
4615 if(inCompiler)
4616 {
4617 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4618 {
4619 struct Declaration * decl;
4620 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4621 struct Declarator * d;
4622 struct Declarator * funcDecl;
4623 struct External * external;
4624
4625 specifiers = MkList();
4626 declarators = MkList();
4627 ListAdd(specifiers, MkSpecifier(EXTERN));
4628 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4629 if(dllImport)
4630 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4631 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4632 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType == 1)
4633 {
4634 struct Specifier * spec;
4635
4636 for(spec = (*specifiers).first; spec; spec = spec->next)
4637 if(spec->type == 5 && spec->extDecl && spec->extDecl->type == 0 && !strcmp(spec->extDecl->s, "dllexport"))
4638 {
4639 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4640 FreeSpecifier(spec);
4641 break;
4642 }
4643 }
4644 funcDecl = GetFuncDecl(d);
4645 if(funcDecl && !funcDecl->function.parameters)
4646 {
4647 funcDecl->function.parameters = MkList();
4648 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4649 }
4650 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4651 {
4652 struct Context * oldCtx = curContext;
4653
4654 curContext = globalContext;
4655 decl = MkDeclaration(specifiers, declarators);
4656 curContext = oldCtx;
4657 }
4658 if(symbol->pointerExternal)
4659 {
4660 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4661
4662 {
4663 *functionSymbol = *symbol;
4664 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4665 if(functionSymbol->type)
4666 functionSymbol->type->refCount++;
4667 }
4668 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4669 symbol->pointerExternal->symbol = functionSymbol;
4670 }
4671 external = MkExternalDeclaration(decl);
4672 if(curExternal)
4673 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4674 external->symbol = symbol;
4675 symbol->pointerExternal = external;
4676 }
4677 else
4678 {
4679 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4680 }
4681 if(curExternal)
4682 symbol->id = curExternal->symbol->idCode;
4683 }
4684 }
4685 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1) ? 0x1 : 0x0;
4686 }
4687
4688 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4689
4690 struct GlobalData
4691 {
4692 uintptr_t key;
4693 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4694 struct __ecereNameSpace__ecere__sys__BTNode * left;
4695 struct __ecereNameSpace__ecere__sys__BTNode * right;
4696 int depth;
4697 struct __ecereNameSpace__ecere__com__Instance * module;
4698 char *  dataTypeString;
4699 struct Type * dataType;
4700 void *  symbol;
4701 char *  fullName;
4702 } __attribute__ ((gcc_struct));
4703
4704 void DeclareGlobalData(struct GlobalData * data)
4705 {
4706 struct Symbol * symbol = data->symbol;
4707
4708 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4709 {
4710 if(inCompiler)
4711 {
4712 if(!symbol)
4713 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4714 }
4715 if(!data->dataType)
4716 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4717 DeclareType(data->dataType, 0x1, 0x1);
4718 if(inCompiler)
4719 {
4720 if(!symbol->pointerExternal)
4721 {
4722 struct Declaration * decl;
4723 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4724 struct Declarator * d;
4725 struct External * external;
4726
4727 specifiers = MkList();
4728 declarators = MkList();
4729 ListAdd(specifiers, MkSpecifier(EXTERN));
4730 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4731 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4732 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4733 decl = MkDeclaration(specifiers, declarators);
4734 external = MkExternalDeclaration(decl);
4735 if(curExternal)
4736 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4737 external->symbol = symbol;
4738 symbol->pointerExternal = external;
4739 }
4740 else
4741 {
4742 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4743 }
4744 if(curExternal)
4745 symbol->id = curExternal->symbol->idCode;
4746 }
4747 }
4748 }
4749
4750 struct Conversion
4751 {
4752 struct Conversion * prev, * next;
4753 struct __ecereNameSpace__ecere__com__Property * convert;
4754 unsigned int isGet;
4755 struct Type * resultType;
4756 } __attribute__ ((gcc_struct));
4757
4758 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4759
4760 extern void Compiler_Warning(char *  format, ...);
4761
4762 void PrintType(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
4763
4764 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)
4765 {
4766 if(source && dest)
4767 {
4768 if(source->kind == 20 && dest->kind != 20)
4769 {
4770 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4771
4772 if(type)
4773 source = type;
4774 }
4775 if(dest->kind == 20 && source->kind != 20)
4776 {
4777 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4778
4779 if(type)
4780 dest = type;
4781 }
4782 if(dest->classObjectType == 2)
4783 {
4784 if(source->classObjectType != 3)
4785 return 0x1;
4786 else
4787 {
4788 if((dest->_class && strcmp(dest->_class->string, "class")) || (source->_class && strcmp(source->_class->string, "class")))
4789 {
4790 return 0x1;
4791 }
4792 }
4793 }
4794 else
4795 {
4796 if(source->classObjectType == 3)
4797 return 0x1;
4798 if(dest->classObjectType == 3 && source->classObjectType != 2)
4799 return 0x1;
4800 }
4801 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4802 {
4803 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4804 return 0x1;
4805 }
4806 if(dest->kind == 14 && source->kind != 0)
4807 return 0x1;
4808 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))
4809 return 0x1;
4810 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))
4811 return 0x1;
4812 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4813 {
4814 if(source->_class->registered && source->_class->registered->type == 3)
4815 {
4816 if(conversions != (((void *)0)))
4817 {
4818 if(source->_class->registered == dest->_class->registered)
4819 return 0x1;
4820 }
4821 else
4822 {
4823 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4824
4825 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4826 ;
4827 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4828 ;
4829 if(sourceBase == destBase)
4830 return 0x1;
4831 }
4832 }
4833 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))
4834 return 0x1;
4835 else
4836 {
4837 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))
4838 {
4839 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4840 {
4841 return 0x1;
4842 }
4843 }
4844 }
4845 }
4846 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
4847 return 0x1;
4848 if(doConversion)
4849 {
4850 if(source->kind == 8)
4851 {
4852 struct __ecereNameSpace__ecere__com__Class * _class;
4853
4854 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4855 {
4856 struct __ecereNameSpace__ecere__com__Property * convert;
4857
4858 for(convert = _class->conversions.first; convert; convert = convert->next)
4859 {
4860 if(convert->memberAccess == 1 || _class->module == privateModule)
4861 {
4862 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4863
4864 if(!convert->dataType)
4865 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4866 if(MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x0, 0x1, 0x0, 0x1))
4867 {
4868 if(!conversions && !convert->Get)
4869 return 0x1;
4870 else if(conversions != (((void *)0)))
4871 {
4872 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))
4873 return 0x1;
4874 else
4875 {
4876 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4877
4878 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4879 return 0x1;
4880 }
4881 }
4882 }
4883 }
4884 }
4885 }
4886 }
4887 if(dest->kind == 8)
4888 {
4889 struct __ecereNameSpace__ecere__com__Class * _class;
4890
4891 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4892 {
4893 struct __ecereNameSpace__ecere__com__Property * convert;
4894
4895 for(convert = _class->conversions.first; convert; convert = convert->next)
4896 {
4897 if(convert->memberAccess == 1 || _class->module == privateModule)
4898 {
4899 if(!convert->dataType)
4900 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4901 if(convert->dataType != dest && MatchTypes(source, convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1))
4902 {
4903 if(!conversions && !convert->Set)
4904 return 0x1;
4905 else if(conversions != (((void *)0)))
4906 {
4907 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))
4908 return 0x1;
4909 else
4910 {
4911 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4912
4913 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4914 return 0x1;
4915 }
4916 }
4917 }
4918 }
4919 }
4920 }
4921 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
4922 {
4923 if(!dest->_class->registered->dataType)
4924 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
4925 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
4926 {
4927 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4928 {
4929 return 0x1;
4930 }
4931 }
4932 }
4933 }
4934 if(source->kind == 8)
4935 {
4936 struct __ecereNameSpace__ecere__com__Class * _class;
4937
4938 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4939 {
4940 struct __ecereNameSpace__ecere__com__Property * convert;
4941
4942 for(convert = _class->conversions.first; convert; convert = convert->next)
4943 {
4944 if(convert->memberAccess == 1 || _class->module == privateModule)
4945 {
4946 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4947
4948 if(!convert->dataType)
4949 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4950 if(convert->dataType != source && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x1))
4951 {
4952 if(!conversions && !convert->Get)
4953 return 0x1;
4954 else if(conversions != (((void *)0)))
4955 {
4956 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))
4957 return 0x1;
4958 else
4959 {
4960 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4961
4962 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4963 return 0x1;
4964 }
4965 }
4966 }
4967 }
4968 }
4969 }
4970 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
4971 {
4972 if(!source->_class->registered->dataType)
4973 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
4974 if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4975 {
4976 return 0x1;
4977 }
4978 }
4979 }
4980 }
4981 if(source->kind == 8 || source->kind == 19)
4982 ;
4983 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
4984 return 0x1;
4985 else if(dest->kind == 7 && source->kind == 6)
4986 return 0x1;
4987 else if(dest->kind == 2 && (source->kind == 1 || source->kind == 24))
4988 return 0x1;
4989 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 23))
4990 return 0x1;
4991 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 22 || source->kind == 23))
4992 return 0x1;
4993 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 23 || source->kind == 4))
4994 return 0x1;
4995 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 4 || source->kind == 22))
4996 return 0x1;
4997 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))
4998 return 0x1;
4999 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))
5000 return 0x1;
5001 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)))
5002 {
5003 struct Type * paramSource, * paramDest;
5004
5005 if(dest->kind == 16)
5006 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
5007 if(source->kind == 16)
5008 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
5009 if(dest->kind == 13 && dest->type->kind == 11)
5010 dest = dest->type;
5011 if(source->kind == 13 && source->type->kind == 11)
5012 source = source->type;
5013 if(dest->kind == 16)
5014 dest = dest->method->dataType;
5015 if(source->kind == 16)
5016 source = source->method->dataType;
5017 paramSource = source->params.first;
5018 if(paramSource && paramSource->kind == 0)
5019 paramSource = (((void *)0));
5020 paramDest = dest->params.first;
5021 if(paramDest && paramDest->kind == 0)
5022 paramDest = (((void *)0));
5023 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
5024 {
5025 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))))
5026 {
5027 if(paramDest && paramDest->kind == 8)
5028 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), paramDest->_class->string);
5029 else
5030 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class should not take an object\n", (((void *)0))));
5031 return 0x0;
5032 }
5033 paramDest = paramDest->next;
5034 }
5035 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
5036 {
5037 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
5038 {
5039 if(dest->thisClass)
5040 {
5041 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
5042 {
5043 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
5044 return 0x0;
5045 }
5046 }
5047 else
5048 {
5049 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
5050 {
5051 if(owningClassDest)
5052 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
5053 else
5054 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "overriding class expected to be derived from method class\n", (((void *)0))));
5055 return 0x0;
5056 }
5057 }
5058 paramSource = paramSource->next;
5059 }
5060 else
5061 {
5062 if(dest->thisClass)
5063 {
5064 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
5065 {
5066 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
5067 return 0x0;
5068 }
5069 }
5070 else
5071 {
5072 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
5073 {
5074 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), source->thisClass->registered->fullName);
5075 return 0x0;
5076 }
5077 }
5078 }
5079 }
5080 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5081 {
5082 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible return type for function\n", (((void *)0))));
5083 return 0x0;
5084 }
5085 for(; paramDest; paramDest = paramDest->next)
5086 {
5087 if(!paramSource)
5088 {
5089 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "not enough parameters\n", (((void *)0))));
5090 return 0x0;
5091 }
5092 {
5093 struct Type * paramDestType = paramDest;
5094 struct Type * paramSourceType = paramSource;
5095 struct Type * type = paramDestType;
5096
5097 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
5098 {
5099 int id = 0;
5100 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
5101 struct __ecereNameSpace__ecere__com__Class * sClass;
5102
5103 for(sClass = owningClassSource; sClass; sClass = sClass->base)
5104 {
5105 id = 0;
5106 if(sClass->templateClass)
5107 sClass = sClass->templateClass;
5108 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
5109 {
5110 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
5111 {
5112 for(sClass = sClass->base; sClass; sClass = sClass->base)
5113 {
5114 if(sClass->templateClass)
5115 sClass = sClass->templateClass;
5116 id += sClass->templateParams.count;
5117 }
5118 break;
5119 }
5120 id++;
5121 }
5122 if(curParam)
5123 break;
5124 }
5125 if(curParam)
5126 {
5127 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
5128
5129 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
5130 }
5131 }
5132 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)))
5133 {
5134 char type[1024];
5135
5136 type[0] = (char)0;
5137 PrintType(paramDest, type, 0x0, 0x1);
5138 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
5139 if(paramDestType != paramDest)
5140 FreeType(paramDestType);
5141 return 0x0;
5142 }
5143 if(paramDestType != paramDest)
5144 FreeType(paramDestType);
5145 }
5146 paramSource = paramSource->next;
5147 }
5148 if(paramSource)
5149 {
5150 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many parameters\n", (((void *)0))));
5151 return 0x0;
5152 }
5153 return 0x1;
5154 }
5155 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
5156 {
5157 return 0x1;
5158 }
5159 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
5160 {
5161 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5162 return 0x1;
5163 }
5164 }
5165 return 0x0;
5166 }
5167
5168 static void FreeConvert(struct Conversion * convert)
5169 {
5170 if(convert->resultType)
5171 FreeType(convert->resultType);
5172 }
5173
5174 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
5175
5176 struct __ecereNameSpace__ecere__com__BTNamedLink
5177 {
5178 char *  name;
5179 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
5180 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
5181 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
5182 int depth;
5183 void *  data;
5184 } __attribute__ ((gcc_struct));
5185
5186 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
5187
5188 struct __ecereNameSpace__ecere__com__EnumClassData
5189 {
5190 struct __ecereNameSpace__ecere__sys__OldList values;
5191 int largest;
5192 } __attribute__ ((gcc_struct));
5193
5194 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
5195
5196 struct __ecereNameSpace__ecere__sys__NamedLink
5197 {
5198 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
5199 struct __ecereNameSpace__ecere__sys__NamedLink * next;
5200 char *  name;
5201 void *  data;
5202 } __attribute__ ((gcc_struct));
5203
5204 extern void FreeExpContents(struct Expression * exp);
5205
5206 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
5207
5208 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
5209
5210 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
5211
5212 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
5213
5214 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (*  freeFn)(void * ));
5215
5216 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5217 {
5218 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
5219
5220 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)))
5221 {
5222 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
5223
5224 if(_class->type == 4)
5225 {
5226 struct __ecereNameSpace__ecere__sys__OldList converts = 
5227 {
5228 0, 0, 0, 0, 0
5229 };
5230 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5231
5232 type->kind = 8;
5233 if(!_class->symbol)
5234 _class->symbol = FindClass(_class->fullName);
5235 type->_class = _class->symbol;
5236 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0))
5237 {
5238 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5239 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5240
5241 if(enumClass)
5242 {
5243 struct __ecereNameSpace__ecere__com__Class * baseClass;
5244
5245 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
5246 {
5247 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
5248
5249 for(value = e->values.first; value; value = value->next)
5250 {
5251 if(!strcmp(value->name, string))
5252 break;
5253 }
5254 if(value)
5255 {
5256 FreeExpContents(sourceExp);
5257 FreeType(sourceExp->expType);
5258 sourceExp->isConstant = 0x1;
5259 sourceExp->expType = MkClassType(baseClass->fullName);
5260 {
5261 char constant[256];
5262
5263 sourceExp->type = 2;
5264 if(!strcmp(baseClass->dataTypeString, "int"))
5265 sprintf(constant, "%d", (int)value->data);
5266 else
5267 sprintf(constant, "0x%X", (int)value->data);
5268 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5269 }
5270 while(converts.first)
5271 {
5272 struct Conversion * convert = converts.first;
5273
5274 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
5275 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5276 }
5277 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5278 return 0x1;
5279 }
5280 }
5281 }
5282 }
5283 if(converts.first)
5284 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
5285 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5286 }
5287 }
5288 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)))
5289 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5290 return 0x1;
5291 return 0x0;
5292 }
5293
5294 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5295
5296 struct __ecereNameSpace__ecere__com__SubModule
5297 {
5298 struct __ecereNameSpace__ecere__com__SubModule * prev;
5299 struct __ecereNameSpace__ecere__com__SubModule * next;
5300 struct __ecereNameSpace__ecere__com__Instance * module;
5301 int importMode;
5302 } __attribute__ ((gcc_struct));
5303
5304 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5305 {
5306 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5307
5308 if(searchFor == searchIn)
5309 return 0x1;
5310 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
5311 {
5312 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->application)
5313 {
5314 if(ModuleVisibility(subModule->module, searchFor))
5315 return 0x1;
5316 }
5317 }
5318 return 0x0;
5319 }
5320
5321 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5322
5323 struct __ecereNameSpace__ecere__com__Application
5324 {
5325 int argc;
5326 char * *  argv;
5327 int exitCode;
5328 unsigned int isGUIApp;
5329 struct __ecereNameSpace__ecere__sys__OldList allModules;
5330 char *  parsedCommand;
5331 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5332 } __attribute__ ((gcc_struct));
5333
5334 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5335 {
5336 struct __ecereNameSpace__ecere__com__Instance * module;
5337
5338 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))
5339 return 0x1;
5340 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))
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)))->publicNameSpace, sourceExp, dest, string, conversions))
5343 return 0x1;
5344 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)
5345 {
5346 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5347 return 0x1;
5348 }
5349 return 0x0;
5350 }
5351
5352 extern unsigned long strtoul(const char *  nptr, char * *  endptr, int base);
5353
5354 void ReadString(char *  output, char *  string);
5355
5356 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5357
5358 extern struct TypeName * QMkClass(char *  spec, struct Declarator * decl);
5359
5360 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5361
5362 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
5363 {
5364 struct Type * source = sourceExp->expType;
5365 struct Type * realDest = dest;
5366 struct Type * backupSourceExpType = (((void *)0));
5367
5368 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
5369 return 0x1;
5370 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5371 {
5372 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
5373 {
5374 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5375
5376 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5377 ;
5378 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5379 ;
5380 if(sourceBase == destBase)
5381 return 0x1;
5382 }
5383 }
5384 if(source)
5385 {
5386 struct __ecereNameSpace__ecere__sys__OldList * specs;
5387 unsigned int flag = 0x0;
5388 long long value = (((int)0x7fffffff));
5389
5390 source->refCount++;
5391 dest->refCount++;
5392 if(sourceExp->type == 2)
5393 {
5394 if(source->isSigned)
5395 value = strtoll(sourceExp->constant, (((void *)0)), 0);
5396 else
5397 value = strtoull(sourceExp->constant, (((void *)0)), 0);
5398 }
5399 else if(sourceExp->type == 4 && sourceExp->op.op == '-' && !sourceExp->op.exp1 && sourceExp->op.exp2 && sourceExp->op.exp2->type == 2)
5400 {
5401 if(source->isSigned)
5402 value = -strtoll(sourceExp->op.exp2->constant, (((void *)0)), 0);
5403 else
5404 value = -strtoull(sourceExp->op.exp2->constant, (((void *)0)), 0);
5405 }
5406 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
5407 {
5408 FreeType(source);
5409 source = __extension__ ({
5410 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5411
5412 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0x0, __ecereInstance1->refCount = 1, __ecereInstance1;
5413 });
5414 }
5415 if(dest->kind == 8)
5416 {
5417 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5418
5419 if(_class && _class->type == 3)
5420 {
5421 if(source->kind != 8)
5422 {
5423 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5424 struct Type * tempDest, * tempSource;
5425
5426 for(; _class->base->type != 1000; _class = _class->base)
5427 ;
5428 tempSource = dest;
5429 tempDest = tempType;
5430 tempType->kind = 8;
5431 if(!_class->symbol)
5432 _class->symbol = FindClass(_class->fullName);
5433 tempType->_class = _class->symbol;
5434 tempType->truth = dest->truth;
5435 if(tempType->_class)
5436 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5437 backupSourceExpType = sourceExp->expType;
5438 sourceExp->expType = dest;
5439 dest->refCount++;
5440 flag = 0x1;
5441 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5442 }
5443 }
5444 if(_class && _class->type == 2 && source->kind != 8)
5445 {
5446 if(!dest->_class->registered->dataType)
5447 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5448 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5449 {
5450 FreeType(source);
5451 FreeType(sourceExp->expType);
5452 source = sourceExp->expType = MkClassType(dest->_class->string);
5453 source->refCount++;
5454 }
5455 }
5456 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5457 {
5458 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5459 struct Declarator * decl;
5460 char string[1024];
5461
5462 ReadString(string, sourceExp->string);
5463 decl = SpecDeclFromString(string, specs, (((void *)0)));
5464 FreeExpContents(sourceExp);
5465 FreeType(sourceExp->expType);
5466 sourceExp->type = 24;
5467 sourceExp->_classExp.specifiers = specs;
5468 sourceExp->_classExp.decl = decl;
5469 sourceExp->expType = dest;
5470 dest->refCount++;
5471 FreeType(source);
5472 FreeType(dest);
5473 if(backupSourceExpType)
5474 FreeType(backupSourceExpType);
5475 return 0x1;
5476 }
5477 }
5478 else if(source->kind == 8)
5479 {
5480 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5481
5482 if(_class && (_class->type == 3 || !strcmp(_class->fullName, "bool") || _class->type == 2))
5483 {
5484 if(dest->kind != 8)
5485 {
5486 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5487 struct Type * tempDest, * tempSource;
5488
5489 if(!source->_class->registered->dataType)
5490 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5491 for(; _class->base->type != 1000; _class = _class->base)
5492 ;
5493 tempDest = source;
5494 tempSource = tempType;
5495 tempType->kind = 8;
5496 tempType->_class = FindClass(_class->fullName);
5497 tempType->truth = source->truth;
5498 tempType->classObjectType = source->classObjectType;
5499 if(tempType->_class)
5500 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5501 if(conversions->last)
5502 {
5503 ((struct Conversion *)conversions->last)->resultType = dest;
5504 dest->refCount++;
5505 }
5506 FreeType(sourceExp->expType);
5507 sourceExp->expType = MkClassType(_class->fullName);
5508 sourceExp->expType->truth = source->truth;
5509 sourceExp->expType->classObjectType = source->classObjectType;
5510 if(!sourceExp->destType)
5511 {
5512 FreeType(sourceExp->destType);
5513 sourceExp->destType = sourceExp->expType;
5514 if(sourceExp->expType)
5515 sourceExp->expType->refCount++;
5516 }
5517 if(!_class->dataType)
5518 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5519 FreeType(dest);
5520 dest = MkClassType(source->_class->string);
5521 dest->truth = source->truth;
5522 dest->classObjectType = source->classObjectType;
5523 FreeType(source);
5524 source = _class->dataType;
5525 source->refCount++;
5526 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5527 }
5528 }
5529 }
5530 if(!flag)
5531 {
5532 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5533 {
5534 FreeType(source);
5535 FreeType(dest);
5536 return 0x1;
5537 }
5538 }
5539 if(dest->kind == 8)
5540 {
5541 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5542
5543 if(_class && !dest->truth && (_class->type == 3 || !strcmp(_class->fullName, "bool") || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5544 {
5545 if(_class->type == 0 || _class->type == 5)
5546 {
5547 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5548
5549 *newExp = *sourceExp;
5550 if(sourceExp->destType)
5551 sourceExp->destType->refCount++;
5552 if(sourceExp->expType)
5553 sourceExp->expType->refCount++;
5554 sourceExp->type = 11;
5555 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5556 sourceExp->cast.exp = newExp;
5557 FreeType(sourceExp->expType);
5558 sourceExp->expType = (((void *)0));
5559 ProcessExpressionType(sourceExp);
5560 if(!inCompiler)
5561 {
5562 FreeType(sourceExp->expType);
5563 sourceExp->expType = dest;
5564 }
5565 FreeType(source);
5566 if(inCompiler)
5567 FreeType(dest);
5568 if(backupSourceExpType)
5569 FreeType(backupSourceExpType);
5570 return 0x1;
5571 }
5572 if(!_class->dataType)
5573 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5574 FreeType(dest);
5575 dest = _class->dataType;
5576 dest->refCount++;
5577 }
5578 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))
5579 {
5580 specs = MkListOne(MkSpecifier(DOUBLE));
5581 }
5582 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))
5583 {
5584 specs = MkListOne(MkSpecifier(FLOAT));
5585 }
5586 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))
5587 {
5588 specs = MkList();
5589 if(!dest->isSigned)
5590 ListAdd(specs, MkSpecifier(UNSIGNED));
5591 ListAdd(specs, MkSpecifier(INT64));
5592 }
5593 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
5594 {
5595 specs = MkList();
5596 if(!dest->isSigned)
5597 ListAdd(specs, MkSpecifier(UNSIGNED));
5598 ListAdd(specs, MkSpecifier(INT));
5599 }
5600 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5601 {
5602 specs = MkList();
5603 if(!dest->isSigned)
5604 ListAdd(specs, MkSpecifier(UNSIGNED));
5605 ListAdd(specs, MkSpecifier(SHORT));
5606 }
5607 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 24 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5608 {
5609 specs = MkList();
5610 if(!dest->isSigned)
5611 ListAdd(specs, MkSpecifier(UNSIGNED));
5612 ListAdd(specs, MkSpecifier(CHAR));
5613 }
5614 else
5615 {
5616 FreeType(source);
5617 FreeType(dest);
5618 if(backupSourceExpType)
5619 {
5620 if(sourceExp->expType)
5621 FreeType(sourceExp->expType);
5622 sourceExp->expType = backupSourceExpType;
5623 }
5624 return 0x0;
5625 }
5626 }
5627 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))
5628 {
5629 specs = MkListOne(MkSpecifier(DOUBLE));
5630 }
5631 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))
5632 {
5633 specs = MkListOne(MkSpecifier(FLOAT));
5634 }
5635 else if(dest->kind == 24 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (value == 1 || value == 0))
5636 {
5637 specs = MkList();
5638 ListAdd(specs, MkSpecifier(BOOL));
5639 }
5640 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)))
5641 {
5642 specs = MkList();
5643 if(!dest->isSigned)
5644 ListAdd(specs, MkSpecifier(UNSIGNED));
5645 ListAdd(specs, MkSpecifier(CHAR));
5646 }
5647 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)))))
5648 {
5649 specs = MkList();
5650 if(!dest->isSigned)
5651 ListAdd(specs, MkSpecifier(UNSIGNED));
5652 ListAdd(specs, MkSpecifier(SHORT));
5653 }
5654 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3))
5655 {
5656 specs = MkList();
5657 if(!dest->isSigned)
5658 ListAdd(specs, MkSpecifier(UNSIGNED));
5659 ListAdd(specs, MkSpecifier(INT));
5660 }
5661 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5662 {
5663 specs = MkList();
5664 if(!dest->isSigned)
5665 ListAdd(specs, MkSpecifier(UNSIGNED));
5666 ListAdd(specs, MkSpecifier(INT64));
5667 }
5668 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
5669 {
5670 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5671 }
5672 else
5673 {
5674 FreeType(source);
5675 FreeType(dest);
5676 if(backupSourceExpType)
5677 {
5678 if(sourceExp->expType)
5679 FreeType(sourceExp->expType);
5680 sourceExp->expType = backupSourceExpType;
5681 }
5682 return 0x0;
5683 }
5684 if(!flag)
5685 {
5686 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5687
5688 *newExp = *sourceExp;
5689 newExp->prev = (((void *)0));
5690 newExp->next = (((void *)0));
5691 if(sourceExp->destType)
5692 sourceExp->destType->refCount++;
5693 if(sourceExp->expType)
5694 sourceExp->expType->refCount++;
5695 sourceExp->type = 11;
5696 if(realDest->kind == 8)
5697 {
5698 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5699 FreeList(specs, FreeSpecifier);
5700 }
5701 else
5702 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5703 if(newExp->type == 4)
5704 {
5705 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5706 }
5707 else
5708 sourceExp->cast.exp = newExp;
5709 FreeType(sourceExp->expType);
5710 sourceExp->expType = (((void *)0));
5711 ProcessExpressionType(sourceExp);
5712 }
5713 else
5714 FreeList(specs, FreeSpecifier);
5715 FreeType(dest);
5716 FreeType(source);
5717 if(backupSourceExpType)
5718 FreeType(backupSourceExpType);
5719 return 0x1;
5720 }
5721 else
5722 {
5723 while((sourceExp->type == 5 || sourceExp->type == 32) && sourceExp->list)
5724 sourceExp = (*sourceExp->list).last;
5725 if(sourceExp->type == 0)
5726 {
5727 struct Identifier * id = sourceExp->identifier;
5728
5729 if(dest->kind == 8)
5730 {
5731 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5732 {
5733 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5734 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5735
5736 if(enumClass)
5737 {
5738 for(; _class && _class->type == 4; _class = _class->base)
5739 {
5740 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5741 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5742
5743 for(value = e->values.first; value; value = value->next)
5744 {
5745 if(!strcmp(value->name, id->string))
5746 break;
5747 }
5748 if(value)
5749 {
5750 FreeExpContents(sourceExp);
5751 FreeType(sourceExp->expType);
5752 sourceExp->isConstant = 0x1;
5753 sourceExp->expType = MkClassType(_class->fullName);
5754 {
5755 char constant[256];
5756
5757 sourceExp->type = 2;
5758 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5759 sprintf(constant, "%d", (int)value->data);
5760 else
5761 sprintf(constant, "0x%X", (int)value->data);
5762 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5763 }
5764 return 0x1;
5765 }
5766 }
5767 }
5768 }
5769 }
5770 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5771 return 0x1;
5772 }
5773 }
5774 return 0x0;
5775 }
5776
5777 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5778 {
5779 int value2 = op2->i;
5780
5781 exp->type = 2;
5782 exp->string = PrintInt(op1->i + value2);
5783 if(!exp->expType)
5784 {
5785 exp->expType = op1->type;
5786 if(op1->type)
5787 op1->type->refCount++;
5788 }
5789 return 0x1;
5790 }
5791
5792 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5793 {
5794 unsigned int value2 = op2->ui;
5795
5796 exp->type = 2;
5797 exp->string = PrintUInt(op1->ui + value2);
5798 if(!exp->expType)
5799 {
5800 exp->expType = op1->type;
5801 if(op1->type)
5802 op1->type->refCount++;
5803 }
5804 return 0x1;
5805 }
5806
5807 static unsigned int Int64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5808 {
5809 long long value2 = op2->i64;
5810
5811 exp->type = 2;
5812 exp->string = PrintInt64(op1->i64 + value2);
5813 if(!exp->expType)
5814 {
5815 exp->expType = op1->type;
5816 if(op1->type)
5817 op1->type->refCount++;
5818 }
5819 return 0x1;
5820 }
5821
5822 static unsigned int UInt64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5823 {
5824 uint64 value2 = op2->ui64;
5825
5826 exp->type = 2;
5827 exp->string = PrintUInt64(op1->ui64 + value2);
5828 if(!exp->expType)
5829 {
5830 exp->expType = op1->type;
5831 if(op1->type)
5832 op1->type->refCount++;
5833 }
5834 return 0x1;
5835 }
5836
5837 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5838 {
5839 short value2 = op2->s;
5840
5841 exp->type = 2;
5842 exp->string = PrintShort(op1->s + value2);
5843 if(!exp->expType)
5844 {
5845 exp->expType = op1->type;
5846 if(op1->type)
5847 op1->type->refCount++;
5848 }
5849 return 0x1;
5850 }
5851
5852 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5853 {
5854 unsigned short value2 = op2->us;
5855
5856 exp->type = 2;
5857 exp->string = PrintUShort(op1->us + value2);
5858 if(!exp->expType)
5859 {
5860 exp->expType = op1->type;
5861 if(op1->type)
5862 op1->type->refCount++;
5863 }
5864 return 0x1;
5865 }
5866
5867 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5868 {
5869 char value2 = op2->c;
5870
5871 exp->type = 2;
5872 exp->string = PrintChar(op1->c + value2);
5873 if(!exp->expType)
5874 {
5875 exp->expType = op1->type;
5876 if(op1->type)
5877 op1->type->refCount++;
5878 }
5879 return 0x1;
5880 }
5881
5882 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5883 {
5884 unsigned char value2 = op2->uc;
5885
5886 exp->type = 2;
5887 exp->string = PrintUChar(op1->uc + value2);
5888 if(!exp->expType)
5889 {
5890 exp->expType = op1->type;
5891 if(op1->type)
5892 op1->type->refCount++;
5893 }
5894 return 0x1;
5895 }
5896
5897 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5898 {
5899 float value2 = op2->f;
5900
5901 exp->type = 2;
5902 exp->string = PrintFloat(op1->f + value2);
5903 if(!exp->expType)
5904 {
5905 exp->expType = op1->type;
5906 if(op1->type)
5907 op1->type->refCount++;
5908 }
5909 return 0x1;
5910 }
5911
5912 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5913 {
5914 double value2 = op2->d;
5915
5916 exp->type = 2;
5917 exp->string = PrintDouble(op1->d + value2);
5918 if(!exp->expType)
5919 {
5920 exp->expType = op1->type;
5921 if(op1->type)
5922 op1->type->refCount++;
5923 }
5924 return 0x1;
5925 }
5926
5927 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5928 {
5929 int value2 = op2->i;
5930
5931 exp->type = 2;
5932 exp->string = PrintInt(op1->i - value2);
5933 if(!exp->expType)
5934 {
5935 exp->expType = op1->type;
5936 if(op1->type)
5937 op1->type->refCount++;
5938 }
5939 return 0x1;
5940 }
5941
5942 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5943 {
5944 unsigned int value2 = op2->ui;
5945
5946 exp->type = 2;
5947 exp->string = PrintUInt(op1->ui - value2);
5948 if(!exp->expType)
5949 {
5950 exp->expType = op1->type;
5951 if(op1->type)
5952 op1->type->refCount++;
5953 }
5954 return 0x1;
5955 }
5956
5957 static unsigned int Int64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5958 {
5959 long long value2 = op2->i64;
5960
5961 exp->type = 2;
5962 exp->string = PrintInt64(op1->i64 - value2);
5963 if(!exp->expType)
5964 {
5965 exp->expType = op1->type;
5966 if(op1->type)
5967 op1->type->refCount++;
5968 }
5969 return 0x1;
5970 }
5971
5972 static unsigned int UInt64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5973 {
5974 uint64 value2 = op2->ui64;
5975
5976 exp->type = 2;
5977 exp->string = PrintUInt64(op1->ui64 - value2);
5978 if(!exp->expType)
5979 {
5980 exp->expType = op1->type;
5981 if(op1->type)
5982 op1->type->refCount++;
5983 }
5984 return 0x1;
5985 }
5986
5987 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5988 {
5989 short value2 = op2->s;
5990
5991 exp->type = 2;
5992 exp->string = PrintShort(op1->s - value2);
5993 if(!exp->expType)
5994 {
5995 exp->expType = op1->type;
5996 if(op1->type)
5997 op1->type->refCount++;
5998 }
5999 return 0x1;
6000 }
6001
6002 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6003 {
6004 unsigned short value2 = op2->us;
6005
6006 exp->type = 2;
6007 exp->string = PrintUShort(op1->us - value2);
6008 if(!exp->expType)
6009 {
6010 exp->expType = op1->type;
6011 if(op1->type)
6012 op1->type->refCount++;
6013 }
6014 return 0x1;
6015 }
6016
6017 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6018 {
6019 char value2 = op2->c;
6020
6021 exp->type = 2;
6022 exp->string = PrintChar(op1->c - value2);
6023 if(!exp->expType)
6024 {
6025 exp->expType = op1->type;
6026 if(op1->type)
6027 op1->type->refCount++;
6028 }
6029 return 0x1;
6030 }
6031
6032 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6033 {
6034 unsigned char value2 = op2->uc;
6035
6036 exp->type = 2;
6037 exp->string = PrintUChar(op1->uc - value2);
6038 if(!exp->expType)
6039 {
6040 exp->expType = op1->type;
6041 if(op1->type)
6042 op1->type->refCount++;
6043 }
6044 return 0x1;
6045 }
6046
6047 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6048 {
6049 float value2 = op2->f;
6050
6051 exp->type = 2;
6052 exp->string = PrintFloat(op1->f - value2);
6053 if(!exp->expType)
6054 {
6055 exp->expType = op1->type;
6056 if(op1->type)
6057 op1->type->refCount++;
6058 }
6059 return 0x1;
6060 }
6061
6062 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6063 {
6064 double value2 = op2->d;
6065
6066 exp->type = 2;
6067 exp->string = PrintDouble(op1->d - value2);
6068 if(!exp->expType)
6069 {
6070 exp->expType = op1->type;
6071 if(op1->type)
6072 op1->type->refCount++;
6073 }
6074 return 0x1;
6075 }
6076
6077 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6078 {
6079 int value2 = op2->i;
6080
6081 exp->type = 2;
6082 exp->string = PrintInt(op1->i * value2);
6083 if(!exp->expType)
6084 {
6085 exp->expType = op1->type;
6086 if(op1->type)
6087 op1->type->refCount++;
6088 }
6089 return 0x1;
6090 }
6091
6092 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6093 {
6094 unsigned int value2 = op2->ui;
6095
6096 exp->type = 2;
6097 exp->string = PrintUInt(op1->ui * value2);
6098 if(!exp->expType)
6099 {
6100 exp->expType = op1->type;
6101 if(op1->type)
6102 op1->type->refCount++;
6103 }
6104 return 0x1;
6105 }
6106
6107 static unsigned int Int64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6108 {
6109 long long value2 = op2->i64;
6110
6111 exp->type = 2;
6112 exp->string = PrintInt64(op1->i64 * value2);
6113 if(!exp->expType)
6114 {
6115 exp->expType = op1->type;
6116 if(op1->type)
6117 op1->type->refCount++;
6118 }
6119 return 0x1;
6120 }
6121
6122 static unsigned int UInt64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6123 {
6124 uint64 value2 = op2->ui64;
6125
6126 exp->type = 2;
6127 exp->string = PrintUInt64(op1->ui64 * value2);
6128 if(!exp->expType)
6129 {
6130 exp->expType = op1->type;
6131 if(op1->type)
6132 op1->type->refCount++;
6133 }
6134 return 0x1;
6135 }
6136
6137 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6138 {
6139 short value2 = op2->s;
6140
6141 exp->type = 2;
6142 exp->string = PrintShort(op1->s * value2);
6143 if(!exp->expType)
6144 {
6145 exp->expType = op1->type;
6146 if(op1->type)
6147 op1->type->refCount++;
6148 }
6149 return 0x1;
6150 }
6151
6152 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6153 {
6154 unsigned short value2 = op2->us;
6155
6156 exp->type = 2;
6157 exp->string = PrintUShort(op1->us * value2);
6158 if(!exp->expType)
6159 {
6160 exp->expType = op1->type;
6161 if(op1->type)
6162 op1->type->refCount++;
6163 }
6164 return 0x1;
6165 }
6166
6167 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6168 {
6169 char value2 = op2->c;
6170
6171 exp->type = 2;
6172 exp->string = PrintChar(op1->c * value2);
6173 if(!exp->expType)
6174 {
6175 exp->expType = op1->type;
6176 if(op1->type)
6177 op1->type->refCount++;
6178 }
6179 return 0x1;
6180 }
6181
6182 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6183 {
6184 unsigned char value2 = op2->uc;
6185
6186 exp->type = 2;
6187 exp->string = PrintUChar(op1->uc * value2);
6188 if(!exp->expType)
6189 {
6190 exp->expType = op1->type;
6191 if(op1->type)
6192 op1->type->refCount++;
6193 }
6194 return 0x1;
6195 }
6196
6197 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6198 {
6199 float value2 = op2->f;
6200
6201 exp->type = 2;
6202 exp->string = PrintFloat(op1->f * value2);
6203 if(!exp->expType)
6204 {
6205 exp->expType = op1->type;
6206 if(op1->type)
6207 op1->type->refCount++;
6208 }
6209 return 0x1;
6210 }
6211
6212 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6213 {
6214 double value2 = op2->d;
6215
6216 exp->type = 2;
6217 exp->string = PrintDouble(op1->d * value2);
6218 if(!exp->expType)
6219 {
6220 exp->expType = op1->type;
6221 if(op1->type)
6222 op1->type->refCount++;
6223 }
6224 return 0x1;
6225 }
6226
6227 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6228 {
6229 int value2 = op2->i;
6230
6231 exp->type = 2;
6232 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
6233 if(!exp->expType)
6234 {
6235 exp->expType = op1->type;
6236 if(op1->type)
6237 op1->type->refCount++;
6238 }
6239 return 0x1;
6240 }
6241
6242 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6243 {
6244 unsigned int value2 = op2->ui;
6245
6246 exp->type = 2;
6247 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
6248 if(!exp->expType)
6249 {
6250 exp->expType = op1->type;
6251 if(op1->type)
6252 op1->type->refCount++;
6253 }
6254 return 0x1;
6255 }
6256
6257 static unsigned int Int64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6258 {
6259 long long value2 = op2->i64;
6260
6261 exp->type = 2;
6262 exp->string = PrintInt64(value2 ? (op1->i64 / value2) : 0);
6263 if(!exp->expType)
6264 {
6265 exp->expType = op1->type;
6266 if(op1->type)
6267 op1->type->refCount++;
6268 }
6269 return 0x1;
6270 }
6271
6272 static unsigned int UInt64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6273 {
6274 uint64 value2 = op2->ui64;
6275
6276 exp->type = 2;
6277 exp->string = PrintUInt64(value2 ? (op1->ui64 / value2) : 0);
6278 if(!exp->expType)
6279 {
6280 exp->expType = op1->type;
6281 if(op1->type)
6282 op1->type->refCount++;
6283 }
6284 return 0x1;
6285 }
6286
6287 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6288 {
6289 short value2 = op2->s;
6290
6291 exp->type = 2;
6292 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
6293 if(!exp->expType)
6294 {
6295 exp->expType = op1->type;
6296 if(op1->type)
6297 op1->type->refCount++;
6298 }
6299 return 0x1;
6300 }
6301
6302 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6303 {
6304 unsigned short value2 = op2->us;
6305
6306 exp->type = 2;
6307 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
6308 if(!exp->expType)
6309 {
6310 exp->expType = op1->type;
6311 if(op1->type)
6312 op1->type->refCount++;
6313 }
6314 return 0x1;
6315 }
6316
6317 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6318 {
6319 char value2 = op2->c;
6320
6321 exp->type = 2;
6322 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
6323 if(!exp->expType)
6324 {
6325 exp->expType = op1->type;
6326 if(op1->type)
6327 op1->type->refCount++;
6328 }
6329 return 0x1;
6330 }
6331
6332 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6333 {
6334 unsigned char value2 = op2->uc;
6335
6336 exp->type = 2;
6337 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
6338 if(!exp->expType)
6339 {
6340 exp->expType = op1->type;
6341 if(op1->type)
6342 op1->type->refCount++;
6343 }
6344 return 0x1;
6345 }
6346
6347 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6348 {
6349 float value2 = op2->f;
6350
6351 exp->type = 2;
6352 exp->string = PrintFloat(op1->f / value2);
6353 if(!exp->expType)
6354 {
6355 exp->expType = op1->type;
6356 if(op1->type)
6357 op1->type->refCount++;
6358 }
6359 return 0x1;
6360 }
6361
6362 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6363 {
6364 double value2 = op2->d;
6365
6366 exp->type = 2;
6367 exp->string = PrintDouble(op1->d / value2);
6368 if(!exp->expType)
6369 {
6370 exp->expType = op1->type;
6371 if(op1->type)
6372 op1->type->refCount++;
6373 }
6374 return 0x1;
6375 }
6376
6377 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6378 {
6379 int value2 = op2->i;
6380
6381 exp->type = 2;
6382 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
6383 if(!exp->expType)
6384 {
6385 exp->expType = op1->type;
6386 if(op1->type)
6387 op1->type->refCount++;
6388 }
6389 return 0x1;
6390 }
6391
6392 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6393 {
6394 unsigned int value2 = op2->ui;
6395
6396 exp->type = 2;
6397 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
6398 if(!exp->expType)
6399 {
6400 exp->expType = op1->type;
6401 if(op1->type)
6402 op1->type->refCount++;
6403 }
6404 return 0x1;
6405 }
6406
6407 static unsigned int Int64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6408 {
6409 long long value2 = op2->i64;
6410
6411 exp->type = 2;
6412 exp->string = PrintInt64(value2 ? (op1->i64 % value2) : 0);
6413 if(!exp->expType)
6414 {
6415 exp->expType = op1->type;
6416 if(op1->type)
6417 op1->type->refCount++;
6418 }
6419 return 0x1;
6420 }
6421
6422 static unsigned int UInt64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6423 {
6424 uint64 value2 = op2->ui64;
6425
6426 exp->type = 2;
6427 exp->string = PrintUInt64(value2 ? (op1->ui64 % value2) : 0);
6428 if(!exp->expType)
6429 {
6430 exp->expType = op1->type;
6431 if(op1->type)
6432 op1->type->refCount++;
6433 }
6434 return 0x1;
6435 }
6436
6437 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6438 {
6439 short value2 = op2->s;
6440
6441 exp->type = 2;
6442 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
6443 if(!exp->expType)
6444 {
6445 exp->expType = op1->type;
6446 if(op1->type)
6447 op1->type->refCount++;
6448 }
6449 return 0x1;
6450 }
6451
6452 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6453 {
6454 unsigned short value2 = op2->us;
6455
6456 exp->type = 2;
6457 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
6458 if(!exp->expType)
6459 {
6460 exp->expType = op1->type;
6461 if(op1->type)
6462 op1->type->refCount++;
6463 }
6464 return 0x1;
6465 }
6466
6467 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6468 {
6469 char value2 = op2->c;
6470
6471 exp->type = 2;
6472 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
6473 if(!exp->expType)
6474 {
6475 exp->expType = op1->type;
6476 if(op1->type)
6477 op1->type->refCount++;
6478 }
6479 return 0x1;
6480 }
6481
6482 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6483 {
6484 unsigned char value2 = op2->uc;
6485
6486 exp->type = 2;
6487 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
6488 if(!exp->expType)
6489 {
6490 exp->expType = op1->type;
6491 if(op1->type)
6492 op1->type->refCount++;
6493 }
6494 return 0x1;
6495 }
6496
6497 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6498 {
6499 exp->type = 2;
6500 exp->string = PrintInt((-op1->i));
6501 if(!exp->expType)
6502 {
6503 exp->expType = op1->type;
6504 if(op1->type)
6505 op1->type->refCount++;
6506 }
6507 return 0x1;
6508 }
6509
6510 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6511 {
6512 exp->type = 2;
6513 exp->string = PrintUInt((unsigned int)(-op1->ui));
6514 if(!exp->expType)
6515 {
6516 exp->expType = op1->type;
6517 if(op1->type)
6518 op1->type->refCount++;
6519 }
6520 return 0x1;
6521 }
6522
6523 static unsigned int Int64Neg(struct Expression * exp, struct Operand * op1)
6524 {
6525 exp->type = 2;
6526 exp->string = PrintInt64((-op1->i64));
6527 if(!exp->expType)
6528 {
6529 exp->expType = op1->type;
6530 if(op1->type)
6531 op1->type->refCount++;
6532 }
6533 return 0x1;
6534 }
6535
6536 static unsigned int UInt64Neg(struct Expression * exp, struct Operand * op1)
6537 {
6538 exp->type = 2;
6539 exp->string = PrintUInt64((uint64)(-op1->ui64));
6540 if(!exp->expType)
6541 {
6542 exp->expType = op1->type;
6543 if(op1->type)
6544 op1->type->refCount++;
6545 }
6546 return 0x1;
6547 }
6548
6549 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6550 {
6551 exp->type = 2;
6552 exp->string = PrintShort((-op1->s));
6553 if(!exp->expType)
6554 {
6555 exp->expType = op1->type;
6556 if(op1->type)
6557 op1->type->refCount++;
6558 }
6559 return 0x1;
6560 }
6561
6562 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6563 {
6564 exp->type = 2;
6565 exp->string = PrintUShort((unsigned short)(-op1->us));
6566 if(!exp->expType)
6567 {
6568 exp->expType = op1->type;
6569 if(op1->type)
6570 op1->type->refCount++;
6571 }
6572 return 0x1;
6573 }
6574
6575 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6576 {
6577 exp->type = 2;
6578 exp->string = PrintChar((-op1->c));
6579 if(!exp->expType)
6580 {
6581 exp->expType = op1->type;
6582 if(op1->type)
6583 op1->type->refCount++;
6584 }
6585 return 0x1;
6586 }
6587
6588 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6589 {
6590 exp->type = 2;
6591 exp->string = PrintUChar((unsigned char)(-op1->uc));
6592 if(!exp->expType)
6593 {
6594 exp->expType = op1->type;
6595 if(op1->type)
6596 op1->type->refCount++;
6597 }
6598 return 0x1;
6599 }
6600
6601 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6602 {
6603 exp->type = 2;
6604 exp->string = PrintFloat((float)(-op1->f));
6605 if(!exp->expType)
6606 {
6607 exp->expType = op1->type;
6608 if(op1->type)
6609 op1->type->refCount++;
6610 }
6611 return 0x1;
6612 }
6613
6614 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6615 {
6616 exp->type = 2;
6617 exp->string = PrintDouble((double)(-op1->d));
6618 if(!exp->expType)
6619 {
6620 exp->expType = op1->type;
6621 if(op1->type)
6622 op1->type->refCount++;
6623 }
6624 return 0x1;
6625 }
6626
6627 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6628 {
6629 exp->type = 2;
6630 exp->string = PrintInt((++op1->i));
6631 if(!exp->expType)
6632 {
6633 exp->expType = op1->type;
6634 if(op1->type)
6635 op1->type->refCount++;
6636 }
6637 return 0x1;
6638 }
6639
6640 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6641 {
6642 exp->type = 2;
6643 exp->string = PrintUInt((++op1->ui));
6644 if(!exp->expType)
6645 {
6646 exp->expType = op1->type;
6647 if(op1->type)
6648 op1->type->refCount++;
6649 }
6650 return 0x1;
6651 }
6652
6653 static unsigned int Int64Inc(struct Expression * exp, struct Operand * op1)
6654 {
6655 exp->type = 2;
6656 exp->string = PrintInt64((++op1->i64));
6657 if(!exp->expType)
6658 {
6659 exp->expType = op1->type;
6660 if(op1->type)
6661 op1->type->refCount++;
6662 }
6663 return 0x1;
6664 }
6665
6666 static unsigned int UInt64Inc(struct Expression * exp, struct Operand * op1)
6667 {
6668 exp->type = 2;
6669 exp->string = PrintUInt64((++op1->ui64));
6670 if(!exp->expType)
6671 {
6672 exp->expType = op1->type;
6673 if(op1->type)
6674 op1->type->refCount++;
6675 }
6676 return 0x1;
6677 }
6678
6679 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6680 {
6681 exp->type = 2;
6682 exp->string = PrintShort((++op1->s));
6683 if(!exp->expType)
6684 {
6685 exp->expType = op1->type;
6686 if(op1->type)
6687 op1->type->refCount++;
6688 }
6689 return 0x1;
6690 }
6691
6692 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6693 {
6694 exp->type = 2;
6695 exp->string = PrintUShort((++op1->us));
6696 if(!exp->expType)
6697 {
6698 exp->expType = op1->type;
6699 if(op1->type)
6700 op1->type->refCount++;
6701 }
6702 return 0x1;
6703 }
6704
6705 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6706 {
6707 exp->type = 2;
6708 exp->string = PrintChar((++op1->c));
6709 if(!exp->expType)
6710 {
6711 exp->expType = op1->type;
6712 if(op1->type)
6713 op1->type->refCount++;
6714 }
6715 return 0x1;
6716 }
6717
6718 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6719 {
6720 exp->type = 2;
6721 exp->string = PrintUChar((++op1->uc));
6722 if(!exp->expType)
6723 {
6724 exp->expType = op1->type;
6725 if(op1->type)
6726 op1->type->refCount++;
6727 }
6728 return 0x1;
6729 }
6730
6731 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6732 {
6733 exp->type = 2;
6734 exp->string = PrintFloat((float)(++op1->f));
6735 if(!exp->expType)
6736 {
6737 exp->expType = op1->type;
6738 if(op1->type)
6739 op1->type->refCount++;
6740 }
6741 return 0x1;
6742 }
6743
6744 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6745 {
6746 exp->type = 2;
6747 exp->string = PrintDouble((double)(++op1->d));
6748 if(!exp->expType)
6749 {
6750 exp->expType = op1->type;
6751 if(op1->type)
6752 op1->type->refCount++;
6753 }
6754 return 0x1;
6755 }
6756
6757 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6758 {
6759 exp->type = 2;
6760 exp->string = PrintInt((--op1->i));
6761 if(!exp->expType)
6762 {
6763 exp->expType = op1->type;
6764 if(op1->type)
6765 op1->type->refCount++;
6766 }
6767 return 0x1;
6768 }
6769
6770 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6771 {
6772 exp->type = 2;
6773 exp->string = PrintUInt((--op1->ui));
6774 if(!exp->expType)
6775 {
6776 exp->expType = op1->type;
6777 if(op1->type)
6778 op1->type->refCount++;
6779 }
6780 return 0x1;
6781 }
6782
6783 static unsigned int Int64Dec(struct Expression * exp, struct Operand * op1)
6784 {
6785 exp->type = 2;
6786 exp->string = PrintInt64((--op1->i64));
6787 if(!exp->expType)
6788 {
6789 exp->expType = op1->type;
6790 if(op1->type)
6791 op1->type->refCount++;
6792 }
6793 return 0x1;
6794 }
6795
6796 static unsigned int UInt64Dec(struct Expression * exp, struct Operand * op1)
6797 {
6798 exp->type = 2;
6799 exp->string = PrintUInt64((--op1->ui64));
6800 if(!exp->expType)
6801 {
6802 exp->expType = op1->type;
6803 if(op1->type)
6804 op1->type->refCount++;
6805 }
6806 return 0x1;
6807 }
6808
6809 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6810 {
6811 exp->type = 2;
6812 exp->string = PrintShort((--op1->s));
6813 if(!exp->expType)
6814 {
6815 exp->expType = op1->type;
6816 if(op1->type)
6817 op1->type->refCount++;
6818 }
6819 return 0x1;
6820 }
6821
6822 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6823 {
6824 exp->type = 2;
6825 exp->string = PrintUShort((--op1->us));
6826 if(!exp->expType)
6827 {
6828 exp->expType = op1->type;
6829 if(op1->type)
6830 op1->type->refCount++;
6831 }
6832 return 0x1;
6833 }
6834
6835 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6836 {
6837 exp->type = 2;
6838 exp->string = PrintChar((--op1->c));
6839 if(!exp->expType)
6840 {
6841 exp->expType = op1->type;
6842 if(op1->type)
6843 op1->type->refCount++;
6844 }
6845 return 0x1;
6846 }
6847
6848 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6849 {
6850 exp->type = 2;
6851 exp->string = PrintUChar((--op1->uc));
6852 if(!exp->expType)
6853 {
6854 exp->expType = op1->type;
6855 if(op1->type)
6856 op1->type->refCount++;
6857 }
6858 return 0x1;
6859 }
6860
6861 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6862 {
6863 exp->type = 2;
6864 exp->string = PrintFloat((float)(--op1->f));
6865 if(!exp->expType)
6866 {
6867 exp->expType = op1->type;
6868 if(op1->type)
6869 op1->type->refCount++;
6870 }
6871 return 0x1;
6872 }
6873
6874 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6875 {
6876 exp->type = 2;
6877 exp->string = PrintDouble((double)(--op1->d));
6878 if(!exp->expType)
6879 {
6880 exp->expType = op1->type;
6881 if(op1->type)
6882 op1->type->refCount++;
6883 }
6884 return 0x1;
6885 }
6886
6887 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6888 {
6889 int value2 = op2->i;
6890
6891 exp->type = 2;
6892 exp->string = PrintInt(op1->i = value2);
6893 if(!exp->expType)
6894 {
6895 exp->expType = op1->type;
6896 if(op1->type)
6897 op1->type->refCount++;
6898 }
6899 return 0x1;
6900 }
6901
6902 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6903 {
6904 unsigned int value2 = op2->ui;
6905
6906 exp->type = 2;
6907 exp->string = PrintUInt(op1->ui = value2);
6908 if(!exp->expType)
6909 {
6910 exp->expType = op1->type;
6911 if(op1->type)
6912 op1->type->refCount++;
6913 }
6914 return 0x1;
6915 }
6916
6917 static unsigned int Int64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6918 {
6919 long long value2 = op2->i64;
6920
6921 exp->type = 2;
6922 exp->string = PrintInt64(op1->i64 = value2);
6923 if(!exp->expType)
6924 {
6925 exp->expType = op1->type;
6926 if(op1->type)
6927 op1->type->refCount++;
6928 }
6929 return 0x1;
6930 }
6931
6932 static unsigned int UInt64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6933 {
6934 uint64 value2 = op2->ui64;
6935
6936 exp->type = 2;
6937 exp->string = PrintUInt64(op1->ui64 = value2);
6938 if(!exp->expType)
6939 {
6940 exp->expType = op1->type;
6941 if(op1->type)
6942 op1->type->refCount++;
6943 }
6944 return 0x1;
6945 }
6946
6947 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6948 {
6949 short value2 = op2->s;
6950
6951 exp->type = 2;
6952 exp->string = PrintShort(op1->s = value2);
6953 if(!exp->expType)
6954 {
6955 exp->expType = op1->type;
6956 if(op1->type)
6957 op1->type->refCount++;
6958 }
6959 return 0x1;
6960 }
6961
6962 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6963 {
6964 unsigned short value2 = op2->us;
6965
6966 exp->type = 2;
6967 exp->string = PrintUShort(op1->us = value2);
6968 if(!exp->expType)
6969 {
6970 exp->expType = op1->type;
6971 if(op1->type)
6972 op1->type->refCount++;
6973 }
6974 return 0x1;
6975 }
6976
6977 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6978 {
6979 char value2 = op2->c;
6980
6981 exp->type = 2;
6982 exp->string = PrintChar(op1->c = value2);
6983 if(!exp->expType)
6984 {
6985 exp->expType = op1->type;
6986 if(op1->type)
6987 op1->type->refCount++;
6988 }
6989 return 0x1;
6990 }
6991
6992 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6993 {
6994 unsigned char value2 = op2->uc;
6995
6996 exp->type = 2;
6997 exp->string = PrintUChar(op1->uc = value2);
6998 if(!exp->expType)
6999 {
7000 exp->expType = op1->type;
7001 if(op1->type)
7002 op1->type->refCount++;
7003 }
7004 return 0x1;
7005 }
7006
7007 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7008 {
7009 float value2 = op2->f;
7010
7011 exp->type = 2;
7012 exp->string = PrintFloat(op1->f = value2);
7013 if(!exp->expType)
7014 {
7015 exp->expType = op1->type;
7016 if(op1->type)
7017 op1->type->refCount++;
7018 }
7019 return 0x1;
7020 }
7021
7022 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7023 {
7024 double value2 = op2->d;
7025
7026 exp->type = 2;
7027 exp->string = PrintDouble(op1->d = value2);
7028 if(!exp->expType)
7029 {
7030 exp->expType = op1->type;
7031 if(op1->type)
7032 op1->type->refCount++;
7033 }
7034 return 0x1;
7035 }
7036
7037 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7038 {
7039 int value2 = op2->i;
7040
7041 exp->type = 2;
7042 exp->string = PrintInt(op1->i += value2);
7043 if(!exp->expType)
7044 {
7045 exp->expType = op1->type;
7046 if(op1->type)
7047 op1->type->refCount++;
7048 }
7049 return 0x1;
7050 }
7051
7052 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7053 {
7054 unsigned int value2 = op2->ui;
7055
7056 exp->type = 2;
7057 exp->string = PrintUInt(op1->ui += value2);
7058 if(!exp->expType)
7059 {
7060 exp->expType = op1->type;
7061 if(op1->type)
7062 op1->type->refCount++;
7063 }
7064 return 0x1;
7065 }
7066
7067 static unsigned int Int64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7068 {
7069 long long value2 = op2->i64;
7070
7071 exp->type = 2;
7072 exp->string = PrintInt64(op1->i64 += value2);
7073 if(!exp->expType)
7074 {
7075 exp->expType = op1->type;
7076 if(op1->type)
7077 op1->type->refCount++;
7078 }
7079 return 0x1;
7080 }
7081
7082 static unsigned int UInt64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7083 {
7084 uint64 value2 = op2->ui64;
7085
7086 exp->type = 2;
7087 exp->string = PrintUInt64(op1->ui64 += value2);
7088 if(!exp->expType)
7089 {
7090 exp->expType = op1->type;
7091 if(op1->type)
7092 op1->type->refCount++;
7093 }
7094 return 0x1;
7095 }
7096
7097 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7098 {
7099 short value2 = op2->s;
7100
7101 exp->type = 2;
7102 exp->string = PrintShort(op1->s += value2);
7103 if(!exp->expType)
7104 {
7105 exp->expType = op1->type;
7106 if(op1->type)
7107 op1->type->refCount++;
7108 }
7109 return 0x1;
7110 }
7111
7112 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7113 {
7114 unsigned short value2 = op2->us;
7115
7116 exp->type = 2;
7117 exp->string = PrintUShort(op1->us += value2);
7118 if(!exp->expType)
7119 {
7120 exp->expType = op1->type;
7121 if(op1->type)
7122 op1->type->refCount++;
7123 }
7124 return 0x1;
7125 }
7126
7127 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7128 {
7129 char value2 = op2->c;
7130
7131 exp->type = 2;
7132 exp->string = PrintChar(op1->c += value2);
7133 if(!exp->expType)
7134 {
7135 exp->expType = op1->type;
7136 if(op1->type)
7137 op1->type->refCount++;
7138 }
7139 return 0x1;
7140 }
7141
7142 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7143 {
7144 unsigned char value2 = op2->uc;
7145
7146 exp->type = 2;
7147 exp->string = PrintUChar(op1->uc += value2);
7148 if(!exp->expType)
7149 {
7150 exp->expType = op1->type;
7151 if(op1->type)
7152 op1->type->refCount++;
7153 }
7154 return 0x1;
7155 }
7156
7157 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7158 {
7159 float value2 = op2->f;
7160
7161 exp->type = 2;
7162 exp->string = PrintFloat(op1->f += value2);
7163 if(!exp->expType)
7164 {
7165 exp->expType = op1->type;
7166 if(op1->type)
7167 op1->type->refCount++;
7168 }
7169 return 0x1;
7170 }
7171
7172 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7173 {
7174 double value2 = op2->d;
7175
7176 exp->type = 2;
7177 exp->string = PrintDouble(op1->d += value2);
7178 if(!exp->expType)
7179 {
7180 exp->expType = op1->type;
7181 if(op1->type)
7182 op1->type->refCount++;
7183 }
7184 return 0x1;
7185 }
7186
7187 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7188 {
7189 int value2 = op2->i;
7190
7191 exp->type = 2;
7192 exp->string = PrintInt(op1->i -= value2);
7193 if(!exp->expType)
7194 {
7195 exp->expType = op1->type;
7196 if(op1->type)
7197 op1->type->refCount++;
7198 }
7199 return 0x1;
7200 }
7201
7202 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7203 {
7204 unsigned int value2 = op2->ui;
7205
7206 exp->type = 2;
7207 exp->string = PrintUInt(op1->ui -= value2);
7208 if(!exp->expType)
7209 {
7210 exp->expType = op1->type;
7211 if(op1->type)
7212 op1->type->refCount++;
7213 }
7214 return 0x1;
7215 }
7216
7217 static unsigned int Int64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7218 {
7219 long long value2 = op2->i64;
7220
7221 exp->type = 2;
7222 exp->string = PrintInt64(op1->i64 -= value2);
7223 if(!exp->expType)
7224 {
7225 exp->expType = op1->type;
7226 if(op1->type)
7227 op1->type->refCount++;
7228 }
7229 return 0x1;
7230 }
7231
7232 static unsigned int UInt64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7233 {
7234 uint64 value2 = op2->ui64;
7235
7236 exp->type = 2;
7237 exp->string = PrintUInt64(op1->ui64 -= value2);
7238 if(!exp->expType)
7239 {
7240 exp->expType = op1->type;
7241 if(op1->type)
7242 op1->type->refCount++;
7243 }
7244 return 0x1;
7245 }
7246
7247 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7248 {
7249 short value2 = op2->s;
7250
7251 exp->type = 2;
7252 exp->string = PrintShort(op1->s -= value2);
7253 if(!exp->expType)
7254 {
7255 exp->expType = op1->type;
7256 if(op1->type)
7257 op1->type->refCount++;
7258 }
7259 return 0x1;
7260 }
7261
7262 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7263 {
7264 unsigned short value2 = op2->us;
7265
7266 exp->type = 2;
7267 exp->string = PrintUShort(op1->us -= value2);
7268 if(!exp->expType)
7269 {
7270 exp->expType = op1->type;
7271 if(op1->type)
7272 op1->type->refCount++;
7273 }
7274 return 0x1;
7275 }
7276
7277 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7278 {
7279 char value2 = op2->c;
7280
7281 exp->type = 2;
7282 exp->string = PrintChar(op1->c -= value2);
7283 if(!exp->expType)
7284 {
7285 exp->expType = op1->type;
7286 if(op1->type)
7287 op1->type->refCount++;
7288 }
7289 return 0x1;
7290 }
7291
7292 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7293 {
7294 unsigned char value2 = op2->uc;
7295
7296 exp->type = 2;
7297 exp->string = PrintUChar(op1->uc -= value2);
7298 if(!exp->expType)
7299 {
7300 exp->expType = op1->type;
7301 if(op1->type)
7302 op1->type->refCount++;
7303 }
7304 return 0x1;
7305 }
7306
7307 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7308 {
7309 float value2 = op2->f;
7310
7311 exp->type = 2;
7312 exp->string = PrintFloat(op1->f -= value2);
7313 if(!exp->expType)
7314 {
7315 exp->expType = op1->type;
7316 if(op1->type)
7317 op1->type->refCount++;
7318 }
7319 return 0x1;
7320 }
7321
7322 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7323 {
7324 double value2 = op2->d;
7325
7326 exp->type = 2;
7327 exp->string = PrintDouble(op1->d -= value2);
7328 if(!exp->expType)
7329 {
7330 exp->expType = op1->type;
7331 if(op1->type)
7332 op1->type->refCount++;
7333 }
7334 return 0x1;
7335 }
7336
7337 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7338 {
7339 int value2 = op2->i;
7340
7341 exp->type = 2;
7342 exp->string = PrintInt(op1->i *= value2);
7343 if(!exp->expType)
7344 {
7345 exp->expType = op1->type;
7346 if(op1->type)
7347 op1->type->refCount++;
7348 }
7349 return 0x1;
7350 }
7351
7352 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7353 {
7354 unsigned int value2 = op2->ui;
7355
7356 exp->type = 2;
7357 exp->string = PrintUInt(op1->ui *= value2);
7358 if(!exp->expType)
7359 {
7360 exp->expType = op1->type;
7361 if(op1->type)
7362 op1->type->refCount++;
7363 }
7364 return 0x1;
7365 }
7366
7367 static unsigned int Int64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7368 {
7369 long long value2 = op2->i64;
7370
7371 exp->type = 2;
7372 exp->string = PrintInt64(op1->i64 *= value2);
7373 if(!exp->expType)
7374 {
7375 exp->expType = op1->type;
7376 if(op1->type)
7377 op1->type->refCount++;
7378 }
7379 return 0x1;
7380 }
7381
7382 static unsigned int UInt64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7383 {
7384 uint64 value2 = op2->ui64;
7385
7386 exp->type = 2;
7387 exp->string = PrintUInt64(op1->ui64 *= value2);
7388 if(!exp->expType)
7389 {
7390 exp->expType = op1->type;
7391 if(op1->type)
7392 op1->type->refCount++;
7393 }
7394 return 0x1;
7395 }
7396
7397 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7398 {
7399 short value2 = op2->s;
7400
7401 exp->type = 2;
7402 exp->string = PrintShort(op1->s *= value2);
7403 if(!exp->expType)
7404 {
7405 exp->expType = op1->type;
7406 if(op1->type)
7407 op1->type->refCount++;
7408 }
7409 return 0x1;
7410 }
7411
7412 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7413 {
7414 unsigned short value2 = op2->us;
7415
7416 exp->type = 2;
7417 exp->string = PrintUShort(op1->us *= value2);
7418 if(!exp->expType)
7419 {
7420 exp->expType = op1->type;
7421 if(op1->type)
7422 op1->type->refCount++;
7423 }
7424 return 0x1;
7425 }
7426
7427 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7428 {
7429 char value2 = op2->c;
7430
7431 exp->type = 2;
7432 exp->string = PrintChar(op1->c *= value2);
7433 if(!exp->expType)
7434 {
7435 exp->expType = op1->type;
7436 if(op1->type)
7437 op1->type->refCount++;
7438 }
7439 return 0x1;
7440 }
7441
7442 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7443 {
7444 unsigned char value2 = op2->uc;
7445
7446 exp->type = 2;
7447 exp->string = PrintUChar(op1->uc *= value2);
7448 if(!exp->expType)
7449 {
7450 exp->expType = op1->type;
7451 if(op1->type)
7452 op1->type->refCount++;
7453 }
7454 return 0x1;
7455 }
7456
7457 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7458 {
7459 float value2 = op2->f;
7460
7461 exp->type = 2;
7462 exp->string = PrintFloat(op1->f *= value2);
7463 if(!exp->expType)
7464 {
7465 exp->expType = op1->type;
7466 if(op1->type)
7467 op1->type->refCount++;
7468 }
7469 return 0x1;
7470 }
7471
7472 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7473 {
7474 double value2 = op2->d;
7475
7476 exp->type = 2;
7477 exp->string = PrintDouble(op1->d *= value2);
7478 if(!exp->expType)
7479 {
7480 exp->expType = op1->type;
7481 if(op1->type)
7482 op1->type->refCount++;
7483 }
7484 return 0x1;
7485 }
7486
7487 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7488 {
7489 int value2 = op2->i;
7490
7491 exp->type = 2;
7492 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
7493 if(!exp->expType)
7494 {
7495 exp->expType = op1->type;
7496 if(op1->type)
7497 op1->type->refCount++;
7498 }
7499 return 0x1;
7500 }
7501
7502 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7503 {
7504 unsigned int value2 = op2->ui;
7505
7506 exp->type = 2;
7507 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
7508 if(!exp->expType)
7509 {
7510 exp->expType = op1->type;
7511 if(op1->type)
7512 op1->type->refCount++;
7513 }
7514 return 0x1;
7515 }
7516
7517 static unsigned int Int64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7518 {
7519 long long value2 = op2->i64;
7520
7521 exp->type = 2;
7522 exp->string = PrintInt64(value2 ? (op1->i64 /= value2) : 0);
7523 if(!exp->expType)
7524 {
7525 exp->expType = op1->type;
7526 if(op1->type)
7527 op1->type->refCount++;
7528 }
7529 return 0x1;
7530 }
7531
7532 static unsigned int UInt64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7533 {
7534 uint64 value2 = op2->ui64;
7535
7536 exp->type = 2;
7537 exp->string = PrintUInt64(value2 ? (op1->ui64 /= value2) : 0);
7538 if(!exp->expType)
7539 {
7540 exp->expType = op1->type;
7541 if(op1->type)
7542 op1->type->refCount++;
7543 }
7544 return 0x1;
7545 }
7546
7547 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7548 {
7549 short value2 = op2->s;
7550
7551 exp->type = 2;
7552 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
7553 if(!exp->expType)
7554 {
7555 exp->expType = op1->type;
7556 if(op1->type)
7557 op1->type->refCount++;
7558 }
7559 return 0x1;
7560 }
7561
7562 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7563 {
7564 unsigned short value2 = op2->us;
7565
7566 exp->type = 2;
7567 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
7568 if(!exp->expType)
7569 {
7570 exp->expType = op1->type;
7571 if(op1->type)
7572 op1->type->refCount++;
7573 }
7574 return 0x1;
7575 }
7576
7577 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7578 {
7579 char value2 = op2->c;
7580
7581 exp->type = 2;
7582 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
7583 if(!exp->expType)
7584 {
7585 exp->expType = op1->type;
7586 if(op1->type)
7587 op1->type->refCount++;
7588 }
7589 return 0x1;
7590 }
7591
7592 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7593 {
7594 unsigned char value2 = op2->uc;
7595
7596 exp->type = 2;
7597 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
7598 if(!exp->expType)
7599 {
7600 exp->expType = op1->type;
7601 if(op1->type)
7602 op1->type->refCount++;
7603 }
7604 return 0x1;
7605 }
7606
7607 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7608 {
7609 float value2 = op2->f;
7610
7611 exp->type = 2;
7612 exp->string = PrintFloat(op1->f /= value2);
7613 if(!exp->expType)
7614 {
7615 exp->expType = op1->type;
7616 if(op1->type)
7617 op1->type->refCount++;
7618 }
7619 return 0x1;
7620 }
7621
7622 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7623 {
7624 double value2 = op2->d;
7625
7626 exp->type = 2;
7627 exp->string = PrintDouble(op1->d /= value2);
7628 if(!exp->expType)
7629 {
7630 exp->expType = op1->type;
7631 if(op1->type)
7632 op1->type->refCount++;
7633 }
7634 return 0x1;
7635 }
7636
7637 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7638 {
7639 int value2 = op2->i;
7640
7641 exp->type = 2;
7642 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
7643 if(!exp->expType)
7644 {
7645 exp->expType = op1->type;
7646 if(op1->type)
7647 op1->type->refCount++;
7648 }
7649 return 0x1;
7650 }
7651
7652 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7653 {
7654 unsigned int value2 = op2->ui;
7655
7656 exp->type = 2;
7657 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
7658 if(!exp->expType)
7659 {
7660 exp->expType = op1->type;
7661 if(op1->type)
7662 op1->type->refCount++;
7663 }
7664 return 0x1;
7665 }
7666
7667 static unsigned int Int64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7668 {
7669 long long value2 = op2->i64;
7670
7671 exp->type = 2;
7672 exp->string = PrintInt64(value2 ? (op1->i64 %= value2) : 0);
7673 if(!exp->expType)
7674 {
7675 exp->expType = op1->type;
7676 if(op1->type)
7677 op1->type->refCount++;
7678 }
7679 return 0x1;
7680 }
7681
7682 static unsigned int UInt64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7683 {
7684 uint64 value2 = op2->ui64;
7685
7686 exp->type = 2;
7687 exp->string = PrintUInt64(value2 ? (op1->ui64 %= value2) : 0);
7688 if(!exp->expType)
7689 {
7690 exp->expType = op1->type;
7691 if(op1->type)
7692 op1->type->refCount++;
7693 }
7694 return 0x1;
7695 }
7696
7697 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7698 {
7699 short value2 = op2->s;
7700
7701 exp->type = 2;
7702 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
7703 if(!exp->expType)
7704 {
7705 exp->expType = op1->type;
7706 if(op1->type)
7707 op1->type->refCount++;
7708 }
7709 return 0x1;
7710 }
7711
7712 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7713 {
7714 unsigned short value2 = op2->us;
7715
7716 exp->type = 2;
7717 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
7718 if(!exp->expType)
7719 {
7720 exp->expType = op1->type;
7721 if(op1->type)
7722 op1->type->refCount++;
7723 }
7724 return 0x1;
7725 }
7726
7727 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7728 {
7729 char value2 = op2->c;
7730
7731 exp->type = 2;
7732 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
7733 if(!exp->expType)
7734 {
7735 exp->expType = op1->type;
7736 if(op1->type)
7737 op1->type->refCount++;
7738 }
7739 return 0x1;
7740 }
7741
7742 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7743 {
7744 unsigned char value2 = op2->uc;
7745
7746 exp->type = 2;
7747 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
7748 if(!exp->expType)
7749 {
7750 exp->expType = op1->type;
7751 if(op1->type)
7752 op1->type->refCount++;
7753 }
7754 return 0x1;
7755 }
7756
7757 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7758 {
7759 int value2 = op2->i;
7760
7761 exp->type = 2;
7762 exp->string = PrintInt(op1->i & value2);
7763 if(!exp->expType)
7764 {
7765 exp->expType = op1->type;
7766 if(op1->type)
7767 op1->type->refCount++;
7768 }
7769 return 0x1;
7770 }
7771
7772 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7773 {
7774 unsigned int value2 = op2->ui;
7775
7776 exp->type = 2;
7777 exp->string = PrintUInt(op1->ui & value2);
7778 if(!exp->expType)
7779 {
7780 exp->expType = op1->type;
7781 if(op1->type)
7782 op1->type->refCount++;
7783 }
7784 return 0x1;
7785 }
7786
7787 static unsigned int Int64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7788 {
7789 long long value2 = op2->i64;
7790
7791 exp->type = 2;
7792 exp->string = PrintInt64(op1->i64 & value2);
7793 if(!exp->expType)
7794 {
7795 exp->expType = op1->type;
7796 if(op1->type)
7797 op1->type->refCount++;
7798 }
7799 return 0x1;
7800 }
7801
7802 static unsigned int UInt64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7803 {
7804 uint64 value2 = op2->ui64;
7805
7806 exp->type = 2;
7807 exp->string = PrintUInt64(op1->ui64 & value2);
7808 if(!exp->expType)
7809 {
7810 exp->expType = op1->type;
7811 if(op1->type)
7812 op1->type->refCount++;
7813 }
7814 return 0x1;
7815 }
7816
7817 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7818 {
7819 short value2 = op2->s;
7820
7821 exp->type = 2;
7822 exp->string = PrintShort(op1->s & value2);
7823 if(!exp->expType)
7824 {
7825 exp->expType = op1->type;
7826 if(op1->type)
7827 op1->type->refCount++;
7828 }
7829 return 0x1;
7830 }
7831
7832 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7833 {
7834 unsigned short value2 = op2->us;
7835
7836 exp->type = 2;
7837 exp->string = PrintUShort(op1->us & value2);
7838 if(!exp->expType)
7839 {
7840 exp->expType = op1->type;
7841 if(op1->type)
7842 op1->type->refCount++;
7843 }
7844 return 0x1;
7845 }
7846
7847 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7848 {
7849 char value2 = op2->c;
7850
7851 exp->type = 2;
7852 exp->string = PrintChar(op1->c & value2);
7853 if(!exp->expType)
7854 {
7855 exp->expType = op1->type;
7856 if(op1->type)
7857 op1->type->refCount++;
7858 }
7859 return 0x1;
7860 }
7861
7862 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7863 {
7864 unsigned char value2 = op2->uc;
7865
7866 exp->type = 2;
7867 exp->string = PrintUChar(op1->uc & value2);
7868 if(!exp->expType)
7869 {
7870 exp->expType = op1->type;
7871 if(op1->type)
7872 op1->type->refCount++;
7873 }
7874 return 0x1;
7875 }
7876
7877 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7878 {
7879 int value2 = op2->i;
7880
7881 exp->type = 2;
7882 exp->string = PrintInt(op1->i | value2);
7883 if(!exp->expType)
7884 {
7885 exp->expType = op1->type;
7886 if(op1->type)
7887 op1->type->refCount++;
7888 }
7889 return 0x1;
7890 }
7891
7892 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7893 {
7894 unsigned int value2 = op2->ui;
7895
7896 exp->type = 2;
7897 exp->string = PrintUInt(op1->ui | value2);
7898 if(!exp->expType)
7899 {
7900 exp->expType = op1->type;
7901 if(op1->type)
7902 op1->type->refCount++;
7903 }
7904 return 0x1;
7905 }
7906
7907 static unsigned int Int64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7908 {
7909 long long value2 = op2->i64;
7910
7911 exp->type = 2;
7912 exp->string = PrintInt64(op1->i64 | value2);
7913 if(!exp->expType)
7914 {
7915 exp->expType = op1->type;
7916 if(op1->type)
7917 op1->type->refCount++;
7918 }
7919 return 0x1;
7920 }
7921
7922 static unsigned int UInt64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7923 {
7924 uint64 value2 = op2->ui64;
7925
7926 exp->type = 2;
7927 exp->string = PrintUInt64(op1->ui64 | value2);
7928 if(!exp->expType)
7929 {
7930 exp->expType = op1->type;
7931 if(op1->type)
7932 op1->type->refCount++;
7933 }
7934 return 0x1;
7935 }
7936
7937 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7938 {
7939 short value2 = op2->s;
7940
7941 exp->type = 2;
7942 exp->string = PrintShort(op1->s | value2);
7943 if(!exp->expType)
7944 {
7945 exp->expType = op1->type;
7946 if(op1->type)
7947 op1->type->refCount++;
7948 }
7949 return 0x1;
7950 }
7951
7952 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7953 {
7954 unsigned short value2 = op2->us;
7955
7956 exp->type = 2;
7957 exp->string = PrintUShort(op1->us | value2);
7958 if(!exp->expType)
7959 {
7960 exp->expType = op1->type;
7961 if(op1->type)
7962 op1->type->refCount++;
7963 }
7964 return 0x1;
7965 }
7966
7967 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7968 {
7969 char value2 = op2->c;
7970
7971 exp->type = 2;
7972 exp->string = PrintChar(op1->c | value2);
7973 if(!exp->expType)
7974 {
7975 exp->expType = op1->type;
7976 if(op1->type)
7977 op1->type->refCount++;
7978 }
7979 return 0x1;
7980 }
7981
7982 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7983 {
7984 unsigned char value2 = op2->uc;
7985
7986 exp->type = 2;
7987 exp->string = PrintUChar(op1->uc | value2);
7988 if(!exp->expType)
7989 {
7990 exp->expType = op1->type;
7991 if(op1->type)
7992 op1->type->refCount++;
7993 }
7994 return 0x1;
7995 }
7996
7997 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7998 {
7999 int value2 = op2->i;
8000
8001 exp->type = 2;
8002 exp->string = PrintInt(op1->i ^ value2);
8003 if(!exp->expType)
8004 {
8005 exp->expType = op1->type;
8006 if(op1->type)
8007 op1->type->refCount++;
8008 }
8009 return 0x1;
8010 }
8011
8012 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8013 {
8014 unsigned int value2 = op2->ui;
8015
8016 exp->type = 2;
8017 exp->string = PrintUInt(op1->ui ^ value2);
8018 if(!exp->expType)
8019 {
8020 exp->expType = op1->type;
8021 if(op1->type)
8022 op1->type->refCount++;
8023 }
8024 return 0x1;
8025 }
8026
8027 static unsigned int Int64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8028 {
8029 long long value2 = op2->i64;
8030
8031 exp->type = 2;
8032 exp->string = PrintInt64(op1->i64 ^ value2);
8033 if(!exp->expType)
8034 {
8035 exp->expType = op1->type;
8036 if(op1->type)
8037 op1->type->refCount++;
8038 }
8039 return 0x1;
8040 }
8041
8042 static unsigned int UInt64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8043 {
8044 uint64 value2 = op2->ui64;
8045
8046 exp->type = 2;
8047 exp->string = PrintUInt64(op1->ui64 ^ value2);
8048 if(!exp->expType)
8049 {
8050 exp->expType = op1->type;
8051 if(op1->type)
8052 op1->type->refCount++;
8053 }
8054 return 0x1;
8055 }
8056
8057 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8058 {
8059 short value2 = op2->s;
8060
8061 exp->type = 2;
8062 exp->string = PrintShort(op1->s ^ value2);
8063 if(!exp->expType)
8064 {
8065 exp->expType = op1->type;
8066 if(op1->type)
8067 op1->type->refCount++;
8068 }
8069 return 0x1;
8070 }
8071
8072 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8073 {
8074 unsigned short value2 = op2->us;
8075
8076 exp->type = 2;
8077 exp->string = PrintUShort(op1->us ^ value2);
8078 if(!exp->expType)
8079 {
8080 exp->expType = op1->type;
8081 if(op1->type)
8082 op1->type->refCount++;
8083 }
8084 return 0x1;
8085 }
8086
8087 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8088 {
8089 char value2 = op2->c;
8090
8091 exp->type = 2;
8092 exp->string = PrintChar(op1->c ^ value2);
8093 if(!exp->expType)
8094 {
8095 exp->expType = op1->type;
8096 if(op1->type)
8097 op1->type->refCount++;
8098 }
8099 return 0x1;
8100 }
8101
8102 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8103 {
8104 unsigned char value2 = op2->uc;
8105
8106 exp->type = 2;
8107 exp->string = PrintUChar(op1->uc ^ value2);
8108 if(!exp->expType)
8109 {
8110 exp->expType = op1->type;
8111 if(op1->type)
8112 op1->type->refCount++;
8113 }
8114 return 0x1;
8115 }
8116
8117 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8118 {
8119 int value2 = op2->i;
8120
8121 exp->type = 2;
8122 exp->string = PrintInt(op1->i << value2);
8123 if(!exp->expType)
8124 {
8125 exp->expType = op1->type;
8126 if(op1->type)
8127 op1->type->refCount++;
8128 }
8129 return 0x1;
8130 }
8131
8132 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8133 {
8134 unsigned int value2 = op2->ui;
8135
8136 exp->type = 2;
8137 exp->string = PrintUInt(op1->ui << value2);
8138 if(!exp->expType)
8139 {
8140 exp->expType = op1->type;
8141 if(op1->type)
8142 op1->type->refCount++;
8143 }
8144 return 0x1;
8145 }
8146
8147 static unsigned int Int64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8148 {
8149 long long value2 = op2->i64;
8150
8151 exp->type = 2;
8152 exp->string = PrintInt64(op1->i64 << value2);
8153 if(!exp->expType)
8154 {
8155 exp->expType = op1->type;
8156 if(op1->type)
8157 op1->type->refCount++;
8158 }
8159 return 0x1;
8160 }
8161
8162 static unsigned int UInt64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8163 {
8164 uint64 value2 = op2->ui64;
8165
8166 exp->type = 2;
8167 exp->string = PrintUInt64(op1->ui64 << value2);
8168 if(!exp->expType)
8169 {
8170 exp->expType = op1->type;
8171 if(op1->type)
8172 op1->type->refCount++;
8173 }
8174 return 0x1;
8175 }
8176
8177 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8178 {
8179 short value2 = op2->s;
8180
8181 exp->type = 2;
8182 exp->string = PrintShort(op1->s << value2);
8183 if(!exp->expType)
8184 {
8185 exp->expType = op1->type;
8186 if(op1->type)
8187 op1->type->refCount++;
8188 }
8189 return 0x1;
8190 }
8191
8192 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8193 {
8194 unsigned short value2 = op2->us;
8195
8196 exp->type = 2;
8197 exp->string = PrintUShort(op1->us << value2);
8198 if(!exp->expType)
8199 {
8200 exp->expType = op1->type;
8201 if(op1->type)
8202 op1->type->refCount++;
8203 }
8204 return 0x1;
8205 }
8206
8207 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8208 {
8209 char value2 = op2->c;
8210
8211 exp->type = 2;
8212 exp->string = PrintChar(op1->c << value2);
8213 if(!exp->expType)
8214 {
8215 exp->expType = op1->type;
8216 if(op1->type)
8217 op1->type->refCount++;
8218 }
8219 return 0x1;
8220 }
8221
8222 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8223 {
8224 unsigned char value2 = op2->uc;
8225
8226 exp->type = 2;
8227 exp->string = PrintUChar(op1->uc << value2);
8228 if(!exp->expType)
8229 {
8230 exp->expType = op1->type;
8231 if(op1->type)
8232 op1->type->refCount++;
8233 }
8234 return 0x1;
8235 }
8236
8237 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8238 {
8239 int value2 = op2->i;
8240
8241 exp->type = 2;
8242 exp->string = PrintInt(op1->i >> value2);
8243 if(!exp->expType)
8244 {
8245 exp->expType = op1->type;
8246 if(op1->type)
8247 op1->type->refCount++;
8248 }
8249 return 0x1;
8250 }
8251
8252 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8253 {
8254 unsigned int value2 = op2->ui;
8255
8256 exp->type = 2;
8257 exp->string = PrintUInt(op1->ui >> value2);
8258 if(!exp->expType)
8259 {
8260 exp->expType = op1->type;
8261 if(op1->type)
8262 op1->type->refCount++;
8263 }
8264 return 0x1;
8265 }
8266
8267 static unsigned int Int64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8268 {
8269 long long value2 = op2->i64;
8270
8271 exp->type = 2;
8272 exp->string = PrintInt64(op1->i64 >> value2);
8273 if(!exp->expType)
8274 {
8275 exp->expType = op1->type;
8276 if(op1->type)
8277 op1->type->refCount++;
8278 }
8279 return 0x1;
8280 }
8281
8282 static unsigned int UInt64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8283 {
8284 uint64 value2 = op2->ui64;
8285
8286 exp->type = 2;
8287 exp->string = PrintUInt64(op1->ui64 >> value2);
8288 if(!exp->expType)
8289 {
8290 exp->expType = op1->type;
8291 if(op1->type)
8292 op1->type->refCount++;
8293 }
8294 return 0x1;
8295 }
8296
8297 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8298 {
8299 short value2 = op2->s;
8300
8301 exp->type = 2;
8302 exp->string = PrintShort(op1->s >> value2);
8303 if(!exp->expType)
8304 {
8305 exp->expType = op1->type;
8306 if(op1->type)
8307 op1->type->refCount++;
8308 }
8309 return 0x1;
8310 }
8311
8312 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8313 {
8314 unsigned short value2 = op2->us;
8315
8316 exp->type = 2;
8317 exp->string = PrintUShort(op1->us >> value2);
8318 if(!exp->expType)
8319 {
8320 exp->expType = op1->type;
8321 if(op1->type)
8322 op1->type->refCount++;
8323 }
8324 return 0x1;
8325 }
8326
8327 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8328 {
8329 char value2 = op2->c;
8330
8331 exp->type = 2;
8332 exp->string = PrintChar(op1->c >> value2);
8333 if(!exp->expType)
8334 {
8335 exp->expType = op1->type;
8336 if(op1->type)
8337 op1->type->refCount++;
8338 }
8339 return 0x1;
8340 }
8341
8342 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8343 {
8344 unsigned char value2 = op2->uc;
8345
8346 exp->type = 2;
8347 exp->string = PrintUChar(op1->uc >> value2);
8348 if(!exp->expType)
8349 {
8350 exp->expType = op1->type;
8351 if(op1->type)
8352 op1->type->refCount++;
8353 }
8354 return 0x1;
8355 }
8356
8357 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
8358 {
8359 exp->type = 2;
8360 exp->string = PrintInt((~op1->i));
8361 if(!exp->expType)
8362 {
8363 exp->expType = op1->type;
8364 if(op1->type)
8365 op1->type->refCount++;
8366 }
8367 return 0x1;
8368 }
8369
8370 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
8371 {
8372 exp->type = 2;
8373 exp->string = PrintUInt((unsigned int)(~op1->ui));
8374 if(!exp->expType)
8375 {
8376 exp->expType = op1->type;
8377 if(op1->type)
8378 op1->type->refCount++;
8379 }
8380 return 0x1;
8381 }
8382
8383 static unsigned int Int64BitNot(struct Expression * exp, struct Operand * op1)
8384 {
8385 exp->type = 2;
8386 exp->string = PrintInt64((long long)(~op1->i64));
8387 if(!exp->expType)
8388 {
8389 exp->expType = op1->type;
8390 if(op1->type)
8391 op1->type->refCount++;
8392 }
8393 return 0x1;
8394 }
8395
8396 static unsigned int UInt64BitNot(struct Expression * exp, struct Operand * op1)
8397 {
8398 exp->type = 2;
8399 exp->string = PrintUInt64((uint64)(~op1->ui64));
8400 if(!exp->expType)
8401 {
8402 exp->expType = op1->type;
8403 if(op1->type)
8404 op1->type->refCount++;
8405 }
8406 return 0x1;
8407 }
8408
8409 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
8410 {
8411 exp->type = 2;
8412 exp->string = PrintShort((short)(~op1->s));
8413 if(!exp->expType)
8414 {
8415 exp->expType = op1->type;
8416 if(op1->type)
8417 op1->type->refCount++;
8418 }
8419 return 0x1;
8420 }
8421
8422 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
8423 {
8424 exp->type = 2;
8425 exp->string = PrintUShort((unsigned short)(~op1->us));
8426 if(!exp->expType)
8427 {
8428 exp->expType = op1->type;
8429 if(op1->type)
8430 op1->type->refCount++;
8431 }
8432 return 0x1;
8433 }
8434
8435 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
8436 {
8437 exp->type = 2;
8438 exp->string = PrintChar((char)(~op1->c));
8439 if(!exp->expType)
8440 {
8441 exp->expType = op1->type;
8442 if(op1->type)
8443 op1->type->refCount++;
8444 }
8445 return 0x1;
8446 }
8447
8448 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
8449 {
8450 exp->type = 2;
8451 exp->string = PrintUChar((unsigned char)(~op1->uc));
8452 if(!exp->expType)
8453 {
8454 exp->expType = op1->type;
8455 if(op1->type)
8456 op1->type->refCount++;
8457 }
8458 return 0x1;
8459 }
8460
8461 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8462 {
8463 int value2 = op2->i;
8464
8465 exp->type = 2;
8466 exp->string = PrintInt(op1->i &= value2);
8467 if(!exp->expType)
8468 {
8469 exp->expType = op1->type;
8470 if(op1->type)
8471 op1->type->refCount++;
8472 }
8473 return 0x1;
8474 }
8475
8476 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8477 {
8478 unsigned int value2 = op2->ui;
8479
8480 exp->type = 2;
8481 exp->string = PrintUInt(op1->ui &= value2);
8482 if(!exp->expType)
8483 {
8484 exp->expType = op1->type;
8485 if(op1->type)
8486 op1->type->refCount++;
8487 }
8488 return 0x1;
8489 }
8490
8491 static unsigned int Int64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8492 {
8493 long long value2 = op2->i64;
8494
8495 exp->type = 2;
8496 exp->string = PrintInt64(op1->i64 &= value2);
8497 if(!exp->expType)
8498 {
8499 exp->expType = op1->type;
8500 if(op1->type)
8501 op1->type->refCount++;
8502 }
8503 return 0x1;
8504 }
8505
8506 static unsigned int UInt64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8507 {
8508 uint64 value2 = op2->ui64;
8509
8510 exp->type = 2;
8511 exp->string = PrintUInt64(op1->ui64 &= value2);
8512 if(!exp->expType)
8513 {
8514 exp->expType = op1->type;
8515 if(op1->type)
8516 op1->type->refCount++;
8517 }
8518 return 0x1;
8519 }
8520
8521 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8522 {
8523 short value2 = op2->s;
8524
8525 exp->type = 2;
8526 exp->string = PrintShort(op1->s &= value2);
8527 if(!exp->expType)
8528 {
8529 exp->expType = op1->type;
8530 if(op1->type)
8531 op1->type->refCount++;
8532 }
8533 return 0x1;
8534 }
8535
8536 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8537 {
8538 unsigned short value2 = op2->us;
8539
8540 exp->type = 2;
8541 exp->string = PrintUShort(op1->us &= value2);
8542 if(!exp->expType)
8543 {
8544 exp->expType = op1->type;
8545 if(op1->type)
8546 op1->type->refCount++;
8547 }
8548 return 0x1;
8549 }
8550
8551 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8552 {
8553 char value2 = op2->c;
8554
8555 exp->type = 2;
8556 exp->string = PrintChar(op1->c &= value2);
8557 if(!exp->expType)
8558 {
8559 exp->expType = op1->type;
8560 if(op1->type)
8561 op1->type->refCount++;
8562 }
8563 return 0x1;
8564 }
8565
8566 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8567 {
8568 unsigned char value2 = op2->uc;
8569
8570 exp->type = 2;
8571 exp->string = PrintUChar(op1->uc &= value2);
8572 if(!exp->expType)
8573 {
8574 exp->expType = op1->type;
8575 if(op1->type)
8576 op1->type->refCount++;
8577 }
8578 return 0x1;
8579 }
8580
8581 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8582 {
8583 int value2 = op2->i;
8584
8585 exp->type = 2;
8586 exp->string = PrintInt(op1->i |= value2);
8587 if(!exp->expType)
8588 {
8589 exp->expType = op1->type;
8590 if(op1->type)
8591 op1->type->refCount++;
8592 }
8593 return 0x1;
8594 }
8595
8596 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8597 {
8598 unsigned int value2 = op2->ui;
8599
8600 exp->type = 2;
8601 exp->string = PrintUInt(op1->ui |= value2);
8602 if(!exp->expType)
8603 {
8604 exp->expType = op1->type;
8605 if(op1->type)
8606 op1->type->refCount++;
8607 }
8608 return 0x1;
8609 }
8610
8611 static unsigned int Int64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8612 {
8613 long long value2 = op2->i64;
8614
8615 exp->type = 2;
8616 exp->string = PrintInt64(op1->i64 |= value2);
8617 if(!exp->expType)
8618 {
8619 exp->expType = op1->type;
8620 if(op1->type)
8621 op1->type->refCount++;
8622 }
8623 return 0x1;
8624 }
8625
8626 static unsigned int UInt64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8627 {
8628 uint64 value2 = op2->ui64;
8629
8630 exp->type = 2;
8631 exp->string = PrintUInt64(op1->ui64 |= value2);
8632 if(!exp->expType)
8633 {
8634 exp->expType = op1->type;
8635 if(op1->type)
8636 op1->type->refCount++;
8637 }
8638 return 0x1;
8639 }
8640
8641 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8642 {
8643 short value2 = op2->s;
8644
8645 exp->type = 2;
8646 exp->string = PrintShort(op1->s |= value2);
8647 if(!exp->expType)
8648 {
8649 exp->expType = op1->type;
8650 if(op1->type)
8651 op1->type->refCount++;
8652 }
8653 return 0x1;
8654 }
8655
8656 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8657 {
8658 unsigned short value2 = op2->us;
8659
8660 exp->type = 2;
8661 exp->string = PrintUShort(op1->us |= value2);
8662 if(!exp->expType)
8663 {
8664 exp->expType = op1->type;
8665 if(op1->type)
8666 op1->type->refCount++;
8667 }
8668 return 0x1;
8669 }
8670
8671 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8672 {
8673 char value2 = op2->c;
8674
8675 exp->type = 2;
8676 exp->string = PrintChar(op1->c |= value2);
8677 if(!exp->expType)
8678 {
8679 exp->expType = op1->type;
8680 if(op1->type)
8681 op1->type->refCount++;
8682 }
8683 return 0x1;
8684 }
8685
8686 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8687 {
8688 unsigned char value2 = op2->uc;
8689
8690 exp->type = 2;
8691 exp->string = PrintUChar(op1->uc |= value2);
8692 if(!exp->expType)
8693 {
8694 exp->expType = op1->type;
8695 if(op1->type)
8696 op1->type->refCount++;
8697 }
8698 return 0x1;
8699 }
8700
8701 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8702 {
8703 int value2 = op2->i;
8704
8705 exp->type = 2;
8706 exp->string = PrintInt(op1->i ^= value2);
8707 if(!exp->expType)
8708 {
8709 exp->expType = op1->type;
8710 if(op1->type)
8711 op1->type->refCount++;
8712 }
8713 return 0x1;
8714 }
8715
8716 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8717 {
8718 unsigned int value2 = op2->ui;
8719
8720 exp->type = 2;
8721 exp->string = PrintUInt(op1->ui ^= value2);
8722 if(!exp->expType)
8723 {
8724 exp->expType = op1->type;
8725 if(op1->type)
8726 op1->type->refCount++;
8727 }
8728 return 0x1;
8729 }
8730
8731 static unsigned int Int64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8732 {
8733 long long value2 = op2->i64;
8734
8735 exp->type = 2;
8736 exp->string = PrintInt64(op1->i64 ^= value2);
8737 if(!exp->expType)
8738 {
8739 exp->expType = op1->type;
8740 if(op1->type)
8741 op1->type->refCount++;
8742 }
8743 return 0x1;
8744 }
8745
8746 static unsigned int UInt64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8747 {
8748 uint64 value2 = op2->ui64;
8749
8750 exp->type = 2;
8751 exp->string = PrintUInt64(op1->ui64 ^= value2);
8752 if(!exp->expType)
8753 {
8754 exp->expType = op1->type;
8755 if(op1->type)
8756 op1->type->refCount++;
8757 }
8758 return 0x1;
8759 }
8760
8761 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8762 {
8763 short value2 = op2->s;
8764
8765 exp->type = 2;
8766 exp->string = PrintShort(op1->s ^= value2);
8767 if(!exp->expType)
8768 {
8769 exp->expType = op1->type;
8770 if(op1->type)
8771 op1->type->refCount++;
8772 }
8773 return 0x1;
8774 }
8775
8776 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8777 {
8778 unsigned short value2 = op2->us;
8779
8780 exp->type = 2;
8781 exp->string = PrintUShort(op1->us ^= value2);
8782 if(!exp->expType)
8783 {
8784 exp->expType = op1->type;
8785 if(op1->type)
8786 op1->type->refCount++;
8787 }
8788 return 0x1;
8789 }
8790
8791 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8792 {
8793 char value2 = op2->c;
8794
8795 exp->type = 2;
8796 exp->string = PrintChar(op1->c ^= value2);
8797 if(!exp->expType)
8798 {
8799 exp->expType = op1->type;
8800 if(op1->type)
8801 op1->type->refCount++;
8802 }
8803 return 0x1;
8804 }
8805
8806 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8807 {
8808 unsigned char value2 = op2->uc;
8809
8810 exp->type = 2;
8811 exp->string = PrintUChar(op1->uc ^= value2);
8812 if(!exp->expType)
8813 {
8814 exp->expType = op1->type;
8815 if(op1->type)
8816 op1->type->refCount++;
8817 }
8818 return 0x1;
8819 }
8820
8821 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8822 {
8823 int value2 = op2->i;
8824
8825 exp->type = 2;
8826 exp->string = PrintInt(op1->i <<= value2);
8827 if(!exp->expType)
8828 {
8829 exp->expType = op1->type;
8830 if(op1->type)
8831 op1->type->refCount++;
8832 }
8833 return 0x1;
8834 }
8835
8836 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8837 {
8838 unsigned int value2 = op2->ui;
8839
8840 exp->type = 2;
8841 exp->string = PrintUInt(op1->ui <<= value2);
8842 if(!exp->expType)
8843 {
8844 exp->expType = op1->type;
8845 if(op1->type)
8846 op1->type->refCount++;
8847 }
8848 return 0x1;
8849 }
8850
8851 static unsigned int Int64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8852 {
8853 long long value2 = op2->i64;
8854
8855 exp->type = 2;
8856 exp->string = PrintInt64(op1->i64 <<= value2);
8857 if(!exp->expType)
8858 {
8859 exp->expType = op1->type;
8860 if(op1->type)
8861 op1->type->refCount++;
8862 }
8863 return 0x1;
8864 }
8865
8866 static unsigned int UInt64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8867 {
8868 uint64 value2 = op2->ui64;
8869
8870 exp->type = 2;
8871 exp->string = PrintUInt64(op1->ui64 <<= value2);
8872 if(!exp->expType)
8873 {
8874 exp->expType = op1->type;
8875 if(op1->type)
8876 op1->type->refCount++;
8877 }
8878 return 0x1;
8879 }
8880
8881 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8882 {
8883 short value2 = op2->s;
8884
8885 exp->type = 2;
8886 exp->string = PrintShort(op1->s <<= value2);
8887 if(!exp->expType)
8888 {
8889 exp->expType = op1->type;
8890 if(op1->type)
8891 op1->type->refCount++;
8892 }
8893 return 0x1;
8894 }
8895
8896 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8897 {
8898 unsigned short value2 = op2->us;
8899
8900 exp->type = 2;
8901 exp->string = PrintUShort(op1->us <<= value2);
8902 if(!exp->expType)
8903 {
8904 exp->expType = op1->type;
8905 if(op1->type)
8906 op1->type->refCount++;
8907 }
8908 return 0x1;
8909 }
8910
8911 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8912 {
8913 char value2 = op2->c;
8914
8915 exp->type = 2;
8916 exp->string = PrintChar(op1->c <<= value2);
8917 if(!exp->expType)
8918 {
8919 exp->expType = op1->type;
8920 if(op1->type)
8921 op1->type->refCount++;
8922 }
8923 return 0x1;
8924 }
8925
8926 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8927 {
8928 unsigned char value2 = op2->uc;
8929
8930 exp->type = 2;
8931 exp->string = PrintUChar(op1->uc <<= value2);
8932 if(!exp->expType)
8933 {
8934 exp->expType = op1->type;
8935 if(op1->type)
8936 op1->type->refCount++;
8937 }
8938 return 0x1;
8939 }
8940
8941 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8942 {
8943 int value2 = op2->i;
8944
8945 exp->type = 2;
8946 exp->string = PrintInt(op1->i >>= value2);
8947 if(!exp->expType)
8948 {
8949 exp->expType = op1->type;
8950 if(op1->type)
8951 op1->type->refCount++;
8952 }
8953 return 0x1;
8954 }
8955
8956 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8957 {
8958 unsigned int value2 = op2->ui;
8959
8960 exp->type = 2;
8961 exp->string = PrintUInt(op1->ui >>= value2);
8962 if(!exp->expType)
8963 {
8964 exp->expType = op1->type;
8965 if(op1->type)
8966 op1->type->refCount++;
8967 }
8968 return 0x1;
8969 }
8970
8971 static unsigned int Int64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8972 {
8973 long long value2 = op2->i64;
8974
8975 exp->type = 2;
8976 exp->string = PrintInt64(op1->i64 >>= value2);
8977 if(!exp->expType)
8978 {
8979 exp->expType = op1->type;
8980 if(op1->type)
8981 op1->type->refCount++;
8982 }
8983 return 0x1;
8984 }
8985
8986 static unsigned int UInt64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8987 {
8988 uint64 value2 = op2->ui64;
8989
8990 exp->type = 2;
8991 exp->string = PrintUInt64(op1->ui64 >>= value2);
8992 if(!exp->expType)
8993 {
8994 exp->expType = op1->type;
8995 if(op1->type)
8996 op1->type->refCount++;
8997 }
8998 return 0x1;
8999 }
9000
9001 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9002 {
9003 short value2 = op2->s;
9004
9005 exp->type = 2;
9006 exp->string = PrintShort(op1->s >>= value2);
9007 if(!exp->expType)
9008 {
9009 exp->expType = op1->type;
9010 if(op1->type)
9011 op1->type->refCount++;
9012 }
9013 return 0x1;
9014 }
9015
9016 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9017 {
9018 unsigned short value2 = op2->us;
9019
9020 exp->type = 2;
9021 exp->string = PrintUShort(op1->us >>= value2);
9022 if(!exp->expType)
9023 {
9024 exp->expType = op1->type;
9025 if(op1->type)
9026 op1->type->refCount++;
9027 }
9028 return 0x1;
9029 }
9030
9031 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9032 {
9033 char value2 = op2->c;
9034
9035 exp->type = 2;
9036 exp->string = PrintChar(op1->c >>= value2);
9037 if(!exp->expType)
9038 {
9039 exp->expType = op1->type;
9040 if(op1->type)
9041 op1->type->refCount++;
9042 }
9043 return 0x1;
9044 }
9045
9046 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9047 {
9048 unsigned char value2 = op2->uc;
9049
9050 exp->type = 2;
9051 exp->string = PrintUChar(op1->uc >>= value2);
9052 if(!exp->expType)
9053 {
9054 exp->expType = op1->type;
9055 if(op1->type)
9056 op1->type->refCount++;
9057 }
9058 return 0x1;
9059 }
9060
9061 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
9062 {
9063 exp->type = 2;
9064 exp->string = PrintInt((int)(!op1->i));
9065 if(!exp->expType)
9066 {
9067 exp->expType = op1->type;
9068 if(op1->type)
9069 op1->type->refCount++;
9070 }
9071 return 0x1;
9072 }
9073
9074 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
9075 {
9076 exp->type = 2;
9077 exp->string = PrintUInt((unsigned int)(!op1->ui));
9078 if(!exp->expType)
9079 {
9080 exp->expType = op1->type;
9081 if(op1->type)
9082 op1->type->refCount++;
9083 }
9084 return 0x1;
9085 }
9086
9087 static unsigned int Int64Not(struct Expression * exp, struct Operand * op1)
9088 {
9089 exp->type = 2;
9090 exp->string = PrintInt64((long long)(!op1->i64));
9091 if(!exp->expType)
9092 {
9093 exp->expType = op1->type;
9094 if(op1->type)
9095 op1->type->refCount++;
9096 }
9097 return 0x1;
9098 }
9099
9100 static unsigned int UInt64Not(struct Expression * exp, struct Operand * op1)
9101 {
9102 exp->type = 2;
9103 exp->string = PrintUInt64((uint64)(!op1->ui64));
9104 if(!exp->expType)
9105 {
9106 exp->expType = op1->type;
9107 if(op1->type)
9108 op1->type->refCount++;
9109 }
9110 return 0x1;
9111 }
9112
9113 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
9114 {
9115 exp->type = 2;
9116 exp->string = PrintShort((short)(!op1->s));
9117 if(!exp->expType)
9118 {
9119 exp->expType = op1->type;
9120 if(op1->type)
9121 op1->type->refCount++;
9122 }
9123 return 0x1;
9124 }
9125
9126 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
9127 {
9128 exp->type = 2;
9129 exp->string = PrintUShort((unsigned short)(!op1->us));
9130 if(!exp->expType)
9131 {
9132 exp->expType = op1->type;
9133 if(op1->type)
9134 op1->type->refCount++;
9135 }
9136 return 0x1;
9137 }
9138
9139 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
9140 {
9141 exp->type = 2;
9142 exp->string = PrintChar((char)(!op1->c));
9143 if(!exp->expType)
9144 {
9145 exp->expType = op1->type;
9146 if(op1->type)
9147 op1->type->refCount++;
9148 }
9149 return 0x1;
9150 }
9151
9152 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
9153 {
9154 exp->type = 2;
9155 exp->string = PrintUChar((unsigned char)(!op1->uc));
9156 if(!exp->expType)
9157 {
9158 exp->expType = op1->type;
9159 if(op1->type)
9160 op1->type->refCount++;
9161 }
9162 return 0x1;
9163 }
9164
9165 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9166 {
9167 int value2 = op2->i;
9168
9169 exp->type = 2;
9170 exp->string = PrintInt(op1->i == value2);
9171 if(!exp->expType)
9172 {
9173 exp->expType = op1->type;
9174 if(op1->type)
9175 op1->type->refCount++;
9176 }
9177 return 0x1;
9178 }
9179
9180 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9181 {
9182 unsigned int value2 = op2->ui;
9183
9184 exp->type = 2;
9185 exp->string = PrintUInt(op1->ui == value2);
9186 if(!exp->expType)
9187 {
9188 exp->expType = op1->type;
9189 if(op1->type)
9190 op1->type->refCount++;
9191 }
9192 return 0x1;
9193 }
9194
9195 static unsigned int Int64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9196 {
9197 long long value2 = op2->i64;
9198
9199 exp->type = 2;
9200 exp->string = PrintInt64(op1->i64 == value2);
9201 if(!exp->expType)
9202 {
9203 exp->expType = op1->type;
9204 if(op1->type)
9205 op1->type->refCount++;
9206 }
9207 return 0x1;
9208 }
9209
9210 static unsigned int UInt64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9211 {
9212 uint64 value2 = op2->ui64;
9213
9214 exp->type = 2;
9215 exp->string = PrintUInt64(op1->ui64 == value2);
9216 if(!exp->expType)
9217 {
9218 exp->expType = op1->type;
9219 if(op1->type)
9220 op1->type->refCount++;
9221 }
9222 return 0x1;
9223 }
9224
9225 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9226 {
9227 short value2 = op2->s;
9228
9229 exp->type = 2;
9230 exp->string = PrintShort(op1->s == value2);
9231 if(!exp->expType)
9232 {
9233 exp->expType = op1->type;
9234 if(op1->type)
9235 op1->type->refCount++;
9236 }
9237 return 0x1;
9238 }
9239
9240 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9241 {
9242 unsigned short value2 = op2->us;
9243
9244 exp->type = 2;
9245 exp->string = PrintUShort(op1->us == value2);
9246 if(!exp->expType)
9247 {
9248 exp->expType = op1->type;
9249 if(op1->type)
9250 op1->type->refCount++;
9251 }
9252 return 0x1;
9253 }
9254
9255 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9256 {
9257 char value2 = op2->c;
9258
9259 exp->type = 2;
9260 exp->string = PrintChar(op1->c == value2);
9261 if(!exp->expType)
9262 {
9263 exp->expType = op1->type;
9264 if(op1->type)
9265 op1->type->refCount++;
9266 }
9267 return 0x1;
9268 }
9269
9270 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9271 {
9272 unsigned char value2 = op2->uc;
9273
9274 exp->type = 2;
9275 exp->string = PrintUChar(op1->uc == value2);
9276 if(!exp->expType)
9277 {
9278 exp->expType = op1->type;
9279 if(op1->type)
9280 op1->type->refCount++;
9281 }
9282 return 0x1;
9283 }
9284
9285 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9286 {
9287 float value2 = op2->f;
9288
9289 exp->type = 2;
9290 exp->string = PrintFloat(op1->f == value2);
9291 if(!exp->expType)
9292 {
9293 exp->expType = op1->type;
9294 if(op1->type)
9295 op1->type->refCount++;
9296 }
9297 return 0x1;
9298 }
9299
9300 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9301 {
9302 double value2 = op2->d;
9303
9304 exp->type = 2;
9305 exp->string = PrintDouble(op1->d == value2);
9306 if(!exp->expType)
9307 {
9308 exp->expType = op1->type;
9309 if(op1->type)
9310 op1->type->refCount++;
9311 }
9312 return 0x1;
9313 }
9314
9315 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9316 {
9317 int value2 = op2->i;
9318
9319 exp->type = 2;
9320 exp->string = PrintInt(op1->i != value2);
9321 if(!exp->expType)
9322 {
9323 exp->expType = op1->type;
9324 if(op1->type)
9325 op1->type->refCount++;
9326 }
9327 return 0x1;
9328 }
9329
9330 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9331 {
9332 unsigned int value2 = op2->ui;
9333
9334 exp->type = 2;
9335 exp->string = PrintUInt(op1->ui != value2);
9336 if(!exp->expType)
9337 {
9338 exp->expType = op1->type;
9339 if(op1->type)
9340 op1->type->refCount++;
9341 }
9342 return 0x1;
9343 }
9344
9345 static unsigned int Int64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9346 {
9347 long long value2 = op2->i64;
9348
9349 exp->type = 2;
9350 exp->string = PrintInt64(op1->i64 != value2);
9351 if(!exp->expType)
9352 {
9353 exp->expType = op1->type;
9354 if(op1->type)
9355 op1->type->refCount++;
9356 }
9357 return 0x1;
9358 }
9359
9360 static unsigned int UInt64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9361 {
9362 uint64 value2 = op2->ui64;
9363
9364 exp->type = 2;
9365 exp->string = PrintUInt64(op1->ui64 != value2);
9366 if(!exp->expType)
9367 {
9368 exp->expType = op1->type;
9369 if(op1->type)
9370 op1->type->refCount++;
9371 }
9372 return 0x1;
9373 }
9374
9375 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9376 {
9377 short value2 = op2->s;
9378
9379 exp->type = 2;
9380 exp->string = PrintShort(op1->s != value2);
9381 if(!exp->expType)
9382 {
9383 exp->expType = op1->type;
9384 if(op1->type)
9385 op1->type->refCount++;
9386 }
9387 return 0x1;
9388 }
9389
9390 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9391 {
9392 unsigned short value2 = op2->us;
9393
9394 exp->type = 2;
9395 exp->string = PrintUShort(op1->us != value2);
9396 if(!exp->expType)
9397 {
9398 exp->expType = op1->type;
9399 if(op1->type)
9400 op1->type->refCount++;
9401 }
9402 return 0x1;
9403 }
9404
9405 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9406 {
9407 char value2 = op2->c;
9408
9409 exp->type = 2;
9410 exp->string = PrintChar(op1->c != value2);
9411 if(!exp->expType)
9412 {
9413 exp->expType = op1->type;
9414 if(op1->type)
9415 op1->type->refCount++;
9416 }
9417 return 0x1;
9418 }
9419
9420 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9421 {
9422 unsigned char value2 = op2->uc;
9423
9424 exp->type = 2;
9425 exp->string = PrintUChar(op1->uc != value2);
9426 if(!exp->expType)
9427 {
9428 exp->expType = op1->type;
9429 if(op1->type)
9430 op1->type->refCount++;
9431 }
9432 return 0x1;
9433 }
9434
9435 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9436 {
9437 float value2 = op2->f;
9438
9439 exp->type = 2;
9440 exp->string = PrintFloat(op1->f != value2);
9441 if(!exp->expType)
9442 {
9443 exp->expType = op1->type;
9444 if(op1->type)
9445 op1->type->refCount++;
9446 }
9447 return 0x1;
9448 }
9449
9450 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9451 {
9452 double value2 = op2->d;
9453
9454 exp->type = 2;
9455 exp->string = PrintDouble(op1->d != value2);
9456 if(!exp->expType)
9457 {
9458 exp->expType = op1->type;
9459 if(op1->type)
9460 op1->type->refCount++;
9461 }
9462 return 0x1;
9463 }
9464
9465 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9466 {
9467 int value2 = op2->i;
9468
9469 exp->type = 2;
9470 exp->string = PrintInt(op1->i && value2);
9471 if(!exp->expType)
9472 {
9473 exp->expType = op1->type;
9474 if(op1->type)
9475 op1->type->refCount++;
9476 }
9477 return 0x1;
9478 }
9479
9480 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9481 {
9482 unsigned int value2 = op2->ui;
9483
9484 exp->type = 2;
9485 exp->string = PrintUInt(op1->ui && value2);
9486 if(!exp->expType)
9487 {
9488 exp->expType = op1->type;
9489 if(op1->type)
9490 op1->type->refCount++;
9491 }
9492 return 0x1;
9493 }
9494
9495 static unsigned int Int64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9496 {
9497 long long value2 = op2->i64;
9498
9499 exp->type = 2;
9500 exp->string = PrintInt64(op1->i64 && value2);
9501 if(!exp->expType)
9502 {
9503 exp->expType = op1->type;
9504 if(op1->type)
9505 op1->type->refCount++;
9506 }
9507 return 0x1;
9508 }
9509
9510 static unsigned int UInt64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9511 {
9512 uint64 value2 = op2->ui64;
9513
9514 exp->type = 2;
9515 exp->string = PrintUInt64(op1->ui64 && value2);
9516 if(!exp->expType)
9517 {
9518 exp->expType = op1->type;
9519 if(op1->type)
9520 op1->type->refCount++;
9521 }
9522 return 0x1;
9523 }
9524
9525 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9526 {
9527 short value2 = op2->s;
9528
9529 exp->type = 2;
9530 exp->string = PrintShort(op1->s && value2);
9531 if(!exp->expType)
9532 {
9533 exp->expType = op1->type;
9534 if(op1->type)
9535 op1->type->refCount++;
9536 }
9537 return 0x1;
9538 }
9539
9540 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9541 {
9542 unsigned short value2 = op2->us;
9543
9544 exp->type = 2;
9545 exp->string = PrintUShort(op1->us && value2);
9546 if(!exp->expType)
9547 {
9548 exp->expType = op1->type;
9549 if(op1->type)
9550 op1->type->refCount++;
9551 }
9552 return 0x1;
9553 }
9554
9555 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9556 {
9557 char value2 = op2->c;
9558
9559 exp->type = 2;
9560 exp->string = PrintChar(op1->c && value2);
9561 if(!exp->expType)
9562 {
9563 exp->expType = op1->type;
9564 if(op1->type)
9565 op1->type->refCount++;
9566 }
9567 return 0x1;
9568 }
9569
9570 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9571 {
9572 unsigned char value2 = op2->uc;
9573
9574 exp->type = 2;
9575 exp->string = PrintUChar(op1->uc && value2);
9576 if(!exp->expType)
9577 {
9578 exp->expType = op1->type;
9579 if(op1->type)
9580 op1->type->refCount++;
9581 }
9582 return 0x1;
9583 }
9584
9585 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9586 {
9587 float value2 = op2->f;
9588
9589 exp->type = 2;
9590 exp->string = PrintFloat(op1->f && value2);
9591 if(!exp->expType)
9592 {
9593 exp->expType = op1->type;
9594 if(op1->type)
9595 op1->type->refCount++;
9596 }
9597 return 0x1;
9598 }
9599
9600 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9601 {
9602 double value2 = op2->d;
9603
9604 exp->type = 2;
9605 exp->string = PrintDouble(op1->d && value2);
9606 if(!exp->expType)
9607 {
9608 exp->expType = op1->type;
9609 if(op1->type)
9610 op1->type->refCount++;
9611 }
9612 return 0x1;
9613 }
9614
9615 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9616 {
9617 int value2 = op2->i;
9618
9619 exp->type = 2;
9620 exp->string = PrintInt(op1->i || value2);
9621 if(!exp->expType)
9622 {
9623 exp->expType = op1->type;
9624 if(op1->type)
9625 op1->type->refCount++;
9626 }
9627 return 0x1;
9628 }
9629
9630 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9631 {
9632 unsigned int value2 = op2->ui;
9633
9634 exp->type = 2;
9635 exp->string = PrintUInt(op1->ui || value2);
9636 if(!exp->expType)
9637 {
9638 exp->expType = op1->type;
9639 if(op1->type)
9640 op1->type->refCount++;
9641 }
9642 return 0x1;
9643 }
9644
9645 static unsigned int Int64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9646 {
9647 long long value2 = op2->i64;
9648
9649 exp->type = 2;
9650 exp->string = PrintInt64(op1->i64 || value2);
9651 if(!exp->expType)
9652 {
9653 exp->expType = op1->type;
9654 if(op1->type)
9655 op1->type->refCount++;
9656 }
9657 return 0x1;
9658 }
9659
9660 static unsigned int UInt64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9661 {
9662 uint64 value2 = op2->ui64;
9663
9664 exp->type = 2;
9665 exp->string = PrintUInt64(op1->ui64 || value2);
9666 if(!exp->expType)
9667 {
9668 exp->expType = op1->type;
9669 if(op1->type)
9670 op1->type->refCount++;
9671 }
9672 return 0x1;
9673 }
9674
9675 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9676 {
9677 short value2 = op2->s;
9678
9679 exp->type = 2;
9680 exp->string = PrintShort(op1->s || value2);
9681 if(!exp->expType)
9682 {
9683 exp->expType = op1->type;
9684 if(op1->type)
9685 op1->type->refCount++;
9686 }
9687 return 0x1;
9688 }
9689
9690 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9691 {
9692 unsigned short value2 = op2->us;
9693
9694 exp->type = 2;
9695 exp->string = PrintUShort(op1->us || value2);
9696 if(!exp->expType)
9697 {
9698 exp->expType = op1->type;
9699 if(op1->type)
9700 op1->type->refCount++;
9701 }
9702 return 0x1;
9703 }
9704
9705 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9706 {
9707 char value2 = op2->c;
9708
9709 exp->type = 2;
9710 exp->string = PrintChar(op1->c || value2);
9711 if(!exp->expType)
9712 {
9713 exp->expType = op1->type;
9714 if(op1->type)
9715 op1->type->refCount++;
9716 }
9717 return 0x1;
9718 }
9719
9720 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9721 {
9722 unsigned char value2 = op2->uc;
9723
9724 exp->type = 2;
9725 exp->string = PrintUChar(op1->uc || value2);
9726 if(!exp->expType)
9727 {
9728 exp->expType = op1->type;
9729 if(op1->type)
9730 op1->type->refCount++;
9731 }
9732 return 0x1;
9733 }
9734
9735 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9736 {
9737 float value2 = op2->f;
9738
9739 exp->type = 2;
9740 exp->string = PrintFloat(op1->f || value2);
9741 if(!exp->expType)
9742 {
9743 exp->expType = op1->type;
9744 if(op1->type)
9745 op1->type->refCount++;
9746 }
9747 return 0x1;
9748 }
9749
9750 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9751 {
9752 double value2 = op2->d;
9753
9754 exp->type = 2;
9755 exp->string = PrintDouble(op1->d || value2);
9756 if(!exp->expType)
9757 {
9758 exp->expType = op1->type;
9759 if(op1->type)
9760 op1->type->refCount++;
9761 }
9762 return 0x1;
9763 }
9764
9765 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9766 {
9767 int value2 = op2->i;
9768
9769 exp->type = 2;
9770 exp->string = PrintInt(op1->i > value2);
9771 if(!exp->expType)
9772 {
9773 exp->expType = op1->type;
9774 if(op1->type)
9775 op1->type->refCount++;
9776 }
9777 return 0x1;
9778 }
9779
9780 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9781 {
9782 unsigned int value2 = op2->ui;
9783
9784 exp->type = 2;
9785 exp->string = PrintUInt(op1->ui > value2);
9786 if(!exp->expType)
9787 {
9788 exp->expType = op1->type;
9789 if(op1->type)
9790 op1->type->refCount++;
9791 }
9792 return 0x1;
9793 }
9794
9795 static unsigned int Int64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9796 {
9797 long long value2 = op2->i64;
9798
9799 exp->type = 2;
9800 exp->string = PrintInt64(op1->i64 > value2);
9801 if(!exp->expType)
9802 {
9803 exp->expType = op1->type;
9804 if(op1->type)
9805 op1->type->refCount++;
9806 }
9807 return 0x1;
9808 }
9809
9810 static unsigned int UInt64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9811 {
9812 uint64 value2 = op2->ui64;
9813
9814 exp->type = 2;
9815 exp->string = PrintUInt64(op1->ui64 > value2);
9816 if(!exp->expType)
9817 {
9818 exp->expType = op1->type;
9819 if(op1->type)
9820 op1->type->refCount++;
9821 }
9822 return 0x1;
9823 }
9824
9825 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9826 {
9827 short value2 = op2->s;
9828
9829 exp->type = 2;
9830 exp->string = PrintShort(op1->s > value2);
9831 if(!exp->expType)
9832 {
9833 exp->expType = op1->type;
9834 if(op1->type)
9835 op1->type->refCount++;
9836 }
9837 return 0x1;
9838 }
9839
9840 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9841 {
9842 unsigned short value2 = op2->us;
9843
9844 exp->type = 2;
9845 exp->string = PrintUShort(op1->us > value2);
9846 if(!exp->expType)
9847 {
9848 exp->expType = op1->type;
9849 if(op1->type)
9850 op1->type->refCount++;
9851 }
9852 return 0x1;
9853 }
9854
9855 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9856 {
9857 char value2 = op2->c;
9858
9859 exp->type = 2;
9860 exp->string = PrintChar(op1->c > value2);
9861 if(!exp->expType)
9862 {
9863 exp->expType = op1->type;
9864 if(op1->type)
9865 op1->type->refCount++;
9866 }
9867 return 0x1;
9868 }
9869
9870 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9871 {
9872 unsigned char value2 = op2->uc;
9873
9874 exp->type = 2;
9875 exp->string = PrintUChar(op1->uc > value2);
9876 if(!exp->expType)
9877 {
9878 exp->expType = op1->type;
9879 if(op1->type)
9880 op1->type->refCount++;
9881 }
9882 return 0x1;
9883 }
9884
9885 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9886 {
9887 float value2 = op2->f;
9888
9889 exp->type = 2;
9890 exp->string = PrintFloat(op1->f > value2);
9891 if(!exp->expType)
9892 {
9893 exp->expType = op1->type;
9894 if(op1->type)
9895 op1->type->refCount++;
9896 }
9897 return 0x1;
9898 }
9899
9900 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9901 {
9902 double value2 = op2->d;
9903
9904 exp->type = 2;
9905 exp->string = PrintDouble(op1->d > value2);
9906 if(!exp->expType)
9907 {
9908 exp->expType = op1->type;
9909 if(op1->type)
9910 op1->type->refCount++;
9911 }
9912 return 0x1;
9913 }
9914
9915 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9916 {
9917 int value2 = op2->i;
9918
9919 exp->type = 2;
9920 exp->string = PrintInt(op1->i < value2);
9921 if(!exp->expType)
9922 {
9923 exp->expType = op1->type;
9924 if(op1->type)
9925 op1->type->refCount++;
9926 }
9927 return 0x1;
9928 }
9929
9930 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9931 {
9932 unsigned int value2 = op2->ui;
9933
9934 exp->type = 2;
9935 exp->string = PrintUInt(op1->ui < value2);
9936 if(!exp->expType)
9937 {
9938 exp->expType = op1->type;
9939 if(op1->type)
9940 op1->type->refCount++;
9941 }
9942 return 0x1;
9943 }
9944
9945 static unsigned int Int64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9946 {
9947 long long value2 = op2->i64;
9948
9949 exp->type = 2;
9950 exp->string = PrintInt64(op1->i64 < value2);
9951 if(!exp->expType)
9952 {
9953 exp->expType = op1->type;
9954 if(op1->type)
9955 op1->type->refCount++;
9956 }
9957 return 0x1;
9958 }
9959
9960 static unsigned int UInt64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9961 {
9962 uint64 value2 = op2->ui64;
9963
9964 exp->type = 2;
9965 exp->string = PrintUInt64(op1->ui64 < value2);
9966 if(!exp->expType)
9967 {
9968 exp->expType = op1->type;
9969 if(op1->type)
9970 op1->type->refCount++;
9971 }
9972 return 0x1;
9973 }
9974
9975 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9976 {
9977 short value2 = op2->s;
9978
9979 exp->type = 2;
9980 exp->string = PrintShort(op1->s < value2);
9981 if(!exp->expType)
9982 {
9983 exp->expType = op1->type;
9984 if(op1->type)
9985 op1->type->refCount++;
9986 }
9987 return 0x1;
9988 }
9989
9990 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9991 {
9992 unsigned short value2 = op2->us;
9993
9994 exp->type = 2;
9995 exp->string = PrintUShort(op1->us < value2);
9996 if(!exp->expType)
9997 {
9998 exp->expType = op1->type;
9999 if(op1->type)
10000 op1->type->refCount++;
10001 }
10002 return 0x1;
10003 }
10004
10005 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10006 {
10007 char value2 = op2->c;
10008
10009 exp->type = 2;
10010 exp->string = PrintChar(op1->c < value2);
10011 if(!exp->expType)
10012 {
10013 exp->expType = op1->type;
10014 if(op1->type)
10015 op1->type->refCount++;
10016 }
10017 return 0x1;
10018 }
10019
10020 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10021 {
10022 unsigned char value2 = op2->uc;
10023
10024 exp->type = 2;
10025 exp->string = PrintUChar(op1->uc < value2);
10026 if(!exp->expType)
10027 {
10028 exp->expType = op1->type;
10029 if(op1->type)
10030 op1->type->refCount++;
10031 }
10032 return 0x1;
10033 }
10034
10035 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10036 {
10037 float value2 = op2->f;
10038
10039 exp->type = 2;
10040 exp->string = PrintFloat(op1->f < value2);
10041 if(!exp->expType)
10042 {
10043 exp->expType = op1->type;
10044 if(op1->type)
10045 op1->type->refCount++;
10046 }
10047 return 0x1;
10048 }
10049
10050 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10051 {
10052 double value2 = op2->d;
10053
10054 exp->type = 2;
10055 exp->string = PrintDouble(op1->d < value2);
10056 if(!exp->expType)
10057 {
10058 exp->expType = op1->type;
10059 if(op1->type)
10060 op1->type->refCount++;
10061 }
10062 return 0x1;
10063 }
10064
10065 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10066 {
10067 int value2 = op2->i;
10068
10069 exp->type = 2;
10070 exp->string = PrintInt(op1->i >= value2);
10071 if(!exp->expType)
10072 {
10073 exp->expType = op1->type;
10074 if(op1->type)
10075 op1->type->refCount++;
10076 }
10077 return 0x1;
10078 }
10079
10080 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10081 {
10082 unsigned int value2 = op2->ui;
10083
10084 exp->type = 2;
10085 exp->string = PrintUInt(op1->ui >= value2);
10086 if(!exp->expType)
10087 {
10088 exp->expType = op1->type;
10089 if(op1->type)
10090 op1->type->refCount++;
10091 }
10092 return 0x1;
10093 }
10094
10095 static unsigned int Int64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10096 {
10097 long long value2 = op2->i64;
10098
10099 exp->type = 2;
10100 exp->string = PrintInt64(op1->i64 >= value2);
10101 if(!exp->expType)
10102 {
10103 exp->expType = op1->type;
10104 if(op1->type)
10105 op1->type->refCount++;
10106 }
10107 return 0x1;
10108 }
10109
10110 static unsigned int UInt64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10111 {
10112 uint64 value2 = op2->ui64;
10113
10114 exp->type = 2;
10115 exp->string = PrintUInt64(op1->ui64 >= value2);
10116 if(!exp->expType)
10117 {
10118 exp->expType = op1->type;
10119 if(op1->type)
10120 op1->type->refCount++;
10121 }
10122 return 0x1;
10123 }
10124
10125 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10126 {
10127 short value2 = op2->s;
10128
10129 exp->type = 2;
10130 exp->string = PrintShort(op1->s >= value2);
10131 if(!exp->expType)
10132 {
10133 exp->expType = op1->type;
10134 if(op1->type)
10135 op1->type->refCount++;
10136 }
10137 return 0x1;
10138 }
10139
10140 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10141 {
10142 unsigned short value2 = op2->us;
10143
10144 exp->type = 2;
10145 exp->string = PrintUShort(op1->us >= value2);
10146 if(!exp->expType)
10147 {
10148 exp->expType = op1->type;
10149 if(op1->type)
10150 op1->type->refCount++;
10151 }
10152 return 0x1;
10153 }
10154
10155 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10156 {
10157 char value2 = op2->c;
10158
10159 exp->type = 2;
10160 exp->string = PrintChar(op1->c >= value2);
10161 if(!exp->expType)
10162 {
10163 exp->expType = op1->type;
10164 if(op1->type)
10165 op1->type->refCount++;
10166 }
10167 return 0x1;
10168 }
10169
10170 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10171 {
10172 unsigned char value2 = op2->uc;
10173
10174 exp->type = 2;
10175 exp->string = PrintUChar(op1->uc >= value2);
10176 if(!exp->expType)
10177 {
10178 exp->expType = op1->type;
10179 if(op1->type)
10180 op1->type->refCount++;
10181 }
10182 return 0x1;
10183 }
10184
10185 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10186 {
10187 float value2 = op2->f;
10188
10189 exp->type = 2;
10190 exp->string = PrintFloat(op1->f >= value2);
10191 if(!exp->expType)
10192 {
10193 exp->expType = op1->type;
10194 if(op1->type)
10195 op1->type->refCount++;
10196 }
10197 return 0x1;
10198 }
10199
10200 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10201 {
10202 double value2 = op2->d;
10203
10204 exp->type = 2;
10205 exp->string = PrintDouble(op1->d >= value2);
10206 if(!exp->expType)
10207 {
10208 exp->expType = op1->type;
10209 if(op1->type)
10210 op1->type->refCount++;
10211 }
10212 return 0x1;
10213 }
10214
10215 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10216 {
10217 int value2 = op2->i;
10218
10219 exp->type = 2;
10220 exp->string = PrintInt(op1->i <= value2);
10221 if(!exp->expType)
10222 {
10223 exp->expType = op1->type;
10224 if(op1->type)
10225 op1->type->refCount++;
10226 }
10227 return 0x1;
10228 }
10229
10230 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10231 {
10232 unsigned int value2 = op2->ui;
10233
10234 exp->type = 2;
10235 exp->string = PrintUInt(op1->ui <= value2);
10236 if(!exp->expType)
10237 {
10238 exp->expType = op1->type;
10239 if(op1->type)
10240 op1->type->refCount++;
10241 }
10242 return 0x1;
10243 }
10244
10245 static unsigned int Int64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10246 {
10247 long long value2 = op2->i64;
10248
10249 exp->type = 2;
10250 exp->string = PrintInt64(op1->i64 <= value2);
10251 if(!exp->expType)
10252 {
10253 exp->expType = op1->type;
10254 if(op1->type)
10255 op1->type->refCount++;
10256 }
10257 return 0x1;
10258 }
10259
10260 static unsigned int UInt64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10261 {
10262 uint64 value2 = op2->ui64;
10263
10264 exp->type = 2;
10265 exp->string = PrintUInt64(op1->ui64 <= value2);
10266 if(!exp->expType)
10267 {
10268 exp->expType = op1->type;
10269 if(op1->type)
10270 op1->type->refCount++;
10271 }
10272 return 0x1;
10273 }
10274
10275 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10276 {
10277 short value2 = op2->s;
10278
10279 exp->type = 2;
10280 exp->string = PrintShort(op1->s <= value2);
10281 if(!exp->expType)
10282 {
10283 exp->expType = op1->type;
10284 if(op1->type)
10285 op1->type->refCount++;
10286 }
10287 return 0x1;
10288 }
10289
10290 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10291 {
10292 unsigned short value2 = op2->us;
10293
10294 exp->type = 2;
10295 exp->string = PrintUShort(op1->us <= value2);
10296 if(!exp->expType)
10297 {
10298 exp->expType = op1->type;
10299 if(op1->type)
10300 op1->type->refCount++;
10301 }
10302 return 0x1;
10303 }
10304
10305 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10306 {
10307 char value2 = op2->c;
10308
10309 exp->type = 2;
10310 exp->string = PrintChar(op1->c <= value2);
10311 if(!exp->expType)
10312 {
10313 exp->expType = op1->type;
10314 if(op1->type)
10315 op1->type->refCount++;
10316 }
10317 return 0x1;
10318 }
10319
10320 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10321 {
10322 unsigned char value2 = op2->uc;
10323
10324 exp->type = 2;
10325 exp->string = PrintUChar(op1->uc <= value2);
10326 if(!exp->expType)
10327 {
10328 exp->expType = op1->type;
10329 if(op1->type)
10330 op1->type->refCount++;
10331 }
10332 return 0x1;
10333 }
10334
10335 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10336 {
10337 float value2 = op2->f;
10338
10339 exp->type = 2;
10340 exp->string = PrintFloat(op1->f <= value2);
10341 if(!exp->expType)
10342 {
10343 exp->expType = op1->type;
10344 if(op1->type)
10345 op1->type->refCount++;
10346 }
10347 return 0x1;
10348 }
10349
10350 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10351 {
10352 double value2 = op2->d;
10353
10354 exp->type = 2;
10355 exp->string = PrintDouble(op1->d <= value2);
10356 if(!exp->expType)
10357 {
10358 exp->expType = op1->type;
10359 if(op1->type)
10360 op1->type->refCount++;
10361 }
10362 return 0x1;
10363 }
10364
10365 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10366 {
10367 exp->type = 2;
10368 exp->string = PrintInt(op1->i ? op2->i : op3->i);
10369 if(!exp->expType)
10370 {
10371 exp->expType = op1->type;
10372 if(op1->type)
10373 op1->type->refCount++;
10374 }
10375 return 0x1;
10376 }
10377
10378 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10379 {
10380 exp->type = 2;
10381 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
10382 if(!exp->expType)
10383 {
10384 exp->expType = op1->type;
10385 if(op1->type)
10386 op1->type->refCount++;
10387 }
10388 return 0x1;
10389 }
10390
10391 static unsigned int Int64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10392 {
10393 exp->type = 2;
10394 exp->string = PrintInt64(op1->i64 ? op2->i64 : op3->i64);
10395 if(!exp->expType)
10396 {
10397 exp->expType = op1->type;
10398 if(op1->type)
10399 op1->type->refCount++;
10400 }
10401 return 0x1;
10402 }
10403
10404 static unsigned int UInt64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10405 {
10406 exp->type = 2;
10407 exp->string = PrintUInt64(op1->ui64 ? op2->ui64 : op3->ui64);
10408 if(!exp->expType)
10409 {
10410 exp->expType = op1->type;
10411 if(op1->type)
10412 op1->type->refCount++;
10413 }
10414 return 0x1;
10415 }
10416
10417 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10418 {
10419 exp->type = 2;
10420 exp->string = PrintShort(op1->s ? op2->s : op3->s);
10421 if(!exp->expType)
10422 {
10423 exp->expType = op1->type;
10424 if(op1->type)
10425 op1->type->refCount++;
10426 }
10427 return 0x1;
10428 }
10429
10430 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10431 {
10432 exp->type = 2;
10433 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
10434 if(!exp->expType)
10435 {
10436 exp->expType = op1->type;
10437 if(op1->type)
10438 op1->type->refCount++;
10439 }
10440 return 0x1;
10441 }
10442
10443 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10444 {
10445 exp->type = 2;
10446 exp->string = PrintChar(op1->c ? op2->c : op3->c);
10447 if(!exp->expType)
10448 {
10449 exp->expType = op1->type;
10450 if(op1->type)
10451 op1->type->refCount++;
10452 }
10453 return 0x1;
10454 }
10455
10456 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10457 {
10458 exp->type = 2;
10459 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
10460 if(!exp->expType)
10461 {
10462 exp->expType = op1->type;
10463 if(op1->type)
10464 op1->type->refCount++;
10465 }
10466 return 0x1;
10467 }
10468
10469 static unsigned int FloatCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10470 {
10471 exp->type = 2;
10472 exp->string = PrintFloat(op1->f ? op2->f : op3->f);
10473 if(!exp->expType)
10474 {
10475 exp->expType = op1->type;
10476 if(op1->type)
10477 op1->type->refCount++;
10478 }
10479 return 0x1;
10480 }
10481
10482 static unsigned int DoubleCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10483 {
10484 exp->type = 2;
10485 exp->string = PrintDouble(op1->d ? op2->d : op3->d);
10486 if(!exp->expType)
10487 {
10488 exp->expType = op1->type;
10489 if(op1->type)
10490 op1->type->refCount++;
10491 }
10492 return 0x1;
10493 }
10494
10495 struct OpTable intOps = 
10496 {
10497 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
10498 };
10499
10500 struct OpTable uintOps = 
10501 {
10502 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
10503 };
10504
10505 struct OpTable int64Ops = 
10506 {
10507 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
10508 };
10509
10510 struct OpTable uint64Ops = 
10511 {
10512 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
10513 };
10514
10515 struct OpTable shortOps = 
10516 {
10517 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
10518 };
10519
10520 struct OpTable ushortOps = 
10521 {
10522 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
10523 };
10524
10525 struct OpTable floatOps = 
10526 {
10527 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
10528 };
10529
10530 struct OpTable doubleOps = 
10531 {
10532 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
10533 };
10534
10535 struct OpTable charOps = 
10536 {
10537 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
10538 };
10539
10540 struct OpTable ucharOps = 
10541 {
10542 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
10543 };
10544
10545 void ReadString(char * output, char * string)
10546 {
10547 int len = strlen(string);
10548 int c, d = 0;
10549 unsigned int quoted = 0x0, escaped = 0x0;
10550
10551 for(c = 0; c < len; c++)
10552 {
10553 char ch = string[c];
10554
10555 if(escaped)
10556 {
10557 switch(ch)
10558 {
10559 case 'n':
10560 output[d] = '\n';
10561 break;
10562 case 't':
10563 output[d] = '\t';
10564 break;
10565 case 'a':
10566 output[d] = '\a';
10567 break;
10568 case 'b':
10569 output[d] = '\b';
10570 break;
10571 case 'f':
10572 output[d] = '\f';
10573 break;
10574 case 'r':
10575 output[d] = '\r';
10576 break;
10577 case 'v':
10578 output[d] = '\v';
10579 break;
10580 case '\\':
10581 output[d] = '\\';
10582 break;
10583 case '\"':
10584 output[d] = '\"';
10585 break;
10586 case '\'':
10587 output[d] = '\'';
10588 break;
10589 default:
10590 output[d] = ch;
10591 }
10592 d++;
10593 escaped = 0x0;
10594 }
10595 else
10596 {
10597 if(ch == '\"')
10598 quoted ^= 0x1;
10599 else if(quoted)
10600 {
10601 if(ch == '\\')
10602 escaped = 0x1;
10603 else
10604 output[d++] = ch;
10605 }
10606 }
10607 }
10608 output[d] = '\0';
10609 }
10610
10611 int UnescapeString(char * d, char * s, int len)
10612 {
10613 int j = 0, k = 0;
10614 char ch;
10615
10616 while(j < len && (ch = s[j]))
10617 {
10618 switch(ch)
10619 {
10620 case '\\':
10621 switch((ch = s[++j]))
10622 {
10623 case 'n':
10624 d[k] = '\n';
10625 break;
10626 case 't':
10627 d[k] = '\t';
10628 break;
10629 case 'a':
10630 d[k] = '\a';
10631 break;
10632 case 'b':
10633 d[k] = '\b';
10634 break;
10635 case 'f':
10636 d[k] = '\f';
10637 break;
10638 case 'r':
10639 d[k] = '\r';
10640 break;
10641 case 'v':
10642 d[k] = '\v';
10643 break;
10644 case '\\':
10645 d[k] = '\\';
10646 break;
10647 case '\"':
10648 d[k] = '\"';
10649 break;
10650 case '\'':
10651 d[k] = '\'';
10652 break;
10653 default:
10654 d[k] = '\\';
10655 d[k] = ch;
10656 }
10657 break;
10658 default:
10659 d[k] = ch;
10660 }
10661 j++, k++;
10662 }
10663 d[k] = '\0';
10664 return k;
10665 }
10666
10667 char * OffsetEscapedString(char * s, int len, int offset)
10668 {
10669 char ch;
10670 int j = 0, k = 0;
10671
10672 while(j < len && k < offset && (ch = s[j]))
10673 {
10674 if(ch == '\\')
10675 ++j;
10676 j++, k++;
10677 }
10678 return (k == offset) ? s + j : (((void *)0));
10679 }
10680
10681 extern long long __ecereNameSpace__ecere__com___strtoi64(char *  string, char * *  endString, int base);
10682
10683 extern uint64 __ecereNameSpace__ecere__com___strtoui64(char *  string, char * *  endString, int base);
10684
10685 extern double strtod(char * , char * * );
10686
10687 extern float (* __ecereMethod_float_inf)(void);
10688
10689 extern float (* __ecereMethod_float_nan)(void);
10690
10691 extern double (* __ecereMethod_double_inf)(void);
10692
10693 extern double (* __ecereMethod_double_nan)(void);
10694
10695 struct Operand GetOperand(struct Expression * exp)
10696 {
10697 struct Operand op = 
10698 {
10699 0, 0, 0, 0, 
10700 {
10701 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10702 }
10703 };
10704 struct Type * type = exp->expType;
10705
10706 if(type)
10707 {
10708 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
10709 {
10710 if(!type->_class->registered->dataType)
10711 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
10712 type = type->_class->registered->dataType;
10713 }
10714 if(exp->type == 3 && op.kind == 13)
10715 {
10716 op.ui64 = (uint64)exp->string;
10717 op.kind = 13;
10718 op.ops = uint64Ops;
10719 }
10720 else if(exp->isConstant && exp->type == 2)
10721 {
10722 op.kind = type->kind;
10723 op.type = exp->expType;
10724 switch(op.kind)
10725 {
10726 case 24:
10727 case 1:
10728 {
10729 if(exp->constant[0] == '\'')
10730 {
10731 op.c = exp->constant[1];
10732 op.ops = charOps;
10733 }
10734 else if(type->isSigned)
10735 {
10736 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
10737 op.ops = charOps;
10738 }
10739 else
10740 {
10741 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
10742 op.ops = ucharOps;
10743 }
10744 break;
10745 }
10746 case 2:
10747 if(type->isSigned)
10748 {
10749 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
10750 op.ops = shortOps;
10751 }
10752 else
10753 {
10754 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
10755 op.ops = ushortOps;
10756 }
10757 break;
10758 case 3:
10759 case 5:
10760 if(type->isSigned)
10761 {
10762 op.i = strtol(exp->constant, (((void *)0)), 0);
10763 op.ops = intOps;
10764 }
10765 else
10766 {
10767 op.ui = strtoul(exp->constant, (((void *)0)), 0);
10768 op.ops = uintOps;
10769 }
10770 op.kind = 3;
10771 break;
10772 case 4:
10773 if(type->isSigned)
10774 {
10775 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10776 op.ops = int64Ops;
10777 }
10778 else
10779 {
10780 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10781 op.ops = uint64Ops;
10782 }
10783 op.kind = 4;
10784 break;
10785 case 22:
10786 if(type->isSigned)
10787 {
10788 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10789 op.ops = int64Ops;
10790 }
10791 else
10792 {
10793 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10794 op.ops = uint64Ops;
10795 }
10796 op.kind = 4;
10797 break;
10798 case 23:
10799 if(type->isSigned)
10800 {
10801 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10802 op.ops = int64Ops;
10803 }
10804 else
10805 {
10806 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10807 op.ops = uint64Ops;
10808 }
10809 op.kind = 4;
10810 break;
10811 case 6:
10812 if(!strcmp(exp->constant, "inf"))
10813 op.f = __ecereMethod_float_inf();
10814 else if(!strcmp(exp->constant, "-inf"))
10815 op.f = -__ecereMethod_float_inf();
10816 else if(!strcmp(exp->constant, "nan"))
10817 op.f = __ecereMethod_float_nan();
10818 else if(!strcmp(exp->constant, "-nan"))
10819 op.f = -__ecereMethod_float_nan();
10820 else
10821 op.f = (float)strtod(exp->constant, (((void *)0)));
10822 op.ops = floatOps;
10823 break;
10824 case 7:
10825 if(!strcmp(exp->constant, "inf"))
10826 op.d = __ecereMethod_double_inf();
10827 else if(!strcmp(exp->constant, "-inf"))
10828 op.d = -__ecereMethod_double_inf();
10829 else if(!strcmp(exp->constant, "nan"))
10830 op.d = __ecereMethod_double_nan();
10831 else if(!strcmp(exp->constant, "-nan"))
10832 op.d = -__ecereMethod_double_nan();
10833 else
10834 op.d = (double)strtod(exp->constant, (((void *)0)));
10835 op.ops = doubleOps;
10836 break;
10837 case 12:
10838 case 13:
10839 case 8:
10840 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10841 op.kind = 13;
10842 op.ops = uint64Ops;
10843 break;
10844 }
10845 }
10846 }
10847 return op;
10848 }
10849
10850 int __ecereVMethodID_class_OnGetString;
10851
10852 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
10853
10854 static void UnusedFunction()
10855 {
10856 int a;
10857
10858 ((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);
10859 }
10860
10861 extern int __ecereVMethodID_class_OnGetString;
10862
10863 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
10864 {
10865 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10866
10867 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
10868 {
10869 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
10870 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
10871 else
10872 {
10873 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10874 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
10875 struct Type * type;
10876 void * ptr = inst->data + dataMember->offset + offset;
10877 char * result = (((void *)0));
10878
10879 exp->loc = member->loc = inst->loc;
10880 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
10881 if(!dataMember->dataType)
10882 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
10883 type = dataMember->dataType;
10884 if(type->kind == 8)
10885 {
10886 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10887
10888 if(_class->type == 4)
10889 {
10890 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
10891
10892 if(enumClass)
10893 {
10894 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
10895 struct __ecereNameSpace__ecere__sys__NamedLink * item;
10896
10897 for(item = e->values.first; item; item = item->next)
10898 {
10899 if((int)item->data == *(int *)ptr)
10900 {
10901 result = item->name;
10902 break;
10903 }
10904 }
10905 if(result)
10906 {
10907 exp->identifier = MkIdentifier(result);
10908 exp->type = 0;
10909 exp->destType = MkClassType(_class->fullName);
10910 ProcessExpressionType(exp);
10911 }
10912 }
10913 }
10914 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
10915 {
10916 if(!_class->dataType)
10917 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10918 type = _class->dataType;
10919 }
10920 }
10921 if(!result)
10922 {
10923 switch(type->kind)
10924 {
10925 case 6:
10926 {
10927 FreeExpContents(exp);
10928 exp->constant = PrintFloat(*(float *)ptr);
10929 exp->type = 2;
10930 break;
10931 }
10932 case 7:
10933 {
10934 FreeExpContents(exp);
10935 exp->constant = PrintDouble(*(double *)ptr);
10936 exp->type = 2;
10937 break;
10938 }
10939 case 3:
10940 {
10941 FreeExpContents(exp);
10942 exp->constant = PrintInt(*(int *)ptr);
10943 exp->type = 2;
10944 break;
10945 }
10946 case 4:
10947 {
10948 FreeExpContents(exp);
10949 exp->constant = PrintInt64(*(long long *)ptr);
10950 exp->type = 2;
10951 break;
10952 }
10953 case 22:
10954 {
10955 FreeExpContents(exp);
10956 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
10957 exp->type = 2;
10958 break;
10959 }
10960 case 23:
10961 {
10962 FreeExpContents(exp);
10963 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
10964 exp->type = 2;
10965 break;
10966 }
10967 default:
10968 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
10969 }
10970 }
10971 ListAdd(memberList, member);
10972 }
10973 if(parentDataMember->type == 1)
10974 break;
10975 }
10976 }
10977
10978 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
10979
10980 void PopulateInstance(struct Instantiation * inst)
10981 {
10982 struct Symbol * classSym = inst->_class->symbol;
10983 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
10984 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10985 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
10986
10987 if(!inst->members)
10988 inst->members = MkListOne(MkMembersInitList(memberList));
10989 else
10990 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
10991 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
10992 {
10993 if(!dataMember->isProperty)
10994 {
10995 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
10996 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
10997 else
10998 {
10999 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11000 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
11001 struct Type * type;
11002 void * ptr = inst->data + dataMember->offset;
11003 char * result = (((void *)0));
11004
11005 exp->loc = member->loc = inst->loc;
11006 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
11007 if(!dataMember->dataType)
11008 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
11009 type = dataMember->dataType;
11010 if(type->kind == 8)
11011 {
11012 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11013
11014 if(_class->type == 4)
11015 {
11016 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11017
11018 if(enumClass)
11019 {
11020 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
11021 struct __ecereNameSpace__ecere__sys__NamedLink * item;
11022
11023 for(item = e->values.first; item; item = item->next)
11024 {
11025 if((int)item->data == *(int *)ptr)
11026 {
11027 result = item->name;
11028 break;
11029 }
11030 }
11031 }
11032 if(result)
11033 {
11034 exp->identifier = MkIdentifier(result);
11035 exp->type = 0;
11036 exp->destType = MkClassType(_class->fullName);
11037 ProcessExpressionType(exp);
11038 }
11039 }
11040 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
11041 {
11042 if(!_class->dataType)
11043 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11044 type = _class->dataType;
11045 }
11046 }
11047 if(!result)
11048 {
11049 switch(type->kind)
11050 {
11051 case 6:
11052 {
11053 exp->constant = PrintFloat(*(float *)ptr);
11054 exp->type = 2;
11055 break;
11056 }
11057 case 7:
11058 {
11059 exp->constant = PrintDouble(*(double *)ptr);
11060 exp->type = 2;
11061 break;
11062 }
11063 case 3:
11064 {
11065 exp->constant = PrintInt(*(int *)ptr);
11066 exp->type = 2;
11067 break;
11068 }
11069 case 4:
11070 {
11071 exp->constant = PrintInt64(*(long long *)ptr);
11072 exp->type = 2;
11073 break;
11074 }
11075 case 22:
11076 {
11077 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
11078 exp->type = 2;
11079 break;
11080 }
11081 default:
11082 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
11083 }
11084 }
11085 ListAdd(memberList, member);
11086 }
11087 }
11088 }
11089 }
11090
11091 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);
11092
11093 extern void FreeInstance(struct Instantiation * inst);
11094
11095 void ComputeInstantiation(struct Expression * exp)
11096 {
11097 struct Instantiation * inst = exp->instance;
11098 struct MembersInit * members;
11099 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
11100 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
11101 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
11102 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
11103 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
11104 int subMemberStackPos = 0;
11105 uint64 bits = 0;
11106
11107 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11108 {
11109 if(inst->data)
11110 return ;
11111 if(_class->type == 0 || _class->type == 5)
11112 {
11113 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
11114 if(_class->type == 0)
11115 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)inst->data))->_refCount++;
11116 }
11117 else
11118 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11119 }
11120 if(inst->members)
11121 {
11122 for(members = (*inst->members).first; members; members = members->next)
11123 {
11124 switch(members->type)
11125 {
11126 case 0:
11127 {
11128 if(members->dataMembers)
11129 {
11130 struct MemberInit * member;
11131
11132 for(member = (*members->dataMembers).first; member; member = member->next)
11133 {
11134 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
11135 unsigned int found = 0x0;
11136 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11137 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
11138 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
11139 unsigned int dataMemberOffset;
11140
11141 if(!ident)
11142 {
11143 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
11144 if(curMember)
11145 {
11146 if(curMember->isProperty)
11147 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
11148 else
11149 {
11150 dataMember = curMember;
11151 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11152 if(_class->type == 0)
11153 dataMemberOffset += _class->base->structSize;
11154 }
11155 found = 0x1;
11156 }
11157 }
11158 else
11159 {
11160 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
11161 if(prop)
11162 {
11163 found = 0x1;
11164 if(prop->memberAccess == 1)
11165 {
11166 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
11167 curClass = prop->_class;
11168 }
11169 }
11170 else
11171 {
11172 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
11173 int _subMemberStackPos = 0;
11174
11175 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
11176 if(dataMember)
11177 {
11178 found = 0x1;
11179 if(dataMember->memberAccess == 1)
11180 {
11181 curMember = dataMember;
11182 curClass = dataMember->_class;
11183 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
11184 subMemberStackPos = _subMemberStackPos;
11185 }
11186 }
11187 }
11188 }
11189 if(found && member->initializer && member->initializer->type == 0)
11190 {
11191 struct Expression * value = member->initializer->exp;
11192 struct Type * type = (((void *)0));
11193 unsigned int deepMember = 0x0;
11194
11195 if(prop)
11196 {
11197 type = prop->dataType;
11198 }
11199 else if(dataMember)
11200 {
11201 if(!dataMember->dataType)
11202 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
11203 type = dataMember->dataType;
11204 }
11205 if(ident && ident->next)
11206 {
11207 deepMember = 0x1;
11208 for(ident = ident->next; ident && type; ident = ident->next)
11209 {
11210 if(type->kind == 8)
11211 {
11212 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
11213 if(prop)
11214 type = prop->dataType;
11215 else
11216 {
11217 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11218 if(dataMember)
11219 type = dataMember->dataType;
11220 }
11221 }
11222 else if(type->kind == 9 || type->kind == 10)
11223 {
11224 struct Type * memberType;
11225
11226 for(memberType = type->members.first; memberType; memberType = memberType->next)
11227 {
11228 if(!strcmp(memberType->name, ident->string))
11229 {
11230 type = memberType;
11231 break;
11232 }
11233 }
11234 }
11235 }
11236 }
11237 if(value)
11238 {
11239 FreeType(value->destType);
11240 value->destType = type;
11241 if(type)
11242 type->refCount++;
11243 ComputeExpression(value);
11244 }
11245 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11246 {
11247 if(type->kind == 8)
11248 {
11249 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11250
11251 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
11252 {
11253 if(!_class->dataType)
11254 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11255 type = _class->dataType;
11256 }
11257 }
11258 if(dataMember)
11259 {
11260 void * ptr = inst->data + dataMemberOffset;
11261
11262 if(value->type == 2)
11263 {
11264 switch(type->kind)
11265 {
11266 case 3:
11267 {
11268 GetInt(value, (int *)ptr);
11269 break;
11270 }
11271 case 4:
11272 {
11273 GetInt64(value, (long long *)ptr);
11274 break;
11275 }
11276 case 22:
11277 {
11278 GetIntPtr(value, (intptr_t *)ptr);
11279 break;
11280 }
11281 case 23:
11282 {
11283 GetIntSize(value, (ssize_t *)ptr);
11284 break;
11285 }
11286 case 6:
11287 {
11288 GetFloat(value, (float *)ptr);
11289 break;
11290 }
11291 case 7:
11292 {
11293 GetDouble(value, (double *)ptr);
11294 break;
11295 }
11296 }
11297 }
11298 else if(value->type == 1)
11299 {
11300 if(type->kind == 8)
11301 {
11302 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11303
11304 if(_class->type == 1)
11305 {
11306 ComputeTypeSize(type);
11307 if(value->instance->data)
11308 memcpy(ptr, value->instance->data, type->size);
11309 }
11310 }
11311 }
11312 }
11313 else if(prop)
11314 {
11315 if(value->type == 1 && value->instance->data)
11316 {
11317 if(type->kind == 8)
11318 {
11319 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11320
11321 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)))
11322 {
11323 void (* Set)(void *, void *) = (void *)prop->Set;
11324
11325 Set(inst->data, value->instance->data);
11326 PopulateInstance(inst);
11327 }
11328 }
11329 }
11330 else if(value->type == 2)
11331 {
11332 switch(type->kind)
11333 {
11334 case 7:
11335 {
11336 void (* Set)(void *, double) = (void *)prop->Set;
11337
11338 Set(inst->data, strtod(value->constant, (((void *)0))));
11339 break;
11340 }
11341 case 6:
11342 {
11343 void (* Set)(void *, float) = (void *)prop->Set;
11344
11345 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
11346 break;
11347 }
11348 case 3:
11349 {
11350 void (* Set)(void *, int) = (void *)prop->Set;
11351
11352 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
11353 break;
11354 }
11355 case 4:
11356 {
11357 void (* Set)(void *, long long) = (void *)prop->Set;
11358
11359 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11360 break;
11361 }
11362 case 22:
11363 {
11364 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11365
11366 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11367 break;
11368 }
11369 case 23:
11370 {
11371 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11372
11373 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11374 break;
11375 }
11376 }
11377 }
11378 else if(value->type == 3)
11379 {
11380 char temp[1024];
11381
11382 ReadString(temp, value->string);
11383 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
11384 }
11385 }
11386 }
11387 else if(!deepMember && type && _class->type == 3)
11388 {
11389 if(prop)
11390 {
11391 if(value->type == 2)
11392 {
11393 if(type->kind == 8)
11394 {
11395 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11396
11397 if(_class->type == 3)
11398 {
11399 if(!_class->dataType)
11400 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11401 type = _class->dataType;
11402 }
11403 }
11404 switch(type->kind)
11405 {
11406 case 6:
11407 {
11408 float fValue;
11409 float (* Set)(float) = (void *)prop->Set;
11410
11411 GetFloat(member->initializer->exp, &fValue);
11412 exp->constant = PrintFloat(Set(fValue));
11413 exp->type = 2;
11414 break;
11415 }
11416 case 7:
11417 {
11418 double dValue;
11419 double (* Set)(double) = (void *)prop->Set;
11420
11421 GetDouble(member->initializer->exp, &dValue);
11422 exp->constant = PrintDouble(Set(dValue));
11423 exp->type = 2;
11424 break;
11425 }
11426 }
11427 }
11428 }
11429 }
11430 else if(!deepMember && type && _class->type == 2)
11431 {
11432 if(prop)
11433 {
11434 if(value->type == 1 && value->instance->data)
11435 {
11436 unsigned int (* Set)(void *) = (void *)prop->Set;
11437
11438 bits = Set(value->instance->data);
11439 }
11440 else if(value->type == 2)
11441 {
11442 }
11443 }
11444 else if(dataMember)
11445 {
11446 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
11447 struct Type * type;
11448 int part = 0;
11449
11450 GetInt(value, &part);
11451 bits = (bits & ~bitMember->mask);
11452 if(!bitMember->dataType)
11453 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
11454 type = bitMember->dataType;
11455 if(type->kind == 8 && type->_class && type->_class->registered)
11456 {
11457 if(!type->_class->registered->dataType)
11458 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
11459 type = type->_class->registered->dataType;
11460 }
11461 switch(type->kind)
11462 {
11463 case 24:
11464 case 1:
11465 if(type->isSigned)
11466 bits |= ((char)part << bitMember->pos);
11467 else
11468 bits |= ((unsigned char)part << bitMember->pos);
11469 break;
11470 case 2:
11471 if(type->isSigned)
11472 bits |= ((short)part << bitMember->pos);
11473 else
11474 bits |= ((unsigned short)part << bitMember->pos);
11475 break;
11476 case 3:
11477 case 5:
11478 if(type->isSigned)
11479 bits |= (part << bitMember->pos);
11480 else
11481 bits |= ((unsigned int)part << bitMember->pos);
11482 break;
11483 case 4:
11484 if(type->isSigned)
11485 bits |= ((long long)part << bitMember->pos);
11486 else
11487 bits |= ((uint64)part << bitMember->pos);
11488 break;
11489 case 22:
11490 if(type->isSigned)
11491 {
11492 bits |= ((intptr_t)part << bitMember->pos);
11493 }
11494 else
11495 {
11496 bits |= ((uintptr_t)part << bitMember->pos);
11497 }
11498 break;
11499 case 23:
11500 if(type->isSigned)
11501 {
11502 bits |= ((ssize_t)part << bitMember->pos);
11503 }
11504 else
11505 {
11506 bits |= ((size_t)part << bitMember->pos);
11507 }
11508 break;
11509 }
11510 }
11511 }
11512 }
11513 else
11514 {
11515 if(_class && _class->type == 3)
11516 {
11517 ComputeExpression(member->initializer->exp);
11518 exp->constant = member->initializer->exp->constant;
11519 exp->type = 2;
11520 member->initializer->exp->constant = (((void *)0));
11521 }
11522 }
11523 }
11524 }
11525 break;
11526 }
11527 }
11528 }
11529 }
11530 if(_class && _class->type == 2)
11531 {
11532 exp->constant = PrintHexUInt(bits);
11533 exp->type = 2;
11534 }
11535 if(exp->type != 1)
11536 {
11537 FreeInstance(inst);
11538 }
11539 }
11540
11541 static unsigned int Promote(struct Operand * op, int kind, unsigned int isSigned)
11542 {
11543 unsigned int result = 0x0;
11544
11545 switch(kind)
11546 {
11547 case 2:
11548 if(op->kind == 1 || op->kind == 15 || op->kind == 24)
11549 result = isSigned ? GetOpShort(op, &op->s) : GetOpUShort(op, &op->us);
11550 break;
11551 case 3:
11552 case 5:
11553 if(op->kind == 1 || op->kind == 2 || op->kind == 15 || op->kind == 24)
11554 result = isSigned ? GetOpInt(op, &op->i) : GetOpUInt(op, &op->ui);
11555 break;
11556 case 4:
11557 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)
11558 result = isSigned ? GetOpInt64(op, &op->i64) : GetOpUInt64(op, &op->ui64);
11559 break;
11560 case 6:
11561 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)
11562 result = GetOpFloat(op, &op->f);
11563 break;
11564 case 7:
11565 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)
11566 result = GetOpDouble(op, &op->d);
11567 break;
11568 case 13:
11569 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)
11570 result = GetOpUIntPtr(op, &op->ui64);
11571 break;
11572 case 15:
11573 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)
11574 result = isSigned ? GetOpInt(op, &op->i) : GetOpUInt(op, &op->ui);
11575 break;
11576 case 22:
11577 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11578 result = isSigned ? GetOpIntPtr(op, &op->i64) : GetOpUIntPtr(op, &op->i64);
11579 break;
11580 case 23:
11581 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11582 result = isSigned ? GetOpIntSize(op, &op->ui64) : GetOpUIntSize(op, &op->ui64);
11583 break;
11584 }
11585 return result;
11586 }
11587
11588 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
11589 {
11590 if(exp->op.op == SIZEOF)
11591 {
11592 FreeExpContents(exp);
11593 exp->type = 2;
11594 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
11595 }
11596 else
11597 {
11598 if(!exp->op.exp1)
11599 {
11600 switch(exp->op.op)
11601 {
11602 case '+':
11603 {
11604 struct Expression * exp2 = exp->op.exp2;
11605
11606 exp->op.exp2 = (((void *)0));
11607 FreeExpContents(exp);
11608 FreeType(exp->expType);
11609 FreeType(exp->destType);
11610 *exp = *exp2;
11611 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
11612 break;
11613 }
11614 case '-':
11615 if(op1->ops.Neg)
11616 {
11617 FreeExpContents(exp);
11618 op1->ops.Neg(exp, op1);
11619 }
11620 break;
11621 case '~':
11622 if(op1->ops.BitNot)
11623 {
11624 FreeExpContents(exp);
11625 op1->ops.BitNot(exp, op1);
11626 }
11627 break;
11628 case '!':
11629 if(op1->ops.Not)
11630 {
11631 FreeExpContents(exp);
11632 op1->ops.Not(exp, op1);
11633 }
11634 break;
11635 }
11636 }
11637 else
11638 {
11639 if(op1 && op2 && op1->type && op2->type && op1->kind != op2->kind)
11640 {
11641 if(Promote(op2, op1->kind, op1->type->isSigned))
11642 op2->kind = op1->kind, op2->ops = op1->ops;
11643 else if(Promote(op1, op2->kind, op2->type->isSigned))
11644 op1->kind = op2->kind, op1->ops = op2->ops;
11645 }
11646 switch(exp->op.op)
11647 {
11648 case '+':
11649 if(op1->ops.Add)
11650 {
11651 FreeExpContents(exp);
11652 op1->ops.Add(exp, op1, op2);
11653 }
11654 break;
11655 case '-':
11656 if(op1->ops.Sub)
11657 {
11658 FreeExpContents(exp);
11659 op1->ops.Sub(exp, op1, op2);
11660 }
11661 break;
11662 case '*':
11663 if(op1->ops.Mul)
11664 {
11665 FreeExpContents(exp);
11666 op1->ops.Mul(exp, op1, op2);
11667 }
11668 break;
11669 case '/':
11670 if(op1->ops.Div)
11671 {
11672 FreeExpContents(exp);
11673 op1->ops.Div(exp, op1, op2);
11674 }
11675 break;
11676 case '%':
11677 if(op1->ops.Mod)
11678 {
11679 FreeExpContents(exp);
11680 op1->ops.Mod(exp, op1, op2);
11681 }
11682 break;
11683 case '&':
11684 if(exp->op.exp2)
11685 {
11686 if(op1->ops.BitAnd)
11687 {
11688 FreeExpContents(exp);
11689 op1->ops.BitAnd(exp, op1, op2);
11690 }
11691 }
11692 break;
11693 case '|':
11694 if(op1->ops.BitOr)
11695 {
11696 FreeExpContents(exp);
11697 op1->ops.BitOr(exp, op1, op2);
11698 }
11699 break;
11700 case '^':
11701 if(op1->ops.BitXor)
11702 {
11703 FreeExpContents(exp);
11704 op1->ops.BitXor(exp, op1, op2);
11705 }
11706 break;
11707 case LEFT_OP:
11708 if(op1->ops.LShift)
11709 {
11710 FreeExpContents(exp);
11711 op1->ops.LShift(exp, op1, op2);
11712 }
11713 break;
11714 case RIGHT_OP:
11715 if(op1->ops.RShift)
11716 {
11717 FreeExpContents(exp);
11718 op1->ops.RShift(exp, op1, op2);
11719 }
11720 break;
11721 case EQ_OP:
11722 if(op1->ops.Equ)
11723 {
11724 FreeExpContents(exp);
11725 op1->ops.Equ(exp, op1, op2);
11726 }
11727 break;
11728 case NE_OP:
11729 if(op1->ops.Nqu)
11730 {
11731 FreeExpContents(exp);
11732 op1->ops.Nqu(exp, op1, op2);
11733 }
11734 break;
11735 case AND_OP:
11736 if(op1->ops.And)
11737 {
11738 FreeExpContents(exp);
11739 op1->ops.And(exp, op1, op2);
11740 }
11741 break;
11742 case OR_OP:
11743 if(op1->ops.Or)
11744 {
11745 FreeExpContents(exp);
11746 op1->ops.Or(exp, op1, op2);
11747 }
11748 break;
11749 case '>':
11750 if(op1->ops.Grt)
11751 {
11752 FreeExpContents(exp);
11753 op1->ops.Grt(exp, op1, op2);
11754 }
11755 break;
11756 case '<':
11757 if(op1->ops.Sma)
11758 {
11759 FreeExpContents(exp);
11760 op1->ops.Sma(exp, op1, op2);
11761 }
11762 break;
11763 case GE_OP:
11764 if(op1->ops.GrtEqu)
11765 {
11766 FreeExpContents(exp);
11767 op1->ops.GrtEqu(exp, op1, op2);
11768 }
11769 break;
11770 case LE_OP:
11771 if(op1->ops.SmaEqu)
11772 {
11773 FreeExpContents(exp);
11774 op1->ops.SmaEqu(exp, op1, op2);
11775 }
11776 break;
11777 }
11778 }
11779 }
11780 }
11781
11782 void PrintTypeNoConst(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
11783
11784 extern struct Expression * MkExpIdentifier(struct Identifier * id);
11785
11786 void ComputeExpression(struct Expression * exp)
11787 {
11788 char expString[10240];
11789
11790 expString[0] = '\0';
11791 switch(exp->type)
11792 {
11793 case 1:
11794 {
11795 ComputeInstantiation(exp);
11796 break;
11797 }
11798 case 4:
11799 {
11800 struct Expression * exp1, * exp2 = (((void *)0));
11801 struct Operand op1 = 
11802 {
11803 0, 0, 0, 0, 
11804 {
11805 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11806 }
11807 };
11808 struct Operand op2 = 
11809 {
11810 0, 0, 0, 0, 
11811 {
11812 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11813 }
11814 };
11815
11816 if(exp->op.exp2)
11817 {
11818 struct Expression * e = exp->op.exp2;
11819
11820 while((e->type == 5 || e->type == 32 || e->type == 23) && e->list)
11821 {
11822 if(e->type == 5 || e->type == 32 || e->type == 23)
11823 {
11824 if(e->type == 23)
11825 e = (*((struct Statement *)(*e->compound->compound.statements).last)->expressions).last;
11826 else
11827 e = (*e->list).last;
11828 }
11829 }
11830 if(exp->op.op == 261 && e && e->expType)
11831 {
11832 if(e->type == 3 && e->string)
11833 {
11834 char * string = e->string;
11835 int len = strlen(string);
11836 char * tmp = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (len - 2 + 1));
11837
11838 len = UnescapeString(tmp, string + 1, len - 2);
11839 (__ecereNameSpace__ecere__com__eSystem_Delete(tmp), tmp = 0);
11840 FreeExpContents(exp);
11841 exp->type = 2;
11842 exp->constant = PrintUInt(len + 1);
11843 }
11844 else
11845 {
11846 struct Type * type = e->expType;
11847
11848 type->refCount++;
11849 FreeExpContents(exp);
11850 exp->type = 2;
11851 exp->constant = PrintUInt(ComputeTypeSize(type));
11852 FreeType(type);
11853 }
11854 break;
11855 }
11856 else
11857 ComputeExpression(exp->op.exp2);
11858 }
11859 if(exp->op.exp1)
11860 {
11861 ComputeExpression(exp->op.exp1);
11862 exp1 = exp->op.exp1;
11863 exp2 = exp->op.exp2;
11864 op1 = GetOperand(exp1);
11865 if(op1.type)
11866 op1.type->refCount++;
11867 if(exp2)
11868 {
11869 op2 = GetOperand(exp2);
11870 if(op2.type)
11871 op2.type->refCount++;
11872 }
11873 }
11874 else
11875 {
11876 exp1 = exp->op.exp2;
11877 op1 = GetOperand(exp1);
11878 if(op1.type)
11879 op1.type->refCount++;
11880 }
11881 CallOperator(exp, exp1, exp2, &op1, &op2);
11882 if(op1.type)
11883 FreeType(op1.type);
11884 if(op2.type)
11885 FreeType(op2.type);
11886 break;
11887 }
11888 case 5:
11889 case 32:
11890 {
11891 struct Expression * e, * n;
11892
11893 for(e = (*exp->list).first; e; e = n)
11894 {
11895 n = e->next;
11896 if(!n)
11897 {
11898 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
11899
11900 ComputeExpression(e);
11901 FreeType(exp->expType);
11902 FreeType(exp->destType);
11903 *exp = *e;
11904 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
11905 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
11906 }
11907 else
11908 {
11909 FreeExpression(e);
11910 }
11911 }
11912 break;
11913 }
11914 case 8:
11915 {
11916 struct Expression * memberExp = exp->member.exp;
11917 struct Identifier * memberID = exp->member.member;
11918 struct Type * type;
11919
11920 ComputeExpression(exp->member.exp);
11921 type = exp->member.exp->expType;
11922 if(type)
11923 {
11924 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)));
11925 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11926 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11927 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
11928
11929 if(type->kind == 19 && exp->member.exp->type == 24)
11930 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
11931 if(!_class)
11932 {
11933 char string[256];
11934 struct Symbol * classSym;
11935
11936 string[0] = '\0';
11937 PrintTypeNoConst(type, string, 0x0, 0x1);
11938 classSym = FindClass(string);
11939 _class = classSym ? classSym->registered : (((void *)0));
11940 }
11941 if(exp->member.member)
11942 {
11943 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
11944 if(!prop)
11945 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
11946 }
11947 if(!prop && !member && _class && exp->member.member)
11948 {
11949 struct Symbol * classSym = FindClass(exp->member.member->string);
11950
11951 convertTo = _class;
11952 _class = classSym ? classSym->registered : (((void *)0));
11953 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
11954 }
11955 if(prop)
11956 {
11957 if(prop->compiled)
11958 {
11959 struct Type * type = prop->dataType;
11960
11961 if(_class->type == 3)
11962 {
11963 if(type->kind == 8)
11964 {
11965 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11966
11967 if(_class->type == 3)
11968 {
11969 if(!_class->dataType)
11970 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11971 type = _class->dataType;
11972 }
11973 }
11974 switch(type->kind)
11975 {
11976 case 6:
11977 {
11978 float value;
11979 float (* Get)(float) = (void *)prop->Get;
11980
11981 GetFloat(exp->member.exp, &value);
11982 exp->constant = PrintFloat(Get ? Get(value) : value);
11983 exp->type = 2;
11984 break;
11985 }
11986 case 7:
11987 {
11988 double value;
11989 double (* Get)(double);
11990
11991 GetDouble(exp->member.exp, &value);
11992 if(convertTo)
11993 Get = (void *)prop->Set;
11994 else
11995 Get = (void *)prop->Get;
11996 exp->constant = PrintDouble(Get ? Get(value) : value);
11997 exp->type = 2;
11998 break;
11999 }
12000 }
12001 }
12002 else
12003 {
12004 if(convertTo)
12005 {
12006 struct Expression * value = exp->member.exp;
12007 struct Type * type;
12008
12009 if(!prop->dataType)
12010 ProcessPropertyType(prop);
12011 type = prop->dataType;
12012 if(!type)
12013 {
12014 }
12015 else if(_class->type == 1)
12016 {
12017 switch(type->kind)
12018 {
12019 case 8:
12020 {
12021 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
12022
12023 if(propertyClass->type == 1 && value->type == 1)
12024 {
12025 void (* Set)(void *, void *) = (void *)prop->Set;
12026
12027 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12028 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12029 exp->instance->_class = MkSpecifierName(_class->fullName);
12030 exp->instance->loc = exp->loc;
12031 exp->type = 1;
12032 Set(exp->instance->data, value->instance->data);
12033 PopulateInstance(exp->instance);
12034 }
12035 break;
12036 }
12037 case 3:
12038 {
12039 int intValue;
12040 void (* Set)(void *, int) = (void *)prop->Set;
12041
12042 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12043 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12044 exp->instance->_class = MkSpecifierName(_class->fullName);
12045 exp->instance->loc = exp->loc;
12046 exp->type = 1;
12047 GetInt(value, &intValue);
12048 Set(exp->instance->data, intValue);
12049 PopulateInstance(exp->instance);
12050 break;
12051 }
12052 case 4:
12053 {
12054 long long intValue;
12055 void (* Set)(void *, long long) = (void *)prop->Set;
12056
12057 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12058 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12059 exp->instance->_class = MkSpecifierName(_class->fullName);
12060 exp->instance->loc = exp->loc;
12061 exp->type = 1;
12062 GetInt64(value, &intValue);
12063 Set(exp->instance->data, intValue);
12064 PopulateInstance(exp->instance);
12065 break;
12066 }
12067 case 22:
12068 {
12069 intptr_t intValue;
12070 void (* Set)(void *, intptr_t) = (void *)prop->Set;
12071
12072 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12073 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12074 exp->instance->_class = MkSpecifierName(_class->fullName);
12075 exp->instance->loc = exp->loc;
12076 exp->type = 1;
12077 GetIntPtr(value, &intValue);
12078 Set(exp->instance->data, intValue);
12079 PopulateInstance(exp->instance);
12080 break;
12081 }
12082 case 23:
12083 {
12084 ssize_t intValue;
12085 void (* Set)(void *, ssize_t) = (void *)prop->Set;
12086
12087 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12088 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12089 exp->instance->_class = MkSpecifierName(_class->fullName);
12090 exp->instance->loc = exp->loc;
12091 exp->type = 1;
12092 GetIntSize(value, &intValue);
12093 Set(exp->instance->data, intValue);
12094 PopulateInstance(exp->instance);
12095 break;
12096 }
12097 case 6:
12098 {
12099 float floatValue;
12100 void (* Set)(void *, float) = (void *)prop->Set;
12101
12102 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12103 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12104 exp->instance->_class = MkSpecifierName(_class->fullName);
12105 exp->instance->loc = exp->loc;
12106 exp->type = 1;
12107 GetFloat(value, &floatValue);
12108 Set(exp->instance->data, floatValue);
12109 PopulateInstance(exp->instance);
12110 break;
12111 }
12112 case 7:
12113 {
12114 double doubleValue;
12115 void (* Set)(void *, double) = (void *)prop->Set;
12116
12117 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12118 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12119 exp->instance->_class = MkSpecifierName(_class->fullName);
12120 exp->instance->loc = exp->loc;
12121 exp->type = 1;
12122 GetDouble(value, &doubleValue);
12123 Set(exp->instance->data, doubleValue);
12124 PopulateInstance(exp->instance);
12125 break;
12126 }
12127 }
12128 }
12129 else if(_class->type == 2)
12130 {
12131 switch(type->kind)
12132 {
12133 case 8:
12134 {
12135 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
12136
12137 if(propertyClass->type == 1 && value->instance->data)
12138 {
12139 unsigned int (* Set)(void *) = (void *)prop->Set;
12140 unsigned int bits = Set(value->instance->data);
12141
12142 exp->constant = PrintHexUInt(bits);
12143 exp->type = 2;
12144 break;
12145 }
12146 else if(_class->type == 2)
12147 {
12148 unsigned int value;
12149 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
12150 unsigned int bits;
12151
12152 GetUInt(exp->member.exp, &value);
12153 bits = Set(value);
12154 exp->constant = PrintHexUInt(bits);
12155 exp->type = 2;
12156 }
12157 }
12158 }
12159 }
12160 }
12161 else
12162 {
12163 if(_class->type == 2)
12164 {
12165 unsigned int value;
12166
12167 GetUInt(exp->member.exp, &value);
12168 switch(type->kind)
12169 {
12170 case 8:
12171 {
12172 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12173
12174 if(_class->type == 1)
12175 {
12176 void (* Get)(unsigned int, void *) = (void *)prop->Get;
12177
12178 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12179 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12180 exp->instance->_class = MkSpecifierName(_class->fullName);
12181 exp->instance->loc = exp->loc;
12182 exp->type = 1;
12183 Get(value, exp->instance->data);
12184 PopulateInstance(exp->instance);
12185 }
12186 else if(_class->type == 2)
12187 {
12188 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
12189 uint64 bits = Get(value);
12190
12191 exp->constant = PrintHexUInt64(bits);
12192 exp->type = 2;
12193 }
12194 break;
12195 }
12196 }
12197 }
12198 else if(_class->type == 1)
12199 {
12200 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
12201
12202 switch(type->kind)
12203 {
12204 case 8:
12205 {
12206 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12207
12208 if(_class->type == 1 && value)
12209 {
12210 void (* Get)(void *, void *) = (void *)prop->Get;
12211
12212 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12213 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12214 exp->instance->_class = MkSpecifierName(_class->fullName);
12215 exp->instance->loc = exp->loc;
12216 exp->type = 1;
12217 Get(value, exp->instance->data);
12218 PopulateInstance(exp->instance);
12219 }
12220 break;
12221 }
12222 }
12223 }
12224 }
12225 }
12226 }
12227 else
12228 {
12229 exp->isConstant = 0x0;
12230 }
12231 }
12232 else if(member)
12233 {
12234 }
12235 }
12236 if(exp->type != 8)
12237 {
12238 FreeExpression(memberExp);
12239 FreeIdentifier(memberID);
12240 }
12241 break;
12242 }
12243 case 10:
12244 {
12245 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
12246
12247 FreeExpContents(exp);
12248 exp->constant = PrintUInt(ComputeTypeSize(type));
12249 exp->type = 2;
12250 FreeType(type);
12251 break;
12252 }
12253 case 15:
12254 {
12255 struct Symbol * classSym = exp->_class->symbol;
12256
12257 if(classSym && classSym->registered)
12258 {
12259 if(classSym->registered->fixed)
12260 {
12261 FreeSpecifier(exp->_class);
12262 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
12263 exp->type = 2;
12264 }
12265 else
12266 {
12267 char className[1024];
12268
12269 strcpy(className, "__ecereClass_");
12270 FullClassNameCat(className, classSym->string, 0x1);
12271 MangleClassName(className);
12272 DeclareClass(classSym, className);
12273 FreeExpContents(exp);
12274 exp->type = 9;
12275 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
12276 exp->member.member = MkIdentifier("structSize");
12277 }
12278 }
12279 break;
12280 }
12281 case 11:
12282 {
12283 struct Type * type;
12284 struct Expression * e = exp;
12285
12286 if(exp->type == 11)
12287 {
12288 if(exp->cast.exp)
12289 ComputeExpression(exp->cast.exp);
12290 e = exp->cast.exp;
12291 }
12292 if(e && exp->expType)
12293 {
12294 type = exp->expType;
12295 if(type->kind == 8)
12296 {
12297 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12298
12299 if(_class && (_class->type == 3 || _class->type == 2))
12300 {
12301 if(!_class->dataType)
12302 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
12303 type = _class->dataType;
12304 }
12305 }
12306 switch(type->kind)
12307 {
12308 case 24:
12309 case 1:
12310 if(type->isSigned)
12311 {
12312 char value = (char)0;
12313
12314 if(GetChar(e, &value))
12315 {
12316 FreeExpContents(exp);
12317 exp->constant = PrintChar(value);
12318 exp->type = 2;
12319 }
12320 }
12321 else
12322 {
12323 unsigned char value = (unsigned char)0;
12324
12325 if(GetUChar(e, &value))
12326 {
12327 FreeExpContents(exp);
12328 exp->constant = PrintUChar(value);
12329 exp->type = 2;
12330 }
12331 }
12332 break;
12333 case 2:
12334 if(type->isSigned)
12335 {
12336 short value = (short)0;
12337
12338 if(GetShort(e, &value))
12339 {
12340 FreeExpContents(exp);
12341 exp->constant = PrintShort(value);
12342 exp->type = 2;
12343 }
12344 }
12345 else
12346 {
12347 unsigned short value = (unsigned short)0;
12348
12349 if(GetUShort(e, &value))
12350 {
12351 FreeExpContents(exp);
12352 exp->constant = PrintUShort(value);
12353 exp->type = 2;
12354 }
12355 }
12356 break;
12357 case 3:
12358 if(type->isSigned)
12359 {
12360 int value = 0;
12361
12362 if(GetInt(e, &value))
12363 {
12364 FreeExpContents(exp);
12365 exp->constant = PrintInt(value);
12366 exp->type = 2;
12367 }
12368 }
12369 else
12370 {
12371 unsigned int value = 0;
12372
12373 if(GetUInt(e, &value))
12374 {
12375 FreeExpContents(exp);
12376 exp->constant = PrintUInt(value);
12377 exp->type = 2;
12378 }
12379 }
12380 break;
12381 case 4:
12382 if(type->isSigned)
12383 {
12384 long long value = 0;
12385
12386 if(GetInt64(e, &value))
12387 {
12388 FreeExpContents(exp);
12389 exp->constant = PrintInt64(value);
12390 exp->type = 2;
12391 }
12392 }
12393 else
12394 {
12395 uint64 value = 0;
12396
12397 if(GetUInt64(e, &value))
12398 {
12399 FreeExpContents(exp);
12400 exp->constant = PrintUInt64(value);
12401 exp->type = 2;
12402 }
12403 }
12404 break;
12405 case 22:
12406 if(type->isSigned)
12407 {
12408 intptr_t value = 0;
12409
12410 if(GetIntPtr(e, &value))
12411 {
12412 FreeExpContents(exp);
12413 exp->constant = PrintInt64((long long)value);
12414 exp->type = 2;
12415 }
12416 }
12417 else
12418 {
12419 uintptr_t value = 0;
12420
12421 if(GetUIntPtr(e, &value))
12422 {
12423 FreeExpContents(exp);
12424 exp->constant = PrintUInt64((uint64)value);
12425 exp->type = 2;
12426 }
12427 }
12428 break;
12429 case 23:
12430 if(type->isSigned)
12431 {
12432 ssize_t value = 0;
12433
12434 if(GetIntSize(e, &value))
12435 {
12436 FreeExpContents(exp);
12437 exp->constant = PrintInt64((long long)value);
12438 exp->type = 2;
12439 }
12440 }
12441 else
12442 {
12443 size_t value = 0;
12444
12445 if(GetUIntSize(e, &value))
12446 {
12447 FreeExpContents(exp);
12448 exp->constant = PrintUInt64((uint64)value);
12449 exp->type = 2;
12450 }
12451 }
12452 break;
12453 case 6:
12454 {
12455 float value = 0;
12456
12457 if(GetFloat(e, &value))
12458 {
12459 FreeExpContents(exp);
12460 exp->constant = PrintFloat(value);
12461 exp->type = 2;
12462 }
12463 break;
12464 }
12465 case 7:
12466 {
12467 double value = 0;
12468
12469 if(GetDouble(e, &value))
12470 {
12471 FreeExpContents(exp);
12472 exp->constant = PrintDouble(value);
12473 exp->type = 2;
12474 }
12475 break;
12476 }
12477 }
12478 }
12479 break;
12480 }
12481 case 12:
12482 {
12483 struct Operand op1 = 
12484 {
12485 0, 0, 0, 0, 
12486 {
12487 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12488 }
12489 };
12490 struct Operand op2 = 
12491 {
12492 0, 0, 0, 0, 
12493 {
12494 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12495 }
12496 };
12497 struct Operand op3 = 
12498 {
12499 0, 0, 0, 0, 
12500 {
12501 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12502 }
12503 };
12504
12505 if(exp->cond.exp)
12506 ComputeExpression((*exp->cond.exp).last);
12507 if(exp->cond.elseExp)
12508 ComputeExpression(exp->cond.elseExp);
12509 if(exp->cond.cond)
12510 ComputeExpression(exp->cond.cond);
12511 op1 = GetOperand(exp->cond.cond);
12512 if(op1.type)
12513 op1.type->refCount++;
12514 op2 = GetOperand((*exp->cond.exp).last);
12515 if(op2.type)
12516 op2.type->refCount++;
12517 op3 = GetOperand(exp->cond.elseExp);
12518 if(op3.type)
12519 op3.type->refCount++;
12520 if(op1.ops.Cond)
12521 {
12522 FreeExpContents(exp);
12523 op1.ops.Cond(exp, &op1, &op2, &op3);
12524 }
12525 if(op1.type)
12526 FreeType(op1.type);
12527 if(op2.type)
12528 FreeType(op2.type);
12529 if(op3.type)
12530 FreeType(op3.type);
12531 break;
12532 }
12533 }
12534 }
12535
12536 void ApplyAnyObjectLogic(struct Expression * e);
12537
12538 extern void CopyTypeInto(struct Type * type, struct Type * src);
12539
12540 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
12541 {
12542 unsigned int result = 0x1;
12543
12544 if(destType)
12545 {
12546 struct __ecereNameSpace__ecere__sys__OldList converts = 
12547 {
12548 0, 0, 0, 0, 0
12549 };
12550 struct Conversion * convert;
12551
12552 if(destType->kind == 0)
12553 return 0x0;
12554 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
12555 result = 0x0;
12556 if(converts.count)
12557 {
12558 for(convert = converts.first; convert; convert = convert->next)
12559 {
12560 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
12561
12562 if(!empty)
12563 {
12564 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12565 int objectType = exp->expType ? exp->expType->classObjectType : 0;
12566
12567 *newExp = *exp;
12568 newExp->destType = (((void *)0));
12569 if(convert->isGet)
12570 {
12571 exp->type = 8;
12572 exp->addedThis = 0x1;
12573 exp->member.exp = newExp;
12574 FreeType(exp->member.exp->expType);
12575 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
12576 exp->member.exp->expType->classObjectType = objectType;
12577 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
12578 exp->member.memberType = 1;
12579 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12580 exp->needCast = 0x1;
12581 if(exp->expType)
12582 exp->expType->refCount++;
12583 ApplyAnyObjectLogic(exp->member.exp);
12584 }
12585 else
12586 {
12587 {
12588 exp->type = 8;
12589 exp->addedThis = 0x1;
12590 exp->member.exp = newExp;
12591 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
12592 {
12593 newExp->byReference = 0x1;
12594 }
12595 FreeType(exp->member.exp->expType);
12596 exp->member.exp->expType = (((void *)0));
12597 if(convert->convert->dataType)
12598 {
12599 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12600 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
12601 exp->member.exp->expType->refCount = 1;
12602 exp->member.exp->expType->classObjectType = objectType;
12603 ApplyAnyObjectLogic(exp->member.exp);
12604 }
12605 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
12606 exp->member.memberType = 4;
12607 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12608 exp->needCast = 0x1;
12609 if(convert->resultType)
12610 convert->resultType->refCount++;
12611 }
12612 }
12613 }
12614 else
12615 {
12616 FreeType(exp->expType);
12617 if(convert->isGet)
12618 {
12619 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12620 exp->needCast = 0x1;
12621 if(exp->expType)
12622 exp->expType->refCount++;
12623 }
12624 else
12625 {
12626 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12627 exp->needCast = 0x1;
12628 if(convert->resultType)
12629 convert->resultType->refCount++;
12630 }
12631 }
12632 }
12633 if(exp->isConstant && inCompiler)
12634 ComputeExpression(exp);
12635 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
12636 }
12637 if(!result && exp->expType && converts.count)
12638 {
12639 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
12640 }
12641 if(!result && exp->expType && exp->destType)
12642 {
12643 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))
12644 result = 0x1;
12645 }
12646 }
12647 return result;
12648 }
12649
12650 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
12651
12652 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
12653
12654 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
12655
12656 void CheckTemplateTypes(struct Expression * exp)
12657 {
12658 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
12659 {
12660 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12661 struct Statement * compound;
12662 struct Context * context;
12663
12664 *newExp = *exp;
12665 if(exp->destType)
12666 exp->destType->refCount++;
12667 if(exp->expType)
12668 exp->expType->refCount++;
12669 newExp->prev = (((void *)0));
12670 newExp->next = (((void *)0));
12671 switch(exp->expType->kind)
12672 {
12673 case 7:
12674 if(exp->destType->classObjectType)
12675 {
12676 if(exp->destType)
12677 exp->destType->refCount--;
12678 if(exp->expType)
12679 exp->expType->refCount--;
12680 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12681 }
12682 else
12683 {
12684 struct __ecereNameSpace__ecere__sys__OldList * specs;
12685 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12686 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12687
12688 context = PushContext();
12689 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12690 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12691 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12692 exp->type = 23;
12693 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12694 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
12695 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
12696 exp->compound->compound.context = context;
12697 PopContext(context);
12698 }
12699 break;
12700 default:
12701 exp->type = 11;
12702 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
12703 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12704 break;
12705 }
12706 }
12707 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
12708 {
12709 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12710 struct Statement * compound;
12711 struct Context * context;
12712
12713 *newExp = *exp;
12714 if(exp->destType)
12715 exp->destType->refCount++;
12716 if(exp->expType)
12717 exp->expType->refCount++;
12718 newExp->prev = (((void *)0));
12719 newExp->next = (((void *)0));
12720 switch(exp->expType->kind)
12721 {
12722 case 7:
12723 if(exp->destType->classObjectType)
12724 {
12725 if(exp->destType)
12726 exp->destType->refCount--;
12727 if(exp->expType)
12728 exp->expType->refCount--;
12729 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12730 }
12731 else
12732 {
12733 struct __ecereNameSpace__ecere__sys__OldList * specs;
12734 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12735 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12736
12737 context = PushContext();
12738 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12739 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12740 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12741 exp->type = 23;
12742 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12743 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
12744 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
12745 exp->compound->compound.context = context;
12746 PopContext(context);
12747 }
12748 break;
12749 case 8:
12750 {
12751 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
12752 {
12753 exp->type = 5;
12754 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
12755 ProcessExpressionType((*exp->list).first);
12756 break;
12757 }
12758 else
12759 {
12760 exp->type = 5;
12761 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
12762 newExp->needCast = 0x1;
12763 ProcessExpressionType((*exp->list).first);
12764 break;
12765 }
12766 }
12767 default:
12768 {
12769 if(exp->expType->kind == 20)
12770 {
12771 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
12772
12773 if(type)
12774 {
12775 FreeType(exp->destType);
12776 FreeType(exp->expType);
12777 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12778 break;
12779 }
12780 }
12781 if(newExp->type == 8 && newExp->member.memberType == 3)
12782 {
12783 exp->type = 4;
12784 exp->op.op = '*';
12785 exp->op.exp1 = (((void *)0));
12786 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
12787 }
12788 else
12789 {
12790 char typeString[1024];
12791 struct Declarator * decl;
12792 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12793
12794 typeString[0] = '\0';
12795 PrintType(exp->expType, typeString, 0x0, 0x0);
12796 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12797 exp->type = 11;
12798 exp->cast.typeName = MkTypeName(specs, decl);
12799 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12800 exp->cast.exp->needCast = 0x1;
12801 }
12802 break;
12803 }
12804 }
12805 }
12806 }
12807
12808 extern int strncmp(const char * , const char * , size_t n);
12809
12810 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char *  key);
12811
12812 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
12813 {
12814 int nsLen = strlen(nameSpace);
12815 struct Symbol * symbol;
12816
12817 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)))
12818 {
12819 char * s = symbol->string;
12820
12821 if(!strncmp(s, nameSpace, nsLen))
12822 {
12823 int c;
12824 char * namePart;
12825
12826 for(c = strlen(s) - 1; c >= 0; c--)
12827 if(s[c] == ':')
12828 break;
12829 namePart = s + c + 1;
12830 if(!strcmp(namePart, name))
12831 {
12832 return symbol;
12833 }
12834 }
12835 else
12836 break;
12837 }
12838 return (((void *)0));
12839 }
12840
12841 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
12842 {
12843 int c;
12844 char nameSpace[1024];
12845 char * namePart;
12846 unsigned int gotColon = 0x0;
12847
12848 nameSpace[0] = '\0';
12849 for(c = strlen(name) - 1; c >= 0; c--)
12850 if(name[c] == ':')
12851 {
12852 gotColon = 0x1;
12853 break;
12854 }
12855 namePart = name + c + 1;
12856 while(c >= 0 && name[c] == ':')
12857 c--;
12858 if(c >= 0)
12859 {
12860 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
12861
12862 if(symbol)
12863 return symbol;
12864 memcpy(nameSpace, name, c + 1);
12865 nameSpace[c + 1] = (char)0;
12866 return ScanWithNameSpace(tree, nameSpace, namePart);
12867 }
12868 else if(gotColon)
12869 {
12870 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12871
12872 return symbol;
12873 }
12874 else
12875 {
12876 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12877
12878 if(symbol)
12879 return symbol;
12880 return ScanWithNameSpace(tree, "", namePart);
12881 }
12882 return (((void *)0));
12883 }
12884
12885 static void ProcessDeclaration(struct Declaration * decl);
12886
12887 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
12888 {
12889 struct Context * ctx;
12890 struct Symbol * symbol = (((void *)0));
12891
12892 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
12893 {
12894 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
12895 {
12896 symbol = (((void *)0));
12897 if(thisNameSpace)
12898 {
12899 char curName[1024];
12900
12901 strcpy(curName, thisNameSpace);
12902 strcat(curName, "::");
12903 strcat(curName, name);
12904 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
12905 }
12906 if(!symbol)
12907 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
12908 }
12909 else
12910 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
12911 if(symbol || ctx == endContext)
12912 break;
12913 }
12914 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
12915 {
12916 if(symbol->pointerExternal->type == 0)
12917 {
12918 struct FunctionDefinition * function = symbol->pointerExternal->function;
12919 struct Context * tmpContext = curContext;
12920
12921 curContext = (((void *)0));
12922 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
12923 curContext = tmpContext;
12924 symbol->pointerExternal->symbol = symbol;
12925 DeclareType(symbol->type, 0x1, 0x1);
12926 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
12927 symbol->id = curExternal->symbol->idCode;
12928 }
12929 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
12930 {
12931 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
12932 symbol->id = curExternal->symbol->idCode;
12933 }
12934 }
12935 return symbol;
12936 }
12937
12938 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
12939 {
12940 if(!type->isSigned && type->kind != 22 && type->kind != 23)
12941 ListAdd(specs, MkSpecifier(UNSIGNED));
12942 switch(type->kind)
12943 {
12944 case 8:
12945 {
12946 if(type->_class->registered)
12947 {
12948 if(!type->_class->registered->dataType)
12949 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
12950 GetTypeSpecs(type->_class->registered->dataType, specs);
12951 }
12952 break;
12953 }
12954 case 7:
12955 ListAdd(specs, MkSpecifier(DOUBLE));
12956 break;
12957 case 6:
12958 ListAdd(specs, MkSpecifier(FLOAT));
12959 break;
12960 case 1:
12961 ListAdd(specs, MkSpecifier(CHAR));
12962 break;
12963 case 24:
12964 ListAdd(specs, MkSpecifier(_BOOL));
12965 break;
12966 case 2:
12967 ListAdd(specs, MkSpecifier(SHORT));
12968 break;
12969 case 4:
12970 ListAdd(specs, MkSpecifier(INT64));
12971 break;
12972 case 22:
12973 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
12974 break;
12975 case 23:
12976 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
12977 break;
12978 case 3:
12979 default:
12980 ListAdd(specs, MkSpecifier(INT));
12981 break;
12982 }
12983 }
12984
12985 static void PrintArraySize(struct Type * arrayType, char * string)
12986 {
12987 char size[256];
12988
12989 size[0] = '\0';
12990 strcat(size, "[");
12991 if(arrayType->enumClass)
12992 strcat(size, arrayType->enumClass->string);
12993 else if(arrayType->arraySizeExp)
12994 PrintExpression(arrayType->arraySizeExp, size);
12995 strcat(size, "]");
12996 strcat(string, size);
12997 }
12998
12999 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
13000 {
13001 if(type)
13002 {
13003 if(printConst && type->constant)
13004 strcat(string, "const ");
13005 switch(type->kind)
13006 {
13007 case 8:
13008 {
13009 struct Symbol * c = type->_class;
13010
13011 if(type->classObjectType == 2)
13012 strcat(string, "typed_object");
13013 else if(type->classObjectType == 3)
13014 strcat(string, "any_object");
13015 else
13016 {
13017 if(c && c->string)
13018 strcat(string, (fullName || !c->registered) ? c->string : c->registered->name);
13019 }
13020 if(type->byReference)
13021 strcat(string, " &");
13022 break;
13023 }
13024 case 0:
13025 strcat(string, "void");
13026 break;
13027 case 3:
13028 strcat(string, type->isSigned ? "int" : "uint");
13029 break;
13030 case 4:
13031 strcat(string, type->isSigned ? "int64" : "uint64");
13032 break;
13033 case 22:
13034 strcat(string, type->isSigned ? "intptr" : "uintptr");
13035 break;
13036 case 23:
13037 strcat(string, type->isSigned ? "intsize" : "uintsize");
13038 break;
13039 case 1:
13040 strcat(string, type->isSigned ? "char" : "byte");
13041 break;
13042 case 24:
13043 strcat(string, "_Bool");
13044 break;
13045 case 2:
13046 strcat(string, type->isSigned ? "short" : "uint16");
13047 break;
13048 case 6:
13049 strcat(string, "float");
13050 break;
13051 case 7:
13052 strcat(string, "double");
13053 break;
13054 case 9:
13055 if(type->enumName)
13056 {
13057 strcat(string, "struct ");
13058 strcat(string, type->enumName);
13059 }
13060 else if(type->typeName)
13061 strcat(string, type->typeName);
13062 else
13063 {
13064 struct Type * member;
13065
13066 strcat(string, "struct { ");
13067 for(member = type->members.first; member; member = member->next)
13068 {
13069 PrintType(member, string, 0x1, fullName);
13070 strcat(string, "; ");
13071 }
13072 strcat(string, "}");
13073 }
13074 break;
13075 case 10:
13076 if(type->enumName)
13077 {
13078 strcat(string, "union ");
13079 strcat(string, type->enumName);
13080 }
13081 else if(type->typeName)
13082 strcat(string, type->typeName);
13083 else
13084 {
13085 strcat(string, "union ");
13086 strcat(string, "(unnamed)");
13087 }
13088 break;
13089 case 15:
13090 if(type->enumName)
13091 {
13092 strcat(string, "enum ");
13093 strcat(string, type->enumName);
13094 }
13095 else if(type->typeName)
13096 strcat(string, type->typeName);
13097 else
13098 strcat(string, "int");
13099 break;
13100 case 14:
13101 strcat(string, "...");
13102 break;
13103 case 19:
13104 strcat(string, "subclass(");
13105 strcat(string, type->_class ? type->_class->string : "int");
13106 strcat(string, ")");
13107 break;
13108 case 20:
13109 strcat(string, type->templateParameter->identifier->string);
13110 break;
13111 case 21:
13112 strcat(string, "thisclass");
13113 break;
13114 case 17:
13115 strcat(string, "__builtin_va_list");
13116 break;
13117 }
13118 }
13119 }
13120
13121 extern char *  __ecereNameSpace__ecere__sys__RSearchString(char *  buffer, char *  subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
13122
13123 static void PrintName(struct Type * type, char * string, unsigned int fullName)
13124 {
13125 if(type->name && type->name[0])
13126 {
13127 if(fullName)
13128 strcat(string, type->name);
13129 else
13130 {
13131 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
13132
13133 if(name)
13134 name += 2;
13135 else
13136 name = type->name;
13137 strcat(string, name);
13138 }
13139 }
13140 }
13141
13142 static void PrintAttribs(struct Type * type, char * string)
13143 {
13144 if(type)
13145 {
13146 if(type->dllExport)
13147 strcat(string, "dllexport ");
13148 if(type->attrStdcall)
13149 strcat(string, "stdcall ");
13150 }
13151 }
13152
13153 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
13154 {
13155 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13156 {
13157 struct Type * attrType = (((void *)0));
13158
13159 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
13160 PrintAttribs(type, string);
13161 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
13162 strcat(string, " const");
13163 PrePrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName, type, printConst);
13164 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
13165 strcat(string, " (");
13166 if(type->kind == 13)
13167 {
13168 if(type->type->kind == 11 || type->type->kind == 16)
13169 PrintAttribs(type->type, string);
13170 }
13171 if(type->kind == 13)
13172 {
13173 if(type->type->kind == 11 || type->type->kind == 16 || type->type->kind == 12)
13174 strcat(string, "*");
13175 else
13176 strcat(string, " *");
13177 }
13178 if(printConst && type->constant && type->kind == 13)
13179 strcat(string, " const");
13180 }
13181 else
13182 PrintTypeSpecs(type, string, fullName, printConst);
13183 }
13184
13185 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
13186 {
13187 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
13188 strcat(string, ")");
13189 if(type->kind == 12)
13190 PrintArraySize(type, string);
13191 else if(type->kind == 11)
13192 {
13193 struct Type * param;
13194
13195 strcat(string, "(");
13196 for(param = type->params.first; param; param = param->next)
13197 {
13198 PrintType(param, string, 0x1, fullName);
13199 if(param->next)
13200 strcat(string, ", ");
13201 }
13202 strcat(string, ")");
13203 }
13204 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13205 PostPrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName);
13206 }
13207
13208 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
13209 {
13210 PrePrintType(type, string, fullName, (((void *)0)), printConst);
13211 if(type->thisClass || (printName && type->name && type->name[0]))
13212 strcat(string, " ");
13213 if((type->thisClass || type->staticMethod))
13214 {
13215 struct Symbol * _class = type->thisClass;
13216
13217 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
13218 {
13219 if(type->classObjectType == 1)
13220 strcat(string, "class");
13221 else
13222 strcat(string, type->byReference ? "typed_object&" : "typed_object");
13223 }
13224 else if(_class && _class->string)
13225 {
13226 char * s = _class->string;
13227
13228 if(fullName)
13229 strcat(string, s);
13230 else
13231 {
13232 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 0x1, 0x0);
13233
13234 if(name)
13235 name += 2;
13236 else
13237 name = s;
13238 strcat(string, name);
13239 }
13240 }
13241 strcat(string, "::");
13242 }
13243 if(printName && type->name)
13244 PrintName(type, string, fullName);
13245 PostPrintType(type, string, fullName);
13246 if(type->bitFieldCount)
13247 {
13248 char count[100];
13249
13250 sprintf(count, ":%d", type->bitFieldCount);
13251 strcat(string, count);
13252 }
13253 }
13254
13255 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13256 {
13257 _PrintType(type, string, printName, fullName, 0x1);
13258 }
13259
13260 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13261 {
13262 _PrintType(type, string, printName, fullName, 0x0);
13263 }
13264
13265 static struct Type * FindMember(struct Type * type, char * string)
13266 {
13267 struct Type * memberType;
13268
13269 for(memberType = type->members.first; memberType; memberType = memberType->next)
13270 {
13271 if(!memberType->name)
13272 {
13273 struct Type * subType = FindMember(memberType, string);
13274
13275 if(subType)
13276 return subType;
13277 }
13278 else if(!strcmp(memberType->name, string))
13279 return memberType;
13280 }
13281 return (((void *)0));
13282 }
13283
13284 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
13285 {
13286 struct Type * memberType;
13287
13288 for(memberType = type->members.first; memberType; memberType = memberType->next)
13289 {
13290 if(!memberType->name)
13291 {
13292 struct Type * subType = FindMember(memberType, string);
13293
13294 if(subType)
13295 {
13296 *offset += memberType->offset;
13297 return subType;
13298 }
13299 }
13300 else if(!strcmp(memberType->name, string))
13301 {
13302 *offset += memberType->offset;
13303 return memberType;
13304 }
13305 }
13306 return (((void *)0));
13307 }
13308
13309 extern unsigned int parseError;
13310
13311 unsigned int GetParseError()
13312 {
13313 return parseError;
13314 }
13315
13316 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
13317
13318 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
13319
13320 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
13321
13322 struct Expression * ParseExpressionString(char * expression)
13323 {
13324 parseError = 0x0;
13325 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13326 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__extension__ ({
13327 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13328
13329 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13330 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
13331 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13332 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13333
13334 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13335 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13336 echoOn = 0x0;
13337 parsedExpression = (((void *)0));
13338 resetScanner();
13339 expression_yyparse();
13340 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13341 return parsedExpression;
13342 }
13343
13344 extern char *  QMkString(char *  source);
13345
13346 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
13347 {
13348 struct Identifier * id = exp->identifier;
13349 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13350 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13351 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13352 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13353
13354 if(_class && _class->type == 4)
13355 {
13356 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
13357 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
13358
13359 if(enumClass)
13360 {
13361 struct __ecereNameSpace__ecere__com__Class * baseClass;
13362
13363 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
13364 {
13365 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
13366
13367 for(value = e->values.first; value; value = value->next)
13368 {
13369 if(!strcmp(value->name, id->string))
13370 break;
13371 }
13372 if(value)
13373 {
13374 char constant[256];
13375
13376 FreeExpContents(exp);
13377 exp->type = 2;
13378 exp->isConstant = 0x1;
13379 if(!strcmp(baseClass->dataTypeString, "int"))
13380 sprintf(constant, "%d", (int)value->data);
13381 else
13382 sprintf(constant, "0x%X", (int)value->data);
13383 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13384 exp->expType = MkClassType(baseClass->fullName);
13385 break;
13386 }
13387 }
13388 }
13389 if(value)
13390 return 0x1;
13391 }
13392 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
13393 {
13394 ProcessMethodType(method);
13395 exp->expType = __extension__ ({
13396 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13397
13398 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1->methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
13399 });
13400 return 0x1;
13401 }
13402 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
13403 {
13404 if(!prop->dataType)
13405 ProcessPropertyType(prop);
13406 exp->expType = prop->dataType;
13407 if(prop->dataType)
13408 prop->dataType->refCount++;
13409 return 0x1;
13410 }
13411 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
13412 {
13413 if(!member->dataType)
13414 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13415 exp->expType = member->dataType;
13416 if(member->dataType)
13417 member->dataType->refCount++;
13418 return 0x1;
13419 }
13420 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
13421 {
13422 if(!classProp->dataType)
13423 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
13424 if(classProp->constant)
13425 {
13426 FreeExpContents(exp);
13427 exp->isConstant = 0x1;
13428 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
13429 {
13430 exp->type = 3;
13431 exp->constant = QMkString((char *)classProp->Get(_class));
13432 }
13433 else
13434 {
13435 char constant[256];
13436
13437 exp->type = 2;
13438 sprintf(constant, "%d", (int)classProp->Get(_class));
13439 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13440 }
13441 }
13442 else
13443 {
13444 }
13445 exp->expType = classProp->dataType;
13446 if(classProp->dataType)
13447 classProp->dataType->refCount++;
13448 return 0x1;
13449 }
13450 return 0x0;
13451 }
13452
13453 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
13454 {
13455 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
13456 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
13457 struct __ecereNameSpace__ecere__com__NameSpace * child;
13458
13459 if(!data)
13460 {
13461 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)))
13462 {
13463 data = ScanGlobalData(child, name);
13464 if(data)
13465 break;
13466 }
13467 }
13468 return data;
13469 }
13470
13471 extern struct __ecereNameSpace__ecere__com__NameSpace *  globalData;
13472
13473 extern char *  strncpy(char * , const char * , size_t n);
13474
13475 static struct GlobalData * FindGlobalData(char * name)
13476 {
13477 int start = 0, c;
13478 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13479
13480 nameSpace = globalData;
13481 for(c = 0; name[c]; c++)
13482 {
13483 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
13484 {
13485 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
13486 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
13487
13488 strncpy(spaceName, name + start, c - start);
13489 spaceName[c - start] = '\0';
13490 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
13491 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
13492 if(!newSpace)
13493 return (((void *)0));
13494 nameSpace = newSpace;
13495 if(name[c] == ':')
13496 c++;
13497 start = c + 1;
13498 }
13499 }
13500 if(c - start)
13501 {
13502 return ScanGlobalData(nameSpace, name + start);
13503 }
13504 return (((void *)0));
13505 }
13506
13507 static int definedExpStackPos;
13508
13509 static void * definedExpStack[512];
13510
13511 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
13512 {
13513 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
13514
13515 FreeExpContents(checkedExp);
13516 FreeType(checkedExp->expType);
13517 FreeType(checkedExp->destType);
13518 *checkedExp = *newExp;
13519 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13520 checkedExp->prev = prev;
13521 checkedExp->next = next;
13522 }
13523
13524 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
13525
13526 extern int printf(char * , ...);
13527
13528 void __ecereMethod_Expression_Clear();
13529
13530 void ApplyAnyObjectLogic(struct Expression * e)
13531 {
13532 struct Type * destType = e->destType;
13533
13534 if(destType && (destType->classObjectType == 3))
13535 {
13536 if(e && e->expType)
13537 {
13538 struct Type * type = e->expType;
13539 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
13540
13541 if(type->kind == 8 && type->_class && type->_class->registered)
13542 {
13543 _class = type->_class->registered;
13544 }
13545 else if(type->kind == 19)
13546 {
13547 _class = FindClass("ecere::com::Class")->registered;
13548 }
13549 else
13550 {
13551 char string[1024] = "";
13552 struct Symbol * classSym;
13553
13554 PrintTypeNoConst(type, string, 0x0, 0x1);
13555 classSym = FindClass(string);
13556 if(classSym)
13557 _class = classSym->registered;
13558 }
13559 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)))
13560 {
13561 if(!_class || strcmp(_class->fullName, "char *"))
13562 {
13563 struct Expression * checkedExp = e, * newExp;
13564
13565 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->list) || checkedExp->type == 11)
13566 {
13567 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13568 {
13569 if(checkedExp->type == 23)
13570 {
13571 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13572 }
13573 else
13574 checkedExp = (*checkedExp->list).last;
13575 }
13576 else if(checkedExp->type == 11)
13577 checkedExp = checkedExp->cast.exp;
13578 }
13579 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
13580 {
13581 newExp = checkedExp->op.exp2;
13582 checkedExp->op.exp2 = (((void *)0));
13583 FreeExpContents(checkedExp);
13584 if(e->expType && e->expType->passAsTemplate)
13585 {
13586 char size[100];
13587
13588 ComputeTypeSize(e->expType);
13589 sprintf(size, "%d", e->expType->size);
13590 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))))));
13591 }
13592 ReplaceExpContents(checkedExp, newExp);
13593 e->byReference = 0x1;
13594 }
13595 else if(!e->byReference || (_class && _class->type == 5))
13596 {
13597 struct Expression * checkedExp, * newExp;
13598
13599 {
13600 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;
13601
13602 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
13603 {
13604 struct Context * context = PushContext();
13605 struct Declarator * decl;
13606 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13607 char typeString[1024];
13608 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13609
13610 typeString[0] = '\0';
13611 *newExp = *e;
13612 newExp->prev = (((void *)0));
13613 newExp->next = (((void *)0));
13614 newExp->expType = (((void *)0));
13615 PrintTypeNoConst(e->expType, typeString, 0x0, 0x1);
13616 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13617 newExp->destType = ProcessType(specs, decl);
13618 curContext = context;
13619 if(curCompound)
13620 {
13621 char name[100];
13622 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
13623
13624 e->type = 23;
13625 sprintf(name, "__internalValue%03X", internalValueCounter++);
13626 if(!curCompound->compound.declarations)
13627 curCompound->compound.declarations = MkList();
13628 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
13629 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
13630 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
13631 e->compound = MkCompoundStmt((((void *)0)), stmts);
13632 }
13633 else
13634 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
13635 {
13636 struct Type * type = e->destType;
13637
13638 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13639 CopyTypeInto(e->destType, type);
13640 e->destType->refCount = 1;
13641 e->destType->classObjectType = 0;
13642 FreeType(type);
13643 }
13644 e->compound->compound.context = context;
13645 PopContext(context);
13646 curContext = context->parent;
13647 }
13648 }
13649 checkedExp = e;
13650 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->list) || checkedExp->type == 11)
13651 {
13652 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13653 {
13654 if(checkedExp->type == 23)
13655 {
13656 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13657 }
13658 else
13659 checkedExp = (*checkedExp->list).last;
13660 }
13661 else if(checkedExp->type == 11)
13662 checkedExp = checkedExp->cast.exp;
13663 }
13664 {
13665 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13666
13667 *operand = *checkedExp;
13668 checkedExp->destType = (((void *)0));
13669 checkedExp->expType = (((void *)0));
13670 __ecereMethod_Expression_Clear(checkedExp);
13671 checkedExp->type = 4;
13672 checkedExp->op.op = '&';
13673 checkedExp->op.exp1 = (((void *)0));
13674 checkedExp->op.exp2 = operand;
13675 }
13676 }
13677 }
13678 }
13679 }
13680 }
13681 {
13682 }
13683 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))))
13684 {
13685 if(e->expType->classObjectType && destType && destType->classObjectType)
13686 {
13687 return ;
13688 }
13689 else
13690 {
13691 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13692
13693 *thisExp = *e;
13694 thisExp->prev = (((void *)0));
13695 thisExp->next = (((void *)0));
13696 __ecereMethod_Expression_Clear(e);
13697 e->type = 5;
13698 e->list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
13699 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
13700 ((struct Expression *)(*e->list).first)->byReference = 0x1;
13701 {
13702 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13703 CopyTypeInto(e->expType, thisExp->expType);
13704 e->expType->byReference = 0x0;
13705 e->expType->refCount = 1;
13706 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))
13707 {
13708 e->expType->classObjectType = 0;
13709 }
13710 }
13711 }
13712 }
13713 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
13714 {
13715 if(destType->kind == 14)
13716 {
13717 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unspecified type\n", (((void *)0))));
13718 }
13719 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
13720 {
13721 unsigned int byReference = e->expType->byReference;
13722 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13723 struct Declarator * decl;
13724 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13725 char typeString[1024];
13726 struct Type * type;
13727 int backupClassObjectType;
13728 unsigned int backupByReference;
13729
13730 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
13731 type = e->expType;
13732 else
13733 type = destType;
13734 backupClassObjectType = type->classObjectType;
13735 backupByReference = type->byReference;
13736 type->classObjectType = 0;
13737 type->byReference = 0x0;
13738 typeString[0] = '\0';
13739 PrintType(type, typeString, 0x0, 0x1);
13740 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13741 type->classObjectType = backupClassObjectType;
13742 type->byReference = backupByReference;
13743 *thisExp = *e;
13744 thisExp->prev = (((void *)0));
13745 thisExp->next = (((void *)0));
13746 __ecereMethod_Expression_Clear(e);
13747 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)))
13748 {
13749 e->type = 4;
13750 e->op.op = '*';
13751 e->op.exp1 = (((void *)0));
13752 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
13753 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13754 CopyTypeInto(e->expType, type);
13755 e->expType->byReference = 0x0;
13756 e->expType->refCount = 1;
13757 }
13758 else
13759 {
13760 e->type = 11;
13761 e->cast.typeName = MkTypeName(specs, decl);
13762 e->cast.exp = thisExp;
13763 e->byReference = 0x1;
13764 e->expType = type;
13765 type->refCount++;
13766 }
13767 e->destType = destType;
13768 destType->refCount++;
13769 }
13770 }
13771 }
13772
13773 extern char *  strstr(const char * , const char * );
13774
13775 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
13776
13777 struct __ecereNameSpace__ecere__com__DefinedExpression
13778 {
13779 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
13780 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
13781 char *  name;
13782 char *  value;
13783 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
13784 } __attribute__ ((gcc_struct));
13785
13786 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
13787
13788 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
13789
13790 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char *  string, int *  numBytes);
13791
13792 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
13793
13794 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
13795
13796 extern struct Expression * CopyExpression(struct Expression * exp);
13797
13798 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
13799
13800 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList *  specifiers, struct Declarator * decl);
13801
13802 static void ProcessStatement(struct Statement * stmt);
13803
13804 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
13805
13806 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
13807
13808 extern char *  __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, void * object, ...);
13809
13810 extern char *  sourceFile;
13811
13812 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
13813
13814 void ProcessExpressionType(struct Expression * exp)
13815 {
13816 unsigned int unresolved = 0x0;
13817 struct Location oldyylloc = yylloc;
13818 unsigned int notByReference = 0x0;
13819
13820 if(!exp || exp->expType)
13821 return ;
13822 yylloc = exp->loc;
13823 switch(exp->type)
13824 {
13825 case 0:
13826 {
13827 struct Identifier * id = exp->identifier;
13828
13829 if(!id || !topContext)
13830 return ;
13831 if(id->_class && id->_class->name)
13832 {
13833 id->classSym = id->_class->symbol;
13834 }
13835 if(strstr(id->string, "__ecereClass") == id->string)
13836 {
13837 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
13838 break;
13839 }
13840 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
13841 {
13842 ReplaceClassMembers(exp, thisClass);
13843 if(exp->type != 0)
13844 {
13845 ProcessExpressionType(exp);
13846 break;
13847 }
13848 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
13849 break;
13850 }
13851 else
13852 {
13853 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13854
13855 if(!symbol)
13856 {
13857 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
13858 break;
13859 else
13860 {
13861 if(thisClass)
13862 {
13863 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
13864 if(exp->type != 0)
13865 {
13866 ProcessExpressionType(exp);
13867 break;
13868 }
13869 }
13870 else if(currentClass && !id->_class)
13871 {
13872 if(ResolveIdWithClass(exp, currentClass, 0x1))
13873 break;
13874 }
13875 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13876 }
13877 }
13878 if(symbol)
13879 {
13880 struct Type * type = symbol->type;
13881 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
13882
13883 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
13884 {
13885 struct Context * context = SetupTemplatesContext(_class);
13886
13887 type = ReplaceThisClassType(_class);
13888 FinishTemplatesContext(context);
13889 if(type)
13890 type->refCount = 0;
13891 }
13892 FreeSpecifier(id->_class);
13893 id->_class = (((void *)0));
13894 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13895 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
13896 id->classSym = (((void *)0));
13897 exp->expType = type;
13898 if(type)
13899 type->refCount++;
13900 if(type && (type->kind == 15 || (_class && _class->type == 4)))
13901 exp->isConstant = 0x1;
13902 if(symbol->isParam || !strcmp(id->string, "this"))
13903 {
13904 if(_class && _class->type == 1 && !type->declaredWithStruct)
13905 exp->byReference = 0x1;
13906 }
13907 if(symbol->isIterator)
13908 {
13909 if(symbol->isIterator == 3)
13910 {
13911 exp->type = 5;
13912 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
13913 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
13914 exp->expType = (((void *)0));
13915 ProcessExpressionType(exp);
13916 }
13917 else if(symbol->isIterator != 4)
13918 {
13919 exp->type = 8;
13920 exp->member.exp = MkExpIdentifier(exp->identifier);
13921 exp->member.exp->expType = exp->expType;
13922 exp->member.member = MkIdentifier("data");
13923 exp->expType = (((void *)0));
13924 ProcessExpressionType(exp);
13925 }
13926 }
13927 break;
13928 }
13929 else
13930 {
13931 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
13932
13933 if(thisNameSpace && !(id->_class && !id->_class->name))
13934 {
13935 char name[1024];
13936
13937 strcpy(name, thisNameSpace);
13938 strcat(name, "::");
13939 strcat(name, id->string);
13940 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
13941 }
13942 if(!definedExp)
13943 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
13944 if(definedExp)
13945 {
13946 int c;
13947
13948 for(c = 0; c < definedExpStackPos; c++)
13949 if(definedExpStack[c] == definedExp)
13950 break;
13951 if(c == definedExpStackPos && c < sizeof (definedExpStack) / sizeof(void *))
13952 {
13953 struct Location backupYylloc = yylloc;
13954 struct __ecereNameSpace__ecere__com__Instance * backInput = fileInput;
13955
13956 definedExpStack[definedExpStackPos++] = definedExp;
13957 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13958 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__extension__ ({
13959 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13960
13961 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13962 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
13963 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13964 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13965
13966 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13967 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13968 echoOn = 0x0;
13969 parsedExpression = (((void *)0));
13970 resetScanner();
13971 expression_yyparse();
13972 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13973 if(backInput)
13974 fileInput = backInput;
13975 yylloc = backupYylloc;
13976 if(parsedExpression)
13977 {
13978 FreeIdentifier(id);
13979 exp->type = 5;
13980 exp->list = MkListOne(parsedExpression);
13981 parsedExpression->loc = yylloc;
13982 ProcessExpressionType(exp);
13983 definedExpStackPos--;
13984 return ;
13985 }
13986 definedExpStackPos--;
13987 }
13988 else
13989 {
13990 if(inCompiler)
13991 {
13992 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Recursion in defined expression %s\n", (((void *)0))), id->string);
13993 }
13994 }
13995 }
13996 else
13997 {
13998 struct GlobalData * data = (((void *)0));
13999
14000 if(thisNameSpace && !(id->_class && !id->_class->name))
14001 {
14002 char name[1024];
14003
14004 strcpy(name, thisNameSpace);
14005 strcat(name, "::");
14006 strcat(name, id->string);
14007 data = FindGlobalData(name);
14008 }
14009 if(!data)
14010 data = FindGlobalData(id->string);
14011 if(data)
14012 {
14013 DeclareGlobalData(data);
14014 exp->expType = data->dataType;
14015 if(data->dataType)
14016 data->dataType->refCount++;
14017 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14018 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
14019 FreeSpecifier(id->_class);
14020 id->_class = (((void *)0));
14021 break;
14022 }
14023 else
14024 {
14025 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
14026
14027 if(thisNameSpace && !(id->_class && !id->_class->name))
14028 {
14029 char name[1024];
14030
14031 strcpy(name, thisNameSpace);
14032 strcat(name, "::");
14033 strcat(name, id->string);
14034 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
14035 }
14036 if(!function)
14037 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
14038 if(function)
14039 {
14040 char name[1024];
14041
14042 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14043 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
14044 name[0] = (char)0;
14045 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
14046 strcpy(name, "__ecereFunction_");
14047 FullClassNameCat(name, id->string, 0x0);
14048 if(DeclareFunction(function, name))
14049 {
14050 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14051 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
14052 }
14053 exp->expType = function->dataType;
14054 if(function->dataType)
14055 function->dataType->refCount++;
14056 FreeSpecifier(id->_class);
14057 id->_class = (((void *)0));
14058 break;
14059 }
14060 }
14061 }
14062 }
14063 }
14064 unresolved = 0x1;
14065 break;
14066 }
14067 case 1:
14068 {
14069 struct __ecereNameSpace__ecere__com__Class * _class;
14070
14071 if(!exp->instance->_class)
14072 {
14073 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
14074 {
14075 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
14076 }
14077 }
14078 ProcessInstantiationType(exp->instance);
14079 exp->isConstant = exp->instance->isConstant;
14080 if(exp->instance->_class)
14081 {
14082 exp->expType = MkClassType(exp->instance->_class->name);
14083 }
14084 break;
14085 }
14086 case 2:
14087 {
14088 if(!exp->expType)
14089 {
14090 char * constant = exp->constant;
14091 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
14092
14093 exp->expType = type;
14094 if(constant[0] == '\'')
14095 {
14096 if((int)((unsigned char *)constant)[1] > 127)
14097 {
14098 int nb;
14099 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
14100
14101 if(nb < 2)
14102 ch = constant[1];
14103 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
14104 exp->constant = PrintUInt(ch);
14105 type->kind = 8;
14106 type->_class = FindClass("unichar");
14107 type->isSigned = 0x0;
14108 }
14109 else
14110 {
14111 type->kind = 1;
14112 type->isSigned = 0x1;
14113 }
14114 }
14115 else
14116 {
14117 char * dot = strchr(constant, '.');
14118 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
14119 char * exponent;
14120
14121 if(isHex)
14122 {
14123 exponent = strchr(constant, 'p');
14124 if(!exponent)
14125 exponent = strchr(constant, 'P');
14126 }
14127 else
14128 {
14129 exponent = strchr(constant, 'e');
14130 if(!exponent)
14131 exponent = strchr(constant, 'E');
14132 }
14133 if(dot || exponent)
14134 {
14135 if(strchr(constant, 'f') || strchr(constant, 'F'))
14136 type->kind = 6;
14137 else
14138 type->kind = 7;
14139 type->isSigned = 0x1;
14140 }
14141 else
14142 {
14143 unsigned int isSigned = constant[0] == '-';
14144 char * endP = (((void *)0));
14145 long long i64 = strtoll(constant, &endP, 0);
14146 uint64 ui64 = strtoull(constant, &endP, 0);
14147 unsigned int is64Bit = endP && (!strcmp(endP, "LL") || !strcmp(endP, "ll"));
14148
14149 if(isSigned)
14150 {
14151 if(i64 < (((int)0x80000000)))
14152 is64Bit = 0x1;
14153 }
14154 else
14155 {
14156 if(ui64 > (((int)0x7fffffff)))
14157 {
14158 if(ui64 > (0xffffffff))
14159 {
14160 is64Bit = 0x1;
14161 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
14162 isSigned = 0x1;
14163 }
14164 }
14165 else if(constant[0] != '0' || !constant[1])
14166 isSigned = 0x1;
14167 }
14168 type->kind = is64Bit ? 4 : 3;
14169 type->isSigned = isSigned;
14170 }
14171 }
14172 exp->isConstant = 0x1;
14173 if(exp->destType && exp->destType->kind == 7)
14174 type->kind = 7;
14175 else if(exp->destType && exp->destType->kind == 6)
14176 type->kind = 6;
14177 else if(exp->destType && exp->destType->kind == 4)
14178 type->kind = 4;
14179 }
14180 break;
14181 }
14182 case 3:
14183 {
14184 exp->isConstant = 0x1;
14185 exp->expType = __extension__ ({
14186 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14187
14188 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
14189 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14190
14191 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 1, __ecereInstance1->constant = 0x1, __ecereInstance1->isSigned = 0x1, __ecereInstance1;
14192 }), __ecereInstance2;
14193 });
14194 break;
14195 }
14196 case 13:
14197 case 26:
14198 ProcessExpressionType(exp->_new.size);
14199 exp->expType = __extension__ ({
14200 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14201
14202 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_new.typeName->qualifiers, exp->_new.typeName->declarator), __ecereInstance1;
14203 });
14204 DeclareType(exp->expType->type, 0x0, 0x0);
14205 break;
14206 case 14:
14207 case 27:
14208 ProcessExpressionType(exp->_renew.size);
14209 ProcessExpressionType(exp->_renew.exp);
14210 exp->expType = __extension__ ({
14211 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14212
14213 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_renew.typeName->qualifiers, exp->_renew.typeName->declarator), __ecereInstance1;
14214 });
14215 DeclareType(exp->expType->type, 0x0, 0x0);
14216 break;
14217 case 4:
14218 {
14219 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
14220 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
14221 unsigned int useDestType = 0x0, useSideType = 0x0;
14222 struct Location oldyylloc = yylloc;
14223 unsigned int useSideUnit = 0x0;
14224 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
14225
14226 switch(exp->op.op)
14227 {
14228 case '=':
14229 case MUL_ASSIGN:
14230 case DIV_ASSIGN:
14231 case MOD_ASSIGN:
14232 case ADD_ASSIGN:
14233 case SUB_ASSIGN:
14234 case LEFT_ASSIGN:
14235 case RIGHT_ASSIGN:
14236 case AND_ASSIGN:
14237 case XOR_ASSIGN:
14238 case OR_ASSIGN:
14239 assign = 0x1;
14240 break;
14241 case '!':
14242 break;
14243 case AND_OP:
14244 case OR_OP:
14245 boolOps = 0x1;
14246 boolResult = 0x1;
14247 break;
14248 case EQ_OP:
14249 case '<':
14250 case '>':
14251 case LE_OP:
14252 case GE_OP:
14253 case NE_OP:
14254 boolResult = 0x1;
14255 useSideType = 0x1;
14256 break;
14257 case '+':
14258 case '-':
14259 useSideUnit = 0x1;
14260 case '|':
14261 case '&':
14262 case '^':
14263 case '/':
14264 case '%':
14265 case '*':
14266 if(exp->op.op != '*' || exp->op.exp1)
14267 {
14268 useSideType = 0x1;
14269 useDestType = 0x1;
14270 }
14271 break;
14272 }
14273 if(exp->op.op == '&')
14274 {
14275 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
14276 {
14277 struct Identifier * id = exp->op.exp2->identifier;
14278 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
14279
14280 if(symbol && symbol->isIterator == 2)
14281 {
14282 exp->type = 8;
14283 exp->member.exp = exp->op.exp2;
14284 exp->member.member = MkIdentifier("key");
14285 exp->expType = (((void *)0));
14286 exp->op.exp2->expType = symbol->type;
14287 symbol->type->refCount++;
14288 ProcessExpressionType(exp);
14289 FreeType(dummy);
14290 break;
14291 }
14292 }
14293 }
14294 if(exp->op.exp1)
14295 {
14296 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))
14297 {
14298 if(exp->op.exp1->destType)
14299 FreeType(exp->op.exp1->destType);
14300 exp->op.exp1->destType = exp->destType;
14301 if(exp->destType)
14302 exp->destType->refCount++;
14303 }
14304 else if(!assign)
14305 {
14306 if(exp->op.exp1->destType)
14307 FreeType(exp->op.exp1->destType);
14308 exp->op.exp1->destType = dummy;
14309 dummy->refCount++;
14310 }
14311 if(exp->op.exp1->destType && exp->op.op != '=')
14312 exp->op.exp1->destType->count++;
14313 ProcessExpressionType(exp->op.exp1);
14314 if(exp->op.exp1->destType && exp->op.op != '=')
14315 exp->op.exp1->destType->count--;
14316 if(exp->op.exp1->destType == dummy)
14317 {
14318 FreeType(dummy);
14319 exp->op.exp1->destType = (((void *)0));
14320 }
14321 type1 = exp->op.exp1->expType;
14322 }
14323 if(exp->op.exp2)
14324 {
14325 char expString[10240];
14326
14327 expString[0] = '\0';
14328 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
14329 {
14330 if(exp->op.exp1)
14331 {
14332 exp->op.exp2->destType = exp->op.exp1->expType;
14333 if(exp->op.exp1->expType)
14334 exp->op.exp1->expType->refCount++;
14335 }
14336 else
14337 {
14338 exp->op.exp2->destType = exp->destType;
14339 if(exp->destType)
14340 exp->destType->refCount++;
14341 }
14342 if(type1)
14343 type1->refCount++;
14344 exp->expType = type1;
14345 }
14346 else if(assign)
14347 {
14348 if(inCompiler)
14349 PrintExpression(exp->op.exp2, expString);
14350 if(type1 && type1->kind == 13)
14351 {
14352 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)
14353 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
14354 else if(exp->op.op == '=')
14355 {
14356 if(exp->op.exp2->destType)
14357 FreeType(exp->op.exp2->destType);
14358 exp->op.exp2->destType = type1;
14359 if(type1)
14360 type1->refCount++;
14361 }
14362 }
14363 else
14364 {
14365 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)
14366 ;
14367 else
14368 {
14369 if(exp->op.exp2->destType)
14370 FreeType(exp->op.exp2->destType);
14371 exp->op.exp2->destType = type1;
14372 if(type1)
14373 type1->refCount++;
14374 }
14375 }
14376 if(type1)
14377 type1->refCount++;
14378 exp->expType = type1;
14379 }
14380 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)))
14381 {
14382 if(exp->op.exp2->destType)
14383 FreeType(exp->op.exp2->destType);
14384 exp->op.exp2->destType = exp->destType;
14385 if(exp->destType)
14386 exp->destType->refCount++;
14387 }
14388 else
14389 {
14390 if(exp->op.exp2->destType)
14391 FreeType(exp->op.exp2->destType);
14392 exp->op.exp2->destType = dummy;
14393 dummy->refCount++;
14394 }
14395 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
14396 {
14397 FreeType(exp->op.exp2->destType);
14398 exp->op.exp2->destType = type1;
14399 type1->refCount++;
14400 }
14401 if(exp->op.exp2->destType && exp->op.op != '=')
14402 exp->op.exp2->destType->count++;
14403 if(exp->op.op == SIZEOF)
14404 {
14405 struct Expression * e = exp->op.exp2;
14406
14407 while((e->type == 5 || e->type == 32 || e->type == 23) && e->list)
14408 {
14409 if(e->type == 5 || e->type == 32 || e->type == 23)
14410 {
14411 if(e->type == 23)
14412 e = (*((struct Statement *)(*e->compound->compound.statements).last)->expressions).last;
14413 else
14414 e = (*e->list).last;
14415 }
14416 }
14417 if(e->type == 11 && e->cast.exp)
14418 e->cast.exp->needCast = 0x1;
14419 }
14420 ProcessExpressionType(exp->op.exp2);
14421 if(exp->op.exp2->destType && exp->op.op != '=')
14422 exp->op.exp2->destType->count--;
14423 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
14424 {
14425 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)
14426 {
14427 if(exp->op.op != '=' && type1->type->kind == 0)
14428 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14429 }
14430 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)))
14431 {
14432 if(exp->op.op == ADD_ASSIGN)
14433 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14434 }
14435 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))
14436 {
14437 if(exp->op.op == ADD_ASSIGN)
14438 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14439 }
14440 else if(inCompiler)
14441 {
14442 char type1String[1024];
14443 char type2String[1024];
14444
14445 type1String[0] = '\0';
14446 type2String[0] = '\0';
14447 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
14448 PrintType(type1, type2String, 0x0, 0x1);
14449 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14450 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
14451 }
14452 }
14453 if(exp->op.exp2->destType == dummy)
14454 {
14455 FreeType(dummy);
14456 exp->op.exp2->destType = (((void *)0));
14457 }
14458 if(exp->op.op == '-' && !exp->op.exp1 && exp->op.exp2->expType && !exp->op.exp2->expType->isSigned)
14459 {
14460 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14461 type2->refCount = 1;
14462 CopyTypeInto(type2, exp->op.exp2->expType);
14463 type2->isSigned = 0x1;
14464 }
14465 else if(exp->op.op == '~' && !exp->op.exp1 && exp->op.exp2->expType && (!exp->op.exp2->expType->isSigned || exp->op.exp2->expType->kind != 3))
14466 {
14467 type2 = __extension__ ({
14468 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14469
14470 __ecereInstance1->kind = 3, __ecereInstance1;
14471 });
14472 type2->refCount = 1;
14473 type2->isSigned = 0x1;
14474 }
14475 else
14476 {
14477 type2 = exp->op.exp2->expType;
14478 if(type2)
14479 type2->refCount++;
14480 }
14481 }
14482 dummy->kind = 0;
14483 if(exp->op.op == SIZEOF)
14484 {
14485 exp->expType = __extension__ ({
14486 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14487
14488 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
14489 });
14490 exp->isConstant = 0x1;
14491 }
14492 else if(exp->op.op == '*' && !exp->op.exp1)
14493 {
14494 exp->expType = Dereference(type2);
14495 if(type2 && type2->kind == 8)
14496 notByReference = 0x1;
14497 }
14498 else if(exp->op.op == '&' && !exp->op.exp1)
14499 exp->expType = Reference(type2);
14500 else if(!assign)
14501 {
14502 if(boolOps)
14503 {
14504 if(exp->op.exp1)
14505 {
14506 if(exp->op.exp1->destType)
14507 FreeType(exp->op.exp1->destType);
14508 exp->op.exp1->destType = MkClassType("bool");
14509 exp->op.exp1->destType->truth = 0x1;
14510 if(!exp->op.exp1->expType)
14511 ProcessExpressionType(exp->op.exp1);
14512 else
14513 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14514 FreeType(exp->op.exp1->expType);
14515 exp->op.exp1->expType = MkClassType("bool");
14516 exp->op.exp1->expType->truth = 0x1;
14517 }
14518 if(exp->op.exp2)
14519 {
14520 if(exp->op.exp2->destType)
14521 FreeType(exp->op.exp2->destType);
14522 exp->op.exp2->destType = MkClassType("bool");
14523 exp->op.exp2->destType->truth = 0x1;
14524 if(!exp->op.exp2->expType)
14525 ProcessExpressionType(exp->op.exp2);
14526 else
14527 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14528 FreeType(exp->op.exp2->expType);
14529 exp->op.exp2->expType = MkClassType("bool");
14530 exp->op.exp2->expType->truth = 0x1;
14531 }
14532 }
14533 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")))))
14534 {
14535 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
14536 {
14537 if(exp->op.exp2->destType)
14538 FreeType(exp->op.exp2->destType);
14539 exp->op.exp2->destType = type1;
14540 type1->refCount++;
14541 if(exp->op.exp1->destType)
14542 FreeType(exp->op.exp1->destType);
14543 exp->op.exp1->destType = type2;
14544 type2->refCount++;
14545 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)
14546 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);
14547 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
14548 {
14549 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14550
14551 if(argExp)
14552 {
14553 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14554
14555 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
14556 ProcessExpressionType(exp->op.exp1);
14557 if(type2->kind != 13)
14558 {
14559 ProcessExpressionType(classExp);
14560 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"))))))));
14561 if(!exp->op.exp2->expType)
14562 {
14563 if(type2)
14564 FreeType(type2);
14565 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
14566 type2->refCount++;
14567 }
14568 ProcessExpressionType(exp->op.exp2);
14569 }
14570 }
14571 }
14572 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)))
14573 {
14574 if(type1->kind != 8 && type1->type->kind == 0)
14575 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14576 exp->expType = type1;
14577 if(type1)
14578 type1->refCount++;
14579 }
14580 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)))
14581 {
14582 if(type2->kind != 8 && type2->type->kind == 0)
14583 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14584 exp->expType = type2;
14585 if(type2)
14586 type2->refCount++;
14587 }
14588 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))
14589 {
14590 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "different levels of indirection\n", (((void *)0))));
14591 }
14592 else
14593 {
14594 unsigned int success = 0x0;
14595
14596 if(type1->kind == 13 && type2->kind == 13)
14597 {
14598 if(exp->op.op == '+')
14599 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14600 else if(exp->op.op == '-')
14601 {
14602 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
14603 {
14604 exp->expType = __extension__ ({
14605 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14606
14607 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
14608 });
14609 success = 0x1;
14610 if(type1->type->kind == 20)
14611 {
14612 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14613
14614 if(argExp)
14615 {
14616 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14617
14618 ProcessExpressionType(classExp);
14619 exp->type = 5;
14620 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")))))));
14621 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
14622 FreeType(dummy);
14623 return ;
14624 }
14625 }
14626 }
14627 }
14628 }
14629 if(!success && exp->op.exp1->type == 2)
14630 {
14631 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14632 {
14633 if(exp->expType)
14634 FreeType(exp->expType);
14635 exp->expType = exp->op.exp1->destType;
14636 if(exp->op.exp1->destType)
14637 exp->op.exp1->destType->refCount++;
14638 success = 0x1;
14639 }
14640 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14641 {
14642 if(exp->expType)
14643 FreeType(exp->expType);
14644 exp->expType = exp->op.exp2->destType;
14645 if(exp->op.exp2->destType)
14646 exp->op.exp2->destType->refCount++;
14647 success = 0x1;
14648 }
14649 }
14650 else if(!success)
14651 {
14652 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14653 {
14654 if(exp->expType)
14655 FreeType(exp->expType);
14656 exp->expType = exp->op.exp2->destType;
14657 if(exp->op.exp2->destType)
14658 exp->op.exp2->destType->refCount++;
14659 success = 0x1;
14660 }
14661 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14662 {
14663 if(exp->expType)
14664 FreeType(exp->expType);
14665 exp->expType = exp->op.exp1->destType;
14666 if(exp->op.exp1->destType)
14667 exp->op.exp1->destType->refCount++;
14668 success = 0x1;
14669 }
14670 }
14671 if(!success)
14672 {
14673 char expString1[10240];
14674 char expString2[10240];
14675 char type1[1024];
14676 char type2[1024];
14677
14678 expString1[0] = '\0';
14679 expString2[0] = '\0';
14680 type1[0] = '\0';
14681 type2[0] = '\0';
14682 if(inCompiler)
14683 {
14684 PrintExpression(exp->op.exp1, expString1);
14685 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
14686 PrintExpression(exp->op.exp2, expString2);
14687 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
14688 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
14689 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
14690 }
14691 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
14692 }
14693 }
14694 }
14695 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
14696 {
14697 if(exp->op.exp1->destType)
14698 FreeType(exp->op.exp1->destType);
14699 exp->op.exp1->destType = type2->_class->registered->dataType;
14700 if(type2->_class->registered->dataType)
14701 type2->_class->registered->dataType->refCount++;
14702 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14703 exp->expType = type2;
14704 if(type2)
14705 type2->refCount++;
14706 }
14707 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
14708 {
14709 if(exp->op.exp2->destType)
14710 FreeType(exp->op.exp2->destType);
14711 exp->op.exp2->destType = type1->_class->registered->dataType;
14712 if(type1->_class->registered->dataType)
14713 type1->_class->registered->dataType->refCount++;
14714 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14715 exp->expType = type1;
14716 if(type1)
14717 type1->refCount++;
14718 }
14719 else if(type1)
14720 {
14721 unsigned int valid = 0x0;
14722
14723 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
14724 {
14725 if(exp->op.exp2->destType)
14726 FreeType(exp->op.exp2->destType);
14727 if(!type1->_class->registered->dataType)
14728 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
14729 exp->op.exp2->destType = type1->_class->registered->dataType;
14730 exp->op.exp2->destType->refCount++;
14731 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14732 if(type2)
14733 FreeType(type2);
14734 type2 = exp->op.exp2->destType;
14735 if(type2)
14736 type2->refCount++;
14737 exp->expType = type2;
14738 type2->refCount++;
14739 }
14740 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
14741 {
14742 if(exp->op.exp1->destType)
14743 FreeType(exp->op.exp1->destType);
14744 if(!type2->_class->registered->dataType)
14745 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
14746 exp->op.exp1->destType = type2->_class->registered->dataType;
14747 exp->op.exp1->destType->refCount++;
14748 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14749 type1 = exp->op.exp1->destType;
14750 exp->expType = type1;
14751 type1->refCount++;
14752 }
14753 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
14754 {
14755 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
14756 {
14757 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
14758 {
14759 if(exp->expType)
14760 FreeType(exp->expType);
14761 exp->expType = exp->op.exp1->expType;
14762 if(exp->op.exp2->expType)
14763 exp->op.exp1->expType->refCount++;
14764 valid = 0x1;
14765 }
14766 }
14767 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
14768 {
14769 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
14770 {
14771 if(exp->expType)
14772 FreeType(exp->expType);
14773 exp->expType = exp->op.exp2->expType;
14774 if(exp->op.exp2->expType)
14775 exp->op.exp2->expType->refCount++;
14776 valid = 0x1;
14777 }
14778 }
14779 }
14780 if(!valid)
14781 {
14782 if(exp->op.exp2->destType)
14783 FreeType(exp->op.exp2->destType);
14784 exp->op.exp2->destType = type1;
14785 type1->refCount++;
14786 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14787 {
14788 if(exp->expType)
14789 FreeType(exp->expType);
14790 exp->expType = exp->op.exp2->destType;
14791 if(exp->op.exp2->destType)
14792 exp->op.exp2->destType->refCount++;
14793 }
14794 else if(type1 && type2)
14795 {
14796 char expString1[10240];
14797 char expString2[10240];
14798 char type1String[1024];
14799 char type2String[1024];
14800
14801 expString1[0] = '\0';
14802 expString2[0] = '\0';
14803 type1String[0] = '\0';
14804 type2String[0] = '\0';
14805 if(inCompiler)
14806 {
14807 PrintExpression(exp->op.exp1, expString1);
14808 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
14809 PrintExpression(exp->op.exp2, expString2);
14810 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
14811 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
14812 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
14813 }
14814 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
14815 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
14816 {
14817 exp->expType = exp->op.exp1->expType;
14818 if(exp->op.exp1->expType)
14819 exp->op.exp1->expType->refCount++;
14820 }
14821 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
14822 {
14823 exp->expType = exp->op.exp2->expType;
14824 if(exp->op.exp2->expType)
14825 exp->op.exp2->expType->refCount++;
14826 }
14827 }
14828 }
14829 }
14830 else if(type2)
14831 {
14832 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
14833 {
14834 struct Type * oldType = exp->op.exp1->expType;
14835
14836 exp->op.exp1->expType = (((void *)0));
14837 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14838 FreeType(oldType);
14839 else
14840 exp->op.exp1->expType = oldType;
14841 }
14842 if(exp->op.exp1->destType)
14843 FreeType(exp->op.exp1->destType);
14844 exp->op.exp1->destType = type2;
14845 type2->refCount++;
14846 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14847 {
14848 if(exp->expType)
14849 FreeType(exp->expType);
14850 exp->expType = exp->op.exp1->destType;
14851 if(exp->op.exp1->destType)
14852 exp->op.exp1->destType->refCount++;
14853 }
14854 }
14855 }
14856 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
14857 {
14858 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
14859 {
14860 if(exp->op.exp1->destType)
14861 FreeType(exp->op.exp1->destType);
14862 exp->op.exp1->destType = type2->_class->registered->dataType;
14863 if(type2->_class->registered->dataType)
14864 type2->_class->registered->dataType->refCount++;
14865 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14866 }
14867 if(exp->op.op == '!')
14868 {
14869 exp->expType = MkClassType("bool");
14870 exp->expType->truth = 0x1;
14871 }
14872 else
14873 {
14874 exp->expType = type2;
14875 if(type2)
14876 type2->refCount++;
14877 }
14878 }
14879 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
14880 {
14881 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
14882 {
14883 if(exp->op.exp2->destType)
14884 FreeType(exp->op.exp2->destType);
14885 exp->op.exp2->destType = type1->_class->registered->dataType;
14886 if(type1->_class->registered->dataType)
14887 type1->_class->registered->dataType->refCount++;
14888 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14889 }
14890 exp->expType = type1;
14891 if(type1)
14892 type1->refCount++;
14893 }
14894 }
14895 yylloc = exp->loc;
14896 if(exp->op.exp1 && !exp->op.exp1->expType)
14897 {
14898 char expString[10000];
14899
14900 expString[0] = '\0';
14901 if(inCompiler)
14902 {
14903 PrintExpression(exp->op.exp1, expString);
14904 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14905 }
14906 if(expString[0])
14907 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
14908 }
14909 if(exp->op.exp2 && !exp->op.exp2->expType)
14910 {
14911 char expString[10240];
14912
14913 expString[0] = '\0';
14914 if(inCompiler)
14915 {
14916 PrintExpression(exp->op.exp2, expString);
14917 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14918 }
14919 if(expString[0])
14920 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
14921 }
14922 if(boolResult)
14923 {
14924 FreeType(exp->expType);
14925 exp->expType = MkClassType("bool");
14926 exp->expType->truth = 0x1;
14927 }
14928 if(exp->op.op != SIZEOF)
14929 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
14930 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
14931 {
14932 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
14933 }
14934 yylloc = oldyylloc;
14935 FreeType(dummy);
14936 if(type2)
14937 FreeType(type2);
14938 break;
14939 }
14940 case 5:
14941 case 32:
14942 {
14943 struct Expression * e;
14944
14945 exp->isConstant = 0x1;
14946 for(e = (*exp->list).first; e; e = e->next)
14947 {
14948 unsigned int inced = 0x0;
14949
14950 if(!e->next)
14951 {
14952 FreeType(e->destType);
14953 e->destType = exp->destType;
14954 if(e->destType)
14955 {
14956 exp->destType->refCount++;
14957 e->destType->count++;
14958 inced = 0x1;
14959 }
14960 }
14961 ProcessExpressionType(e);
14962 if(inced)
14963 exp->destType->count--;
14964 if(!exp->expType && !e->next)
14965 {
14966 exp->expType = e->expType;
14967 if(e->expType)
14968 e->expType->refCount++;
14969 }
14970 if(!e->isConstant)
14971 exp->isConstant = 0x0;
14972 }
14973 e = (*exp->list).first;
14974 if(!e->next && e->type == 8)
14975 {
14976 struct Expression * next = exp->next, * prev = exp->prev;
14977
14978 FreeType(exp->expType);
14979 FreeType(exp->destType);
14980 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14981 *exp = *e;
14982 exp->prev = prev;
14983 exp->next = next;
14984 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
14985 ProcessExpressionType(exp);
14986 }
14987 break;
14988 }
14989 case 6:
14990 {
14991 struct Expression * e;
14992
14993 exp->isConstant = 0x1;
14994 ProcessExpressionType(exp->index.exp);
14995 if(!exp->index.exp->isConstant)
14996 exp->isConstant = 0x0;
14997 if(exp->index.exp->expType)
14998 {
14999 struct Type * source = exp->index.exp->expType;
15000
15001 if(source->kind == 8 && source->_class && source->_class->registered)
15002 {
15003 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
15004 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
15005
15006 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
15007 {
15008 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
15009 if(exp->index.index && (*exp->index.index).last)
15010 {
15011 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
15012 }
15013 }
15014 }
15015 }
15016 for(e = (*exp->index.index).first; e; e = e->next)
15017 {
15018 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
15019 {
15020 if(e->destType)
15021 FreeType(e->destType);
15022 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
15023 }
15024 ProcessExpressionType(e);
15025 if(!e->next)
15026 {
15027 }
15028 if(!e->isConstant)
15029 exp->isConstant = 0x0;
15030 }
15031 if(!exp->expType)
15032 exp->expType = Dereference(exp->index.exp->expType);
15033 if(exp->expType)
15034 DeclareType(exp->expType, 0x0, 0x0);
15035 break;
15036 }
15037 case 7:
15038 {
15039 struct Expression * e;
15040 struct Type * functionType;
15041 struct Type * methodType = (((void *)0));
15042 char name[1024];
15043
15044 name[0] = '\0';
15045 if(inCompiler)
15046 {
15047 PrintExpression(exp->call.exp, name);
15048 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
15049 {
15050 PrintExpression(exp->call.exp, name);
15051 }
15052 }
15053 if(exp->call.exp->type == 0)
15054 {
15055 struct Expression * idExp = exp->call.exp;
15056 struct Identifier * id = idExp->identifier;
15057
15058 if(!strcmp(id->string, "__builtin_frame_address"))
15059 {
15060 exp->expType = ProcessTypeString("void *", 0x1);
15061 if(exp->call.arguments && (*exp->call.arguments).first)
15062 ProcessExpressionType((*exp->call.arguments).first);
15063 break;
15064 }
15065 else if(!strcmp(id->string, "__ENDIAN_PAD"))
15066 {
15067 exp->expType = ProcessTypeString("int", 0x1);
15068 if(exp->call.arguments && (*exp->call.arguments).first)
15069 ProcessExpressionType((*exp->call.arguments).first);
15070 break;
15071 }
15072 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
15073 {
15074 struct Expression * a = (((void *)0));
15075 struct Expression * b = (((void *)0));
15076 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
15077
15078 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
15079 {
15080 a = (*exp->call.arguments).first;
15081 b = (*exp->call.arguments).last;
15082 tempExp1 = a;
15083 tempExp2 = b;
15084 }
15085 else if((*exp->call.arguments).count == 1)
15086 {
15087 a = (*exp->call.arguments).first;
15088 tempExp1 = a;
15089 }
15090 if(a)
15091 {
15092 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
15093 idExp->identifier = (((void *)0));
15094 FreeExpContents(exp);
15095 ProcessExpressionType(a);
15096 if(b)
15097 ProcessExpressionType(b);
15098 exp->type = 5;
15099 exp->list = MkList();
15100 if(a->expType && (!b || b->expType))
15101 {
15102 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
15103 {
15104 if(inCompiler)
15105 {
15106 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15107 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
15108 struct Declaration * decl;
15109 char temp1[1024], temp2[1024];
15110
15111 GetTypeSpecs(a->expType, specs);
15112 if(a && !a->isConstant && a->type != 0)
15113 {
15114 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
15115 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
15116 tempExp1 = QMkExpId(temp1);
15117 tempExp1->expType = a->expType;
15118 if(a->expType)
15119 a->expType->refCount++;
15120 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
15121 }
15122 if(b && !b->isConstant && b->type != 0)
15123 {
15124 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
15125 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
15126 tempExp2 = QMkExpId(temp2);
15127 tempExp2->expType = b->expType;
15128 if(b->expType)
15129 b->expType->refCount++;
15130 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
15131 }
15132 decl = MkDeclaration(specs, decls);
15133 if(!curCompound->compound.declarations)
15134 curCompound->compound.declarations = MkList();
15135 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
15136 }
15137 }
15138 }
15139 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
15140 {
15141 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
15142
15143 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
15144 exp->expType = a->expType;
15145 if(a->expType)
15146 a->expType->refCount++;
15147 }
15148 else if(!strcmp(id->string, "Abs"))
15149 {
15150 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
15151 exp->expType = a->expType;
15152 if(a->expType)
15153 a->expType->refCount++;
15154 }
15155 else if(!strcmp(id->string, "Sgn"))
15156 {
15157 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"))))));
15158 exp->expType = ProcessTypeString("int", 0x0);
15159 }
15160 FreeExpression(tempExp1);
15161 if(tempExp2)
15162 FreeExpression(tempExp2);
15163 FreeIdentifier(id);
15164 break;
15165 }
15166 }
15167 }
15168 {
15169 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
15170
15171 if(!exp->call.exp->destType)
15172 {
15173 exp->call.exp->destType = dummy;
15174 dummy->refCount++;
15175 }
15176 ProcessExpressionType(exp->call.exp);
15177 if(exp->call.exp->destType == dummy)
15178 {
15179 FreeType(dummy);
15180 exp->call.exp->destType = (((void *)0));
15181 }
15182 FreeType(dummy);
15183 }
15184 functionType = exp->call.exp->expType;
15185 if(functionType && functionType->kind == 16)
15186 {
15187 methodType = functionType;
15188 functionType = methodType->method->dataType;
15189 if(exp->call.exp->expType->usedClass)
15190 {
15191 char typeString[1024];
15192
15193 typeString[0] = '\0';
15194 {
15195 struct Symbol * back = functionType->thisClass;
15196
15197 functionType->thisClass = (((void *)0));
15198 PrintType(functionType, typeString, 0x1, 0x1);
15199 functionType->thisClass = back;
15200 }
15201 if(strstr(typeString, "thisclass"))
15202 {
15203 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15204 struct Declarator * decl;
15205
15206 {
15207 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
15208
15209 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
15210 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
15211 thisClassParams = 0x0;
15212 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
15213 {
15214 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
15215
15216 thisClass = exp->call.exp->expType->usedClass;
15217 ProcessDeclarator(decl);
15218 thisClass = backupThisClass;
15219 }
15220 thisClassParams = 0x1;
15221 functionType = ProcessType(specs, decl);
15222 functionType->refCount = 0;
15223 FinishTemplatesContext(context);
15224 }
15225 FreeList(specs, FreeSpecifier);
15226 FreeDeclarator(decl);
15227 }
15228 }
15229 }
15230 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
15231 {
15232 struct Type * type = functionType->type;
15233
15234 if(!functionType->refCount)
15235 {
15236 functionType->type = (((void *)0));
15237 FreeType(functionType);
15238 }
15239 functionType = type;
15240 }
15241 if(functionType && functionType->kind != 11)
15242 {
15243 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "called object %s is not a function\n", (((void *)0))), name);
15244 }
15245 else if(functionType)
15246 {
15247 unsigned int emptyParams = 0x0, noParams = 0x0;
15248 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
15249 struct Type * type = functionType->params.first;
15250 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
15251 int extra = 0;
15252 struct Location oldyylloc = yylloc;
15253
15254 if(!type)
15255 emptyParams = 0x1;
15256 if(functionType->extraParam && e && functionType->thisClass)
15257 {
15258 e->destType = MkClassType(functionType->thisClass->string);
15259 e = e->next;
15260 }
15261 if(!functionType->staticMethod && !functionType->extraParam)
15262 {
15263 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
15264 {
15265 type = MkClassType(memberExp->member.exp->expType->_class->string);
15266 if(e)
15267 {
15268 e->destType = type;
15269 e = e->next;
15270 type = functionType->params.first;
15271 }
15272 else
15273 type->refCount = 0;
15274 }
15275 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
15276 {
15277 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
15278 type->byReference = functionType->byReference;
15279 type->typedByReference = functionType->typedByReference;
15280 if(e)
15281 {
15282 if(e->next && type->kind == 8 && (functionType && functionType->thisClass) && functionType->classObjectType == 2)
15283 e = e->next;
15284 e->destType = type;
15285 e = e->next;
15286 type = functionType->params.first;
15287 }
15288 else
15289 type->refCount = 0;
15290 }
15291 }
15292 if(type && type->kind == 0)
15293 {
15294 noParams = 0x1;
15295 if(!type->refCount)
15296 FreeType(type);
15297 type = (((void *)0));
15298 }
15299 for(; e; e = e->next)
15300 {
15301 if(!type && !emptyParams)
15302 {
15303 yylloc = e->loc;
15304 if(methodType && methodType->methodClass)
15305 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);
15306 else
15307 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);
15308 break;
15309 }
15310 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
15311 {
15312 struct Type * templatedType = (((void *)0));
15313 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
15314 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15315 int id = 0;
15316
15317 if(_class && _class->templateArgs)
15318 {
15319 struct __ecereNameSpace__ecere__com__Class * sClass;
15320
15321 for(sClass = _class; sClass; sClass = sClass->base)
15322 {
15323 if(sClass->templateClass)
15324 sClass = sClass->templateClass;
15325 id = 0;
15326 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15327 {
15328 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
15329 {
15330 struct __ecereNameSpace__ecere__com__Class * nextClass;
15331
15332 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15333 {
15334 if(nextClass->templateClass)
15335 nextClass = nextClass->templateClass;
15336 id += nextClass->templateParams.count;
15337 }
15338 break;
15339 }
15340 id++;
15341 }
15342 if(curParam)
15343 break;
15344 }
15345 }
15346 if(curParam && _class->templateArgs[id].dataTypeString)
15347 {
15348 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
15349
15350 {
15351 struct Context * context = SetupTemplatesContext(_class);
15352
15353 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
15354 FinishTemplatesContext(context);
15355 }
15356 e->destType = templatedType;
15357 if(templatedType)
15358 {
15359 templatedType->passAsTemplate = 0x1;
15360 }
15361 }
15362 else
15363 {
15364 e->destType = type;
15365 if(type)
15366 type->refCount++;
15367 }
15368 }
15369 else
15370 {
15371 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
15372 {
15373 e->destType = type->prev;
15374 e->destType->refCount++;
15375 }
15376 else
15377 {
15378 e->destType = type;
15379 if(type)
15380 type->refCount++;
15381 }
15382 }
15383 if(type && type->kind != 14)
15384 {
15385 struct Type * next = type->next;
15386
15387 if(!type->refCount)
15388 FreeType(type);
15389 type = next;
15390 }
15391 }
15392 if(type && type->kind != 14)
15393 {
15394 if(methodType && methodType->methodClass)
15395 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);
15396 else
15397 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);
15398 }
15399 yylloc = oldyylloc;
15400 if(type && !type->refCount)
15401 FreeType(type);
15402 }
15403 else
15404 {
15405 functionType = __extension__ ({
15406 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15407
15408 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
15409 });
15410 if(exp->call.exp->type == 0)
15411 {
15412 char * string = exp->call.exp->identifier->string;
15413
15414 if(inCompiler)
15415 {
15416 struct Symbol * symbol;
15417 struct Location oldyylloc = yylloc;
15418
15419 yylloc = exp->call.exp->identifier->loc;
15420 if(strstr(string, "__builtin_") == string)
15421 {
15422 if(exp->destType)
15423 {
15424 functionType->returnType = exp->destType;
15425 exp->destType->refCount++;
15426 }
15427 }
15428 else
15429 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s undefined; assuming extern returning int\n", (((void *)0))), string);
15430 symbol = __extension__ ({
15431 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
15432
15433 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 0x1), __ecereInstance1;
15434 });
15435 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
15436 if(strstr(symbol->string, "::"))
15437 globalContext->hasNameSpace = 0x1;
15438 yylloc = oldyylloc;
15439 }
15440 }
15441 else if(exp->call.exp->type == 8)
15442 {
15443 }
15444 else
15445 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "callable object undefined; extern assuming returning int\n", (((void *)0))));
15446 if(!functionType->returnType)
15447 {
15448 functionType->returnType = __extension__ ({
15449 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15450
15451 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15452 });
15453 }
15454 }
15455 if(functionType && functionType->kind == 11)
15456 {
15457 exp->expType = functionType->returnType;
15458 if(functionType->returnType)
15459 functionType->returnType->refCount++;
15460 if(!functionType->refCount)
15461 FreeType(functionType);
15462 }
15463 if(exp->call.arguments)
15464 {
15465 for(e = (*exp->call.arguments).first; e; e = e->next)
15466 {
15467 struct Type * destType = e->destType;
15468
15469 ProcessExpressionType(e);
15470 }
15471 }
15472 break;
15473 }
15474 case 8:
15475 {
15476 struct Type * type;
15477 struct Location oldyylloc = yylloc;
15478 unsigned int thisPtr;
15479 struct Expression * checkExp = exp->member.exp;
15480
15481 while(checkExp)
15482 {
15483 if(checkExp->type == 11)
15484 checkExp = checkExp->cast.exp;
15485 else if(checkExp->type == 5)
15486 checkExp = checkExp->list ? (*checkExp->list).first : (((void *)0));
15487 else
15488 break;
15489 }
15490 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->identifier->string, "this"));
15491 exp->thisPtr = thisPtr;
15492 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
15493 {
15494 exp->member.member->classSym = exp->member.member->_class->symbol;
15495 }
15496 ProcessExpressionType(exp->member.exp);
15497 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)
15498 {
15499 exp->isConstant = 0x0;
15500 }
15501 else
15502 exp->isConstant = exp->member.exp->isConstant;
15503 type = exp->member.exp->expType;
15504 yylloc = exp->loc;
15505 if(type && (type->kind == 20))
15506 {
15507 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
15508 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
15509
15510 if(_class)
15511 {
15512 for(param = _class->templateParams.first; param; param = param->next)
15513 {
15514 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
15515 break;
15516 }
15517 }
15518 if(param && param->defaultArg.member)
15519 {
15520 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
15521
15522 if(argExp)
15523 {
15524 struct Expression * expMember = exp->member.exp;
15525 struct Declarator * decl;
15526 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15527 char thisClassTypeString[1024];
15528
15529 FreeIdentifier(exp->member.member);
15530 ProcessExpressionType(argExp);
15531 {
15532 char * colon = strstr(param->defaultArg.memberString, "::");
15533
15534 if(colon)
15535 {
15536 char className[1024];
15537 struct __ecereNameSpace__ecere__com__Class * sClass;
15538
15539 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
15540 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
15541 }
15542 else
15543 strcpy(thisClassTypeString, _class->fullName);
15544 }
15545 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
15546 exp->expType = ProcessType(specs, decl);
15547 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
15548 {
15549 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
15550 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
15551 int c;
15552 int paramCount = 0;
15553 int lastParam = -1;
15554 char templateString[1024];
15555 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
15556
15557 sprintf(templateString, "%s<", expClass->templateClass->fullName);
15558 for(cClass = expClass; cClass; cClass = cClass->base)
15559 {
15560 int p = 0;
15561
15562 for(param = cClass->templateParams.first; param; param = param->next)
15563 {
15564 int id = p;
15565 struct __ecereNameSpace__ecere__com__Class * sClass;
15566 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
15567
15568 for(sClass = cClass->base; sClass; sClass = sClass->base)
15569 id += sClass->templateParams.count;
15570 arg = expClass->templateArgs[id];
15571 for(sClass = _class; sClass; sClass = sClass->base)
15572 {
15573 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
15574 int p = 0;
15575 struct __ecereNameSpace__ecere__com__Class * nextClass;
15576
15577 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15578 p += nextClass->templateParams.count;
15579 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
15580 {
15581 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
15582 {
15583 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15584 {
15585 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
15586 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
15587 break;
15588 }
15589 }
15590 }
15591 }
15592 {
15593 char argument[256];
15594
15595 argument[0] = '\0';
15596 switch(param->type)
15597 {
15598 case 2:
15599 {
15600 char expString[1024];
15601 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15602 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
15603 struct Expression * exp;
15604 char * string = PrintHexUInt64(arg.expression.ui64);
15605
15606 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
15607 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
15608 ProcessExpressionType(exp);
15609 ComputeExpression(exp);
15610 expString[0] = '\0';
15611 PrintExpression(exp, expString);
15612 strcat(argument, expString);
15613 FreeExpression(exp);
15614 break;
15615 }
15616 case 1:
15617 {
15618 strcat(argument, arg.member->name);
15619 break;
15620 }
15621 case 0:
15622 {
15623 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15624 {
15625 if(!strcmp(arg.dataTypeString, "thisclass"))
15626 strcat(argument, thisClassTypeString);
15627 else
15628 strcat(argument, arg.dataTypeString);
15629 }
15630 break;
15631 }
15632 }
15633 if(argument[0])
15634 {
15635 if(paramCount)
15636 strcat(templateString, ", ");
15637 if(lastParam != p - 1)
15638 {
15639 strcat(templateString, param->name);
15640 strcat(templateString, " = ");
15641 }
15642 strcat(templateString, argument);
15643 paramCount++;
15644 lastParam = p;
15645 }
15646 p++;
15647 }
15648 }
15649 }
15650 {
15651 int len = strlen(templateString);
15652
15653 if(templateString[len - 1] == '>')
15654 templateString[len++] = ' ';
15655 templateString[len++] = '>';
15656 templateString[len++] = '\0';
15657 }
15658 {
15659 struct Context * context = SetupTemplatesContext(_class);
15660
15661 FreeType(exp->expType);
15662 exp->expType = ProcessTypeString(templateString, 0x0);
15663 FinishTemplatesContext(context);
15664 }
15665 }
15666 exp->type = 5;
15667 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")))))))));
15668 }
15669 }
15670 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
15671 {
15672 type = ProcessTemplateParameterType(type->templateParameter);
15673 }
15674 }
15675 if(type && (type->kind == 20))
15676 ;
15677 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)))
15678 {
15679 struct Identifier * id = exp->member.member;
15680 int typeKind = type->kind;
15681 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));
15682
15683 if(typeKind == 19 && exp->member.exp->type == 24)
15684 {
15685 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
15686 typeKind = 8;
15687 }
15688 if(id)
15689 {
15690 if(typeKind == 3 || typeKind == 15)
15691 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
15692 else if(!_class)
15693 {
15694 if(type->kind == 8 && type->_class && type->_class->registered)
15695 {
15696 _class = type->_class->registered;
15697 }
15698 else if((type->kind == 12 || type->kind == 13) && type->type && type->type->kind == 1)
15699 {
15700 _class = FindClass("char *")->registered;
15701 }
15702 else if(type->kind == 13)
15703 {
15704 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
15705 FreeType(exp->expType);
15706 exp->expType = ProcessTypeString("uintptr", 0x0);
15707 exp->byReference = 0x1;
15708 }
15709 else
15710 {
15711 char string[1024] = "";
15712 struct Symbol * classSym;
15713
15714 PrintTypeNoConst(type, string, 0x0, 0x1);
15715 classSym = FindClass(string);
15716 if(classSym)
15717 _class = classSym->registered;
15718 }
15719 }
15720 }
15721 if(_class && id)
15722 {
15723 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
15724 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
15725 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
15726 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
15727 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
15728
15729 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
15730 exp->member.memberType = 1;
15731 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
15732 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
15733 if(typeKind != 19)
15734 {
15735 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
15736 {
15737 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
15738 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
15739 {
15740 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15741 if(prop)
15742 member = (((void *)0));
15743 }
15744 if(!member && !prop)
15745 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15746 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
15747 exp->member.thisPtr = 0x1;
15748 }
15749 else
15750 {
15751 if(!id->classSym)
15752 {
15753 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
15754 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
15755 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
15756 }
15757 if(!prop && !member)
15758 {
15759 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
15760 if(!method)
15761 {
15762 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15763 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
15764 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
15765 }
15766 }
15767 if(member && prop)
15768 {
15769 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
15770 prop = (((void *)0));
15771 else
15772 member = (((void *)0));
15773 }
15774 }
15775 }
15776 if(!prop && !member && !method)
15777 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
15778 if(!prop && !member && !method)
15779 {
15780 if(typeKind == 19)
15781 {
15782 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
15783 if(classProp)
15784 {
15785 exp->member.memberType = 5;
15786 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
15787 }
15788 else
15789 {
15790 char structName[1024];
15791 struct Identifier * id = exp->member.member;
15792 struct Expression * classExp = exp->member.exp;
15793
15794 type->refCount++;
15795 FreeType(classExp->expType);
15796 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
15797 strcpy(structName, "__ecereClassData_");
15798 FullClassNameCat(structName, type->_class->string, 0x0);
15799 exp->type = 9;
15800 exp->member.member = id;
15801 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"))))))));
15802 FreeType(type);
15803 ProcessExpressionType(exp);
15804 return ;
15805 }
15806 }
15807 else
15808 {
15809 struct Symbol * classSym = FindClass(id->string);
15810
15811 if(classSym)
15812 {
15813 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
15814
15815 if(convertClass)
15816 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
15817 }
15818 }
15819 }
15820 if(prop)
15821 {
15822 exp->member.memberType = 1;
15823 if(!prop->dataType)
15824 ProcessPropertyType(prop);
15825 exp->expType = prop->dataType;
15826 if(prop->dataType)
15827 prop->dataType->refCount++;
15828 }
15829 else if(member)
15830 {
15831 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
15832 {
15833 FreeExpContents(exp);
15834 exp->type = 0;
15835 exp->identifier = MkIdentifier("class");
15836 ProcessExpressionType(exp);
15837 return ;
15838 }
15839 exp->member.memberType = 3;
15840 DeclareStruct(_class->fullName, 0x0);
15841 if(!member->dataType)
15842 {
15843 struct Context * context = SetupTemplatesContext(_class);
15844
15845 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
15846 FinishTemplatesContext(context);
15847 }
15848 exp->expType = member->dataType;
15849 if(member->dataType)
15850 member->dataType->refCount++;
15851 }
15852 else if(revConvert)
15853 {
15854 exp->member.memberType = 4;
15855 exp->expType = MkClassType(revConvert->_class->fullName);
15856 }
15857 else if(method)
15858 {
15859 {
15860 exp->member.memberType = 2;
15861 }
15862 if(!method->dataType)
15863 ProcessMethodType(method);
15864 exp->expType = __extension__ ({
15865 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15866
15867 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1;
15868 });
15869 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
15870 exp->expType->usedClass = _class;
15871 }
15872 else if(!classProp)
15873 {
15874 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
15875 {
15876 FreeExpContents(exp);
15877 exp->type = 0;
15878 exp->identifier = MkIdentifier("class");
15879 FreeType(exp->expType);
15880 exp->expType = MkClassType("ecere::com::Class");
15881 return ;
15882 }
15883 yylloc = exp->member.member->loc;
15884 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
15885 if(inCompiler)
15886 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
15887 }
15888 if(_class && exp->expType)
15889 {
15890 struct __ecereNameSpace__ecere__com__Class * tClass;
15891
15892 tClass = _class;
15893 while(tClass && !tClass->templateClass)
15894 tClass = tClass->base;
15895 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
15896 {
15897 int id = 0;
15898 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15899 struct __ecereNameSpace__ecere__com__Class * sClass;
15900
15901 for(sClass = tClass; sClass; sClass = sClass->base)
15902 {
15903 id = 0;
15904 if(sClass->templateClass)
15905 sClass = sClass->templateClass;
15906 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15907 {
15908 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
15909 {
15910 for(sClass = sClass->base; sClass; sClass = sClass->base)
15911 id += sClass->templateParams.count;
15912 break;
15913 }
15914 id++;
15915 }
15916 if(curParam)
15917 break;
15918 }
15919 if(curParam && tClass->templateArgs[id].dataTypeString)
15920 {
15921 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
15922 struct Context * context = SetupTemplatesContext(tClass);
15923
15924 FreeType(exp->expType);
15925 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
15926 if(exp->expType)
15927 {
15928 if(exp->expType->kind == 21)
15929 {
15930 FreeType(exp->expType);
15931 exp->expType = ReplaceThisClassType(_class);
15932 }
15933 if(tClass->templateClass)
15934 exp->expType->passAsTemplate = 0x1;
15935 if(!exp->destType)
15936 {
15937 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
15938 if(exp->destType->kind == 21)
15939 {
15940 FreeType(exp->destType);
15941 exp->destType = ReplaceThisClassType(_class);
15942 }
15943 }
15944 }
15945 FinishTemplatesContext(context);
15946 }
15947 }
15948 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
15949 {
15950 int id = 0;
15951 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15952 struct __ecereNameSpace__ecere__com__Class * sClass;
15953
15954 for(sClass = tClass; sClass; sClass = sClass->base)
15955 {
15956 id = 0;
15957 if(sClass->templateClass)
15958 sClass = sClass->templateClass;
15959 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15960 {
15961 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
15962 {
15963 for(sClass = sClass->base; sClass; sClass = sClass->base)
15964 id += sClass->templateParams.count;
15965 break;
15966 }
15967 id++;
15968 }
15969 if(curParam)
15970 break;
15971 }
15972 if(curParam)
15973 {
15974 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
15975 struct Context * context = SetupTemplatesContext(tClass);
15976 struct Type * basicType;
15977
15978 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
15979 if(basicType)
15980 {
15981 if(basicType->kind == 21)
15982 {
15983 FreeType(basicType);
15984 basicType = ReplaceThisClassType(_class);
15985 }
15986 FreeType(exp->expType);
15987 exp->expType = __extension__ ({
15988 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15989
15990 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = basicType, __ecereInstance1;
15991 });
15992 if(!exp->destType)
15993 {
15994 exp->destType = exp->expType;
15995 exp->destType->refCount++;
15996 }
15997 {
15998 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
15999 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16000 struct Declarator * decl;
16001
16002 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
16003 *newExp = *exp;
16004 if(exp->destType)
16005 exp->destType->refCount++;
16006 if(exp->expType)
16007 exp->expType->refCount++;
16008 exp->type = 11;
16009 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
16010 exp->cast.exp = newExp;
16011 }
16012 }
16013 FinishTemplatesContext(context);
16014 }
16015 }
16016 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
16017 {
16018 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
16019
16020 if(expClass)
16021 {
16022 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
16023 int c;
16024 int p = 0;
16025 int paramCount = 0;
16026 int lastParam = -1;
16027 char templateString[1024];
16028 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
16029
16030 sprintf(templateString, "%s<", expClass->templateClass->fullName);
16031 while(cClass != expClass)
16032 {
16033 struct __ecereNameSpace__ecere__com__Class * sClass;
16034
16035 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
16036 ;
16037 cClass = sClass;
16038 for(param = cClass->templateParams.first; param; param = param->next)
16039 {
16040 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
16041 int c;
16042 int cp = 0;
16043 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
16044 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
16045
16046 while(cClassCur != tClass && !paramCur)
16047 {
16048 struct __ecereNameSpace__ecere__com__Class * sClassCur;
16049
16050 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
16051 ;
16052 cClassCur = sClassCur;
16053 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
16054 {
16055 if(!strcmp(paramCur->name, param->name))
16056 {
16057 break;
16058 }
16059 cp++;
16060 }
16061 }
16062 if(paramCur && paramCur->type == 0)
16063 arg = tClass->templateArgs[cp];
16064 else
16065 arg = expClass->templateArgs[p];
16066 {
16067 char argument[256];
16068
16069 argument[0] = '\0';
16070 switch(param->type)
16071 {
16072 case 2:
16073 {
16074 char expString[1024];
16075 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16076 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
16077 struct Expression * exp;
16078 char * string = PrintHexUInt64(arg.expression.ui64);
16079
16080 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
16081 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
16082 ProcessExpressionType(exp);
16083 ComputeExpression(exp);
16084 expString[0] = '\0';
16085 PrintExpression(exp, expString);
16086 strcat(argument, expString);
16087 FreeExpression(exp);
16088 break;
16089 }
16090 case 1:
16091 {
16092 strcat(argument, arg.member->name);
16093 break;
16094 }
16095 case 0:
16096 {
16097 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
16098 strcat(argument, arg.dataTypeString);
16099 break;
16100 }
16101 }
16102 if(argument[0])
16103 {
16104 if(paramCount)
16105 strcat(templateString, ", ");
16106 if(lastParam != p - 1)
16107 {
16108 strcat(templateString, param->name);
16109 strcat(templateString, " = ");
16110 }
16111 strcat(templateString, argument);
16112 paramCount++;
16113 lastParam = p;
16114 }
16115 }
16116 p++;
16117 }
16118 }
16119 {
16120 int len = strlen(templateString);
16121
16122 if(templateString[len - 1] == '>')
16123 templateString[len++] = ' ';
16124 templateString[len++] = '>';
16125 templateString[len++] = '\0';
16126 }
16127 FreeType(exp->expType);
16128 {
16129 struct Context * context = SetupTemplatesContext(tClass);
16130
16131 exp->expType = ProcessTypeString(templateString, 0x0);
16132 FinishTemplatesContext(context);
16133 }
16134 }
16135 }
16136 }
16137 }
16138 else
16139 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)");
16140 }
16141 else if(type && (type->kind == 9 || type->kind == 10))
16142 {
16143 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
16144
16145 if(memberType)
16146 {
16147 exp->expType = memberType;
16148 if(memberType)
16149 memberType->refCount++;
16150 }
16151 }
16152 else
16153 {
16154 char expString[10240];
16155
16156 expString[0] = '\0';
16157 if(inCompiler)
16158 {
16159 PrintExpression(exp, expString);
16160 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16161 }
16162 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "member operator on non-structure type expression %s\n", (((void *)0))), expString);
16163 }
16164 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
16165 {
16166 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
16167 {
16168 struct Identifier * id = exp->member.member;
16169 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));
16170
16171 if(_class)
16172 {
16173 FreeType(exp->expType);
16174 exp->expType = ReplaceThisClassType(_class);
16175 }
16176 }
16177 }
16178 yylloc = oldyylloc;
16179 break;
16180 }
16181 case 9:
16182 {
16183 struct Type * destType = exp->destType;
16184
16185 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
16186 {
16187 exp->member.member->classSym = exp->member.member->_class->symbol;
16188 }
16189 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
16190 exp->type = 8;
16191 if(destType)
16192 destType->count++;
16193 ProcessExpressionType(exp);
16194 if(destType)
16195 destType->count--;
16196 break;
16197 }
16198 case 15:
16199 {
16200 struct Symbol * classSym = exp->_class->symbol;
16201
16202 if(classSym && classSym->registered)
16203 {
16204 if(classSym->registered->type == 5)
16205 {
16206 char name[1024];
16207
16208 name[0] = '\0';
16209 DeclareStruct(classSym->string, 0x0);
16210 FreeSpecifier(exp->_class);
16211 exp->type = 10;
16212 FullClassNameCat(name, classSym->string, 0x0);
16213 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
16214 }
16215 else
16216 {
16217 if(classSym->registered->fixed)
16218 {
16219 FreeSpecifier(exp->_class);
16220 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
16221 exp->type = 2;
16222 }
16223 else
16224 {
16225 char className[1024];
16226
16227 strcpy(className, "__ecereClass_");
16228 FullClassNameCat(className, classSym->string, 0x1);
16229 MangleClassName(className);
16230 DeclareClass(classSym, className);
16231 FreeExpContents(exp);
16232 exp->type = 9;
16233 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
16234 exp->member.member = MkIdentifier("structSize");
16235 }
16236 }
16237 }
16238 exp->expType = __extension__ ({
16239 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16240
16241 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
16242 });
16243 break;
16244 }
16245 case 10:
16246 {
16247 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
16248
16249 exp->expType = __extension__ ({
16250 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16251
16252 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
16253 });
16254 exp->isConstant = 0x1;
16255 DeclareType(type, 0x0, 0x0);
16256 FreeType(type);
16257 break;
16258 }
16259 case 11:
16260 {
16261 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
16262
16263 type->count = 1;
16264 FreeType(exp->cast.exp->destType);
16265 exp->cast.exp->destType = type;
16266 type->refCount++;
16267 ProcessExpressionType(exp->cast.exp);
16268 type->count = 0;
16269 exp->expType = type;
16270 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
16271 {
16272 void * prev = exp->prev, * next = exp->next;
16273 struct Type * expType = exp->cast.exp->destType;
16274 struct Expression * castExp = exp->cast.exp;
16275 struct Type * destType = exp->destType;
16276
16277 if(expType)
16278 expType->refCount++;
16279 FreeType(exp->expType);
16280 FreeTypeName(exp->cast.typeName);
16281 *exp = *castExp;
16282 FreeType(exp->expType);
16283 FreeType(exp->destType);
16284 exp->expType = expType;
16285 exp->destType = destType;
16286 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
16287 exp->prev = prev;
16288 exp->next = next;
16289 }
16290 else
16291 {
16292 exp->isConstant = exp->cast.exp->isConstant;
16293 }
16294 break;
16295 }
16296 case 33:
16297 {
16298 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
16299
16300 exp->expType = type;
16301 break;
16302 }
16303 case 34:
16304 {
16305 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
16306
16307 ProcessExpressionType(exp->vaArg.exp);
16308 exp->expType = type;
16309 break;
16310 }
16311 case 12:
16312 {
16313 struct Expression * e;
16314
16315 exp->isConstant = 0x1;
16316 FreeType(exp->cond.cond->destType);
16317 exp->cond.cond->destType = MkClassType("bool");
16318 exp->cond.cond->destType->truth = 0x1;
16319 ProcessExpressionType(exp->cond.cond);
16320 if(!exp->cond.cond->isConstant)
16321 exp->isConstant = 0x0;
16322 for(e = (*exp->cond.exp).first; e; e = e->next)
16323 {
16324 if(!e->next)
16325 {
16326 FreeType(e->destType);
16327 e->destType = exp->destType;
16328 if(e->destType)
16329 e->destType->refCount++;
16330 }
16331 ProcessExpressionType(e);
16332 if(!e->next)
16333 {
16334 exp->expType = e->expType;
16335 if(e->expType)
16336 e->expType->refCount++;
16337 }
16338 if(!e->isConstant)
16339 exp->isConstant = 0x0;
16340 }
16341 FreeType(exp->cond.elseExp->destType);
16342 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
16343 if(exp->cond.elseExp->destType)
16344 exp->cond.elseExp->destType->refCount++;
16345 ProcessExpressionType(exp->cond.elseExp);
16346 if(!exp->cond.elseExp->isConstant)
16347 exp->isConstant = 0x0;
16348 break;
16349 }
16350 case 23:
16351 {
16352 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
16353 {
16354 struct Statement * last = (*exp->compound->compound.statements).last;
16355
16356 if(last->type == 3 && last->expressions && (*last->expressions).last)
16357 {
16358 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
16359 if(exp->destType)
16360 exp->destType->refCount++;
16361 }
16362 ProcessStatement(exp->compound);
16363 exp->expType = (last->expressions && (*last->expressions).last) ? ((struct Expression *)(*last->expressions).last)->expType : (((void *)0));
16364 if(exp->expType)
16365 exp->expType->refCount++;
16366 }
16367 break;
16368 }
16369 case 24:
16370 {
16371 struct Specifier * spec = (*exp->_classExp.specifiers).first;
16372
16373 if(spec && spec->type == 1)
16374 {
16375 exp->expType = MkClassType(spec->name);
16376 exp->expType->kind = 19;
16377 exp->byReference = 0x1;
16378 }
16379 else
16380 {
16381 exp->expType = MkClassType("ecere::com::Class");
16382 exp->byReference = 0x1;
16383 }
16384 break;
16385 }
16386 case 25:
16387 {
16388 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
16389
16390 if(_class)
16391 {
16392 struct Identifier * id = exp->classData.id;
16393 char structName[1024];
16394 struct Expression * classExp;
16395
16396 strcpy(structName, "__ecereClassData_");
16397 FullClassNameCat(structName, _class->fullName, 0x0);
16398 exp->type = 9;
16399 exp->member.member = id;
16400 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
16401 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
16402 else
16403 classExp = MkExpIdentifier(MkIdentifier("class"));
16404 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"))))))));
16405 ProcessExpressionType(exp);
16406 return ;
16407 }
16408 break;
16409 }
16410 case 35:
16411 {
16412 struct Type * type = (((void *)0));
16413 char * typeString = (((void *)0));
16414 char typeStringBuf[1024];
16415
16416 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))
16417 {
16418 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
16419
16420 typeString = templateClass->templateArgs[2].dataTypeString;
16421 }
16422 else if(exp->list)
16423 {
16424 struct Expression * e;
16425
16426 for(e = (*exp->list).first; e; e = e->next)
16427 {
16428 ProcessExpressionType(e);
16429 if(e->expType)
16430 {
16431 if(!type)
16432 {
16433 type = e->expType;
16434 type->refCount++;
16435 }
16436 else
16437 {
16438 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
16439 {
16440 FreeType(type);
16441 type = e->expType;
16442 e->expType = (((void *)0));
16443 e = (*exp->list).first;
16444 ProcessExpressionType(e);
16445 if(e->expType)
16446 {
16447 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
16448 {
16449 FreeType(e->expType);
16450 e->expType = (((void *)0));
16451 FreeType(type);
16452 type = (((void *)0));
16453 break;
16454 }
16455 }
16456 }
16457 }
16458 if(e->expType)
16459 {
16460 FreeType(e->expType);
16461 e->expType = (((void *)0));
16462 }
16463 }
16464 }
16465 if(type)
16466 {
16467 typeStringBuf[0] = '\0';
16468 PrintTypeNoConst(type, typeStringBuf, 0x0, 0x1);
16469 typeString = typeStringBuf;
16470 FreeType(type);
16471 type = (((void *)0));
16472 }
16473 }
16474 if(typeString)
16475 {
16476 char templateString[1024];
16477 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
16478 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
16479 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16480 struct Expression * expExt;
16481 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16482
16483 sprintf(templateString, "Container<%s>", typeString);
16484 if(exp->list)
16485 {
16486 struct Expression * e;
16487
16488 type = ProcessTypeString(typeString, 0x0);
16489 while(e = (*exp->list).first)
16490 {
16491 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
16492 e->destType = type;
16493 type->refCount++;
16494 ProcessExpressionType(e);
16495 ListAdd(initializers, MkInitializerAssignment(e));
16496 }
16497 FreeType(type);
16498 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
16499 }
16500 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
16501 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
16502 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16503 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
16504 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16505 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
16506 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16507 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
16508 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16509 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
16510 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16511
16512 __ecereInstance1->type = 2, __ecereInstance1->constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, (void *)0), __ecereInstance1;
16513 })));
16514 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16515 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
16516 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16517 exp->expType = ProcessTypeString(templateString, 0x0);
16518 exp->type = 5;
16519 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
16520 ProcessExpressionType(expExt);
16521 }
16522 else
16523 {
16524 exp->expType = ProcessTypeString("Container", 0x0);
16525 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
16526 }
16527 break;
16528 }
16529 }
16530 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
16531 {
16532 FreeType(exp->expType);
16533 exp->expType = ReplaceThisClassType(thisClass);
16534 }
16535 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
16536 {
16537 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
16538
16539 if(symbol)
16540 {
16541 if(exp->expType->kind != 15)
16542 {
16543 struct Type * member;
16544 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
16545
16546 FreeType(exp->expType);
16547 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16548 exp->expType->kind = symbol->type->kind;
16549 exp->expType->refCount++;
16550 exp->expType->enumName = enumName;
16551 exp->expType->members = symbol->type->members;
16552 for(member = symbol->type->members.first; member; member = member->next)
16553 member->refCount++;
16554 }
16555 else
16556 {
16557 struct __ecereNameSpace__ecere__sys__NamedLink * member;
16558
16559 for(member = symbol->type->members.first; member; member = member->next)
16560 {
16561 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(structSize_NamedLink), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
16562
16563 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
16564 }
16565 }
16566 }
16567 }
16568 yylloc = exp->loc;
16569 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
16570 ;
16571 else if(exp->destType && !exp->destType->keepCast)
16572 {
16573 if(!CheckExpressionType(exp, exp->destType, 0x0))
16574 {
16575 if(!exp->destType->count || unresolved)
16576 {
16577 if(!exp->expType)
16578 {
16579 yylloc = exp->loc;
16580 if(exp->destType->kind != 14)
16581 {
16582 char type2[1024];
16583
16584 type2[0] = '\0';
16585 if(inCompiler)
16586 {
16587 char expString[10240];
16588
16589 expString[0] = '\0';
16590 PrintType(exp->destType, type2, 0x0, 0x1);
16591 if(inCompiler)
16592 {
16593 PrintExpression(exp, expString);
16594 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16595 }
16596 if(unresolved)
16597 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
16598 else if(exp->type != 16)
16599 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
16600 }
16601 }
16602 else
16603 {
16604 char expString[10240];
16605
16606 expString[0] = '\0';
16607 if(inCompiler)
16608 {
16609 PrintExpression(exp, expString);
16610 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16611 }
16612 if(unresolved)
16613 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), expString);
16614 else if(exp->type != 16)
16615 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16616 }
16617 }
16618 else
16619 {
16620 char type1[1024];
16621 char type2[1024];
16622
16623 type1[0] = '\0';
16624 type2[0] = '\0';
16625 if(inCompiler)
16626 {
16627 PrintType(exp->expType, type1, 0x0, 0x1);
16628 PrintType(exp->destType, type2, 0x0, 0x1);
16629 }
16630 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)))
16631 ;
16632 else
16633 {
16634 char expString[10240];
16635
16636 expString[0] = '\0';
16637 if(inCompiler)
16638 {
16639 PrintExpression(exp, expString);
16640 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16641 }
16642 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
16643 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
16644 FreeType(exp->expType);
16645 exp->destType->refCount++;
16646 exp->expType = exp->destType;
16647 }
16648 }
16649 }
16650 }
16651 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
16652 {
16653 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16654 char typeString[1024];
16655 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16656 struct Declarator * decl;
16657
16658 typeString[0] = '\0';
16659 *newExp = *exp;
16660 if(exp->expType)
16661 exp->expType->refCount++;
16662 if(exp->expType)
16663 exp->expType->refCount++;
16664 exp->type = 11;
16665 newExp->destType = exp->expType;
16666 PrintType(exp->expType, typeString, 0x0, 0x0);
16667 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16668 exp->cast.typeName = MkTypeName(specs, decl);
16669 exp->cast.exp = newExp;
16670 }
16671 }
16672 else if(unresolved)
16673 {
16674 if(exp->identifier->_class && exp->identifier->_class->name)
16675 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
16676 else if(exp->identifier->string && exp->identifier->string[0])
16677 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
16678 }
16679 else if(!exp->expType && exp->type != 16)
16680 {
16681 char expString[10240];
16682
16683 expString[0] = '\0';
16684 if(inCompiler)
16685 {
16686 PrintExpression(exp, expString);
16687 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16688 }
16689 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16690 }
16691 if(inCompiler)
16692 ApplyAnyObjectLogic(exp);
16693 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)))
16694 {
16695 exp->byReference = 0x1;
16696 }
16697 yylloc = oldyylloc;
16698 }
16699
16700 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)
16701 {
16702 if(*curMember)
16703 {
16704 *curMember = (*curMember)->next;
16705 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
16706 {
16707 *curMember = subMemberStack[--(*subMemberStackPos)];
16708 *curMember = (*curMember)->next;
16709 }
16710 while((*curMember) && (*curMember)->isProperty)
16711 *curMember = (*curMember)->next;
16712 if(subMemberStackPos)
16713 {
16714 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
16715 {
16716 subMemberStack[(*subMemberStackPos)++] = *curMember;
16717 *curMember = (*curMember)->members.first;
16718 while(*curMember && (*curMember)->isProperty)
16719 *curMember = (*curMember)->next;
16720 }
16721 }
16722 }
16723 while(!*curMember)
16724 {
16725 if(!*curMember)
16726 {
16727 if(subMemberStackPos && *subMemberStackPos)
16728 {
16729 *curMember = subMemberStack[--(*subMemberStackPos)];
16730 *curMember = (*curMember)->next;
16731 }
16732 else
16733 {
16734 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
16735
16736 if(*curClass == _class)
16737 break;
16738 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
16739 ;
16740 *curMember = (*curClass)->membersAndProperties.first;
16741 }
16742 while((*curMember) && (*curMember)->isProperty)
16743 *curMember = (*curMember)->next;
16744 if(subMemberStackPos)
16745 {
16746 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
16747 {
16748 subMemberStack[(*subMemberStackPos)++] = *curMember;
16749 *curMember = (*curMember)->members.first;
16750 while(*curMember && (*curMember)->isProperty)
16751 *curMember = (*curMember)->next;
16752 }
16753 }
16754 }
16755 }
16756 }
16757
16758 static void ProcessInitializer(struct Initializer * init, struct Type * type)
16759 {
16760 switch(init->type)
16761 {
16762 case 0:
16763 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
16764 {
16765 if(init->exp && !init->exp->destType)
16766 {
16767 FreeType(init->exp->destType);
16768 init->exp->destType = type;
16769 if(type)
16770 type->refCount++;
16771 }
16772 if(init->exp)
16773 {
16774 ProcessExpressionType(init->exp);
16775 init->isConstant = init->exp->isConstant;
16776 }
16777 break;
16778 }
16779 else
16780 {
16781 struct Expression * exp = init->exp;
16782 struct Instantiation * inst = exp->instance;
16783 struct MembersInit * members;
16784
16785 init->type = 1;
16786 init->list = MkList();
16787 if(inst->members)
16788 {
16789 for(members = (*inst->members).first; members; members = members->next)
16790 {
16791 if(members->type == 0)
16792 {
16793 struct MemberInit * member;
16794
16795 for(member = (*members->dataMembers).first; member; member = member->next)
16796 {
16797 ListAdd(init->list, member->initializer);
16798 member->initializer = (((void *)0));
16799 }
16800 }
16801 }
16802 }
16803 FreeExpression(exp);
16804 }
16805 case 1:
16806 {
16807 struct Initializer * i;
16808 struct Type * initializerType = (((void *)0));
16809 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
16810 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
16811 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
16812 int subMemberStackPos = 0;
16813
16814 if(type && type->kind == 12)
16815 initializerType = Dereference(type);
16816 else if(type && (type->kind == 9 || type->kind == 10))
16817 initializerType = type->members.first;
16818 for(i = (*init->list).first; i; i = i->next)
16819 {
16820 if(type && type->kind == 8 && type->_class && type->_class->registered)
16821 {
16822 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
16823 if(curMember)
16824 {
16825 if(!curMember->dataType)
16826 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
16827 initializerType = curMember->dataType;
16828 }
16829 }
16830 ProcessInitializer(i, initializerType);
16831 if(initializerType && type && (type->kind == 9 || type->kind == 10))
16832 initializerType = initializerType->next;
16833 if(!i->isConstant)
16834 init->isConstant = 0x0;
16835 }
16836 if(type && type->kind == 12)
16837 FreeType(initializerType);
16838 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
16839 {
16840 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Assigning list initializer to non list\n", (((void *)0))));
16841 }
16842 break;
16843 }
16844 }
16845 }
16846
16847 extern struct Symbol * FindType(struct Context * ctx, char *  name);
16848
16849 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
16850
16851 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
16852 {
16853 switch(spec->type)
16854 {
16855 case 0:
16856 {
16857 if(spec->specifier == THISCLASS)
16858 {
16859 if(thisClass)
16860 {
16861 spec->type = 1;
16862 spec->name = ReplaceThisClass(thisClass);
16863 spec->symbol = FindClass(spec->name);
16864 ProcessSpecifier(spec, declareStruct);
16865 }
16866 }
16867 break;
16868 }
16869 case 1:
16870 {
16871 struct Symbol * symbol = FindType(curContext, spec->name);
16872
16873 if(symbol)
16874 DeclareType(symbol->type, 0x1, 0x1);
16875 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
16876 DeclareStruct(spec->name, 0x0);
16877 break;
16878 }
16879 case 2:
16880 {
16881 struct Enumerator * e;
16882
16883 if(spec->list)
16884 {
16885 for(e = (*spec->list).first; e; e = e->next)
16886 {
16887 if(e->exp)
16888 ProcessExpressionType(e->exp);
16889 }
16890 }
16891 break;
16892 }
16893 case 3:
16894 case 4:
16895 {
16896 if(spec->definitions)
16897 {
16898 struct ClassDef * def;
16899 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
16900
16901 ProcessClass(spec->definitions, symbol);
16902 }
16903 break;
16904 }
16905 }
16906 }
16907
16908 static void ProcessDeclarator(struct Declarator * decl)
16909 {
16910 switch(decl->type)
16911 {
16912 case 1:
16913 if(decl->identifier->classSym)
16914 {
16915 FreeSpecifier(decl->identifier->_class);
16916 decl->identifier->_class = (((void *)0));
16917 }
16918 break;
16919 case 3:
16920 if(decl->array.exp)
16921 ProcessExpressionType(decl->array.exp);
16922 case 0:
16923 case 2:
16924 case 4:
16925 case 5:
16926 case 6:
16927 case 7:
16928 if(decl->declarator)
16929 ProcessDeclarator(decl->declarator);
16930 if(decl->type == 4)
16931 {
16932 struct Identifier * id = GetDeclId(decl);
16933
16934 if(id && id->_class)
16935 {
16936 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
16937
16938 if(!decl->function.parameters)
16939 decl->function.parameters = MkList();
16940 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
16941 id->_class = (((void *)0));
16942 }
16943 if(decl->function.parameters)
16944 {
16945 struct TypeName * param;
16946
16947 for(param = (*decl->function.parameters).first; param; param = param->next)
16948 {
16949 if(param->qualifiers && (*param->qualifiers).first)
16950 {
16951 struct Specifier * spec = (*param->qualifiers).first;
16952
16953 if(spec && spec->specifier == TYPED_OBJECT)
16954 {
16955 struct Declarator * d = param->declarator;
16956 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);
16957
16958 FreeList(param->qualifiers, FreeSpecifier);
16959 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
16960 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
16961 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
16962 param = newParam;
16963 }
16964 else if(spec && spec->specifier == ANY_OBJECT)
16965 {
16966 struct Declarator * d = param->declarator;
16967
16968 FreeList(param->qualifiers, FreeSpecifier);
16969 param->qualifiers = MkListOne(MkSpecifier(VOID));
16970 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
16971 }
16972 else if(spec->specifier == THISCLASS)
16973 {
16974 if(thisClass)
16975 {
16976 spec->type = 1;
16977 spec->name = ReplaceThisClass(thisClass);
16978 spec->symbol = FindClass(spec->name);
16979 ProcessSpecifier(spec, 0x0);
16980 }
16981 }
16982 }
16983 if(param->declarator)
16984 ProcessDeclarator(param->declarator);
16985 }
16986 }
16987 }
16988 break;
16989 }
16990 }
16991
16992 extern struct Identifier * CopyIdentifier(struct Identifier * id);
16993
16994 extern void FreeInitDeclarator(struct InitDeclarator * decl);
16995
16996 static void ProcessDeclaration(struct Declaration * decl)
16997 {
16998 yylloc = decl->loc;
16999 switch(decl->type)
17000 {
17001 case 1:
17002 {
17003 unsigned int declareStruct = 0x0;
17004
17005 if(decl->declarators)
17006 {
17007 struct InitDeclarator * d;
17008
17009 for(d = (*decl->declarators).first; d; d = d->next)
17010 {
17011 struct Type * type, * subType;
17012
17013 ProcessDeclarator(d->declarator);
17014 type = ProcessType(decl->specifiers, d->declarator);
17015 if(d->initializer)
17016 {
17017 ProcessInitializer(d->initializer, type);
17018 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
17019 {
17020 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
17021 {
17022 struct Instantiation * inst = d->initializer->exp->instance;
17023
17024 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
17025 d->initializer->exp->instance = (((void *)0));
17026 if(decl->specifiers)
17027 FreeList(decl->specifiers, FreeSpecifier);
17028 FreeList(decl->declarators, FreeInitDeclarator);
17029 d = (((void *)0));
17030 decl->type = 2;
17031 decl->inst = inst;
17032 }
17033 }
17034 }
17035 for(subType = type; subType; )
17036 {
17037 if(subType->kind == 8)
17038 {
17039 declareStruct = 0x1;
17040 break;
17041 }
17042 else if(subType->kind == 13)
17043 break;
17044 else if(subType->kind == 12)
17045 subType = subType->arrayType;
17046 else
17047 break;
17048 }
17049 FreeType(type);
17050 if(!d)
17051 break;
17052 }
17053 }
17054 if(decl->specifiers)
17055 {
17056 struct Specifier * s;
17057
17058 for(s = (*decl->specifiers).first; s; s = s->next)
17059 {
17060 ProcessSpecifier(s, declareStruct);
17061 }
17062 }
17063 break;
17064 }
17065 case 2:
17066 {
17067 ProcessInstantiationType(decl->inst);
17068 break;
17069 }
17070 case 0:
17071 {
17072 struct Specifier * spec;
17073 struct Declarator * d;
17074 unsigned int declareStruct = 0x0;
17075
17076 if(decl->declarators)
17077 {
17078 for(d = (*decl->declarators).first; d; d = d->next)
17079 {
17080 struct Type * type = ProcessType(decl->specifiers, d->declarator);
17081 struct Type * subType;
17082
17083 ProcessDeclarator(d);
17084 for(subType = type; subType; )
17085 {
17086 if(subType->kind == 8)
17087 {
17088 declareStruct = 0x1;
17089 break;
17090 }
17091 else if(subType->kind == 13)
17092 break;
17093 else if(subType->kind == 12)
17094 subType = subType->arrayType;
17095 else
17096 break;
17097 }
17098 FreeType(type);
17099 }
17100 }
17101 if(decl->specifiers)
17102 {
17103 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
17104 ProcessSpecifier(spec, declareStruct);
17105 }
17106 break;
17107 }
17108 }
17109 }
17110
17111 static struct FunctionDefinition * curFunction;
17112
17113 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
17114 {
17115 char propName[1024], propNameM[1024];
17116 char getName[1024], setName[1024];
17117 struct __ecereNameSpace__ecere__sys__OldList * args;
17118
17119 DeclareProperty(prop, setName, getName);
17120 strcpy(propName, "__ecereProp_");
17121 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17122 strcat(propName, "_");
17123 FullClassNameCat(propName, prop->name, 0x1);
17124 MangleClassName(propName);
17125 strcpy(propNameM, "__ecerePropM_");
17126 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
17127 strcat(propNameM, "_");
17128 FullClassNameCat(propNameM, prop->name, 0x1);
17129 MangleClassName(propNameM);
17130 if(prop->isWatchable)
17131 {
17132 args = MkList();
17133 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17134 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17135 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17136 args = MkList();
17137 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17138 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17139 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17140 }
17141 {
17142 args = MkList();
17143 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17144 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17145 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17146 args = MkList();
17147 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17148 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17149 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17150 }
17151 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
17152 curFunction->propSet->fireWatchersDone = 0x1;
17153 }
17154
17155 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
17156
17157 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
17158
17159 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
17160
17161 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
17162
17163 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
17164
17165 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
17166
17167 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
17168
17169 extern void FreePropertyWatch(struct PropertyWatch * watcher);
17170
17171 static void ProcessStatement(struct Statement * stmt)
17172 {
17173 yylloc = stmt->loc;
17174 switch(stmt->type)
17175 {
17176 case 0:
17177 ProcessStatement(stmt->labeled.stmt);
17178 break;
17179 case 1:
17180 if(stmt->caseStmt.exp)
17181 {
17182 FreeType(stmt->caseStmt.exp->destType);
17183 stmt->caseStmt.exp->destType = curSwitchType;
17184 if(curSwitchType)
17185 curSwitchType->refCount++;
17186 ProcessExpressionType(stmt->caseStmt.exp);
17187 ComputeExpression(stmt->caseStmt.exp);
17188 }
17189 if(stmt->caseStmt.stmt)
17190 ProcessStatement(stmt->caseStmt.stmt);
17191 break;
17192 case 2:
17193 {
17194 if(stmt->compound.context)
17195 {
17196 struct Declaration * decl;
17197 struct Statement * s;
17198 struct Statement * prevCompound = curCompound;
17199 struct Context * prevContext = curContext;
17200
17201 if(!stmt->compound.isSwitch)
17202 curCompound = stmt;
17203 curContext = stmt->compound.context;
17204 if(stmt->compound.declarations)
17205 {
17206 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
17207 ProcessDeclaration(decl);
17208 }
17209 if(stmt->compound.statements)
17210 {
17211 for(s = (*stmt->compound.statements).first; s; s = s->next)
17212 ProcessStatement(s);
17213 }
17214 curContext = prevContext;
17215 curCompound = prevCompound;
17216 }
17217 break;
17218 }
17219 case 3:
17220 {
17221 struct Expression * exp;
17222
17223 if(stmt->expressions)
17224 {
17225 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
17226 ProcessExpressionType(exp);
17227 }
17228 break;
17229 }
17230 case 4:
17231 {
17232 struct Expression * exp;
17233
17234 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
17235 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
17236 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
17237 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
17238 {
17239 ProcessExpressionType(exp);
17240 }
17241 if(stmt->ifStmt.stmt)
17242 ProcessStatement(stmt->ifStmt.stmt);
17243 if(stmt->ifStmt.elseStmt)
17244 ProcessStatement(stmt->ifStmt.elseStmt);
17245 break;
17246 }
17247 case 5:
17248 {
17249 struct Type * oldSwitchType = curSwitchType;
17250
17251 if(stmt->switchStmt.exp)
17252 {
17253 struct Expression * exp;
17254
17255 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
17256 {
17257 if(!exp->next)
17258 {
17259 ProcessExpressionType(exp);
17260 }
17261 if(!exp->next)
17262 curSwitchType = exp->expType;
17263 }
17264 }
17265 ProcessStatement(stmt->switchStmt.stmt);
17266 curSwitchType = oldSwitchType;
17267 break;
17268 }
17269 case 6:
17270 {
17271 if(stmt->whileStmt.exp)
17272 {
17273 struct Expression * exp;
17274
17275 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
17276 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
17277 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
17278 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
17279 {
17280 ProcessExpressionType(exp);
17281 }
17282 }
17283 if(stmt->whileStmt.stmt)
17284 ProcessStatement(stmt->whileStmt.stmt);
17285 break;
17286 }
17287 case 7:
17288 {
17289 if(stmt->doWhile.exp)
17290 {
17291 struct Expression * exp;
17292
17293 if((*stmt->doWhile.exp).last)
17294 {
17295 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
17296 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
17297 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
17298 }
17299 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
17300 {
17301 ProcessExpressionType(exp);
17302 }
17303 }
17304 if(stmt->doWhile.stmt)
17305 ProcessStatement(stmt->doWhile.stmt);
17306 break;
17307 }
17308 case 8:
17309 {
17310 struct Expression * exp;
17311
17312 if(stmt->forStmt.init)
17313 ProcessStatement(stmt->forStmt.init);
17314 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
17315 {
17316 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
17317 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
17318 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
17319 }
17320 if(stmt->forStmt.check)
17321 ProcessStatement(stmt->forStmt.check);
17322 if(stmt->forStmt.increment)
17323 {
17324 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
17325 ProcessExpressionType(exp);
17326 }
17327 if(stmt->forStmt.stmt)
17328 ProcessStatement(stmt->forStmt.stmt);
17329 break;
17330 }
17331 case 18:
17332 {
17333 struct Identifier * id = stmt->forEachStmt.id;
17334 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
17335 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
17336 struct Statement * block = stmt->forEachStmt.stmt;
17337 char iteratorType[1024];
17338 struct Type * source;
17339 struct Expression * e;
17340 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));
17341 struct Expression * arrayExp;
17342 char * typeString = (((void *)0));
17343 int builtinCount = 0;
17344
17345 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
17346 {
17347 if(!e->next)
17348 {
17349 FreeType(e->destType);
17350 e->destType = ProcessTypeString("Container", 0x0);
17351 }
17352 if(!isBuiltin || e->next)
17353 ProcessExpressionType(e);
17354 }
17355 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
17356 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
17357 {
17358 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
17359 struct Symbol * symbol;
17360 struct Expression * expIt = (((void *)0));
17361 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
17362 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
17363 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
17364 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
17365
17366 stmt->type = 2;
17367 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
17368 stmt->compound.context->parent = curContext;
17369 curContext = stmt->compound.context;
17370 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
17371 {
17372 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
17373 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
17374
17375 isCustomAVLTree = 0x1;
17376 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
17377 isAVLTree = 0x1;
17378 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
17379 isMap = 0x1;
17380 }
17381 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
17382 isArray = 0x1;
17383 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
17384 {
17385 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
17386
17387 isLinkList = 0x1;
17388 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
17389 }
17390 if(isArray)
17391 {
17392 struct Declarator * decl;
17393 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17394
17395 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
17396 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17397 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
17398 }
17399 else if(isBuiltin)
17400 {
17401 struct Type * type = (((void *)0));
17402 char typeStringBuf[1024];
17403
17404 arrayExp = (((struct Expression *)(*exp).last)->type == 35) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
17405 if(((struct Expression *)(*exp).last)->type == 11)
17406 {
17407 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
17408
17409 if(typeName)
17410 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
17411 }
17412 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)
17413 {
17414 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
17415
17416 typeString = templateClass->templateArgs[2].dataTypeString;
17417 }
17418 else if(arrayExp->list)
17419 {
17420 struct Expression * e;
17421
17422 for(e = (*arrayExp->list).first; e; e = e->next)
17423 {
17424 ProcessExpressionType(e);
17425 if(e->expType)
17426 {
17427 if(!type)
17428 {
17429 type = e->expType;
17430 type->refCount++;
17431 }
17432 else
17433 {
17434 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
17435 {
17436 FreeType(type);
17437 type = e->expType;
17438 e->expType = (((void *)0));
17439 e = (*arrayExp->list).first;
17440 ProcessExpressionType(e);
17441 if(e->expType)
17442 {
17443 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
17444 {
17445 FreeType(e->expType);
17446 e->expType = (((void *)0));
17447 FreeType(type);
17448 type = (((void *)0));
17449 break;
17450 }
17451 }
17452 }
17453 }
17454 if(e->expType)
17455 {
17456 FreeType(e->expType);
17457 e->expType = (((void *)0));
17458 }
17459 }
17460 }
17461 if(type)
17462 {
17463 typeStringBuf[0] = '\0';
17464 PrintType(type, typeStringBuf, 0x0, 0x1);
17465 typeString = typeStringBuf;
17466 FreeType(type);
17467 }
17468 }
17469 if(typeString)
17470 {
17471 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
17472 struct Declarator * decl;
17473 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17474
17475 if(arrayExp->list)
17476 {
17477 struct Expression * e;
17478
17479 builtinCount = (*arrayExp->list).count;
17480 type = ProcessTypeString(typeString, 0x0);
17481 while(e = (*arrayExp->list).first)
17482 {
17483 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
17484 e->destType = type;
17485 type->refCount++;
17486 ProcessExpressionType(e);
17487 ListAdd(initializers, MkInitializerAssignment(e));
17488 }
17489 FreeType(type);
17490 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
17491 }
17492 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
17493 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
17494 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
17495 FreeList(exp, FreeExpression);
17496 }
17497 else
17498 {
17499 arrayExp->expType = ProcessTypeString("Container", 0x0);
17500 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
17501 }
17502 }
17503 else if(isLinkList && !isList)
17504 {
17505 struct Declarator * decl;
17506 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17507
17508 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
17509 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17510 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
17511 }
17512 else if(_class->templateArgs)
17513 {
17514 if(isMap)
17515 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
17516 else
17517 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
17518 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
17519 }
17520 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
17521 if(block)
17522 {
17523 switch(block->type)
17524 {
17525 case 2:
17526 if(block->compound.context)
17527 block->compound.context->parent = stmt->compound.context;
17528 break;
17529 case 4:
17530 if(block->ifStmt.stmt && block->ifStmt.stmt->type == 2 && block->ifStmt.stmt->compound.context)
17531 block->ifStmt.stmt->compound.context->parent = stmt->compound.context;
17532 if(block->ifStmt.elseStmt && block->ifStmt.elseStmt->type == 2 && block->ifStmt.elseStmt->compound.context)
17533 block->ifStmt.elseStmt->compound.context->parent = stmt->compound.context;
17534 break;
17535 case 5:
17536 if(block->switchStmt.stmt && block->switchStmt.stmt->type == 2 && block->switchStmt.stmt->compound.context)
17537 block->switchStmt.stmt->compound.context->parent = stmt->compound.context;
17538 break;
17539 case 6:
17540 if(block->whileStmt.stmt && block->whileStmt.stmt->type == 2 && block->whileStmt.stmt->compound.context)
17541 block->whileStmt.stmt->compound.context->parent = stmt->compound.context;
17542 break;
17543 case 7:
17544 if(block->doWhile.stmt && block->doWhile.stmt->type == 2 && block->doWhile.stmt->compound.context)
17545 block->doWhile.stmt->compound.context->parent = stmt->compound.context;
17546 break;
17547 case 8:
17548 if(block->forStmt.stmt && block->forStmt.stmt->type == 2 && block->forStmt.stmt->compound.context)
17549 block->forStmt.stmt->compound.context->parent = stmt->compound.context;
17550 break;
17551 case 18:
17552 if(block->forEachStmt.stmt && block->forEachStmt.stmt->type == 2 && block->forEachStmt.stmt->compound.context)
17553 block->forEachStmt.stmt->compound.context->parent = stmt->compound.context;
17554 break;
17555 }
17556 }
17557 if(filter)
17558 {
17559 block = MkIfStmt(filter, block, (((void *)0)));
17560 }
17561 if(isArray)
17562 {
17563 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));
17564 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17565 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17566 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17567 }
17568 else if(isBuiltin)
17569 {
17570 char count[128];
17571
17572 sprintf(count, "%d", builtinCount);
17573 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));
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 if(isLinkList && !isList)
17579 {
17580 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
17581 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
17582
17583 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
17584 {
17585 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));
17586 }
17587 else
17588 {
17589 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17590 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
17591
17592 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));
17593 }
17594 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17595 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17596 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17597 }
17598 else
17599 {
17600 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
17601 }
17602 ProcessExpressionType(expIt);
17603 if((*stmt->compound.declarations).first)
17604 ProcessDeclaration((*stmt->compound.declarations).first);
17605 if(symbol)
17606 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
17607 ProcessStatement(stmt);
17608 curContext = stmt->compound.context->parent;
17609 break;
17610 }
17611 else
17612 {
17613 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Expression is not a container\n", (((void *)0))));
17614 }
17615 break;
17616 }
17617 case 9:
17618 break;
17619 case 10:
17620 break;
17621 case 11:
17622 break;
17623 case 12:
17624 {
17625 struct Expression * exp;
17626
17627 if(stmt->expressions)
17628 {
17629 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
17630 {
17631 if(!exp->next)
17632 {
17633 if(curFunction && !curFunction->type)
17634 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
17635 FreeType(exp->destType);
17636 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
17637 if(exp->destType)
17638 exp->destType->refCount++;
17639 }
17640 ProcessExpressionType(exp);
17641 }
17642 }
17643 break;
17644 }
17645 case 14:
17646 {
17647 ProcessDeclaration(stmt->decl);
17648 break;
17649 }
17650 case 13:
17651 {
17652 struct AsmField * field;
17653
17654 if(stmt->asmStmt.inputFields)
17655 {
17656 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
17657 if(field->expression)
17658 ProcessExpressionType(field->expression);
17659 }
17660 if(stmt->asmStmt.outputFields)
17661 {
17662 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
17663 if(field->expression)
17664 ProcessExpressionType(field->expression);
17665 }
17666 if(stmt->asmStmt.clobberedFields)
17667 {
17668 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
17669 {
17670 if(field->expression)
17671 ProcessExpressionType(field->expression);
17672 }
17673 }
17674 break;
17675 }
17676 case 17:
17677 {
17678 struct PropertyWatch * propWatch;
17679 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17680 struct Expression * object = stmt->_watch.object;
17681 struct Expression * watcher = stmt->_watch.watcher;
17682
17683 if(watcher)
17684 ProcessExpressionType(watcher);
17685 if(object)
17686 ProcessExpressionType(object);
17687 if(inCompiler)
17688 {
17689 if(watcher || thisClass)
17690 {
17691 struct External * external = curExternal;
17692 struct Context * context = curContext;
17693
17694 stmt->type = 3;
17695 stmt->expressions = MkList();
17696 curExternal = external->prev;
17697 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
17698 {
17699 struct ClassFunction * func;
17700 char watcherName[1024];
17701 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
17702 struct External * createdExternal;
17703 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
17704
17705 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
17706 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
17707 if(propWatch->deleteWatch)
17708 strcat(watcherName, "_delete");
17709 else
17710 {
17711 struct Identifier * propID;
17712
17713 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
17714 {
17715 strcat(watcherName, "_");
17716 strcat(watcherName, propID->string);
17717 }
17718 }
17719 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
17720 {
17721 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
17722 ProcessClassFunctionBody(func, propWatch->compound);
17723 propWatch->compound = (((void *)0));
17724 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
17725 createdExternal->symbol->idCode = external->symbol->idCode;
17726 curExternal = createdExternal;
17727 ProcessFunction(createdExternal->function);
17728 {
17729 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
17730
17731 externalDecl->declaration = decl;
17732 if(decl->symbol && !decl->symbol->pointerExternal)
17733 decl->symbol->pointerExternal = externalDecl;
17734 }
17735 if(propWatch->deleteWatch)
17736 {
17737 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17738
17739 ListAdd(args, CopyExpression(object));
17740 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17741 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
17742 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
17743 }
17744 else
17745 {
17746 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
17747 struct Identifier * propID;
17748
17749 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
17750 {
17751 char propName[1024];
17752 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17753
17754 if(prop)
17755 {
17756 char getName[1024], setName[1024];
17757 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17758
17759 DeclareProperty(prop, setName, getName);
17760 strcpy(propName, "__ecereProp_");
17761 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17762 strcat(propName, "_");
17763 FullClassNameCat(propName, prop->name, 0x1);
17764 ListAdd(args, CopyExpression(object));
17765 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17766 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17767 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
17768 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
17769 }
17770 else
17771 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
17772 }
17773 }
17774 }
17775 else
17776 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid watched object\n", (((void *)0))));
17777 }
17778 curExternal = external;
17779 curContext = context;
17780 if(watcher)
17781 FreeExpression(watcher);
17782 if(object)
17783 FreeExpression(object);
17784 FreeList(watches, FreePropertyWatch);
17785 }
17786 else
17787 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a _class\n", (((void *)0))));
17788 }
17789 else
17790 {
17791 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
17792 {
17793 ProcessStatement(propWatch->compound);
17794 }
17795 }
17796 break;
17797 }
17798 case 15:
17799 {
17800 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17801 struct Expression * object = stmt->_watch.object;
17802 struct __ecereNameSpace__ecere__com__Class * _class;
17803
17804 if(object)
17805 ProcessExpressionType(object);
17806 if(inCompiler)
17807 {
17808 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
17809 if(_class)
17810 {
17811 struct Identifier * propID;
17812
17813 stmt->type = 3;
17814 stmt->expressions = MkList();
17815 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
17816 {
17817 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
17818 }
17819 else if(!watches)
17820 {
17821 }
17822 if(watches)
17823 {
17824 for(propID = (*watches).first; propID; propID = propID->next)
17825 {
17826 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17827
17828 if(prop)
17829 {
17830 CreateFireWatcher(prop, object, stmt);
17831 }
17832 else
17833 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
17834 }
17835 }
17836 else
17837 {
17838 struct __ecereNameSpace__ecere__com__Property * prop;
17839 struct __ecereNameSpace__ecere__com__Class * base;
17840
17841 for(base = _class; base; base = base->base)
17842 {
17843 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
17844 {
17845 if(prop->isProperty && prop->isWatchable)
17846 {
17847 CreateFireWatcher(prop, object, stmt);
17848 }
17849 }
17850 }
17851 }
17852 if(object)
17853 FreeExpression(object);
17854 FreeList(watches, FreeIdentifier);
17855 }
17856 else
17857 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
17858 }
17859 break;
17860 }
17861 case 16:
17862 {
17863 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17864 struct Expression * object = stmt->_watch.object;
17865 struct Expression * watcher = stmt->_watch.watcher;
17866 struct __ecereNameSpace__ecere__com__Class * _class;
17867
17868 if(object)
17869 ProcessExpressionType(object);
17870 if(watcher)
17871 ProcessExpressionType(watcher);
17872 if(inCompiler)
17873 {
17874 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
17875 if(watcher || thisClass)
17876 {
17877 if(_class)
17878 {
17879 struct Identifier * propID;
17880
17881 stmt->type = 3;
17882 stmt->expressions = MkList();
17883 if(!watches)
17884 {
17885 struct __ecereNameSpace__ecere__sys__OldList * args;
17886
17887 args = MkList();
17888 ListAdd(args, CopyExpression(object));
17889 ListAdd(args, MkExpConstant("0"));
17890 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17891 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
17892 }
17893 else
17894 {
17895 for(propID = (*watches).first; propID; propID = propID->next)
17896 {
17897 char propName[1024];
17898 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17899
17900 if(prop)
17901 {
17902 char getName[1024], setName[1024];
17903 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17904
17905 DeclareProperty(prop, setName, getName);
17906 strcpy(propName, "__ecereProp_");
17907 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17908 strcat(propName, "_");
17909 FullClassNameCat(propName, prop->name, 0x1);
17910 MangleClassName(propName);
17911 ListAdd(args, CopyExpression(object));
17912 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17913 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17914 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
17915 }
17916 else
17917 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
17918 }
17919 }
17920 if(object)
17921 FreeExpression(object);
17922 if(watcher)
17923 FreeExpression(watcher);
17924 FreeList(watches, FreeIdentifier);
17925 }
17926 else
17927 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
17928 }
17929 else
17930 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
17931 }
17932 break;
17933 }
17934 }
17935 }
17936
17937 extern struct Expression * QBrackets(struct Expression * exp);
17938
17939 extern struct TypeName * QMkType(char *  spec, struct Declarator * decl);
17940
17941 extern struct Declarator * QMkPtrDecl(char *  id);
17942
17943 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
17944
17945 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
17946
17947 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
17948
17949 static void ProcessFunction(struct FunctionDefinition * function)
17950 {
17951 struct Identifier * id = GetDeclId(function->declarator);
17952 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
17953 struct Type * type = symbol ? symbol->type : (((void *)0));
17954 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
17955 struct Context * oldTopContext = topContext;
17956
17957 yylloc = function->loc;
17958 if(type && type->thisClass)
17959 {
17960 struct Symbol * classSym = type->thisClass;
17961 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
17962 char className[1024];
17963 char structName[1024];
17964 struct Declarator * funcDecl;
17965 struct Symbol * thisSymbol;
17966 unsigned int typedObject = 0x0;
17967
17968 if(_class && !_class->base)
17969 {
17970 _class = currentClass;
17971 if(_class && !_class->symbol)
17972 _class->symbol = FindClass(_class->fullName);
17973 classSym = _class ? _class->symbol : (((void *)0));
17974 typedObject = 0x1;
17975 }
17976 thisClass = _class;
17977 if(inCompiler && _class)
17978 {
17979 if(type->kind == 11)
17980 {
17981 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
17982 {
17983 struct Type * param = symbol->type->params.first;
17984
17985 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
17986 FreeType(param);
17987 }
17988 if(type->classObjectType != 1)
17989 {
17990 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
17991 symbol->type->staticMethod = 0x1;
17992 symbol->type->thisClass = (((void *)0));
17993 symbol->type->extraParam = 0x0;
17994 }
17995 }
17996 strcpy(className, "__ecereClass_");
17997 FullClassNameCat(className, _class->fullName, 0x1);
17998 MangleClassName(className);
17999 structName[0] = (char)0;
18000 FullClassNameCat(structName, _class->fullName, 0x0);
18001 funcDecl = GetFuncDecl(function->declarator);
18002 if(funcDecl)
18003 {
18004 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
18005 {
18006 struct TypeName * param = (*funcDecl->function.parameters).first;
18007
18008 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
18009 {
18010 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
18011 FreeTypeName(param);
18012 }
18013 }
18014 if(!function->propertyNoThis)
18015 {
18016 struct TypeName * thisParam;
18017
18018 if(type->classObjectType != 1)
18019 {
18020 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18021 if(!funcDecl->function.parameters)
18022 funcDecl->function.parameters = MkList();
18023 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
18024 }
18025 if(typedObject)
18026 {
18027 if(type->classObjectType != 1)
18028 {
18029 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
18030 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
18031 }
18032 thisParam = __extension__ ({
18033 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
18034
18035 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
18036 });
18037 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
18038 }
18039 }
18040 }
18041 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
18042 {
18043 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
18044
18045 funcDecl = GetFuncDecl(initDecl->declarator);
18046 if(funcDecl)
18047 {
18048 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
18049 {
18050 struct TypeName * param = (*funcDecl->function.parameters).first;
18051
18052 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
18053 {
18054 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
18055 FreeTypeName(param);
18056 }
18057 }
18058 if(type->classObjectType != 1)
18059 {
18060 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
18061 {
18062 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18063
18064 if(!funcDecl->function.parameters)
18065 funcDecl->function.parameters = MkList();
18066 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
18067 }
18068 }
18069 }
18070 }
18071 }
18072 if(function->body)
18073 {
18074 if(type->classObjectType != 1)
18075 {
18076 thisSymbol = __extension__ ({
18077 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18078
18079 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
18080 });
18081 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18082 if(typedObject && thisSymbol->type)
18083 {
18084 thisSymbol->type->classObjectType = 2;
18085 thisSymbol->type->byReference = type->byReference;
18086 thisSymbol->type->typedByReference = type->byReference;
18087 }
18088 }
18089 }
18090 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
18091 {
18092 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
18093
18094 {
18095 struct __ecereNameSpace__ecere__com__Class * base;
18096
18097 for(base = _class; base && base->type != 1000; base = base->next)
18098 {
18099 for(member = base->membersAndProperties.first; member; member = member->next)
18100 if(!member->isProperty)
18101 break;
18102 if(member)
18103 break;
18104 }
18105 }
18106 for(member = _class->membersAndProperties.first; member; member = member->next)
18107 if(!member->isProperty)
18108 break;
18109 if(member)
18110 {
18111 char pointerName[1024];
18112 struct Declaration * decl;
18113 struct Initializer * initializer;
18114 struct Expression * exp, * bytePtr;
18115
18116 strcpy(pointerName, "__ecerePointer_");
18117 FullClassNameCat(pointerName, _class->fullName, 0x0);
18118 {
18119 char className[1024];
18120
18121 strcpy(className, "__ecereClass_");
18122 FullClassNameCat(className, classSym->string, 0x1);
18123 MangleClassName(className);
18124 DeclareClass(classSym, className);
18125 }
18126 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
18127 if(_class->fixed)
18128 {
18129 char string[256];
18130
18131 sprintf(string, "%d", _class->offset);
18132 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
18133 }
18134 else
18135 {
18136 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
18137 }
18138 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
18139 exp->expType = __extension__ ({
18140 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18141
18142 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
18143 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18144
18145 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
18146 }), __ecereInstance2;
18147 });
18148 if(function->body)
18149 {
18150 yylloc = function->body->loc;
18151 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
18152 {
18153 struct Context * prevContext = curContext;
18154
18155 curContext = function->body->compound.context;
18156 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
18157 curContext = prevContext;
18158 }
18159 decl->symbol = (((void *)0));
18160 if(!function->body->compound.declarations)
18161 function->body->compound.declarations = MkList();
18162 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
18163 }
18164 }
18165 }
18166 }
18167 else
18168 thisClass = (((void *)0));
18169 if(id)
18170 {
18171 FreeSpecifier(id->_class);
18172 id->_class = (((void *)0));
18173 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
18174 {
18175 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
18176
18177 id = GetDeclId(initDecl->declarator);
18178 FreeSpecifier(id->_class);
18179 id->_class = (((void *)0));
18180 }
18181 }
18182 if(function->body)
18183 topContext = function->body->compound.context;
18184 {
18185 struct FunctionDefinition * oldFunction = curFunction;
18186
18187 curFunction = function;
18188 if(function->body)
18189 ProcessStatement(function->body);
18190 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
18191 {
18192 struct Statement * prevCompound = curCompound;
18193 struct Context * prevContext = curContext;
18194 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
18195
18196 if(!function->body->compound.statements)
18197 function->body->compound.statements = MkList();
18198 ListAdd(function->body->compound.statements, fireWatchers);
18199 curCompound = function->body;
18200 curContext = function->body->compound.context;
18201 ProcessStatement(fireWatchers);
18202 curContext = prevContext;
18203 curCompound = prevCompound;
18204 }
18205 curFunction = oldFunction;
18206 }
18207 if(function->declarator)
18208 {
18209 ProcessDeclarator(function->declarator);
18210 }
18211 topContext = oldTopContext;
18212 thisClass = oldThisClass;
18213 }
18214
18215 extern void FreeSymbol(struct Symbol * symbol);
18216
18217 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
18218
18219 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
18220 {
18221 struct ClassDef * def;
18222 struct External * external = curExternal;
18223 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
18224
18225 for(def = definitions->first; def; def = def->next)
18226 {
18227 if(def->type == 0)
18228 {
18229 if(def->function->declarator)
18230 curExternal = def->function->declarator->symbol->pointerExternal;
18231 else
18232 curExternal = external;
18233 ProcessFunction((struct FunctionDefinition *)def->function);
18234 }
18235 else if(def->type == 2)
18236 {
18237 if(def->decl->type == 2)
18238 {
18239 thisClass = regClass;
18240 ProcessInstantiationType(def->decl->inst);
18241 thisClass = (((void *)0));
18242 }
18243 else
18244 {
18245 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
18246
18247 if(regClass)
18248 thisClass = regClass;
18249 ProcessDeclaration(def->decl);
18250 thisClass = backThisClass;
18251 }
18252 }
18253 else if(def->type == 1 && def->defProperties)
18254 {
18255 struct MemberInit * defProperty;
18256 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);
18257
18258 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18259 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
18260 {
18261 thisClass = regClass;
18262 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
18263 thisClass = (((void *)0));
18264 }
18265 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18266 FreeSymbol(thisSymbol);
18267 }
18268 else if(def->type == 3 && def->propertyDef)
18269 {
18270 struct PropertyDef * prop = def->propertyDef;
18271
18272 thisClass = regClass;
18273 if(prop->setStmt)
18274 {
18275 if(regClass)
18276 {
18277 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18278
18279 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18280 }
18281 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
18282 ProcessStatement(prop->setStmt);
18283 }
18284 if(prop->getStmt)
18285 {
18286 if(regClass)
18287 {
18288 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18289
18290 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18291 }
18292 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
18293 ProcessStatement(prop->getStmt);
18294 }
18295 if(prop->issetStmt)
18296 {
18297 if(regClass)
18298 {
18299 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18300
18301 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18302 }
18303 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
18304 ProcessStatement(prop->issetStmt);
18305 }
18306 thisClass = (((void *)0));
18307 }
18308 else if(def->type == 4 && def->propertyWatch)
18309 {
18310 struct PropertyWatch * propertyWatch = def->propertyWatch;
18311
18312 thisClass = regClass;
18313 if(propertyWatch->compound)
18314 {
18315 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);
18316
18317 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18318 curExternal = (((void *)0));
18319 ProcessStatement(propertyWatch->compound);
18320 }
18321 thisClass = (((void *)0));
18322 }
18323 }
18324 }
18325
18326 void DeclareFunctionUtil(char * s)
18327 {
18328 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
18329
18330 if(function)
18331 {
18332 char name[1024];
18333
18334 name[0] = (char)0;
18335 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
18336 strcpy(name, "__ecereFunction_");
18337 FullClassNameCat(name, s, 0x0);
18338 DeclareFunction(function, name);
18339 }
18340 }
18341
18342 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
18343
18344 void ComputeDataTypes()
18345 {
18346 struct External * external;
18347 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
18348 struct External * after = (((void *)0));
18349
18350 currentClass = (((void *)0));
18351 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
18352 for(external = (*ast).first; external; external = external->next)
18353 {
18354 if(external->type == 1)
18355 {
18356 struct Declaration * decl = external->declaration;
18357
18358 if(decl)
18359 {
18360 struct __ecereNameSpace__ecere__sys__OldList * decls = decl->declarators;
18361
18362 if(decls)
18363 {
18364 struct InitDeclarator * initDecl = (*decls).first;
18365
18366 if(initDecl)
18367 {
18368 struct Declarator * declarator = initDecl->declarator;
18369
18370 if(declarator && declarator->type == 1)
18371 {
18372 struct Identifier * id = declarator->identifier;
18373
18374 if(id && id->string)
18375 {
18376 if(!strcmp(id->string, "uintptr_t") || !strcmp(id->string, "intptr_t") || !strcmp(id->string, "size_t") || !strcmp(id->string, "ssize_t"))
18377 {
18378 external->symbol->id = -1001, external->symbol->idCode = -1001;
18379 after = external;
18380 }
18381 }
18382 }
18383 }
18384 }
18385 }
18386 }
18387 }
18388 temp->symbol = __extension__ ({
18389 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18390
18391 __ecereInstance1->id = -1000, __ecereInstance1->idCode = -1000, __ecereInstance1;
18392 });
18393 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
18394 curExternal = temp;
18395 DeclareFunctionUtil("eSystem_New");
18396 DeclareFunctionUtil("eSystem_New0");
18397 DeclareFunctionUtil("eSystem_Renew");
18398 DeclareFunctionUtil("eSystem_Renew0");
18399 DeclareFunctionUtil("eSystem_Delete");
18400 DeclareFunctionUtil("eClass_GetProperty");
18401 DeclareFunctionUtil("eInstance_FireSelfWatchers");
18402 DeclareStruct("ecere::com::Class", 0x0);
18403 DeclareStruct("ecere::com::Instance", 0x0);
18404 DeclareStruct("ecere::com::Property", 0x0);
18405 DeclareStruct("ecere::com::DataMember", 0x0);
18406 DeclareStruct("ecere::com::Method", 0x0);
18407 DeclareStruct("ecere::com::SerialBuffer", 0x0);
18408 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
18409 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
18410 for(external = (*ast).first; external; external = external->next)
18411 {
18412 afterExternal = curExternal = external;
18413 if(external->type == 0)
18414 {
18415 currentClass = external->function->_class;
18416 ProcessFunction(external->function);
18417 }
18418 else if(external->type == 1)
18419 {
18420 currentClass = (((void *)0));
18421 ProcessDeclaration(external->declaration);
18422 }
18423 else if(external->type == 2)
18424 {
18425 struct ClassDefinition * _class = external->_class;
18426
18427 currentClass = external->symbol->registered;
18428 if(_class->definitions)
18429 {
18430 ProcessClass(_class->definitions, _class->symbol);
18431 }
18432 if(inCompiler)
18433 {
18434 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
18435 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
18436 }
18437 }
18438 else if(external->type == 4)
18439 {
18440 thisNameSpace = external->id->string;
18441 }
18442 }
18443 currentClass = (((void *)0));
18444 thisNameSpace = (((void *)0));
18445 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
18446 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
18447 }
18448
18449 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);
18450
18451 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);
18452
18453 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
18454
18455 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
18456 {
18457 struct __ecereNameSpace__ecere__com__Class * class;
18458
18459 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
18460 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
18461 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
18462 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
18463 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
18464 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
18465 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
18466 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
18467 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
18468 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
18469 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
18470 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
18471 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
18472 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
18473 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
18474 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
18475 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
18476 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
18477 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt", "bool GetOpInt(Operand op2, int * value2)", GetOpInt, module, 1);
18478 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
18479 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt", "bool GetOpUInt(Operand op2, uint * value2)", GetOpUInt, module, 1);
18480 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
18481 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt64", "bool GetOpInt64(Operand op2, int64 * value2)", GetOpInt64, module, 1);
18482 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
18483 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt64", "bool GetOpUInt64(Operand op2, uint64 * value2)", GetOpUInt64, module, 1);
18484 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
18485 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntPtr", "bool GetOpIntPtr(Operand op2, intptr * value2)", GetOpIntPtr, module, 1);
18486 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
18487 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntPtr", "bool GetOpUIntPtr(Operand op2, uintptr * value2)", GetOpUIntPtr, module, 1);
18488 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
18489 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntSize", "bool GetOpIntSize(Operand op2, intsize * value2)", GetOpIntSize, module, 1);
18490 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
18491 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntSize", "bool GetOpUIntSize(Operand op2, uintsize * value2)", GetOpUIntSize, module, 1);
18492 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
18493 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpShort", "bool GetOpShort(Operand op2, short * value2)", GetOpShort, module, 1);
18494 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
18495 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUShort", "bool GetOpUShort(Operand op2, uint16 * value2)", GetOpUShort, module, 1);
18496 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
18497 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpChar", "bool GetOpChar(Operand op2, char * value2)", GetOpChar, module, 1);
18498 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
18499 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUChar", "bool GetOpUChar(Operand op2, byte * value2)", GetOpUChar, module, 1);
18500 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
18501 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpFloat", "bool GetOpFloat(Operand op2, float * value2)", GetOpFloat, module, 1);
18502 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
18503 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpDouble", "bool GetOpDouble(Operand op2, double * value2)", GetOpDouble, module, 1);
18504 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
18505 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
18506 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
18507 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
18508 __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);
18509 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
18510 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
18511 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
18512 __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);
18513 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
18514 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
18515 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
18516 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
18517 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
18518 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
18519 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
18520 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
18521 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
18522 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
18523 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
18524 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
18525 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
18526 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
18527 __ecereClass_Conversion = class;
18528 __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);
18529 __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);
18530 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
18531 __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);
18532 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
18533 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
18534 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("UnescapeString", "int UnescapeString(char * d, char * s, int len)", UnescapeString, module, 1);
18535 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("OffsetEscapedString", "char * OffsetEscapedString(char * s, int len, int offset)", OffsetEscapedString, module, 1);
18536 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
18537 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
18538 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
18539 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
18540 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
18541 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
18542 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
18543 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
18544 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
18545 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
18546 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetParseError", "bool GetParseError(void)", GetParseError, module, 1);
18547 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
18548 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
18549 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
18550 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
18551 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(String s)", DeclareFunctionUtil, module, 1);
18552 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
18553 }
18554
18555 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
18556 {
18557
18558 }
18559