ide/debugger/watches: Improved + and - pointer operations
[sdk] / compiler / bootstrap / libec / bootstrap / pass15.c
1 /* Code generated from eC source file: pass15.ec */
2 #if defined(__GNUC__)
3 typedef long long int64;
4 typedef unsigned long long uint64;
5 #ifndef _WIN32
6 #define __declspec(x)
7 #endif
8 #elif defined(__TINYC__)
9 #include <stdarg.h>
10 #define __builtin_va_list va_list
11 #define __builtin_va_start va_start
12 #define __builtin_va_end va_end
13 #ifdef _WIN32
14 #define strcasecmp stricmp
15 #define strncasecmp strnicmp
16 #define __declspec(x) __attribute__((x))
17 #else
18 #define __declspec(x)
19 #endif
20 typedef long long int64;
21 typedef unsigned long long uint64;
22 #else
23 typedef __int64 int64;
24 typedef unsigned __int64 uint64;
25 #endif
26 #ifdef __BIG_ENDIAN__
27 #define __ENDIAN_PAD(x) (8 - (x))
28 #else
29 #define __ENDIAN_PAD(x) 0
30 #endif
31 #include <stdint.h>
32 #include <sys/types.h>
33
34 #if /*defined(_W64) || */(defined(__WORDSIZE) && __WORDSIZE == 8) || defined(__x86_64__)
35 #define _64BIT 1
36 #else
37 #define _64BIT 0
38 #endif
39
40 #define arch_PointerSize                  sizeof(void *)
41 #define structSize_Instance               (_64BIT ? 24 : 12)
42 #define structSize_Module                 (_64BIT ? 560 : 300)
43 #define structSize_NamedLink              (_64BIT ? 32 : 16)
44
45 extern void *  __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
46
47 extern void *  __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
48
49 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew(void *  memory, unsigned int size);
50
51 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew0(void *  memory, unsigned int size);
52
53 extern void __ecereNameSpace__ecere__com__eSystem_Delete(void *  memory);
54
55 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BTNode;
56
57 struct __ecereNameSpace__ecere__sys__BTNode;
58
59 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BinaryTree;
60
61 struct __ecereNameSpace__ecere__sys__BinaryTree
62 {
63 struct __ecereNameSpace__ecere__sys__BTNode * root;
64 int count;
65 int (*  CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
66 void (*  FreeKey)(void *  key);
67 } __attribute__ ((gcc_struct));
68
69 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldList;
70
71 struct __ecereNameSpace__ecere__sys__OldList
72 {
73 void *  first;
74 void *  last;
75 int count;
76 unsigned int offset;
77 unsigned int circ;
78 } __attribute__ ((gcc_struct));
79
80 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Method;
81
82 struct __ecereNameSpace__ecere__com__Method
83 {
84 char *  name;
85 struct __ecereNameSpace__ecere__com__Method * parent;
86 struct __ecereNameSpace__ecere__com__Method * left;
87 struct __ecereNameSpace__ecere__com__Method * right;
88 int depth;
89 int (*  function)();
90 int vid;
91 int type;
92 struct __ecereNameSpace__ecere__com__Class * _class;
93 void *  symbol;
94 char *  dataTypeString;
95 struct Type * dataType;
96 int memberAccess;
97 } __attribute__ ((gcc_struct));
98
99 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Property;
100
101 struct __ecereNameSpace__ecere__com__Property
102 {
103 struct __ecereNameSpace__ecere__com__Property * prev;
104 struct __ecereNameSpace__ecere__com__Property * next;
105 char *  name;
106 unsigned int isProperty;
107 int memberAccess;
108 int id;
109 struct __ecereNameSpace__ecere__com__Class * _class;
110 char *  dataTypeString;
111 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
112 struct Type * dataType;
113 void (*  Set)(void * , int);
114 int (*  Get)(void * );
115 unsigned int (*  IsSet)(void * );
116 void *  data;
117 void *  symbol;
118 int vid;
119 unsigned int conversion;
120 unsigned int watcherOffset;
121 char *  category;
122 unsigned int compiled;
123 unsigned int selfWatchable;
124 unsigned int isWatchable;
125 } __attribute__ ((gcc_struct));
126
127 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_CodePosition;
128
129 struct CodePosition
130 {
131 int line;
132 int charPos;
133 int pos;
134 int included;
135 } __attribute__ ((gcc_struct));
136
137 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Location;
138
139 struct Location
140 {
141 struct CodePosition start;
142 struct CodePosition end;
143 } __attribute__ ((gcc_struct));
144
145 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attrib;
146
147 struct Attrib;
148
149 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ExtDecl;
150
151 struct ExtDecl
152 {
153 struct Location loc;
154 int type;
155 union
156 {
157 char * s;
158 struct Attrib * attr;
159 } __attribute__ ((gcc_struct));
160 } __attribute__ ((gcc_struct));
161
162 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDefinition;
163
164 struct ClassDefinition
165 {
166 struct ClassDefinition * prev;
167 struct ClassDefinition * next;
168 struct Location loc;
169 struct Specifier * _class;
170 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
171 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
172 struct Symbol * symbol;
173 struct Location blockStart;
174 struct Location nameLoc;
175 int endid;
176 int declMode;
177 unsigned int deleteWatchable;
178 } __attribute__ ((gcc_struct));
179
180 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
181
182 struct Context
183 {
184 struct Context * parent;
185 struct __ecereNameSpace__ecere__sys__BinaryTree types;
186 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
187 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
188 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
189 int nextID;
190 int simpleID;
191 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
192 struct ClassDefinition * classDef;
193 unsigned int templateTypesOnly;
194 unsigned int hasNameSpace;
195 } __attribute__ ((gcc_struct));
196
197 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
198
199 struct Instantiation
200 {
201 struct Instantiation * prev;
202 struct Instantiation * next;
203 struct Location loc;
204 struct Specifier * _class;
205 struct Expression * exp;
206 struct __ecereNameSpace__ecere__sys__OldList *  members;
207 struct Symbol * symbol;
208 unsigned int fullSet;
209 unsigned int isConstant;
210 unsigned char *  data;
211 struct Location nameLoc;
212 struct Location insideLoc;
213 unsigned int built;
214 } __attribute__ ((gcc_struct));
215
216 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declaration;
217
218 struct Declaration
219 {
220 struct Declaration * prev;
221 struct Declaration * next;
222 struct Location loc;
223 int type;
224 union
225 {
226 struct
227 {
228 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
229 struct __ecereNameSpace__ecere__sys__OldList *  declarators;
230 } __attribute__ ((gcc_struct));
231 struct Instantiation * inst;
232 struct
233 {
234 struct Identifier * id;
235 struct Expression * exp;
236 } __attribute__ ((gcc_struct));
237 } __attribute__ ((gcc_struct));
238 struct Specifier * extStorage;
239 struct Symbol * symbol;
240 int declMode;
241 } __attribute__ ((gcc_struct));
242
243 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Statement;
244
245 struct Statement
246 {
247 struct Statement * prev;
248 struct Statement * next;
249 struct Location loc;
250 int type;
251 union
252 {
253 struct __ecereNameSpace__ecere__sys__OldList *  expressions;
254 struct
255 {
256 struct Identifier * id;
257 struct Statement * stmt;
258 } __attribute__ ((gcc_struct)) labeled;
259 struct
260 {
261 struct Expression * exp;
262 struct Statement * stmt;
263 } __attribute__ ((gcc_struct)) caseStmt;
264 struct
265 {
266 struct __ecereNameSpace__ecere__sys__OldList * declarations;
267 struct __ecereNameSpace__ecere__sys__OldList * statements;
268 struct Context * context;
269 unsigned int isSwitch;
270 } __attribute__ ((gcc_struct)) compound;
271 struct
272 {
273 struct __ecereNameSpace__ecere__sys__OldList * exp;
274 struct Statement * stmt;
275 struct Statement * elseStmt;
276 } __attribute__ ((gcc_struct)) ifStmt;
277 struct
278 {
279 struct __ecereNameSpace__ecere__sys__OldList * exp;
280 struct Statement * stmt;
281 } __attribute__ ((gcc_struct)) switchStmt;
282 struct
283 {
284 struct __ecereNameSpace__ecere__sys__OldList * exp;
285 struct Statement * stmt;
286 } __attribute__ ((gcc_struct)) whileStmt;
287 struct
288 {
289 struct __ecereNameSpace__ecere__sys__OldList * exp;
290 struct Statement * stmt;
291 } __attribute__ ((gcc_struct)) doWhile;
292 struct
293 {
294 struct Statement * init;
295 struct Statement * check;
296 struct __ecereNameSpace__ecere__sys__OldList * increment;
297 struct Statement * stmt;
298 } __attribute__ ((gcc_struct)) forStmt;
299 struct
300 {
301 struct Identifier * id;
302 } __attribute__ ((gcc_struct)) gotoStmt;
303 struct
304 {
305 struct Specifier * spec;
306 char * statements;
307 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
308 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
309 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
310 } __attribute__ ((gcc_struct)) asmStmt;
311 struct
312 {
313 struct Expression * watcher;
314 struct Expression * object;
315 struct __ecereNameSpace__ecere__sys__OldList * watches;
316 } __attribute__ ((gcc_struct)) _watch;
317 struct
318 {
319 struct Identifier * id;
320 struct __ecereNameSpace__ecere__sys__OldList * exp;
321 struct __ecereNameSpace__ecere__sys__OldList * filter;
322 struct Statement * stmt;
323 } __attribute__ ((gcc_struct)) forEachStmt;
324 struct Declaration * decl;
325 } __attribute__ ((gcc_struct));
326 } __attribute__ ((gcc_struct));
327
328 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
329
330 struct TypeName
331 {
332 struct TypeName * prev;
333 struct TypeName * next;
334 struct Location loc;
335 struct __ecereNameSpace__ecere__sys__OldList *  qualifiers;
336 struct Declarator * declarator;
337 int classObjectType;
338 struct Expression * bitCount;
339 } __attribute__ ((gcc_struct));
340
341 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Initializer;
342
343 struct Initializer
344 {
345 struct Initializer * prev;
346 struct Initializer * next;
347 struct Location loc;
348 int type;
349 union
350 {
351 struct Expression * exp;
352 struct __ecereNameSpace__ecere__sys__OldList *  list;
353 } __attribute__ ((gcc_struct));
354 unsigned int isConstant;
355 } __attribute__ ((gcc_struct));
356
357 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
358
359 struct __ecereNameSpace__ecere__com__DataValue
360 {
361 union
362 {
363 char c;
364 unsigned char uc;
365 short s;
366 unsigned short us;
367 int i;
368 unsigned int ui;
369 void *  p;
370 float f;
371 double d;
372 long long i64;
373 uint64 ui64;
374 } __attribute__ ((gcc_struct));
375 } __attribute__ ((gcc_struct));
376
377 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
378
379 struct Expression
380 {
381 struct Expression * prev;
382 struct Expression * next;
383 struct Location loc;
384 int type;
385 union
386 {
387 struct
388 {
389 char *  constant;
390 struct Identifier * identifier;
391 } __attribute__ ((gcc_struct));
392 struct Statement * compound;
393 struct Instantiation * instance;
394 struct
395 {
396 char *  string;
397 unsigned int intlString;
398 } __attribute__ ((gcc_struct));
399 struct __ecereNameSpace__ecere__sys__OldList *  list;
400 struct
401 {
402 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
403 struct Declarator * decl;
404 } __attribute__ ((gcc_struct)) _classExp;
405 struct
406 {
407 struct Identifier * id;
408 } __attribute__ ((gcc_struct)) classData;
409 struct
410 {
411 struct Expression * exp;
412 struct __ecereNameSpace__ecere__sys__OldList * arguments;
413 struct Location argLoc;
414 } __attribute__ ((gcc_struct)) call;
415 struct
416 {
417 struct Expression * exp;
418 struct __ecereNameSpace__ecere__sys__OldList * index;
419 } __attribute__ ((gcc_struct)) index;
420 struct
421 {
422 struct Expression * exp;
423 struct Identifier * member;
424 int memberType;
425 unsigned int thisPtr;
426 } __attribute__ ((gcc_struct)) member;
427 struct
428 {
429 int op;
430 struct Expression * exp1;
431 struct Expression * exp2;
432 } __attribute__ ((gcc_struct)) op;
433 struct TypeName * typeName;
434 struct Specifier * _class;
435 struct
436 {
437 struct TypeName * typeName;
438 struct Expression * exp;
439 } __attribute__ ((gcc_struct)) cast;
440 struct
441 {
442 struct Expression * cond;
443 struct __ecereNameSpace__ecere__sys__OldList * exp;
444 struct Expression * elseExp;
445 } __attribute__ ((gcc_struct)) cond;
446 struct
447 {
448 struct TypeName * typeName;
449 struct Expression * size;
450 } __attribute__ ((gcc_struct)) _new;
451 struct
452 {
453 struct TypeName * typeName;
454 struct Expression * size;
455 struct Expression * exp;
456 } __attribute__ ((gcc_struct)) _renew;
457 struct
458 {
459 char * table;
460 struct Identifier * id;
461 } __attribute__ ((gcc_struct)) db;
462 struct
463 {
464 struct Expression * ds;
465 struct Expression * name;
466 } __attribute__ ((gcc_struct)) dbopen;
467 struct
468 {
469 struct TypeName * typeName;
470 struct Initializer * initializer;
471 } __attribute__ ((gcc_struct)) initializer;
472 struct
473 {
474 struct Expression * exp;
475 struct TypeName * typeName;
476 } __attribute__ ((gcc_struct)) vaArg;
477 } __attribute__ ((gcc_struct));
478 unsigned int debugValue;
479 struct __ecereNameSpace__ecere__com__DataValue val;
480 uint64 address;
481 unsigned int hasAddress;
482 struct Type * expType;
483 struct Type * destType;
484 unsigned int usage;
485 int tempCount;
486 unsigned int byReference;
487 unsigned int isConstant;
488 unsigned int addedThis;
489 unsigned int needCast;
490 unsigned int thisPtr;
491 } __attribute__ ((gcc_struct));
492
493 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
494
495 struct TemplateDatatype
496 {
497 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
498 struct Declarator * decl;
499 } __attribute__ ((gcc_struct));
500
501 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
502
503 struct TemplateArgument;
504
505 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
506
507 struct TemplateParameter
508 {
509 struct TemplateParameter * prev;
510 struct TemplateParameter * next;
511 struct Location loc;
512 int type;
513 struct Identifier * identifier;
514 union
515 {
516 struct TemplateDatatype * dataType;
517 int memberType;
518 } __attribute__ ((gcc_struct));
519 struct TemplateArgument * defaultArgument;
520 char *  dataTypeString;
521 struct Type * baseType;
522 } __attribute__ ((gcc_struct));
523
524 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
525
526 struct Specifier
527 {
528 struct Specifier * prev;
529 struct Specifier * next;
530 struct Location loc;
531 int type;
532 union
533 {
534 int specifier;
535 struct
536 {
537 struct ExtDecl * extDecl;
538 char *  name;
539 struct Symbol * symbol;
540 struct __ecereNameSpace__ecere__sys__OldList *  templateArgs;
541 } __attribute__ ((gcc_struct));
542 struct
543 {
544 struct Identifier * id;
545 struct __ecereNameSpace__ecere__sys__OldList *  list;
546 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
547 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
548 unsigned int addNameSpace;
549 struct Context * ctx;
550 struct ExtDecl * extDeclStruct;
551 } __attribute__ ((gcc_struct));
552 struct Expression * expression;
553 struct Specifier * _class;
554 struct TemplateParameter * templateParameter;
555 } __attribute__ ((gcc_struct));
556 } __attribute__ ((gcc_struct));
557
558 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
559
560 struct Identifier
561 {
562 struct Identifier * prev;
563 struct Identifier * next;
564 struct Location loc;
565 struct Symbol * classSym;
566 struct Specifier * _class;
567 char *  string;
568 struct Identifier * badID;
569 } __attribute__ ((gcc_struct));
570
571 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Pointer;
572
573 struct Pointer;
574
575 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
576
577 struct Declarator
578 {
579 struct Declarator * prev;
580 struct Declarator * next;
581 struct Location loc;
582 int type;
583 struct Symbol * symbol;
584 struct Declarator * declarator;
585 union
586 {
587 struct Identifier * identifier;
588 struct
589 {
590 struct Expression * exp;
591 struct Expression * posExp;
592 struct Attrib * attrib;
593 } __attribute__ ((gcc_struct)) structDecl;
594 struct
595 {
596 struct Expression * exp;
597 struct Specifier * enumClass;
598 } __attribute__ ((gcc_struct)) array;
599 struct
600 {
601 struct __ecereNameSpace__ecere__sys__OldList * parameters;
602 } __attribute__ ((gcc_struct)) function;
603 struct
604 {
605 struct Pointer * pointer;
606 } __attribute__ ((gcc_struct)) pointer;
607 struct
608 {
609 struct ExtDecl * extended;
610 } __attribute__ ((gcc_struct)) extended;
611 } __attribute__ ((gcc_struct));
612 } __attribute__ ((gcc_struct));
613
614 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
615
616 struct FunctionDefinition
617 {
618 struct FunctionDefinition * prev;
619 struct FunctionDefinition * next;
620 struct Location loc;
621 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
622 struct Declarator * declarator;
623 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
624 struct Statement * body;
625 struct __ecereNameSpace__ecere__com__Class * _class;
626 struct __ecereNameSpace__ecere__sys__OldList attached;
627 int declMode;
628 struct Type * type;
629 struct Symbol * propSet;
630 int tempCount;
631 unsigned int propertyNoThis;
632 } __attribute__ ((gcc_struct));
633
634 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
635
636 struct DBTableDef;
637
638 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
639
640 struct External
641 {
642 struct External * prev;
643 struct External * next;
644 struct Location loc;
645 int type;
646 struct Symbol * symbol;
647 union
648 {
649 struct FunctionDefinition * function;
650 struct ClassDefinition * _class;
651 struct Declaration * declaration;
652 char *  importString;
653 struct Identifier * id;
654 struct DBTableDef * table;
655 } __attribute__ ((gcc_struct));
656 int importType;
657 } __attribute__ ((gcc_struct));
658
659 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
660
661 struct ModuleImport
662 {
663 struct ModuleImport * prev;
664 struct ModuleImport * next;
665 char *  name;
666 struct __ecereNameSpace__ecere__sys__OldList classes;
667 struct __ecereNameSpace__ecere__sys__OldList functions;
668 int importType;
669 int importAccess;
670 } __attribute__ ((gcc_struct));
671
672 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
673
674 struct ClassImport
675 {
676 struct ClassImport * prev;
677 struct ClassImport * next;
678 char *  name;
679 struct __ecereNameSpace__ecere__sys__OldList methods;
680 struct __ecereNameSpace__ecere__sys__OldList properties;
681 unsigned int itself;
682 unsigned int isRemote;
683 } __attribute__ ((gcc_struct));
684
685 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
686
687 struct Symbol
688 {
689 char *  string;
690 struct Symbol * parent;
691 struct Symbol * left;
692 struct Symbol * right;
693 int depth;
694 struct Type * type;
695 union
696 {
697 struct __ecereNameSpace__ecere__com__Method * method;
698 struct __ecereNameSpace__ecere__com__Property * _property;
699 struct __ecereNameSpace__ecere__com__Class * registered;
700 } __attribute__ ((gcc_struct));
701 int id;
702 int idCode;
703 union
704 {
705 struct
706 {
707 struct External * pointerExternal;
708 struct External * structExternal;
709 } __attribute__ ((gcc_struct));
710 struct
711 {
712 struct External * externalGet;
713 struct External * externalSet;
714 struct External * externalPtr;
715 struct External * externalIsSet;
716 } __attribute__ ((gcc_struct));
717 struct
718 {
719 struct External * methodExternal;
720 struct External * methodCodeExternal;
721 } __attribute__ ((gcc_struct));
722 } __attribute__ ((gcc_struct));
723 unsigned int imported;
724 unsigned int declaredStructSym;
725 struct __ecereNameSpace__ecere__com__Class * _class;
726 unsigned int declaredStruct;
727 unsigned int needConstructor;
728 unsigned int needDestructor;
729 char *  constructorName;
730 char *  structName;
731 char *  className;
732 char *  destructorName;
733 struct ModuleImport * module;
734 struct ClassImport * _import;
735 struct Location nameLoc;
736 unsigned int isParam;
737 unsigned int isRemote;
738 unsigned int isStruct;
739 unsigned int fireWatchersDone;
740 int declaring;
741 unsigned int classData;
742 unsigned int isStatic;
743 char *  shortName;
744 struct __ecereNameSpace__ecere__sys__OldList *  templateParams;
745 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
746 struct Context * ctx;
747 int isIterator;
748 struct Expression * propCategory;
749 } __attribute__ ((gcc_struct));
750
751 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
752
753 struct Type
754 {
755 struct Type * prev;
756 struct Type * next;
757 int refCount;
758 union
759 {
760 struct Symbol * _class;
761 struct
762 {
763 struct __ecereNameSpace__ecere__sys__OldList members;
764 char *  enumName;
765 } __attribute__ ((gcc_struct));
766 struct
767 {
768 struct Type * returnType;
769 struct __ecereNameSpace__ecere__sys__OldList params;
770 struct Symbol * thisClass;
771 unsigned int staticMethod;
772 struct TemplateParameter * thisClassTemplate;
773 } __attribute__ ((gcc_struct));
774 struct
775 {
776 struct __ecereNameSpace__ecere__com__Method * method;
777 struct __ecereNameSpace__ecere__com__Class * methodClass;
778 struct __ecereNameSpace__ecere__com__Class * usedClass;
779 } __attribute__ ((gcc_struct));
780 struct
781 {
782 struct Type * arrayType;
783 int arraySize;
784 struct Expression * arraySizeExp;
785 unsigned int freeExp;
786 struct Symbol * enumClass;
787 } __attribute__ ((gcc_struct));
788 struct Type * type;
789 struct TemplateParameter * templateParameter;
790 } __attribute__ ((gcc_struct));
791 int kind;
792 unsigned int size;
793 char *  name;
794 char *  typeName;
795 int classObjectType;
796 int alignment;
797 unsigned int offset;
798 int bitFieldCount;
799 int count;
800 unsigned int isSigned : 1;
801 unsigned int constant : 1;
802 unsigned int truth : 1;
803 unsigned int byReference : 1;
804 unsigned int extraParam : 1;
805 unsigned int directClassAccess : 1;
806 unsigned int computing : 1;
807 unsigned int keepCast : 1;
808 unsigned int passAsTemplate : 1;
809 unsigned int dllExport : 1;
810 unsigned int attrStdcall : 1;
811 unsigned int declaredWithStruct : 1;
812 unsigned int typedByReference : 1;
813 } __attribute__ ((gcc_struct));
814
815 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
816
817 struct __ecereNameSpace__ecere__com__Class
818 {
819 struct __ecereNameSpace__ecere__com__Class * prev;
820 struct __ecereNameSpace__ecere__com__Class * next;
821 char *  name;
822 int offset;
823 int structSize;
824 int (* *  _vTbl)();
825 int vTblSize;
826 int (*  Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
827 void (*  Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
828 int offsetClass;
829 int sizeClass;
830 struct __ecereNameSpace__ecere__com__Class * base;
831 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
832 struct __ecereNameSpace__ecere__sys__BinaryTree members;
833 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
834 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
835 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
836 struct __ecereNameSpace__ecere__sys__OldList derivatives;
837 int memberID;
838 int startMemberID;
839 int type;
840 struct __ecereNameSpace__ecere__com__Instance * module;
841 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
842 char *  dataTypeString;
843 struct Type * dataType;
844 int typeSize;
845 int defaultAlignment;
846 void (*  Initialize)();
847 int memberOffset;
848 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
849 char *  designerClass;
850 unsigned int noExpansion;
851 char *  defaultProperty;
852 unsigned int comRedefinition;
853 int count;
854 unsigned int isRemote;
855 unsigned int internalDecl;
856 void *  data;
857 unsigned int computeSize;
858 int structAlignment;
859 int destructionWatchOffset;
860 unsigned int fixed;
861 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
862 int inheritanceAccess;
863 char *  fullName;
864 void *  symbol;
865 struct __ecereNameSpace__ecere__sys__OldList conversions;
866 struct __ecereNameSpace__ecere__sys__OldList templateParams;
867 struct __ecereNameSpace__ecere__com__ClassTemplateArgument *  templateArgs;
868 struct __ecereNameSpace__ecere__com__Class * templateClass;
869 struct __ecereNameSpace__ecere__sys__OldList templatized;
870 int numParams;
871 unsigned int isInstanceClass;
872 unsigned int byValueSystemClass;
873 } __attribute__ ((gcc_struct));
874
875 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char *  name);
876
877 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
878
879 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
880
881 struct __ecereNameSpace__ecere__com__Instance
882 {
883 int (* *  _vTbl)();
884 struct __ecereNameSpace__ecere__com__Class * _class;
885 int _refCount;
886 } __attribute__ ((gcc_struct));
887
888 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
889
890 struct __ecereNameSpace__ecere__com__DataMember
891 {
892 struct __ecereNameSpace__ecere__com__DataMember * prev;
893 struct __ecereNameSpace__ecere__com__DataMember * next;
894 char *  name;
895 unsigned int isProperty;
896 int memberAccess;
897 int id;
898 struct __ecereNameSpace__ecere__com__Class * _class;
899 char *  dataTypeString;
900 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
901 struct Type * dataType;
902 int type;
903 int offset;
904 int memberID;
905 struct __ecereNameSpace__ecere__sys__OldList members;
906 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
907 int memberOffset;
908 int structAlignment;
909 } __attribute__ ((gcc_struct));
910
911 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
912
913 struct __ecereNameSpace__ecere__com__SerialBuffer
914 {
915 unsigned char *  _buffer;
916 unsigned int count;
917 unsigned int _size;
918 unsigned int pos;
919 } __attribute__ ((gcc_struct));
920
921 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
922
923 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
924 {
925 union
926 {
927 struct
928 {
929 char *  dataTypeString;
930 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
931 } __attribute__ ((gcc_struct));
932 struct __ecereNameSpace__ecere__com__DataValue expression;
933 struct
934 {
935 char *  memberString;
936 union
937 {
938 struct __ecereNameSpace__ecere__com__DataMember * member;
939 struct __ecereNameSpace__ecere__com__Property * prop;
940 struct __ecereNameSpace__ecere__com__Method * method;
941 } __attribute__ ((gcc_struct));
942 } __attribute__ ((gcc_struct));
943 } __attribute__ ((gcc_struct));
944 } __attribute__ ((gcc_struct));
945
946 void exit(int status);
947
948 void * calloc(size_t nmemb, size_t size);
949
950 void free(void * ptr);
951
952 void * malloc(size_t size);
953
954 void * realloc(void * ptr, size_t size);
955
956 long int strtol(const char * nptr, char ** endptr, int base);
957
958 long long int strtoll(const char * nptr, char ** endptr, int base);
959
960 unsigned long long int strtoull(const char * nptr, char ** endptr, int base);
961
962 enum yytokentype
963 {
964 IDENTIFIER = 258, CONSTANT = 259, STRING_LITERAL = 260, SIZEOF = 261, PTR_OP = 262, INC_OP = 263, DEC_OP = 264, LEFT_OP = 265, RIGHT_OP = 266, LE_OP = 267, GE_OP = 268, EQ_OP = 269, NE_OP = 270, AND_OP = 271, OR_OP = 272, MUL_ASSIGN = 273, DIV_ASSIGN = 274, MOD_ASSIGN = 275, ADD_ASSIGN = 276, SUB_ASSIGN = 277, LEFT_ASSIGN = 278, RIGHT_ASSIGN = 279, AND_ASSIGN = 280, XOR_ASSIGN = 281, OR_ASSIGN = 282, TYPE_NAME = 283, TYPEDEF = 284, EXTERN = 285, STATIC = 286, AUTO = 287, REGISTER = 288, CHAR = 289, SHORT = 290, INT = 291, UINT = 292, INT64 = 293, LONG = 294, SIGNED = 295, UNSIGNED = 296, FLOAT = 297, DOUBLE = 298, CONST = 299, VOLATILE = 300, VOID = 301, VALIST = 302, STRUCT = 303, UNION = 304, ENUM = 305, ELLIPSIS = 306, CASE = 307, DEFAULT = 308, IF = 309, SWITCH = 310, WHILE = 311, DO = 312, FOR = 313, GOTO = 314, CONTINUE = 315, BREAK = 316, RETURN = 317, IFX = 318, ELSE = 319, CLASS = 320, THISCLASS = 321, CLASS_NAME = 322, PROPERTY = 323, SETPROP = 324, GETPROP = 325, NEWOP = 326, RENEW = 327, DELETE = 328, EXT_DECL = 329, EXT_STORAGE = 330, IMPORT = 331, DEFINE = 332, VIRTUAL = 333, ATTRIB = 334, PUBLIC = 335, PRIVATE = 336, TYPED_OBJECT = 337, ANY_OBJECT = 338, _INCREF = 339, EXTENSION = 340, ASM = 341, TYPEOF = 342, WATCH = 343, STOPWATCHING = 344, FIREWATCHERS = 345, WATCHABLE = 346, CLASS_DESIGNER = 347, CLASS_NO_EXPANSION = 348, CLASS_FIXED = 349, ISPROPSET = 350, CLASS_DEFAULT_PROPERTY = 351, PROPERTY_CATEGORY = 352, CLASS_DATA = 353, CLASS_PROPERTY = 354, SUBCLASS = 355, NAMESPACE = 356, NEW0OP = 357, RENEW0 = 358, VAARG = 359, DBTABLE = 360, DBFIELD = 361, DBINDEX = 362, DATABASE_OPEN = 363, ALIGNOF = 364, ATTRIB_DEP = 365, __ATTRIB = 366, BOOL = 367, _BOOL = 368, _COMPLEX = 369, _IMAGINARY = 370, RESTRICT = 371, THREAD = 372
965 };
966
967 typedef union YYSTYPE
968 {
969 int specifierType;
970 int i;
971 int declMode;
972 struct Identifier * id;
973 struct Expression * exp;
974 struct Specifier * specifier;
975 struct __ecereNameSpace__ecere__sys__OldList * list;
976 struct Enumerator * enumerator;
977 struct Declarator * declarator;
978 struct Pointer * pointer;
979 struct Initializer * initializer;
980 struct InitDeclarator * initDeclarator;
981 struct TypeName * typeName;
982 struct Declaration * declaration;
983 struct Statement * stmt;
984 struct FunctionDefinition * function;
985 struct External * external;
986 struct Context * context;
987 struct AsmField * asmField;
988 struct Attrib * attrib;
989 struct ExtDecl * extDecl;
990 struct Attribute * attribute;
991 struct Instantiation * instance;
992 struct MembersInit * membersInit;
993 struct MemberInit * memberInit;
994 struct ClassFunction * classFunction;
995 struct ClassDefinition * _class;
996 struct ClassDef * classDef;
997 struct PropertyDef * prop;
998 char * string;
999 struct Symbol * symbol;
1000 struct PropertyWatch * propertyWatch;
1001 struct TemplateParameter * templateParameter;
1002 struct TemplateArgument * templateArgument;
1003 struct TemplateDatatype * templateDatatype;
1004 struct DBTableEntry * dbtableEntry;
1005 struct DBIndexItem * dbindexItem;
1006 struct DBTableDef * dbtableDef;
1007 } __attribute__ ((gcc_struct)) YYSTYPE;
1008
1009 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
1010
1011 struct Enumerator
1012 {
1013 struct Enumerator * prev;
1014 struct Enumerator * next;
1015 struct Location loc;
1016 struct Identifier * id;
1017 struct Expression * exp;
1018 } __attribute__ ((gcc_struct));
1019
1020 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
1021
1022 struct InitDeclarator
1023 {
1024 struct InitDeclarator * prev;
1025 struct InitDeclarator * next;
1026 struct Location loc;
1027 struct Declarator * declarator;
1028 struct Initializer * initializer;
1029 } __attribute__ ((gcc_struct));
1030
1031 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
1032
1033 struct AsmField
1034 {
1035 struct AsmField * prev;
1036 struct AsmField * next;
1037 struct Location loc;
1038 char *  command;
1039 struct Expression * expression;
1040 struct Identifier * symbolic;
1041 } __attribute__ ((gcc_struct));
1042
1043 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attribute;
1044
1045 struct Attribute;
1046
1047 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
1048
1049 struct ClassFunction
1050 {
1051 struct ClassFunction * prev;
1052 struct ClassFunction * next;
1053 struct Location loc;
1054 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1055 struct Declarator * declarator;
1056 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
1057 struct Statement * body;
1058 struct __ecereNameSpace__ecere__com__Class * _class;
1059 struct __ecereNameSpace__ecere__sys__OldList attached;
1060 int declMode;
1061 struct Type * type;
1062 struct Symbol * propSet;
1063 unsigned int isVirtual;
1064 unsigned int isConstructor;
1065 unsigned int isDestructor;
1066 unsigned int dontMangle;
1067 int id;
1068 int idCode;
1069 } __attribute__ ((gcc_struct));
1070
1071 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
1072
1073 struct MembersInit
1074 {
1075 struct MembersInit * prev;
1076 struct MembersInit * next;
1077 struct Location loc;
1078 int type;
1079 union
1080 {
1081 struct __ecereNameSpace__ecere__sys__OldList *  dataMembers;
1082 struct ClassFunction * function;
1083 } __attribute__ ((gcc_struct));
1084 } __attribute__ ((gcc_struct));
1085
1086 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
1087
1088 struct MemberInit
1089 {
1090 struct MemberInit * prev;
1091 struct MemberInit * next;
1092 struct Location loc;
1093 struct Location realLoc;
1094 struct __ecereNameSpace__ecere__sys__OldList *  identifiers;
1095 struct Initializer * initializer;
1096 unsigned int used;
1097 unsigned int variable;
1098 unsigned int takeOutExp;
1099 } __attribute__ ((gcc_struct));
1100
1101 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1102
1103 struct PropertyDef
1104 {
1105 struct PropertyDef * prev;
1106 struct PropertyDef * next;
1107 struct Location loc;
1108 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1109 struct Declarator * declarator;
1110 struct Identifier * id;
1111 struct Statement * getStmt;
1112 struct Statement * setStmt;
1113 struct Statement * issetStmt;
1114 struct Symbol * symbol;
1115 struct Expression * category;
1116 struct
1117 {
1118 unsigned int conversion : 1;
1119 unsigned int isWatchable : 1;
1120 unsigned int isDBProp : 1;
1121 } __attribute__ ((gcc_struct));
1122 } __attribute__ ((gcc_struct));
1123
1124 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1125
1126 struct PropertyWatch
1127 {
1128 struct PropertyWatch * prev;
1129 struct PropertyWatch * next;
1130 struct Location loc;
1131 struct Statement * compound;
1132 struct __ecereNameSpace__ecere__sys__OldList *  properties;
1133 unsigned int deleteWatch;
1134 } __attribute__ ((gcc_struct));
1135
1136 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1137
1138 struct ClassDef
1139 {
1140 struct ClassDef * prev;
1141 struct ClassDef * next;
1142 struct Location loc;
1143 int type;
1144 union
1145 {
1146 struct Declaration * decl;
1147 struct ClassFunction * function;
1148 struct __ecereNameSpace__ecere__sys__OldList *  defProperties;
1149 struct PropertyDef * propertyDef;
1150 struct PropertyWatch * propertyWatch;
1151 char *  designer;
1152 struct Identifier * defaultProperty;
1153 struct
1154 {
1155 struct Identifier * id;
1156 struct Initializer * initializer;
1157 } __attribute__ ((gcc_struct));
1158 } __attribute__ ((gcc_struct));
1159 int memberAccess;
1160 void *  object;
1161 } __attribute__ ((gcc_struct));
1162
1163 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1164
1165 struct DBTableEntry;
1166
1167 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1168
1169 struct DBIndexItem;
1170
1171 extern YYSTYPE yylval;
1172
1173 extern struct Location yylloc;
1174
1175 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1176
1177 extern int returnCode;
1178
1179 extern struct Expression * parsedExpression;
1180
1181 extern unsigned int yydebug;
1182
1183 void SetYydebug(unsigned int b)
1184 {
1185 yydebug = b;
1186 }
1187
1188 extern unsigned int echoOn;
1189
1190 void resetScanner();
1191
1192 int propWatcherID;
1193
1194 int expression_yyparse();
1195
1196 static struct Statement * curCompound;
1197
1198 struct External * curExternal, * afterExternal;
1199
1200 static struct Type * curSwitchType;
1201
1202 static struct __ecereNameSpace__ecere__com__Class * currentClass;
1203
1204 struct __ecereNameSpace__ecere__com__Class * thisClass;
1205
1206 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
1207 {
1208 thisClass = c;
1209 }
1210
1211 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
1212 {
1213 return thisClass;
1214 }
1215
1216 static char * thisNameSpace;
1217
1218 struct __ecereNameSpace__ecere__com__Class * containerClass;
1219
1220 unsigned int thisClassParams = 0x1;
1221
1222 unsigned int internalValueCounter;
1223
1224 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
1225
1226 extern size_t strlen(const char * );
1227
1228 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
1229
1230 extern void *  __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1231
1232 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
1233
1234 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
1235
1236 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
1237
1238 void PrintExpression(struct Expression * exp, char * string)
1239 {
1240 {
1241 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
1242 int count;
1243
1244 if(exp)
1245 OutputExpression(exp, f);
1246 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
1247 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
1248
1249 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
1250 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
1251 count = strlen(string);
1252 count += ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__extension__ ({
1253 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
1254
1255 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
1256 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Read])(f, string + count, 1, 1023);
1257 string[count] = '\0';
1258 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
1259 }
1260 }
1261
1262 extern struct Type * ProcessTypeString(char *  string, unsigned int staticMethod);
1263
1264 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1265
1266 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1267 {
1268 if(param && param->type == 0 && (param->dataType || param->dataTypeString))
1269 {
1270 if(!param->baseType)
1271 {
1272 if(param->dataTypeString)
1273 param->baseType = ProcessTypeString(param->dataTypeString, 0x0);
1274 else
1275 param->baseType = ProcessType(param->dataType->specifiers, param->dataType->decl);
1276 }
1277 return param->baseType;
1278 }
1279 return (((void *)0));
1280 }
1281
1282 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1283 {
1284 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1285 return 0x1;
1286 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0x0)
1287 {
1288 return 0x0;
1289 }
1290 if(type1->kind == type2->kind)
1291 {
1292 switch(type1->kind)
1293 {
1294 case 24:
1295 case 1:
1296 case 2:
1297 case 3:
1298 case 4:
1299 case 22:
1300 case 23:
1301 if(type1->passAsTemplate && !type2->passAsTemplate)
1302 return 0x1;
1303 return type1->isSigned != type2->isSigned;
1304 case 8:
1305 return type1->_class != type2->_class;
1306 case 13:
1307 return NeedCast(type1->type, type2->type);
1308 default:
1309 return 0x1;
1310 }
1311 }
1312 return 0x1;
1313 }
1314
1315 extern int strcmp(const char * , const char * );
1316
1317 extern struct Context * curContext;
1318
1319 extern struct Context * topContext;
1320
1321 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
1322
1323 extern struct __ecereNameSpace__ecere__com__Property * __ecereNameSpace__ecere__com__eClass_FindProperty(struct __ecereNameSpace__ecere__com__Class * _class, char *  name, struct __ecereNameSpace__ecere__com__Instance * module);
1324
1325 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1326
1327 extern struct __ecereNameSpace__ecere__com__Method * __ecereNameSpace__ecere__com__eClass_FindMethod(struct __ecereNameSpace__ecere__com__Class * _class, char *  name, struct __ecereNameSpace__ecere__com__Instance * module);
1328
1329 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_FindDataMember(struct __ecereNameSpace__ecere__com__Class * _class, char *  name, struct __ecereNameSpace__ecere__com__Instance * module, struct __ecereNameSpace__ecere__com__DataMember **  subMemberStack, int *  subMemberStackPos);
1330
1331 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassProperty;
1332
1333 struct __ecereNameSpace__ecere__com__ClassProperty
1334 {
1335 char *  name;
1336 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1337 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1338 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1339 int depth;
1340 void (*  Set)(struct __ecereNameSpace__ecere__com__Class *, long long);
1341 long long (*  Get)(struct __ecereNameSpace__ecere__com__Class *);
1342 char *  dataTypeString;
1343 struct Type * dataType;
1344 unsigned int constant;
1345 } __attribute__ ((gcc_struct));
1346
1347 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, char *  name);
1348
1349 extern struct Expression * QMkExpId(char *  id);
1350
1351 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateParameter;
1352
1353 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
1354 {
1355 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
1356 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
1357 char *  name;
1358 int type;
1359 union
1360 {
1361 char *  dataTypeString;
1362 int memberType;
1363 } __attribute__ ((gcc_struct));
1364 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
1365 void *  param;
1366 } __attribute__ ((gcc_struct));
1367
1368 extern struct Expression * GetTemplateArgExpByName(char *  paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
1369
1370 extern struct __ecereNameSpace__ecere__sys__OldList *  MkList(void);
1371
1372 extern void FreeIdentifier(struct Identifier * id);
1373
1374 void ProcessExpressionType(struct Expression * exp);
1375
1376 extern struct Declarator * SpecDeclFromString(char *  string, struct __ecereNameSpace__ecere__sys__OldList *  specs, struct Declarator * baseDecl);
1377
1378 extern struct __ecereNameSpace__ecere__sys__OldList *  MkListOne(void *  item);
1379
1380 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1381
1382 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1383
1384 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1385
1386 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1387
1388 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1389
1390 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char *  key);
1391
1392 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
1393 {
1394 if(exp->type == 0 && exp->identifier)
1395 {
1396 struct Identifier * id = exp->identifier;
1397 struct Context * ctx;
1398 struct Symbol * symbol = (((void *)0));
1399
1400 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
1401 {
1402 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
1403 {
1404 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
1405 if(symbol)
1406 break;
1407 }
1408 }
1409 if(!symbol && ((!id->_class || (id->_class->name && !strcmp(id->_class->name, "property"))) || (id->classSym && __ecereNameSpace__ecere__com__eClass_IsDerived(_class, id->classSym->registered))))
1410 {
1411 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
1412 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
1413 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
1414 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
1415
1416 if(!prop)
1417 {
1418 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
1419 }
1420 if(!prop && !method)
1421 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
1422 if(!prop && !method && !member)
1423 {
1424 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
1425 }
1426 if(prop || method || member || classProp)
1427 {
1428 exp->type = 8;
1429 exp->member.member = id;
1430 exp->member.memberType = 0;
1431 exp->member.exp = QMkExpId("this");
1432 exp->addedThis = 0x1;
1433 }
1434 else if(_class && _class->templateParams.first)
1435 {
1436 struct __ecereNameSpace__ecere__com__Class * sClass;
1437
1438 for(sClass = _class; sClass; sClass = sClass->base)
1439 {
1440 if(sClass->templateParams.first)
1441 {
1442 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
1443
1444 for(param = sClass->templateParams.first; param; param = param->next)
1445 {
1446 if(param->type == 2 && !strcmp(param->name, id->string))
1447 {
1448 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
1449
1450 if(argExp)
1451 {
1452 struct Declarator * decl;
1453 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1454
1455 FreeIdentifier(exp->member.member);
1456 ProcessExpressionType(argExp);
1457 decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
1458 exp->expType = ProcessType(specs, decl);
1459 exp->type = 5;
1460 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
1461 }
1462 }
1463 }
1464 }
1465 }
1466 }
1467 }
1468 }
1469 }
1470
1471 extern int sprintf(char * , char * , ...);
1472
1473 extern int __ecereNameSpace__ecere__com__GetRuntimePlatform(void);
1474
1475 extern char *  strcat(char * , const char * );
1476
1477 extern char *  __ecereNameSpace__ecere__sys__CopyString(char *  string);
1478
1479 char * PrintInt(long long result)
1480 {
1481 char temp[100];
1482
1483 if(result > (((int)0x7fffffff)))
1484 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1485 else
1486 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1487 if(result > (((int)0x7fffffff)) || result < (((int)0x80000000)))
1488 strcat(temp, "LL");
1489 return __ecereNameSpace__ecere__sys__CopyString(temp);
1490 }
1491
1492 char * PrintUInt(uint64 result)
1493 {
1494 char temp[100];
1495
1496 if(result > (0xffffffff))
1497 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1498 else if(result > (((int)0x7fffffff)))
1499 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1500 else
1501 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1502 return __ecereNameSpace__ecere__sys__CopyString(temp);
1503 }
1504
1505 char * PrintInt64(long long result)
1506 {
1507 char temp[100];
1508
1509 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1510 return __ecereNameSpace__ecere__sys__CopyString(temp);
1511 }
1512
1513 char * PrintUInt64(uint64 result)
1514 {
1515 char temp[100];
1516
1517 if(result > (((long long)0x7fffffffffffffffLL)))
1518 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1519 else
1520 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1521 return __ecereNameSpace__ecere__sys__CopyString(temp);
1522 }
1523
1524 char * PrintHexUInt(uint64 result)
1525 {
1526 char temp[100];
1527
1528 if(result > (0xffffffff))
1529 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1530 else
1531 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1532 if(result > (0xffffffff))
1533 strcat(temp, "LL");
1534 return __ecereNameSpace__ecere__sys__CopyString(temp);
1535 }
1536
1537 char * PrintHexUInt64(uint64 result)
1538 {
1539 char temp[100];
1540
1541 if(result > (0xffffffff))
1542 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1543 else
1544 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1545 return __ecereNameSpace__ecere__sys__CopyString(temp);
1546 }
1547
1548 char * PrintShort(short result)
1549 {
1550 char temp[100];
1551
1552 sprintf(temp, "%d", (unsigned short)result);
1553 return __ecereNameSpace__ecere__sys__CopyString(temp);
1554 }
1555
1556 char * PrintUShort(unsigned short result)
1557 {
1558 char temp[100];
1559
1560 if(result > (unsigned short)32767)
1561 sprintf(temp, "0x%X", (int)result);
1562 else
1563 sprintf(temp, "%d", (int)result);
1564 return __ecereNameSpace__ecere__sys__CopyString(temp);
1565 }
1566
1567 extern int isprint(int c);
1568
1569 char * PrintChar(char result)
1570 {
1571 char temp[100];
1572
1573 if(result > (char)0 && isprint(result))
1574 sprintf(temp, "'%c'", result);
1575 else if(result < (char)0)
1576 sprintf(temp, "%d", (int)result);
1577 else
1578 sprintf(temp, "0x%X", (unsigned char)result);
1579 return __ecereNameSpace__ecere__sys__CopyString(temp);
1580 }
1581
1582 char * PrintUChar(unsigned char result)
1583 {
1584 char temp[100];
1585
1586 sprintf(temp, "0x%X", result);
1587 return __ecereNameSpace__ecere__sys__CopyString(temp);
1588 }
1589
1590 extern char *  strcpy(char * , const char * );
1591
1592 extern unsigned int (* __ecereProp_float_Get_isInf)(float this);
1593
1594 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_isInf;
1595
1596 extern int (* __ecereProp_float_Get_signBit)(float this);
1597
1598 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_signBit;
1599
1600 extern unsigned int (* __ecereProp_float_Get_isNan)(float this);
1601
1602 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_isNan;
1603
1604 char * PrintFloat(float result)
1605 {
1606 char temp[350];
1607
1608 if(__ecereProp_float_Get_isInf(result))
1609 {
1610 if(__ecereProp_float_Get_signBit(result))
1611 strcpy(temp, "-inf");
1612 else
1613 strcpy(temp, "inf");
1614 }
1615 else if(__ecereProp_float_Get_isNan(result))
1616 {
1617 if(__ecereProp_float_Get_signBit(result))
1618 strcpy(temp, "-nan");
1619 else
1620 strcpy(temp, "nan");
1621 }
1622 else
1623 sprintf(temp, "%.16ff", result);
1624 return __ecereNameSpace__ecere__sys__CopyString(temp);
1625 }
1626
1627 extern unsigned int (* __ecereProp_double_Get_isInf)(double this);
1628
1629 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_isInf;
1630
1631 extern int (* __ecereProp_double_Get_signBit)(double this);
1632
1633 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_signBit;
1634
1635 extern unsigned int (* __ecereProp_double_Get_isNan)(double this);
1636
1637 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_isNan;
1638
1639 char * PrintDouble(double result)
1640 {
1641 char temp[350];
1642
1643 if(__ecereProp_double_Get_isInf(result))
1644 {
1645 if(__ecereProp_double_Get_signBit(result))
1646 strcpy(temp, "-inf");
1647 else
1648 strcpy(temp, "inf");
1649 }
1650 else if(__ecereProp_double_Get_isNan(result))
1651 {
1652 if(__ecereProp_double_Get_signBit(result))
1653 strcpy(temp, "-nan");
1654 else
1655 strcpy(temp, "nan");
1656 }
1657 else
1658 sprintf(temp, "%.16f", result);
1659 return __ecereNameSpace__ecere__sys__CopyString(temp);
1660 }
1661
1662 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1663
1664 struct OpTable
1665 {
1666 unsigned int (*  Add)(struct Expression *, struct Operand *, struct Operand *);
1667 unsigned int (*  Sub)(struct Expression *, struct Operand *, struct Operand *);
1668 unsigned int (*  Mul)(struct Expression *, struct Operand *, struct Operand *);
1669 unsigned int (*  Div)(struct Expression *, struct Operand *, struct Operand *);
1670 unsigned int (*  Mod)(struct Expression *, struct Operand *, struct Operand *);
1671 unsigned int (*  Neg)(struct Expression *, struct Operand *);
1672 unsigned int (*  Inc)(struct Expression *, struct Operand *);
1673 unsigned int (*  Dec)(struct Expression *, struct Operand *);
1674 unsigned int (*  Asign)(struct Expression *, struct Operand *, struct Operand *);
1675 unsigned int (*  AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1676 unsigned int (*  SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1677 unsigned int (*  MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1678 unsigned int (*  DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1679 unsigned int (*  ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1680 unsigned int (*  BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1681 unsigned int (*  BitOr)(struct Expression *, struct Operand *, struct Operand *);
1682 unsigned int (*  BitXor)(struct Expression *, struct Operand *, struct Operand *);
1683 unsigned int (*  LShift)(struct Expression *, struct Operand *, struct Operand *);
1684 unsigned int (*  RShift)(struct Expression *, struct Operand *, struct Operand *);
1685 unsigned int (*  BitNot)(struct Expression *, struct Operand *);
1686 unsigned int (*  AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1687 unsigned int (*  OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1688 unsigned int (*  XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1689 unsigned int (*  LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1690 unsigned int (*  RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1691 unsigned int (*  Not)(struct Expression *, struct Operand *);
1692 unsigned int (*  Equ)(struct Expression *, struct Operand *, struct Operand *);
1693 unsigned int (*  Nqu)(struct Expression *, struct Operand *, struct Operand *);
1694 unsigned int (*  And)(struct Expression *, struct Operand *, struct Operand *);
1695 unsigned int (*  Or)(struct Expression *, struct Operand *, struct Operand *);
1696 unsigned int (*  Grt)(struct Expression *, struct Operand *, struct Operand *);
1697 unsigned int (*  Sma)(struct Expression *, struct Operand *, struct Operand *);
1698 unsigned int (*  GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1699 unsigned int (*  SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1700 unsigned int (*  Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1701 } __attribute__ ((gcc_struct));
1702
1703 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1704
1705 struct Operand
1706 {
1707 int kind;
1708 struct Type * type;
1709 unsigned int ptrSize;
1710 union
1711 {
1712 char c;
1713 unsigned char uc;
1714 short s;
1715 unsigned short us;
1716 int i;
1717 unsigned int ui;
1718 float f;
1719 double d;
1720 long long i64;
1721 uint64 ui64;
1722 } __attribute__ ((gcc_struct));
1723 struct OpTable ops;
1724 } __attribute__ ((gcc_struct));
1725
1726 unsigned int GetOpInt(struct Operand * op2, int * value2)
1727 {
1728 if(op2->kind == 3 && op2->type->isSigned)
1729 *value2 = op2->i;
1730 else if(op2->kind == 3)
1731 *value2 = (int)op2->ui;
1732 else if(op2->kind == 4 && op2->type->isSigned)
1733 *value2 = (int)op2->i64;
1734 else if(op2->kind == 4)
1735 *value2 = (int)op2->ui64;
1736 else if(op2->kind == 23 && op2->type->isSigned)
1737 *value2 = (int)op2->i64;
1738 else if(op2->kind == 23)
1739 *value2 = (int)op2->ui64;
1740 else if(op2->kind == 22 && op2->type->isSigned)
1741 *value2 = (int)op2->i64;
1742 else if(op2->kind == 22)
1743 *value2 = (int)op2->ui64;
1744 else if(op2->kind == 2 && op2->type->isSigned)
1745 *value2 = (int)op2->s;
1746 else if(op2->kind == 2)
1747 *value2 = (int)op2->us;
1748 else if(op2->kind == 1 && op2->type->isSigned)
1749 *value2 = (int)op2->c;
1750 else if(op2->kind == 24 || op2->kind == 1)
1751 *value2 = (int)op2->uc;
1752 else if(op2->kind == 6)
1753 *value2 = (int)op2->f;
1754 else if(op2->kind == 7)
1755 *value2 = (int)op2->d;
1756 else if(op2->kind == 13)
1757 *value2 = (int)op2->ui64;
1758 else
1759 return 0x0;
1760 return 0x1;
1761 }
1762
1763 struct Operand GetOperand(struct Expression * exp);
1764
1765 unsigned int GetInt(struct Expression * exp, int * value2)
1766 {
1767 struct Operand op2 = GetOperand(exp);
1768
1769 return GetOpInt(&op2, value2);
1770 }
1771
1772 unsigned int GetOpUInt(struct Operand * op2, unsigned int * value2)
1773 {
1774 if(op2->kind == 3 && op2->type->isSigned)
1775 *value2 = (unsigned int)op2->i;
1776 else if(op2->kind == 3)
1777 *value2 = op2->ui;
1778 else if(op2->kind == 4 && op2->type->isSigned)
1779 *value2 = (unsigned int)op2->i64;
1780 else if(op2->kind == 4)
1781 *value2 = (unsigned int)op2->ui64;
1782 else if(op2->kind == 23 && op2->type->isSigned)
1783 *value2 = (unsigned int)op2->i64;
1784 else if(op2->kind == 23)
1785 *value2 = (unsigned int)op2->ui64;
1786 else if(op2->kind == 22 && op2->type->isSigned)
1787 *value2 = (unsigned int)op2->i64;
1788 else if(op2->kind == 22)
1789 *value2 = (unsigned int)op2->ui64;
1790 else if(op2->kind == 2 && op2->type->isSigned)
1791 *value2 = (unsigned int)op2->s;
1792 else if(op2->kind == 2)
1793 *value2 = (unsigned int)op2->us;
1794 else if(op2->kind == 1 && op2->type->isSigned)
1795 *value2 = (unsigned int)op2->c;
1796 else if(op2->kind == 24 || op2->kind == 1)
1797 *value2 = (unsigned int)op2->uc;
1798 else if(op2->kind == 6)
1799 *value2 = (unsigned int)op2->f;
1800 else if(op2->kind == 7)
1801 *value2 = (unsigned int)op2->d;
1802 else if(op2->kind == 13)
1803 *value2 = (unsigned int)op2->ui64;
1804 else
1805 return 0x0;
1806 return 0x1;
1807 }
1808
1809 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1810 {
1811 struct Operand op2 = GetOperand(exp);
1812
1813 return GetOpUInt(&op2, value2);
1814 }
1815
1816 unsigned int GetOpInt64(struct Operand * op2, long long * value2)
1817 {
1818 if(op2->kind == 3 && op2->type->isSigned)
1819 *value2 = (long long)op2->i;
1820 else if(op2->kind == 3)
1821 *value2 = (long long)op2->ui;
1822 else if(op2->kind == 4 && op2->type->isSigned)
1823 *value2 = op2->i64;
1824 else if(op2->kind == 4)
1825 *value2 = (long long)op2->ui64;
1826 else if(op2->kind == 23 && op2->type->isSigned)
1827 *value2 = op2->i64;
1828 else if(op2->kind == 23)
1829 *value2 = (long long)op2->ui64;
1830 else if(op2->kind == 22 && op2->type->isSigned)
1831 *value2 = op2->i64;
1832 else if(op2->kind == 22)
1833 *value2 = (long long)op2->ui64;
1834 else if(op2->kind == 2 && op2->type->isSigned)
1835 *value2 = (long long)op2->s;
1836 else if(op2->kind == 2)
1837 *value2 = (long long)op2->us;
1838 else if(op2->kind == 1 && op2->type->isSigned)
1839 *value2 = (long long)op2->c;
1840 else if(op2->kind == 24 || op2->kind == 1)
1841 *value2 = (long long)op2->uc;
1842 else if(op2->kind == 6)
1843 *value2 = (long long)op2->f;
1844 else if(op2->kind == 7)
1845 *value2 = (long long)op2->d;
1846 else if(op2->kind == 13)
1847 *value2 = (long long)op2->ui64;
1848 else
1849 return 0x0;
1850 return 0x1;
1851 }
1852
1853 unsigned int GetInt64(struct Expression * exp, long long * value2)
1854 {
1855 struct Operand op2 = GetOperand(exp);
1856
1857 return GetOpInt64(&op2, value2);
1858 }
1859
1860 unsigned int GetOpUInt64(struct Operand * op2, uint64 * value2)
1861 {
1862 if(op2->kind == 3 && op2->type->isSigned)
1863 *value2 = (uint64)op2->i;
1864 else if(op2->kind == 3)
1865 *value2 = (uint64)op2->ui;
1866 else if(op2->kind == 4 && op2->type->isSigned)
1867 *value2 = (uint64)op2->i64;
1868 else if(op2->kind == 4)
1869 *value2 = op2->ui64;
1870 else if(op2->kind == 23 && op2->type->isSigned)
1871 *value2 = (uint64)op2->i64;
1872 else if(op2->kind == 23)
1873 *value2 = op2->ui64;
1874 else if(op2->kind == 22 && op2->type->isSigned)
1875 *value2 = (uint64)op2->i64;
1876 else if(op2->kind == 22)
1877 *value2 = op2->ui64;
1878 else if(op2->kind == 2 && op2->type->isSigned)
1879 *value2 = (uint64)op2->s;
1880 else if(op2->kind == 2)
1881 *value2 = (uint64)op2->us;
1882 else if(op2->kind == 1 && op2->type->isSigned)
1883 *value2 = (uint64)op2->c;
1884 else if(op2->kind == 24 || op2->kind == 1)
1885 *value2 = (uint64)op2->uc;
1886 else if(op2->kind == 6)
1887 *value2 = (uint64)op2->f;
1888 else if(op2->kind == 7)
1889 *value2 = (uint64)op2->d;
1890 else if(op2->kind == 13)
1891 *value2 = op2->ui64;
1892 else
1893 return 0x0;
1894 return 0x1;
1895 }
1896
1897 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1898 {
1899 struct Operand op2 = GetOperand(exp);
1900
1901 return GetOpUInt64(&op2, value2);
1902 }
1903
1904 unsigned int GetOpIntPtr(struct Operand * op2, intptr_t * value2)
1905 {
1906 if(op2->kind == 3 && op2->type->isSigned)
1907 *value2 = (intptr_t)op2->i;
1908 else if(op2->kind == 3)
1909 *value2 = (intptr_t)op2->ui;
1910 else if(op2->kind == 4 && op2->type->isSigned)
1911 *value2 = (intptr_t)op2->i64;
1912 else if(op2->kind == 4)
1913 *value2 = (intptr_t)op2->ui64;
1914 else if(op2->kind == 23 && op2->type->isSigned)
1915 *value2 = (intptr_t)op2->i64;
1916 else if(op2->kind == 23)
1917 *value2 = (intptr_t)op2->ui64;
1918 else if(op2->kind == 22 && op2->type->isSigned)
1919 *value2 = (intptr_t)op2->i64;
1920 else if(op2->kind == 22)
1921 *value2 = (intptr_t)op2->ui64;
1922 else if(op2->kind == 2 && op2->type->isSigned)
1923 *value2 = (intptr_t)op2->s;
1924 else if(op2->kind == 2)
1925 *value2 = (intptr_t)op2->us;
1926 else if(op2->kind == 1 && op2->type->isSigned)
1927 *value2 = (intptr_t)op2->c;
1928 else if(op2->kind == 24 || op2->kind == 1)
1929 *value2 = (intptr_t)op2->uc;
1930 else if(op2->kind == 6)
1931 *value2 = (intptr_t)op2->f;
1932 else if(op2->kind == 7)
1933 *value2 = (intptr_t)op2->d;
1934 else if(op2->kind == 13)
1935 *value2 = (intptr_t)op2->ui64;
1936 else
1937 return 0x0;
1938 return 0x1;
1939 }
1940
1941 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
1942 {
1943 struct Operand op2 = GetOperand(exp);
1944
1945 return GetOpIntPtr(&op2, value2);
1946 }
1947
1948 unsigned int GetOpUIntPtr(struct Operand * op2, uintptr_t * value2)
1949 {
1950 if(op2->kind == 3 && op2->type->isSigned)
1951 *value2 = (uintptr_t)op2->i;
1952 else if(op2->kind == 3)
1953 *value2 = (uintptr_t)op2->ui;
1954 else if(op2->kind == 4 && op2->type->isSigned)
1955 *value2 = (uintptr_t)op2->i64;
1956 else if(op2->kind == 4)
1957 *value2 = (uintptr_t)op2->ui64;
1958 else if(op2->kind == 23 && op2->type->isSigned)
1959 *value2 = (uintptr_t)op2->i64;
1960 else if(op2->kind == 23)
1961 *value2 = (uintptr_t)op2->ui64;
1962 else if(op2->kind == 22 && op2->type->isSigned)
1963 *value2 = (uintptr_t)op2->i64;
1964 else if(op2->kind == 22)
1965 *value2 = (uintptr_t)op2->ui64;
1966 else if(op2->kind == 2 && op2->type->isSigned)
1967 *value2 = (uintptr_t)op2->s;
1968 else if(op2->kind == 2)
1969 *value2 = (uintptr_t)op2->us;
1970 else if(op2->kind == 1 && op2->type->isSigned)
1971 *value2 = (uintptr_t)op2->c;
1972 else if(op2->kind == 24 || op2->kind == 1)
1973 *value2 = (uintptr_t)op2->uc;
1974 else if(op2->kind == 6)
1975 *value2 = (uintptr_t)op2->f;
1976 else if(op2->kind == 7)
1977 *value2 = (uintptr_t)op2->d;
1978 else if(op2->kind == 13)
1979 *value2 = (uintptr_t)op2->ui64;
1980 else
1981 return 0x0;
1982 return 0x1;
1983 }
1984
1985 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
1986 {
1987 struct Operand op2 = GetOperand(exp);
1988
1989 return GetOpUIntPtr(&op2, value2);
1990 }
1991
1992 unsigned int GetOpIntSize(struct Operand * op2, ssize_t * value2)
1993 {
1994 if(op2->kind == 3 && op2->type->isSigned)
1995 *value2 = (ssize_t)op2->i;
1996 else if(op2->kind == 3)
1997 *value2 = (ssize_t)op2->ui;
1998 else if(op2->kind == 4 && op2->type->isSigned)
1999 *value2 = (ssize_t)op2->i64;
2000 else if(op2->kind == 4)
2001 *value2 = (ssize_t)op2->ui64;
2002 else if(op2->kind == 23 && op2->type->isSigned)
2003 *value2 = (ssize_t)op2->i64;
2004 else if(op2->kind == 23)
2005 *value2 = (ssize_t)op2->ui64;
2006 else if(op2->kind == 22 && op2->type->isSigned)
2007 *value2 = (ssize_t)op2->i64;
2008 else if(op2->kind == 22)
2009 *value2 = (ssize_t)op2->ui64;
2010 else if(op2->kind == 2 && op2->type->isSigned)
2011 *value2 = (ssize_t)op2->s;
2012 else if(op2->kind == 2)
2013 *value2 = (ssize_t)op2->us;
2014 else if(op2->kind == 1 && op2->type->isSigned)
2015 *value2 = (ssize_t)op2->c;
2016 else if(op2->kind == 24 || op2->kind == 1)
2017 *value2 = (ssize_t)op2->uc;
2018 else if(op2->kind == 6)
2019 *value2 = (ssize_t)op2->f;
2020 else if(op2->kind == 7)
2021 *value2 = (ssize_t)op2->d;
2022 else if(op2->kind == 13)
2023 *value2 = (ssize_t)op2->ui64;
2024 else
2025 return 0x0;
2026 return 0x1;
2027 }
2028
2029 unsigned int GetIntSize(struct Expression * exp, ssize_t * value2)
2030 {
2031 struct Operand op2 = GetOperand(exp);
2032
2033 return GetOpIntSize(&op2, value2);
2034 }
2035
2036 unsigned int GetOpUIntSize(struct Operand * op2, size_t * value2)
2037 {
2038 if(op2->kind == 3 && op2->type->isSigned)
2039 *value2 = (size_t)op2->i;
2040 else if(op2->kind == 3)
2041 *value2 = (size_t)op2->ui;
2042 else if(op2->kind == 4 && op2->type->isSigned)
2043 *value2 = (size_t)op2->i64;
2044 else if(op2->kind == 4)
2045 *value2 = (size_t)op2->ui64;
2046 else if(op2->kind == 23 && op2->type->isSigned)
2047 *value2 = (size_t)op2->i64;
2048 else if(op2->kind == 23)
2049 *value2 = (size_t)op2->ui64;
2050 else if(op2->kind == 22 && op2->type->isSigned)
2051 *value2 = (size_t)op2->i64;
2052 else if(op2->kind == 22)
2053 *value2 = (size_t)op2->ui64;
2054 else if(op2->kind == 2 && op2->type->isSigned)
2055 *value2 = (size_t)op2->s;
2056 else if(op2->kind == 2)
2057 *value2 = (size_t)op2->us;
2058 else if(op2->kind == 1 && op2->type->isSigned)
2059 *value2 = (size_t)op2->c;
2060 else if(op2->kind == 24 || op2->kind == 1)
2061 *value2 = (size_t)op2->uc;
2062 else if(op2->kind == 6)
2063 *value2 = (size_t)op2->f;
2064 else if(op2->kind == 7)
2065 *value2 = (size_t)op2->d;
2066 else if(op2->kind == 13)
2067 *value2 = (size_t)op2->ui64;
2068 else
2069 return 0x0;
2070 return 0x1;
2071 }
2072
2073 unsigned int GetUIntSize(struct Expression * exp, size_t * value2)
2074 {
2075 struct Operand op2 = GetOperand(exp);
2076
2077 return GetOpUIntSize(&op2, value2);
2078 }
2079
2080 unsigned int GetOpShort(struct Operand * op2, short * value2)
2081 {
2082 if(op2->kind == 3 && op2->type->isSigned)
2083 *value2 = (short)op2->i;
2084 else if(op2->kind == 3)
2085 *value2 = (short)op2->ui;
2086 else if(op2->kind == 4 && op2->type->isSigned)
2087 *value2 = (short)op2->i64;
2088 else if(op2->kind == 4)
2089 *value2 = (short)op2->ui64;
2090 else if(op2->kind == 23 && op2->type->isSigned)
2091 *value2 = (short)op2->i64;
2092 else if(op2->kind == 23)
2093 *value2 = (short)op2->ui64;
2094 else if(op2->kind == 22 && op2->type->isSigned)
2095 *value2 = (short)op2->i64;
2096 else if(op2->kind == 22)
2097 *value2 = (short)op2->ui64;
2098 else if(op2->kind == 2 && op2->type->isSigned)
2099 *value2 = op2->s;
2100 else if(op2->kind == 2)
2101 *value2 = (short)op2->us;
2102 else if(op2->kind == 1 && op2->type->isSigned)
2103 *value2 = (short)op2->c;
2104 else if(op2->kind == 24 || op2->kind == 1)
2105 *value2 = (short)op2->uc;
2106 else if(op2->kind == 6)
2107 *value2 = (short)op2->f;
2108 else if(op2->kind == 7)
2109 *value2 = (short)op2->d;
2110 else if(op2->kind == 13)
2111 *value2 = (short)op2->ui64;
2112 else
2113 return 0x0;
2114 return 0x1;
2115 }
2116
2117 unsigned int GetShort(struct Expression * exp, short * value2)
2118 {
2119 struct Operand op2 = GetOperand(exp);
2120
2121 return GetOpShort(&op2, value2);
2122 }
2123
2124 unsigned int GetOpUShort(struct Operand * op2, unsigned short * value2)
2125 {
2126 if(op2->kind == 3 && op2->type->isSigned)
2127 *value2 = (unsigned short)op2->i;
2128 else if(op2->kind == 3)
2129 *value2 = (unsigned short)op2->ui;
2130 else if(op2->kind == 4 && op2->type->isSigned)
2131 *value2 = (unsigned short)op2->i64;
2132 else if(op2->kind == 4)
2133 *value2 = (unsigned short)op2->ui64;
2134 else if(op2->kind == 23 && op2->type->isSigned)
2135 *value2 = (unsigned short)op2->i64;
2136 else if(op2->kind == 23)
2137 *value2 = (unsigned short)op2->ui64;
2138 else if(op2->kind == 22 && op2->type->isSigned)
2139 *value2 = (unsigned short)op2->i64;
2140 else if(op2->kind == 22)
2141 *value2 = (unsigned short)op2->ui64;
2142 else if(op2->kind == 2 && op2->type->isSigned)
2143 *value2 = (unsigned short)op2->s;
2144 else if(op2->kind == 2)
2145 *value2 = op2->us;
2146 else if(op2->kind == 1 && op2->type->isSigned)
2147 *value2 = (unsigned short)op2->c;
2148 else if(op2->kind == 24 || op2->kind == 1)
2149 *value2 = (unsigned short)op2->uc;
2150 else if(op2->kind == 6)
2151 *value2 = (unsigned short)op2->f;
2152 else if(op2->kind == 7)
2153 *value2 = (unsigned short)op2->d;
2154 else if(op2->kind == 13)
2155 *value2 = (unsigned short)op2->ui64;
2156 else
2157 return 0x0;
2158 return 0x1;
2159 }
2160
2161 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
2162 {
2163 struct Operand op2 = GetOperand(exp);
2164
2165 return GetOpUShort(&op2, value2);
2166 }
2167
2168 unsigned int GetOpChar(struct Operand * op2, char * value2)
2169 {
2170 if(op2->kind == 3 && op2->type->isSigned)
2171 *value2 = (char)op2->i;
2172 else if(op2->kind == 3)
2173 *value2 = (char)op2->ui;
2174 else if(op2->kind == 4 && op2->type->isSigned)
2175 *value2 = (char)op2->i64;
2176 else if(op2->kind == 4)
2177 *value2 = (char)op2->ui64;
2178 else if(op2->kind == 23 && op2->type->isSigned)
2179 *value2 = (char)op2->i64;
2180 else if(op2->kind == 23)
2181 *value2 = (char)op2->ui64;
2182 else if(op2->kind == 22 && op2->type->isSigned)
2183 *value2 = (char)op2->i64;
2184 else if(op2->kind == 22)
2185 *value2 = (char)op2->ui64;
2186 else if(op2->kind == 2 && op2->type->isSigned)
2187 *value2 = (char)op2->s;
2188 else if(op2->kind == 2)
2189 *value2 = (char)op2->us;
2190 else if(op2->kind == 1 && op2->type->isSigned)
2191 *value2 = op2->c;
2192 else if(op2->kind == 24 || op2->kind == 1)
2193 *value2 = (char)op2->uc;
2194 else if(op2->kind == 6)
2195 *value2 = (char)op2->f;
2196 else if(op2->kind == 7)
2197 *value2 = (char)op2->d;
2198 else if(op2->kind == 13)
2199 *value2 = (char)op2->ui64;
2200 else
2201 return 0x0;
2202 return 0x1;
2203 }
2204
2205 unsigned int GetChar(struct Expression * exp, char * value2)
2206 {
2207 struct Operand op2 = GetOperand(exp);
2208
2209 return GetOpChar(&op2, value2);
2210 }
2211
2212 unsigned int GetOpUChar(struct Operand * op2, unsigned char * value2)
2213 {
2214 if(op2->kind == 3 && op2->type->isSigned)
2215 *value2 = (unsigned char)op2->i;
2216 else if(op2->kind == 3)
2217 *value2 = (unsigned char)op2->ui;
2218 else if(op2->kind == 4 && op2->type->isSigned)
2219 *value2 = (unsigned char)op2->i64;
2220 else if(op2->kind == 4)
2221 *value2 = (unsigned char)op2->ui64;
2222 else if(op2->kind == 23 && op2->type->isSigned)
2223 *value2 = (unsigned char)op2->i64;
2224 else if(op2->kind == 23)
2225 *value2 = (unsigned char)op2->ui64;
2226 else if(op2->kind == 22 && op2->type->isSigned)
2227 *value2 = (unsigned char)op2->i64;
2228 else if(op2->kind == 22)
2229 *value2 = (unsigned char)op2->ui64;
2230 else if(op2->kind == 2 && op2->type->isSigned)
2231 *value2 = (unsigned char)op2->s;
2232 else if(op2->kind == 2)
2233 *value2 = (unsigned char)op2->us;
2234 else if(op2->kind == 1 && op2->type->isSigned)
2235 *value2 = (unsigned char)op2->c;
2236 else if(op2->kind == 24 || op2->kind == 1)
2237 *value2 = op2->uc;
2238 else if(op2->kind == 6)
2239 *value2 = (unsigned char)op2->f;
2240 else if(op2->kind == 7)
2241 *value2 = (unsigned char)op2->d;
2242 else if(op2->kind == 13)
2243 *value2 = (unsigned char)op2->ui64;
2244 else
2245 return 0x0;
2246 return 0x1;
2247 }
2248
2249 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
2250 {
2251 struct Operand op2 = GetOperand(exp);
2252
2253 return GetOpUChar(&op2, value2);
2254 }
2255
2256 unsigned int GetOpFloat(struct Operand * op2, float * value2)
2257 {
2258 if(op2->kind == 3 && op2->type->isSigned)
2259 *value2 = (float)(float)op2->i;
2260 else if(op2->kind == 3)
2261 *value2 = (float)(float)op2->ui;
2262 else if(op2->kind == 4 && op2->type->isSigned)
2263 *value2 = (float)(float)op2->i64;
2264 else if(op2->kind == 4)
2265 *value2 = (float)(float)op2->ui64;
2266 else if(op2->kind == 23 && op2->type->isSigned)
2267 *value2 = (float)(float)op2->i64;
2268 else if(op2->kind == 23)
2269 *value2 = (float)(float)op2->ui64;
2270 else if(op2->kind == 22 && op2->type->isSigned)
2271 *value2 = (float)(float)op2->i64;
2272 else if(op2->kind == 22)
2273 *value2 = (float)(float)op2->ui64;
2274 else if(op2->kind == 2 && op2->type->isSigned)
2275 *value2 = (float)(float)op2->s;
2276 else if(op2->kind == 2)
2277 *value2 = (float)(float)op2->us;
2278 else if(op2->kind == 1 && op2->type->isSigned)
2279 *value2 = (float)(float)op2->c;
2280 else if(op2->kind == 24 || op2->kind == 1)
2281 *value2 = (float)(float)op2->uc;
2282 else if(op2->kind == 6)
2283 *value2 = (float)op2->f;
2284 else if(op2->kind == 7)
2285 *value2 = (float)op2->d;
2286 else if(op2->kind == 13)
2287 *value2 = (float)(float)op2->ui64;
2288 else
2289 return 0x0;
2290 return 0x1;
2291 }
2292
2293 unsigned int GetFloat(struct Expression * exp, float * value2)
2294 {
2295 struct Operand op2 = GetOperand(exp);
2296
2297 return GetOpFloat(&op2, value2);
2298 }
2299
2300 unsigned int GetOpDouble(struct Operand * op2, double * value2)
2301 {
2302 if(op2->kind == 3 && op2->type->isSigned)
2303 *value2 = (double)(double)op2->i;
2304 else if(op2->kind == 3)
2305 *value2 = (double)(double)op2->ui;
2306 else if(op2->kind == 4 && op2->type->isSigned)
2307 *value2 = (double)(double)op2->i64;
2308 else if(op2->kind == 4)
2309 *value2 = (double)(double)op2->ui64;
2310 else if(op2->kind == 23 && op2->type->isSigned)
2311 *value2 = (double)(double)op2->i64;
2312 else if(op2->kind == 23)
2313 *value2 = (double)(double)op2->ui64;
2314 else if(op2->kind == 22 && op2->type->isSigned)
2315 *value2 = (double)(double)op2->i64;
2316 else if(op2->kind == 22)
2317 *value2 = (double)(double)op2->ui64;
2318 else if(op2->kind == 2 && op2->type->isSigned)
2319 *value2 = (double)(double)op2->s;
2320 else if(op2->kind == 2)
2321 *value2 = (double)(double)op2->us;
2322 else if(op2->kind == 1 && op2->type->isSigned)
2323 *value2 = (double)(double)op2->c;
2324 else if(op2->kind == 24 || op2->kind == 1)
2325 *value2 = (double)(double)op2->uc;
2326 else if(op2->kind == 6)
2327 *value2 = (double)op2->f;
2328 else if(op2->kind == 7)
2329 *value2 = (double)op2->d;
2330 else if(op2->kind == 13)
2331 *value2 = (double)(double)op2->ui64;
2332 else
2333 return 0x0;
2334 return 0x1;
2335 }
2336
2337 unsigned int GetDouble(struct Expression * exp, double * value2)
2338 {
2339 struct Operand op2 = GetOperand(exp);
2340
2341 return GetOpDouble(&op2, value2);
2342 }
2343
2344 void ComputeExpression(struct Expression * exp);
2345
2346 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2347
2348 extern int targetBits;
2349
2350 int ComputeTypeSize(struct Type * type);
2351
2352 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2353
2354 struct __ecereNameSpace__ecere__com__BitMember
2355 {
2356 struct __ecereNameSpace__ecere__com__BitMember * prev;
2357 struct __ecereNameSpace__ecere__com__BitMember * next;
2358 char *  name;
2359 unsigned int isProperty;
2360 int memberAccess;
2361 int id;
2362 struct __ecereNameSpace__ecere__com__Class * _class;
2363 char *  dataTypeString;
2364 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2365 struct Type * dataType;
2366 int type;
2367 int size;
2368 int pos;
2369 uint64 mask;
2370 } __attribute__ ((gcc_struct));
2371
2372 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2373
2374 struct __ecereNameSpace__ecere__sys__OldLink
2375 {
2376 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2377 struct __ecereNameSpace__ecere__sys__OldLink * next;
2378 void *  data;
2379 } __attribute__ ((gcc_struct));
2380
2381 void FinishTemplatesContext(struct Context * context);
2382
2383 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2384 {
2385 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2386 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2387
2388 if(member || ((_class->type == 2 || _class->type == 0 || _class->type == 1 || _class->type == 5) && (_class->type == 2 || (!_class->structSize || _class->structSize == _class->offset)) && _class->computeSize))
2389 {
2390 int c;
2391 int unionMemberOffset = 0;
2392 int bitFields = 0;
2393
2394 if(member)
2395 {
2396 member->memberOffset = 0;
2397 if(targetBits < sizeof(void *) * 8)
2398 member->structAlignment = 0;
2399 }
2400 else if(targetBits < sizeof(void *) * 8)
2401 _class->structAlignment = 0;
2402 if(!member && ((_class->type == 0 || _class->type == 5) || (_class->type == 1 && _class->memberOffset && _class->memberOffset > _class->base->structSize)))
2403 _class->memberOffset = (_class->base && _class->type == 1) ? _class->base->structSize : 0;
2404 if(!member && _class->destructionWatchOffset)
2405 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2406 {
2407 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2408
2409 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2410 {
2411 if(!dataMember->isProperty)
2412 {
2413 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2414 {
2415 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
2416 }
2417 }
2418 }
2419 }
2420 {
2421 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2422
2423 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2424 {
2425 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2426 {
2427 if(!isMember && _class->type == 2 && dataMember->dataType)
2428 {
2429 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2430 uint64 mask = 0;
2431 int d;
2432
2433 ComputeTypeSize(dataMember->dataType);
2434 if(bitMember->pos == -1)
2435 bitMember->pos = _class->memberOffset;
2436 if(!bitMember->size)
2437 bitMember->size = dataMember->dataType->size * 8;
2438 _class->memberOffset = bitMember->pos + bitMember->size;
2439 for(d = 0; d < bitMember->size; d++)
2440 {
2441 if(d)
2442 mask <<= 1;
2443 mask |= 1;
2444 }
2445 bitMember->mask = mask << bitMember->pos;
2446 }
2447 else if(dataMember->type == 0 && dataMember->dataType)
2448 {
2449 int size;
2450 int alignment = 0;
2451
2452 if(dataMember->dataType->kind != 8 || ((!dataMember->dataType->_class || !dataMember->dataType->_class->registered || dataMember->dataType->_class->registered != _class || _class->type != 1)))
2453 ComputeTypeSize(dataMember->dataType);
2454 if(dataMember->dataType->bitFieldCount)
2455 {
2456 bitFields += dataMember->dataType->bitFieldCount;
2457 size = 0;
2458 }
2459 else
2460 {
2461 if(bitFields)
2462 {
2463 int size = (bitFields + 7) / 8;
2464
2465 if(isMember)
2466 {
2467 int __simpleStruct0;
2468
2469 if(alignment)
2470 {
2471 int __simpleStruct0;
2472
2473 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2474 if(member->memberOffset % alignment)
2475 member->memberOffset += alignment - (member->memberOffset % alignment);
2476 }
2477 dataMember->offset = member->memberOffset;
2478 if(member->type == 1)
2479 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2480 else
2481 {
2482 member->memberOffset += size;
2483 }
2484 }
2485 else
2486 {
2487 if(alignment)
2488 {
2489 int __simpleStruct0;
2490
2491 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2492 if(_class->memberOffset % alignment)
2493 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2494 }
2495 dataMember->offset = _class->memberOffset;
2496 _class->memberOffset += size;
2497 }
2498 bitFields = 0;
2499 }
2500 size = dataMember->dataType->size;
2501 alignment = dataMember->dataType->alignment;
2502 }
2503 if(isMember)
2504 {
2505 int __simpleStruct0;
2506
2507 if(alignment)
2508 {
2509 int __simpleStruct0;
2510
2511 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2512 if(member->memberOffset % alignment)
2513 member->memberOffset += alignment - (member->memberOffset % alignment);
2514 }
2515 dataMember->offset = member->memberOffset;
2516 if(member->type == 1)
2517 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2518 else
2519 {
2520 member->memberOffset += size;
2521 }
2522 }
2523 else
2524 {
2525 if(alignment)
2526 {
2527 int __simpleStruct0;
2528
2529 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2530 if(_class->memberOffset % alignment)
2531 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2532 }
2533 dataMember->offset = _class->memberOffset;
2534 _class->memberOffset += size;
2535 }
2536 }
2537 else
2538 {
2539 int alignment;
2540
2541 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 0x1);
2542 alignment = dataMember->structAlignment;
2543 if(isMember)
2544 {
2545 int __simpleStruct0;
2546
2547 if(alignment)
2548 {
2549 int __simpleStruct0;
2550
2551 if(member->memberOffset % alignment)
2552 member->memberOffset += alignment - (member->memberOffset % alignment);
2553 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2554 }
2555 dataMember->offset = member->memberOffset;
2556 if(member->type == 1)
2557 unionMemberOffset = (__simpleStruct0 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2558 else
2559 member->memberOffset += dataMember->memberOffset;
2560 }
2561 else
2562 {
2563 if(alignment)
2564 {
2565 int __simpleStruct0;
2566
2567 if(_class->memberOffset % alignment)
2568 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2569 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2570 }
2571 dataMember->offset = _class->memberOffset;
2572 _class->memberOffset += dataMember->memberOffset;
2573 }
2574 }
2575 }
2576 }
2577 if(bitFields)
2578 {
2579 int alignment = 0;
2580 int size = (bitFields + 7) / 8;
2581
2582 if(isMember)
2583 {
2584 int __simpleStruct0;
2585
2586 if(alignment)
2587 {
2588 int __simpleStruct0;
2589
2590 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2591 if(member->memberOffset % alignment)
2592 member->memberOffset += alignment - (member->memberOffset % alignment);
2593 }
2594 if(member->type == 1)
2595 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2596 else
2597 {
2598 member->memberOffset += size;
2599 }
2600 }
2601 else
2602 {
2603 if(alignment)
2604 {
2605 int __simpleStruct0;
2606
2607 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2608 if(_class->memberOffset % alignment)
2609 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2610 }
2611 _class->memberOffset += size;
2612 }
2613 bitFields = 0;
2614 }
2615 }
2616 if(member && member->type == 1)
2617 {
2618 member->memberOffset = unionMemberOffset;
2619 }
2620 if(!isMember)
2621 {
2622 if(_class->type != 2)
2623 {
2624 int extra = 0;
2625
2626 if(_class->structAlignment)
2627 {
2628 if(_class->memberOffset % _class->structAlignment)
2629 extra += _class->structAlignment - (_class->memberOffset % _class->structAlignment);
2630 }
2631 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset + extra;
2632 if(!member)
2633 {
2634 struct __ecereNameSpace__ecere__com__Property * prop;
2635
2636 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2637 {
2638 if(prop->isProperty && prop->isWatchable)
2639 {
2640 prop->watcherOffset = _class->structSize;
2641 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2642 }
2643 }
2644 }
2645 {
2646 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2647
2648 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2649 {
2650 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2651
2652 if(deriv->computeSize)
2653 {
2654 deriv->offset = _class->structSize;
2655 deriv->memberOffset = 0;
2656 deriv->structSize = deriv->offset;
2657 ComputeClassMembers(deriv, 0x0);
2658 }
2659 }
2660 }
2661 }
2662 }
2663 }
2664 if(context)
2665 FinishTemplatesContext(context);
2666 }
2667
2668 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2669
2670 struct __ecereNameSpace__ecere__com__NameSpace
2671 {
2672 char *  name;
2673 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
2674 struct __ecereNameSpace__ecere__com__NameSpace *  left;
2675 struct __ecereNameSpace__ecere__com__NameSpace *  right;
2676 int depth;
2677 struct __ecereNameSpace__ecere__com__NameSpace *  parent;
2678 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2679 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2680 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2681 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2682 } __attribute__ ((gcc_struct));
2683
2684 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2685
2686 struct __ecereNameSpace__ecere__com__Module
2687 {
2688 struct __ecereNameSpace__ecere__com__Instance * application;
2689 struct __ecereNameSpace__ecere__sys__OldList classes;
2690 struct __ecereNameSpace__ecere__sys__OldList defines;
2691 struct __ecereNameSpace__ecere__sys__OldList functions;
2692 struct __ecereNameSpace__ecere__sys__OldList modules;
2693 struct __ecereNameSpace__ecere__com__Instance * prev;
2694 struct __ecereNameSpace__ecere__com__Instance * next;
2695 char *  name;
2696 void *  library;
2697 void *  Unload;
2698 int importType;
2699 int origImportType;
2700 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2701 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2702 } __attribute__ ((gcc_struct));
2703
2704 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2705 {
2706 struct __ecereNameSpace__ecere__com__Class * _class;
2707 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2708
2709 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
2710 ComputeModuleClasses(subModule->data);
2711 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->classes.first; _class; _class = _class->next)
2712 ComputeClassMembers(_class, 0x0);
2713 }
2714
2715 extern unsigned int inCompiler;
2716
2717 extern void Compiler_Error(char *  format, ...);
2718
2719 extern char *  __ecereNameSpace__ecere__GetTranslatedString(char * name, char *  string, char *  stringAndContext);
2720
2721 int ComputeTypeSize(struct Type * type)
2722 {
2723 unsigned int size = type ? type->size : 0;
2724
2725 if(!size && type && !type->computing)
2726 {
2727 type->computing = 0x1;
2728 switch(type->kind)
2729 {
2730 case 24:
2731 type->alignment = size = sizeof(char);
2732 break;
2733 case 1:
2734 type->alignment = size = sizeof(char);
2735 break;
2736 case 3:
2737 type->alignment = size = sizeof(int);
2738 break;
2739 case 4:
2740 type->alignment = size = sizeof(long long);
2741 break;
2742 case 22:
2743 type->alignment = size = targetBits / 8;
2744 break;
2745 case 23:
2746 type->alignment = size = targetBits / 8;
2747 break;
2748 case 5:
2749 type->alignment = size = sizeof(long);
2750 break;
2751 case 2:
2752 type->alignment = size = sizeof(short);
2753 break;
2754 case 6:
2755 type->alignment = size = sizeof(float);
2756 break;
2757 case 7:
2758 type->alignment = size = sizeof(double);
2759 break;
2760 case 8:
2761 {
2762 struct __ecereNameSpace__ecere__com__Class * _class = type->_class ? type->_class->registered : (((void *)0));
2763
2764 if(_class && _class->type == 1)
2765 {
2766 ComputeClassMembers(_class, 0x0);
2767 type->alignment = _class->structAlignment;
2768 size = _class->structSize;
2769 if(type->alignment && size % type->alignment)
2770 size += type->alignment - (size % type->alignment);
2771 }
2772 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2773 {
2774 if(!_class->dataType)
2775 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2776 size = type->alignment = ComputeTypeSize(_class->dataType);
2777 }
2778 else
2779 size = type->alignment = targetBits / 8;
2780 break;
2781 }
2782 case 13:
2783 case 19:
2784 size = type->alignment = targetBits / 8;
2785 break;
2786 case 12:
2787 if(type->arraySizeExp)
2788 {
2789 ProcessExpressionType(type->arraySizeExp);
2790 ComputeExpression(type->arraySizeExp);
2791 if(!type->arraySizeExp->isConstant || (type->arraySizeExp->expType->kind != 3 && type->arraySizeExp->expType->kind != 15 && (type->arraySizeExp->expType->kind != 8 || !type->arraySizeExp->expType->_class->registered || type->arraySizeExp->expType->_class->registered->type != 4)))
2792 {
2793 struct Location oldLoc = yylloc;
2794 char expression[10240];
2795
2796 expression[0] = '\0';
2797 type->arraySizeExp->expType = (((void *)0));
2798 yylloc = type->arraySizeExp->loc;
2799 if(inCompiler)
2800 PrintExpression(type->arraySizeExp, expression);
2801 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Array size not constant int (%s)\n", (((void *)0))), expression);
2802 yylloc = oldLoc;
2803 }
2804 GetInt(type->arraySizeExp, &type->arraySize);
2805 }
2806 else if(type->enumClass)
2807 {
2808 if(type->enumClass && type->enumClass->registered && type->enumClass->registered->type == 4)
2809 {
2810 type->arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->enumClass->registered, "enumSize");
2811 }
2812 else
2813 type->arraySize = 0;
2814 }
2815 else
2816 {
2817 type->arraySize = 0;
2818 }
2819 size = ComputeTypeSize(type->type) * type->arraySize;
2820 if(type->type)
2821 type->alignment = type->type->alignment;
2822 break;
2823 case 9:
2824 {
2825 struct Type * member;
2826
2827 for(member = type->members.first; member; member = member->next)
2828 {
2829 int __simpleStruct0, __simpleStruct1;
2830 unsigned int addSize = ComputeTypeSize(member);
2831
2832 member->offset = size;
2833 if(member->alignment && size % member->alignment)
2834 member->offset += member->alignment - (size % member->alignment);
2835 size = member->offset;
2836 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2837 size += addSize;
2838 }
2839 if(type->alignment && size % type->alignment)
2840 size += type->alignment - (size % type->alignment);
2841 break;
2842 }
2843 case 10:
2844 {
2845 struct Type * member;
2846
2847 for(member = type->members.first; member; member = member->next)
2848 {
2849 int __simpleStruct0, __simpleStruct1;
2850 unsigned int addSize = ComputeTypeSize(member);
2851
2852 member->offset = size;
2853 if(member->alignment && size % member->alignment)
2854 member->offset += member->alignment - (size % member->alignment);
2855 size = member->offset;
2856 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2857 size = ((size > addSize) ? size : addSize);
2858 }
2859 if(type->alignment && size % type->alignment)
2860 size += type->alignment - (size % type->alignment);
2861 break;
2862 }
2863 case 20:
2864 {
2865 struct TemplateParameter * param = type->templateParameter;
2866 struct Type * baseType = ProcessTemplateParameterType(param);
2867
2868 if(baseType)
2869 {
2870 size = ComputeTypeSize(baseType);
2871 type->alignment = baseType->alignment;
2872 }
2873 else
2874 type->alignment = size = sizeof(uint64);
2875 break;
2876 }
2877 case 15:
2878 {
2879 type->alignment = size = sizeof(enum
2880 {
2881 test
2882 });
2883 break;
2884 }
2885 case 21:
2886 {
2887 type->alignment = size = targetBits / 8;
2888 break;
2889 }
2890 }
2891 type->size = size;
2892 type->computing = 0x0;
2893 }
2894 return size;
2895 }
2896
2897 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2898
2899 extern struct Identifier * MkIdentifier(char *  string);
2900
2901 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void *  item);
2902
2903 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2904
2905 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2906
2907 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2908
2909 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2910
2911 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2912
2913 extern void FreeType(struct Type * type);
2914
2915 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2916
2917 extern struct Specifier * MkSpecifier(int specifier);
2918
2919 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2920
2921 extern struct Expression * MkExpConstant(char *  string);
2922
2923 int AddMembers(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember, unsigned int * retSize, struct __ecereNameSpace__ecere__com__Class * topClass, unsigned int * addedPadding)
2924 {
2925 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2926 unsigned int totalSize = 0;
2927 unsigned int maxSize = 0;
2928 int alignment, size;
2929 struct __ecereNameSpace__ecere__com__DataMember * member;
2930 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2931
2932 if(addedPadding)
2933 *addedPadding = 0x0;
2934 if(!isMember && _class->base)
2935 {
2936 maxSize = _class->structSize;
2937 {
2938 if(_class->type == 1 || _class->type == 5)
2939 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass, (((void *)0)));
2940 else
2941 {
2942 unsigned int baseSize = _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2943
2944 if(maxSize > baseSize)
2945 maxSize -= baseSize;
2946 else
2947 maxSize = 0;
2948 }
2949 }
2950 }
2951 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2952 {
2953 if(!member->isProperty)
2954 {
2955 switch(member->type)
2956 {
2957 case 0:
2958 {
2959 if(member->dataTypeString)
2960 {
2961 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2962 struct Declarator * decl;
2963
2964 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2965 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2966 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2967 if(!member->dataType)
2968 member->dataType = ProcessType(specs, decl);
2969 ReplaceThisClassSpecifiers(specs, topClass);
2970 {
2971 struct Type * type = ProcessType(specs, decl);
2972
2973 DeclareType(member->dataType, 0x0, 0x0);
2974 FreeType(type);
2975 }
2976 ComputeTypeSize(member->dataType);
2977 size = member->dataType->size;
2978 alignment = member->dataType->alignment;
2979 if(alignment)
2980 {
2981 if(totalSize % alignment)
2982 totalSize += alignment - (totalSize % alignment);
2983 }
2984 totalSize += size;
2985 }
2986 break;
2987 }
2988 case 1:
2989 case 2:
2990 {
2991 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
2992
2993 size = 0;
2994 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass, (((void *)0)));
2995 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
2996 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, (((void *)0)), (((void *)0)))));
2997 alignment = member->structAlignment;
2998 if(alignment)
2999 {
3000 if(totalSize % alignment)
3001 totalSize += alignment - (totalSize % alignment);
3002 }
3003 totalSize += size;
3004 break;
3005 }
3006 }
3007 }
3008 }
3009 if(retSize)
3010 {
3011 unsigned int __simpleStruct0;
3012
3013 if(topMember && topMember->type == 1)
3014 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
3015 else
3016 *retSize += totalSize;
3017 }
3018 else if(totalSize < maxSize && _class->type != 1000)
3019 {
3020 int autoPadding = 0;
3021
3022 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
3023 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
3024 if(totalSize + autoPadding < maxSize)
3025 {
3026 char sizeString[50];
3027
3028 sprintf(sizeString, "%d", maxSize - totalSize);
3029 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
3030 if(addedPadding)
3031 *addedPadding = 0x1;
3032 }
3033 }
3034 if(context)
3035 FinishTemplatesContext(context);
3036 return topMember ? topMember->memberID : _class->memberID;
3037 }
3038
3039 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
3040 {
3041 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
3042 unsigned int totalSize = 0;
3043 struct __ecereNameSpace__ecere__com__DataMember * member;
3044 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
3045
3046 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
3047 DeclareMembers(_class->base, 0x0);
3048 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
3049 {
3050 if(!member->isProperty)
3051 {
3052 switch(member->type)
3053 {
3054 case 0:
3055 {
3056 if(!member->dataType && member->dataTypeString)
3057 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
3058 if(member->dataType)
3059 DeclareType(member->dataType, 0x0, 0x0);
3060 break;
3061 }
3062 case 1:
3063 case 2:
3064 {
3065 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
3066 break;
3067 }
3068 }
3069 }
3070 }
3071 if(context)
3072 FinishTemplatesContext(context);
3073 return topMember ? topMember->memberID : _class->memberID;
3074 }
3075
3076 extern struct Symbol * FindClass(char *  name);
3077
3078 extern char *  strchr(const char * , int);
3079
3080 extern void FullClassNameCat(char *  output, char *  className, unsigned int includeTemplateParams);
3081
3082 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (*  FreeFunction)(void * ));
3083
3084 extern void FreeClassDef(struct ClassDef * def);
3085
3086 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
3087
3088 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
3089
3090 extern void MangleClassName(char *  className);
3091
3092 extern void DeclareClass(struct Symbol * classSym, char *  className);
3093
3094 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item, void *  prevItem);
3095
3096 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void *  prevItem, void *  item);
3097
3098 void DeclareStruct(char * name, unsigned int skipNoHead)
3099 {
3100 struct External * external = (((void *)0));
3101 struct Symbol * classSym = FindClass(name);
3102
3103 if(!inCompiler || !classSym)
3104 return ;
3105 if(classSym->registered && (classSym->registered->type == 2 || classSym->registered->type == 3 || classSym->registered->type == 4))
3106 return ;
3107 if(classSym->registered && classSym->imported && !classSym->declaredStructSym)
3108 {
3109 struct Declaration * decl;
3110 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3111 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
3112 char structName[1024];
3113
3114 external = (classSym->registered && classSym->registered->type == 1) ? classSym->pointerExternal : classSym->structExternal;
3115 classSym->declaring++;
3116 if(strchr(classSym->string, '<'))
3117 {
3118 if(classSym->registered->templateClass)
3119 {
3120 DeclareStruct(classSym->registered->templateClass->fullName, skipNoHead);
3121 classSym->declaring--;
3122 }
3123 return ;
3124 }
3125 DeclareMembers(classSym->registered, 0x0);
3126 structName[0] = (char)0;
3127 FullClassNameCat(structName, name, 0x0);
3128 if(!skipNoHead)
3129 {
3130 unsigned int addedPadding = 0x0;
3131
3132 classSym->declaredStructSym = 0x1;
3133 declarations = MkList();
3134 AddMembers(declarations, classSym->registered, 0x0, (((void *)0)), classSym->registered, &addedPadding);
3135 if(!(*declarations).count || ((*declarations).count == 1 && addedPadding))
3136 {
3137 FreeList(declarations, FreeClassDef);
3138 declarations = (((void *)0));
3139 }
3140 }
3141 if(skipNoHead || declarations)
3142 {
3143 if(external && external->declaration)
3144 {
3145 ((struct Specifier *)(*external->declaration->specifiers).first)->definitions = declarations;
3146 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3147 {
3148 if(classSym->structExternal)
3149 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3150 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3151 classSym->id = curExternal->symbol->idCode;
3152 classSym->idCode = curExternal->symbol->idCode;
3153 }
3154 }
3155 else
3156 {
3157 if(!external)
3158 external = MkExternalDeclaration((((void *)0)));
3159 specifiers = MkList();
3160 declarators = MkList();
3161 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
3162 external->declaration = decl = MkDeclaration(specifiers, declarators);
3163 if(decl->symbol && !decl->symbol->pointerExternal)
3164 decl->symbol->pointerExternal = external;
3165 if(classSym->registered && classSym->registered->type == 1)
3166 {
3167 char className[1024];
3168
3169 strcpy(className, "__ecereClass_");
3170 FullClassNameCat(className, classSym->string, 0x1);
3171 MangleClassName(className);
3172 DeclareClass(classSym, className);
3173 external->symbol = classSym;
3174 classSym->pointerExternal = external;
3175 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3176 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3177 }
3178 else
3179 {
3180 char className[1024];
3181
3182 strcpy(className, "__ecereClass_");
3183 FullClassNameCat(className, classSym->string, 0x1);
3184 MangleClassName(className);
3185 classSym->structExternal = external;
3186 DeclareClass(classSym, className);
3187 external->symbol = classSym;
3188 }
3189 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
3190 }
3191 }
3192 classSym->declaring--;
3193 }
3194 else if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3195 {
3196 classSym->declaring++;
3197 {
3198 if(classSym->registered)
3199 DeclareMembers(classSym->registered, 0x0);
3200 }
3201 if(classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 5))
3202 {
3203 if(classSym->structExternal)
3204 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3205 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3206 classSym->id = curExternal->symbol->idCode;
3207 classSym->idCode = curExternal->symbol->idCode;
3208 }
3209 classSym->declaring--;
3210 }
3211 }
3212
3213 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
3214
3215 extern struct ModuleImport * mainModule;
3216
3217 extern struct Specifier * MkSpecifierName(char *  name);
3218
3219 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
3220
3221 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
3222
3223 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
3224
3225 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
3226
3227 extern void FreeDeclarator(struct Declarator * decl);
3228
3229 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
3230
3231 struct PropertyImport
3232 {
3233 struct PropertyImport * prev;
3234 struct PropertyImport * next;
3235 char *  name;
3236 unsigned int isVirtual;
3237 unsigned int hasSet;
3238 unsigned int hasGet;
3239 } __attribute__ ((gcc_struct));
3240
3241 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
3242
3243 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
3244 {
3245 struct Symbol * symbol = prop->symbol;
3246 char propName[1024];
3247
3248 strcpy(setName, "__ecereProp_");
3249 FullClassNameCat(setName, prop->_class->fullName, 0x0);
3250 strcat(setName, "_Set_");
3251 FullClassNameCat(setName, prop->name, 0x1);
3252 strcpy(getName, "__ecereProp_");
3253 FullClassNameCat(getName, prop->_class->fullName, 0x0);
3254 strcat(getName, "_Get_");
3255 FullClassNameCat(getName, prop->name, 0x1);
3256 strcpy(propName, "__ecereProp_");
3257 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3258 strcat(propName, "_");
3259 FullClassNameCat(propName, prop->name, 0x1);
3260 MangleClassName(getName);
3261 MangleClassName(setName);
3262 MangleClassName(propName);
3263 if(prop->_class->type == 1)
3264 DeclareStruct(prop->_class->fullName, 0x0);
3265 if(!symbol || curExternal->symbol->idCode < symbol->id)
3266 {
3267 unsigned int imported = 0x0;
3268 unsigned int dllImport = 0x0;
3269
3270 if(!symbol || symbol->_import)
3271 {
3272 if(!symbol)
3273 {
3274 struct Symbol * classSym;
3275
3276 if(!prop->_class->symbol)
3277 prop->_class->symbol = FindClass(prop->_class->fullName);
3278 classSym = prop->_class->symbol;
3279 if(classSym && !classSym->_import)
3280 {
3281 struct ModuleImport * module;
3282
3283 if(prop->_class->module)
3284 module = FindModule(prop->_class->module);
3285 else
3286 module = mainModule;
3287 classSym->_import = __extension__ ({
3288 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
3289
3290 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
3291 });
3292 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3293 }
3294 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3295 symbol->_import = (struct ClassImport *)__extension__ ({
3296 struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
3297
3298 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0x0, __ecereInstance1->hasSet = prop->Set ? 0x1 : 0x0, __ecereInstance1->hasGet = prop->Get ? 0x1 : 0x0, __ecereInstance1;
3299 });
3300 if(classSym)
3301 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3302 }
3303 imported = 0x1;
3304 if((prop->_class->module != privateModule || !strcmp(prop->_class->name, "float") || !strcmp(prop->_class->name, "double")) && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)prop->_class->module + 24)))->importType != 1)
3305 dllImport = 0x1;
3306 }
3307 if(!symbol->type)
3308 {
3309 struct Context * context = SetupTemplatesContext(prop->_class);
3310
3311 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
3312 FinishTemplatesContext(context);
3313 }
3314 if(prop->Get)
3315 {
3316 if(!symbol->externalGet || symbol->externalGet->type == 0)
3317 {
3318 struct Declaration * decl;
3319 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3320 struct Declarator * d;
3321 struct __ecereNameSpace__ecere__sys__OldList * params;
3322 struct Specifier * spec;
3323 struct External * external;
3324 struct Declarator * typeDecl;
3325 unsigned int simple = 0x0;
3326
3327 specifiers = MkList();
3328 declarators = MkList();
3329 params = MkList();
3330 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3331 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3332 if(dllImport)
3333 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3334 {
3335 struct Context * context = SetupTemplatesContext(prop->_class);
3336
3337 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3338 FinishTemplatesContext(context);
3339 }
3340 for(spec = (*specifiers).first; spec; spec = spec->next)
3341 {
3342 if(spec->type == 1)
3343 {
3344 if((!typeDecl || typeDecl->type == 1))
3345 {
3346 struct Symbol * classSym = spec->symbol;
3347
3348 symbol->_class = classSym->registered;
3349 if(classSym->registered && classSym->registered->type == 1)
3350 {
3351 DeclareStruct(spec->name, 0x0);
3352 simple = 0x1;
3353 }
3354 }
3355 }
3356 }
3357 if(!simple)
3358 d = PlugDeclarator(typeDecl, d);
3359 else
3360 {
3361 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3362 specifiers = MkList();
3363 }
3364 d = MkDeclaratorFunction(d, params);
3365 if(dllImport)
3366 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3367 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3368 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3369 if(simple)
3370 ListAdd(specifiers, MkSpecifier(VOID));
3371 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3372 decl = MkDeclaration(specifiers, declarators);
3373 external = MkExternalDeclaration(decl);
3374 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3375 external->symbol = symbol;
3376 symbol->externalGet = external;
3377 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3378 if(typeDecl)
3379 FreeDeclarator(typeDecl);
3380 }
3381 else
3382 {
3383 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
3384 }
3385 }
3386 if(prop->Set)
3387 {
3388 if(!symbol->externalSet || symbol->externalSet->type == 0)
3389 {
3390 struct Declaration * decl;
3391 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3392 struct Declarator * d;
3393 struct __ecereNameSpace__ecere__sys__OldList * params;
3394 struct Specifier * spec;
3395 struct External * external;
3396 struct Declarator * typeDecl;
3397
3398 declarators = MkList();
3399 params = MkList();
3400 if(!prop->conversion || prop->_class->type == 1)
3401 {
3402 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3403 }
3404 specifiers = MkList();
3405 {
3406 struct Context * context = SetupTemplatesContext(prop->_class);
3407
3408 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3409 FinishTemplatesContext(context);
3410 }
3411 ListAdd(params, MkTypeName(specifiers, d));
3412 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3413 if(dllImport)
3414 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3415 d = MkDeclaratorFunction(d, params);
3416 for(spec = (*specifiers).first; spec; spec = spec->next)
3417 {
3418 if(spec->type == 1)
3419 {
3420 if((!typeDecl || typeDecl->type == 1))
3421 {
3422 struct Symbol * classSym = spec->symbol;
3423
3424 symbol->_class = classSym->registered;
3425 if(classSym->registered && classSym->registered->type == 1)
3426 DeclareStruct(spec->name, 0x0);
3427 }
3428 }
3429 }
3430 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3431 specifiers = MkList();
3432 if(dllImport)
3433 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3434 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3435 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3436 if(!prop->conversion || prop->_class->type == 1)
3437 ListAdd(specifiers, MkSpecifier(VOID));
3438 else
3439 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3440 decl = MkDeclaration(specifiers, declarators);
3441 external = MkExternalDeclaration(decl);
3442 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3443 external->symbol = symbol;
3444 symbol->externalSet = external;
3445 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3446 }
3447 else
3448 {
3449 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3450 }
3451 }
3452 if(!symbol->externalPtr)
3453 {
3454 struct Declaration * decl;
3455 struct External * external;
3456 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3457
3458 if(imported)
3459 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3460 else
3461 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3462 ListAdd(specifiers, MkSpecifierName("Property"));
3463 {
3464 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3465
3466 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3467 if(!imported)
3468 {
3469 strcpy(propName, "__ecerePropM_");
3470 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3471 strcat(propName, "_");
3472 FullClassNameCat(propName, prop->name, 0x1);
3473 MangleClassName(propName);
3474 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3475 }
3476 decl = MkDeclaration(specifiers, list);
3477 }
3478 external = MkExternalDeclaration(decl);
3479 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3480 external->symbol = symbol;
3481 symbol->externalPtr = external;
3482 }
3483 else
3484 {
3485 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3486 }
3487 symbol->id = curExternal->symbol->idCode;
3488 }
3489 }
3490
3491 struct Type * Dereference(struct Type * source)
3492 {
3493 struct Type * type = (((void *)0));
3494
3495 if(source)
3496 {
3497 if(source->kind == 13 || source->kind == 12)
3498 {
3499 type = source->type;
3500 source->type->refCount++;
3501 }
3502 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3503 {
3504 type = __extension__ ({
3505 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3506
3507 __ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
3508 });
3509 }
3510 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3511 {
3512 type = source;
3513 source->refCount++;
3514 }
3515 else
3516 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot dereference type\n", (((void *)0))));
3517 }
3518 return type;
3519 }
3520
3521 static struct Type * Reference(struct Type * source)
3522 {
3523 struct Type * type = (((void *)0));
3524
3525 if(source)
3526 {
3527 type = __extension__ ({
3528 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3529
3530 __ecereInstance1->kind = 13, __ecereInstance1->type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
3531 });
3532 source->refCount++;
3533 }
3534 return type;
3535 }
3536
3537 extern void __ecereNameSpace__ecere__com__eClass_FindNextMember(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class **  curClass, struct __ecereNameSpace__ecere__com__DataMember **  curMember, struct __ecereNameSpace__ecere__com__DataMember **  subMemberStack, int *  subMemberStackPos);
3538
3539 extern void *  memcpy(void * , const void * , size_t size);
3540
3541 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3542
3543 extern void FreeExpression(struct Expression * exp);
3544
3545 extern void __ecereNameSpace__ecere__sys__ChangeCh(char *  string, char ch1, char ch2);
3546
3547 unsigned int MatchTypes(struct Type * source, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, struct __ecereNameSpace__ecere__com__Class * owningClassSource, struct __ecereNameSpace__ecere__com__Class * owningClassDest, unsigned int doConversion, unsigned int enumBaseType, unsigned int acceptReversedParams, unsigned int isConversionExploration);
3548
3549 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3550
3551 extern struct Type * MkClassType(char *  name);
3552
3553 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_AddDataMember(struct __ecereNameSpace__ecere__com__Class * _class, char *  name, char *  type, unsigned int size, unsigned int alignment, int declMode);
3554
3555 void ProcessMemberInitData(struct MemberInit * member, struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class ** curClass, struct __ecereNameSpace__ecere__com__DataMember ** curMember, struct __ecereNameSpace__ecere__com__DataMember ** subMemberStack, int * subMemberStackPos)
3556 {
3557 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3558 unsigned int found = 0x0;
3559 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3560 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3561 unsigned int freeType = 0x0;
3562
3563 yylloc = member->loc;
3564 if(!ident)
3565 {
3566 if(curMember)
3567 {
3568 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3569 if(*curMember)
3570 {
3571 found = 0x1;
3572 dataMember = *curMember;
3573 }
3574 }
3575 }
3576 else
3577 {
3578 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3579 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3580 int _subMemberStackPos = 0;
3581
3582 if(!thisMember)
3583 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3584 if(thisMember)
3585 {
3586 dataMember = thisMember;
3587 if(curMember && thisMember->memberAccess == 1)
3588 {
3589 *curMember = thisMember;
3590 *curClass = thisMember->_class;
3591 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
3592 *subMemberStackPos = _subMemberStackPos;
3593 }
3594 found = 0x1;
3595 }
3596 else
3597 {
3598 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3599 if(method && method->type == 1)
3600 found = 0x1;
3601 else
3602 method = (((void *)0));
3603 }
3604 }
3605 if(found)
3606 {
3607 struct Type * type = (((void *)0));
3608
3609 if(dataMember)
3610 {
3611 if(!dataMember->dataType && dataMember->dataTypeString)
3612 {
3613 struct Context * context = SetupTemplatesContext(_class);
3614
3615 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3616 FinishTemplatesContext(context);
3617 }
3618 type = dataMember->dataType;
3619 }
3620 else if(method)
3621 {
3622 if(!method->dataType)
3623 ProcessMethodType(method);
3624 type = method->dataType;
3625 }
3626 if(ident && ident->next)
3627 {
3628 for(ident = ident->next; ident && type; ident = ident->next)
3629 {
3630 if(type->kind == 8)
3631 {
3632 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3633 if(!dataMember)
3634 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3635 if(dataMember)
3636 type = dataMember->dataType;
3637 }
3638 else if(type->kind == 9 || type->kind == 10)
3639 {
3640 struct Type * memberType;
3641
3642 for(memberType = type->members.first; memberType; memberType = memberType->next)
3643 {
3644 if(!strcmp(memberType->name, ident->string))
3645 {
3646 type = memberType;
3647 break;
3648 }
3649 }
3650 }
3651 }
3652 }
3653 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3654 {
3655 int id = 0;
3656 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3657 struct __ecereNameSpace__ecere__com__Class * sClass;
3658
3659 for(sClass = _class; sClass; sClass = sClass->base)
3660 {
3661 id = 0;
3662 if(sClass->templateClass)
3663 sClass = sClass->templateClass;
3664 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3665 {
3666 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3667 {
3668 for(sClass = sClass->base; sClass; sClass = sClass->base)
3669 {
3670 if(sClass->templateClass)
3671 sClass = sClass->templateClass;
3672 id += sClass->templateParams.count;
3673 }
3674 break;
3675 }
3676 id++;
3677 }
3678 if(curParam)
3679 break;
3680 }
3681 if(curParam)
3682 {
3683 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3684
3685 if(arg.dataTypeString)
3686 {
3687 type = ProcessTypeString(arg.dataTypeString, 0x0);
3688 freeType = 0x1;
3689 if(type && _class->templateClass)
3690 type->passAsTemplate = 0x1;
3691 if(type)
3692 {
3693 }
3694 }
3695 }
3696 }
3697 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3698 {
3699 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3700 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3701 int c;
3702 int paramCount = 0;
3703 int lastParam = -1;
3704 char templateString[1024];
3705 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3706
3707 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3708 for(cClass = expClass; cClass; cClass = cClass->base)
3709 {
3710 int p = 0;
3711
3712 if(cClass->templateClass)
3713 cClass = cClass->templateClass;
3714 for(param = cClass->templateParams.first; param; param = param->next)
3715 {
3716 int id = p;
3717 struct __ecereNameSpace__ecere__com__Class * sClass;
3718 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3719
3720 for(sClass = cClass->base; sClass; sClass = sClass->base)
3721 {
3722 if(sClass->templateClass)
3723 sClass = sClass->templateClass;
3724 id += sClass->templateParams.count;
3725 }
3726 arg = expClass->templateArgs[id];
3727 for(sClass = _class; sClass; sClass = sClass->base)
3728 {
3729 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3730 int p = 0;
3731 struct __ecereNameSpace__ecere__com__Class * nextClass;
3732
3733 if(sClass->templateClass)
3734 sClass = sClass->templateClass;
3735 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3736 {
3737 if(nextClass->templateClass)
3738 nextClass = nextClass->templateClass;
3739 p += nextClass->templateParams.count;
3740 }
3741 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3742 {
3743 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3744 {
3745 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3746 {
3747 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3748 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3749 break;
3750 }
3751 }
3752 }
3753 }
3754 {
3755 char argument[256];
3756
3757 argument[0] = '\0';
3758 switch(param->type)
3759 {
3760 case 2:
3761 {
3762 char expString[1024];
3763 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3764 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3765 struct Expression * exp;
3766 char * string = PrintHexUInt64(arg.expression.ui64);
3767
3768 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3769 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
3770 ProcessExpressionType(exp);
3771 ComputeExpression(exp);
3772 expString[0] = '\0';
3773 PrintExpression(exp, expString);
3774 strcat(argument, expString);
3775 FreeExpression(exp);
3776 break;
3777 }
3778 case 1:
3779 {
3780 strcat(argument, arg.member->name);
3781 break;
3782 }
3783 case 0:
3784 {
3785 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3786 strcat(argument, arg.dataTypeString);
3787 break;
3788 }
3789 }
3790 if(argument[0])
3791 {
3792 if(paramCount)
3793 strcat(templateString, ", ");
3794 if(lastParam != p - 1)
3795 {
3796 strcat(templateString, param->name);
3797 strcat(templateString, " = ");
3798 }
3799 strcat(templateString, argument);
3800 paramCount++;
3801 lastParam = p;
3802 }
3803 p++;
3804 }
3805 }
3806 }
3807 {
3808 int len = strlen(templateString);
3809
3810 if(templateString[len - 1] == '<')
3811 len--;
3812 else
3813 {
3814 if(templateString[len - 1] == '>')
3815 templateString[len++] = ' ';
3816 templateString[len++] = '>';
3817 }
3818 templateString[len++] = '\0';
3819 }
3820 {
3821 struct Context * context = SetupTemplatesContext(_class);
3822
3823 if(freeType)
3824 FreeType(type);
3825 type = ProcessTypeString(templateString, 0x0);
3826 freeType = 0x1;
3827 FinishTemplatesContext(context);
3828 }
3829 }
3830 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3831 {
3832 ProcessExpressionType(member->initializer->exp);
3833 if(!member->initializer->exp->expType)
3834 {
3835 if(inCompiler)
3836 {
3837 char expString[10240];
3838
3839 expString[0] = '\0';
3840 PrintExpression(member->initializer->exp, expString);
3841 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3842 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3843 }
3844 }
3845 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0))
3846 {
3847 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible instance method %s\n", (((void *)0))), ident->string);
3848 }
3849 }
3850 else if(member->initializer)
3851 {
3852 ProcessInitializer(member->initializer, type);
3853 }
3854 if(freeType)
3855 FreeType(type);
3856 }
3857 else
3858 {
3859 if(_class && _class->type == 3)
3860 {
3861 if(member->initializer)
3862 {
3863 struct Type * type = MkClassType(_class->fullName);
3864
3865 ProcessInitializer(member->initializer, type);
3866 FreeType(type);
3867 }
3868 }
3869 else
3870 {
3871 if(member->initializer)
3872 {
3873 ProcessInitializer(member->initializer, (((void *)0)));
3874 }
3875 if(ident)
3876 {
3877 if(method)
3878 {
3879 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3880 }
3881 else if(_class)
3882 {
3883 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3884 if(inCompiler)
3885 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3886 }
3887 }
3888 else if(_class)
3889 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3890 }
3891 }
3892 }
3893
3894 extern struct Identifier * GetDeclId(struct Declarator * decl);
3895
3896 extern struct External * ProcessClassFunction(struct __ecereNameSpace__ecere__com__Class * owningClass, struct ClassFunction * func, struct __ecereNameSpace__ecere__sys__OldList * defs, struct External * after, unsigned int makeStatic);
3897
3898 extern void FreeSpecifier(struct Specifier * spec);
3899
3900 static void ProcessFunction(struct FunctionDefinition * function);
3901
3902 extern struct __ecereNameSpace__ecere__sys__OldList *  CopyList(struct __ecereNameSpace__ecere__sys__OldList *  source, void *  (*  CopyFunction)(void * ));
3903
3904 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3905
3906 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3907
3908 extern void FreeClassFunction(struct ClassFunction * func);
3909
3910 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3911
3912 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3913
3914 void ProcessInstantiationType(struct Instantiation * inst)
3915 {
3916 yylloc = inst->loc;
3917 if(inst->_class)
3918 {
3919 struct MembersInit * members;
3920 struct Symbol * classSym;
3921 struct __ecereNameSpace__ecere__com__Class * _class;
3922
3923 classSym = inst->_class->symbol;
3924 _class = classSym ? classSym->registered : (((void *)0));
3925 if(!_class || _class->type != 5)
3926 DeclareStruct(inst->_class->name, 0x0);
3927 afterExternal = afterExternal ? afterExternal : curExternal;
3928 if(inst->exp)
3929 ProcessExpressionType(inst->exp);
3930 inst->isConstant = 0x1;
3931 if(inst->members)
3932 {
3933 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3934 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3935 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3936 int subMemberStackPos = 0;
3937
3938 for(members = (*inst->members).first; members; members = members->next)
3939 {
3940 switch(members->type)
3941 {
3942 case 1:
3943 {
3944 char name[1024];
3945 static unsigned int instMethodID = 0;
3946 struct External * external = curExternal;
3947 struct Context * context = curContext;
3948 struct Declarator * declarator = members->function->declarator;
3949 struct Identifier * nameID = GetDeclId(declarator);
3950 char * unmangled = nameID ? nameID->string : (((void *)0));
3951 struct Expression * exp;
3952 struct External * createdExternal = (((void *)0));
3953
3954 if(inCompiler)
3955 {
3956 char number[16];
3957
3958 strcpy(name, "__ecereInstMeth_");
3959 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
3960 strcat(name, "_");
3961 strcat(name, nameID->string);
3962 strcat(name, "_");
3963 sprintf(number, "_%08d", instMethodID++);
3964 strcat(name, number);
3965 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
3966 }
3967 if(declarator)
3968 {
3969 struct Symbol * symbol = declarator->symbol;
3970 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
3971
3972 if(method && method->type == 1)
3973 {
3974 symbol->method = method;
3975 ProcessMethodType(method);
3976 if(!symbol->type->thisClass)
3977 {
3978 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
3979 {
3980 if(!currentClass->symbol)
3981 currentClass->symbol = FindClass(currentClass->fullName);
3982 symbol->type->thisClass = currentClass->symbol;
3983 }
3984 else
3985 {
3986 if(!_class->symbol)
3987 _class->symbol = FindClass(_class->fullName);
3988 symbol->type->thisClass = _class->symbol;
3989 }
3990 }
3991 DeclareType(symbol->type, 0x1, 0x1);
3992 }
3993 else if(classSym)
3994 {
3995 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
3996 }
3997 }
3998 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
3999 if(nameID)
4000 {
4001 FreeSpecifier(nameID->_class);
4002 nameID->_class = (((void *)0));
4003 }
4004 if(inCompiler)
4005 {
4006 struct Type * type = declarator->symbol->type;
4007 struct External * oldExternal = curExternal;
4008
4009 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
4010 {
4011 struct External * externalDecl;
4012
4013 externalDecl = MkExternalDeclaration((((void *)0)));
4014 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
4015 if(createdExternal->function)
4016 {
4017 ProcessFunction(createdExternal->function);
4018 {
4019 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
4020
4021 externalDecl->declaration = decl;
4022 if(decl->symbol && !decl->symbol->pointerExternal)
4023 decl->symbol->pointerExternal = externalDecl;
4024 declarator->symbol->pointerExternal = externalDecl;
4025 }
4026 }
4027 }
4028 }
4029 else if(declarator)
4030 {
4031 curExternal = declarator->symbol->pointerExternal;
4032 ProcessFunction((struct FunctionDefinition *)members->function);
4033 }
4034 curExternal = external;
4035 curContext = context;
4036 if(inCompiler)
4037 {
4038 FreeClassFunction(members->function);
4039 exp = QMkExpId(name);
4040 members->type = 0;
4041 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
4042 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
4043 }
4044 break;
4045 }
4046 case 0:
4047 {
4048 if(members->dataMembers && classSym)
4049 {
4050 struct MemberInit * member;
4051 struct Location oldyyloc = yylloc;
4052
4053 for(member = (*members->dataMembers).first; member; member = member->next)
4054 {
4055 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
4056 if(member->initializer && !member->initializer->isConstant)
4057 inst->isConstant = 0x0;
4058 }
4059 yylloc = oldyyloc;
4060 }
4061 break;
4062 }
4063 }
4064 }
4065 }
4066 }
4067 }
4068
4069 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
4070 {
4071 if(inCompiler)
4072 {
4073 if(type->kind == 11)
4074 {
4075 struct Type * param;
4076
4077 if(declareParams)
4078 {
4079 for(param = type->params.first; param; param = param->next)
4080 DeclareType(param, declarePointers, 0x1);
4081 }
4082 DeclareType(type->returnType, declarePointers, 0x1);
4083 }
4084 else if(type->kind == 13 && declarePointers)
4085 DeclareType(type->type, declarePointers, 0x0);
4086 else if(type->kind == 8)
4087 {
4088 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
4089 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
4090 }
4091 else if(type->kind == 9 || type->kind == 10)
4092 {
4093 struct Type * member;
4094
4095 for(member = type->members.first; member; member = member->next)
4096 DeclareType(member, 0x0, 0x0);
4097 }
4098 else if(type->kind == 12)
4099 DeclareType(type->arrayType, declarePointers, 0x0);
4100 }
4101 }
4102
4103 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
4104
4105 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
4106 {
4107 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
4108 int id = 0;
4109 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4110 struct __ecereNameSpace__ecere__com__Class * sClass;
4111
4112 for(sClass = _class; sClass; sClass = sClass->base)
4113 {
4114 id = 0;
4115 if(sClass->templateClass)
4116 sClass = sClass->templateClass;
4117 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4118 {
4119 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
4120 {
4121 for(sClass = sClass->base; sClass; sClass = sClass->base)
4122 {
4123 if(sClass->templateClass)
4124 sClass = sClass->templateClass;
4125 id += sClass->templateParams.count;
4126 }
4127 break;
4128 }
4129 id++;
4130 }
4131 if(curParam)
4132 break;
4133 }
4134 if(curParam)
4135 {
4136 arg = &_class->templateArgs[id];
4137 if(arg && param->type == 0)
4138 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
4139 }
4140 return arg;
4141 }
4142
4143 extern struct Context * PushContext(void);
4144
4145 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
4146
4147 struct TemplatedType
4148 {
4149 uintptr_t key;
4150 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4151 struct __ecereNameSpace__ecere__sys__BTNode * left;
4152 struct __ecereNameSpace__ecere__sys__BTNode * right;
4153 int depth;
4154 struct TemplateParameter * param;
4155 } __attribute__ ((gcc_struct));
4156
4157 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
4158
4159 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
4160 {
4161 struct Context * context = PushContext();
4162
4163 context->templateTypesOnly = 0x1;
4164 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
4165 {
4166 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
4167
4168 for(; param; param = param->next)
4169 {
4170 if(param->type == 0 && param->identifier)
4171 {
4172 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
4173
4174 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4175 }
4176 }
4177 }
4178 else if(_class)
4179 {
4180 struct __ecereNameSpace__ecere__com__Class * sClass;
4181
4182 for(sClass = _class; sClass; sClass = sClass->base)
4183 {
4184 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
4185
4186 for(p = sClass->templateParams.first; p; p = p->next)
4187 {
4188 if(p->type == 0)
4189 {
4190 struct TemplateParameter * param = p->param;
4191 struct TemplatedType * type;
4192
4193 if(!param)
4194 {
4195 p->param = param = __extension__ ({
4196 struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
4197
4198 __ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->dataTypeString, __ecereInstance1;
4199 });
4200 }
4201 type = __extension__ ({
4202 struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
4203
4204 __ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
4205 });
4206 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4207 }
4208 }
4209 }
4210 }
4211 return context;
4212 }
4213
4214 extern void PopContext(struct Context * ctx);
4215
4216 extern void FreeContext(struct Context * context);
4217
4218 void FinishTemplatesContext(struct Context * context)
4219 {
4220 PopContext(context);
4221 FreeContext(context);
4222 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
4223 }
4224
4225 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
4226 {
4227 if(!method->dataType)
4228 {
4229 struct Context * context = SetupTemplatesContext(method->_class);
4230
4231 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4232 FinishTemplatesContext(context);
4233 if(method->type != 1 && method->dataType)
4234 {
4235 if(!method->dataType->thisClass && !method->dataType->staticMethod)
4236 {
4237 if(!method->_class->symbol)
4238 method->_class->symbol = FindClass(method->_class->fullName);
4239 method->dataType->thisClass = method->_class->symbol;
4240 }
4241 }
4242 }
4243 }
4244
4245 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
4246 {
4247 if(!prop->dataType)
4248 {
4249 struct Context * context = SetupTemplatesContext(prop->_class);
4250
4251 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
4252 FinishTemplatesContext(context);
4253 }
4254 }
4255
4256 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4257
4258 extern void FreeTypeName(struct TypeName * typeName);
4259
4260 static void ProcessDeclarator(struct Declarator * decl);
4261
4262 extern struct __ecereNameSpace__ecere__sys__OldList *  excludedSymbols;
4263
4264 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4265
4266 struct MethodImport
4267 {
4268 struct MethodImport * prev;
4269 struct MethodImport * next;
4270 char *  name;
4271 unsigned int isVirtual;
4272 } __attribute__ ((gcc_struct));
4273
4274 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
4275
4276 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
4277 {
4278 struct Symbol * symbol = method->symbol;
4279
4280 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4281 {
4282 unsigned int imported = 0x0;
4283 unsigned int dllImport = 0x0;
4284
4285 if(!method->dataType)
4286 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4287 if(!symbol || symbol->_import || method->type == 1)
4288 {
4289 if(!symbol || method->type == 1)
4290 {
4291 struct Symbol * classSym;
4292
4293 if(!method->_class->symbol)
4294 method->_class->symbol = FindClass(method->_class->fullName);
4295 classSym = method->_class->symbol;
4296 if(!classSym->_import)
4297 {
4298 struct ModuleImport * module;
4299
4300 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->name)
4301 module = FindModule(method->_class->module);
4302 else
4303 module = mainModule;
4304 classSym->_import = __extension__ ({
4305 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
4306
4307 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
4308 });
4309 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4310 }
4311 if(!symbol)
4312 {
4313 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4314 }
4315 if(!symbol->_import)
4316 {
4317 symbol->_import = (struct ClassImport *)__extension__ ({
4318 struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
4319
4320 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
4321 });
4322 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4323 }
4324 if(!symbol)
4325 {
4326 symbol->type = method->dataType;
4327 if(symbol->type)
4328 symbol->type->refCount++;
4329 }
4330 }
4331 if(!method->dataType->dllExport)
4332 {
4333 imported = 0x1;
4334 if((method->_class->module != privateModule || !strcmp(method->_class->name, "float") || !strcmp(method->_class->name, "double")) && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + 24)))->importType != 1)
4335 dllImport = 0x1;
4336 }
4337 }
4338 if(method->type != 1 && method->dataType)
4339 DeclareType(method->dataType, 0x1, 0x1);
4340 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4341 {
4342 struct Declaration * decl;
4343 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4344 struct Declarator * d;
4345 struct Declarator * funcDecl;
4346 struct External * external;
4347
4348 specifiers = MkList();
4349 declarators = MkList();
4350 if(dllImport)
4351 ListAdd(specifiers, MkSpecifier(EXTERN));
4352 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4353 ListAdd(specifiers, MkSpecifier(STATIC));
4354 if(method->type == 1)
4355 {
4356 ListAdd(specifiers, MkSpecifier(INT));
4357 d = MkDeclaratorIdentifier(MkIdentifier(name));
4358 }
4359 else
4360 {
4361 d = MkDeclaratorIdentifier(MkIdentifier(name));
4362 if(dllImport)
4363 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4364 {
4365 struct Context * context = SetupTemplatesContext(method->_class);
4366
4367 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4368 FinishTemplatesContext(context);
4369 }
4370 funcDecl = GetFuncDecl(d);
4371 if(dllImport)
4372 {
4373 struct Specifier * spec, * next;
4374
4375 for(spec = (*specifiers).first; spec; spec = next)
4376 {
4377 next = spec->next;
4378 if(spec->type == 5)
4379 {
4380 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4381 FreeSpecifier(spec);
4382 }
4383 }
4384 }
4385 if(method->dataType && !method->dataType->staticMethod)
4386 {
4387 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
4388 {
4389 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
4390 struct TypeName * thisParam = MkTypeName(MkListOne(MkSpecifierName(method->dataType->thisClass ? method->dataType->thisClass->string : method->_class->fullName)), (_class && _class->type == 1000) ? MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("this"))) : MkDeclaratorIdentifier(MkIdentifier("this")));
4391 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
4392 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4393
4394 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
4395 {
4396 struct TypeName * param = (*funcDecl->function.parameters).first;
4397
4398 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
4399 FreeTypeName(param);
4400 }
4401 if(!funcDecl->function.parameters)
4402 funcDecl->function.parameters = MkList();
4403 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
4404 }
4405 }
4406 }
4407 ProcessDeclarator(d);
4408 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4409 decl = MkDeclaration(specifiers, declarators);
4410 ReplaceThisClassSpecifiers(specifiers, method->_class);
4411 if(symbol->pointerExternal)
4412 {
4413 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4414
4415 {
4416 *functionSymbol = *symbol;
4417 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4418 if(functionSymbol->type)
4419 functionSymbol->type->refCount++;
4420 }
4421 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4422 symbol->pointerExternal->symbol = functionSymbol;
4423 }
4424 external = MkExternalDeclaration(decl);
4425 if(curExternal)
4426 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4427 external->symbol = symbol;
4428 symbol->pointerExternal = external;
4429 }
4430 else if(ast)
4431 {
4432 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4433 }
4434 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4435 }
4436 }
4437
4438 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4439 {
4440 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4441 {
4442 unsigned int first = 0x1;
4443 int p = 0;
4444 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4445 int lastParam = -1;
4446 char className[1024];
4447
4448 strcpy(className, _class->fullName);
4449 for(param = _class->templateParams.first; param; param = param->next)
4450 {
4451 {
4452 if(first)
4453 strcat(className, "<");
4454 if(!first)
4455 strcat(className, ", ");
4456 if(lastParam + 1 != p)
4457 {
4458 strcat(className, param->name);
4459 strcat(className, " = ");
4460 }
4461 strcat(className, param->name);
4462 first = 0x0;
4463 lastParam = p;
4464 }
4465 p++;
4466 }
4467 if(!first)
4468 {
4469 int len = strlen(className);
4470
4471 if(className[len - 1] == '>')
4472 className[len++] = ' ';
4473 className[len++] = '>';
4474 className[len++] = '\0';
4475 }
4476 return __ecereNameSpace__ecere__sys__CopyString(className);
4477 }
4478 else
4479 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4480 }
4481
4482 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4483 {
4484 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4485 {
4486 unsigned int first = 0x1;
4487 int p = 0;
4488 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4489 int lastParam = -1;
4490 char className[1024];
4491
4492 strcpy(className, _class->fullName);
4493 for(param = _class->templateParams.first; param; param = param->next)
4494 {
4495 {
4496 if(first)
4497 strcat(className, "<");
4498 if(!first)
4499 strcat(className, ", ");
4500 if(lastParam + 1 != p)
4501 {
4502 strcat(className, param->name);
4503 strcat(className, " = ");
4504 }
4505 strcat(className, param->name);
4506 first = 0x0;
4507 lastParam = p;
4508 }
4509 p++;
4510 }
4511 if(!first)
4512 {
4513 int len = strlen(className);
4514
4515 if(className[len - 1] == '>')
4516 className[len++] = ' ';
4517 className[len++] = '>';
4518 className[len++] = '\0';
4519 }
4520 return MkClassType(className);
4521 }
4522 else
4523 {
4524 return MkClassType(_class->fullName);
4525 }
4526 }
4527
4528 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4529 {
4530 if(specs != (((void *)0)) && _class)
4531 {
4532 struct Specifier * spec;
4533
4534 for(spec = specs->first; spec; spec = spec->next)
4535 {
4536 if(spec->type == 0 && spec->specifier == THISCLASS)
4537 {
4538 spec->type = 1;
4539 spec->name = ReplaceThisClass(_class);
4540 spec->symbol = FindClass(spec->name);
4541 }
4542 }
4543 }
4544 }
4545
4546 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4547
4548 struct __ecereNameSpace__ecere__com__GlobalFunction
4549 {
4550 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4551 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4552 char *  name;
4553 int (*  function)();
4554 struct __ecereNameSpace__ecere__com__Instance * module;
4555 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
4556 char *  dataTypeString;
4557 struct Type * dataType;
4558 void *  symbol;
4559 } __attribute__ ((gcc_struct));
4560
4561 extern struct Context * globalContext;
4562
4563 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4564
4565 struct FunctionImport
4566 {
4567 struct FunctionImport * prev;
4568 struct FunctionImport * next;
4569 char *  name;
4570 } __attribute__ ((gcc_struct));
4571
4572 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4573 {
4574 struct Symbol * symbol = function->symbol;
4575
4576 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4577 {
4578 unsigned int imported = 0x0;
4579 unsigned int dllImport = 0x0;
4580
4581 if(!function->dataType)
4582 {
4583 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4584 if(!function->dataType->thisClass)
4585 function->dataType->staticMethod = 0x1;
4586 }
4587 if(inCompiler)
4588 {
4589 if(!symbol)
4590 {
4591 struct ModuleImport * module = FindModule(function->module);
4592
4593 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4594 if(module->name)
4595 {
4596 if(!function->dataType->dllExport)
4597 {
4598 symbol->_import = (struct ClassImport *)__extension__ ({
4599 struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
4600
4601 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
4602 });
4603 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4604 }
4605 }
4606 {
4607 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4608 if(!symbol->type->thisClass)
4609 symbol->type->staticMethod = 0x1;
4610 }
4611 }
4612 imported = symbol->_import ? 0x1 : 0x0;
4613 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1)
4614 dllImport = 0x1;
4615 }
4616 DeclareType(function->dataType, 0x1, 0x1);
4617 if(inCompiler)
4618 {
4619 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4620 {
4621 struct Declaration * decl;
4622 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4623 struct Declarator * d;
4624 struct Declarator * funcDecl;
4625 struct External * external;
4626
4627 specifiers = MkList();
4628 declarators = MkList();
4629 ListAdd(specifiers, MkSpecifier(EXTERN));
4630 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4631 if(dllImport)
4632 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4633 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4634 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType == 1)
4635 {
4636 struct Specifier * spec;
4637
4638 for(spec = (*specifiers).first; spec; spec = spec->next)
4639 if(spec->type == 5 && spec->extDecl && spec->extDecl->type == 0 && !strcmp(spec->extDecl->s, "dllexport"))
4640 {
4641 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4642 FreeSpecifier(spec);
4643 break;
4644 }
4645 }
4646 funcDecl = GetFuncDecl(d);
4647 if(funcDecl && !funcDecl->function.parameters)
4648 {
4649 funcDecl->function.parameters = MkList();
4650 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4651 }
4652 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4653 {
4654 struct Context * oldCtx = curContext;
4655
4656 curContext = globalContext;
4657 decl = MkDeclaration(specifiers, declarators);
4658 curContext = oldCtx;
4659 }
4660 if(symbol->pointerExternal)
4661 {
4662 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4663
4664 {
4665 *functionSymbol = *symbol;
4666 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4667 if(functionSymbol->type)
4668 functionSymbol->type->refCount++;
4669 }
4670 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4671 symbol->pointerExternal->symbol = functionSymbol;
4672 }
4673 external = MkExternalDeclaration(decl);
4674 if(curExternal)
4675 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4676 external->symbol = symbol;
4677 symbol->pointerExternal = external;
4678 }
4679 else
4680 {
4681 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4682 }
4683 if(curExternal)
4684 symbol->id = curExternal->symbol->idCode;
4685 }
4686 }
4687 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1) ? 0x1 : 0x0;
4688 }
4689
4690 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4691
4692 struct GlobalData
4693 {
4694 uintptr_t key;
4695 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4696 struct __ecereNameSpace__ecere__sys__BTNode * left;
4697 struct __ecereNameSpace__ecere__sys__BTNode * right;
4698 int depth;
4699 struct __ecereNameSpace__ecere__com__Instance * module;
4700 char *  dataTypeString;
4701 struct Type * dataType;
4702 void *  symbol;
4703 char *  fullName;
4704 } __attribute__ ((gcc_struct));
4705
4706 void DeclareGlobalData(struct GlobalData * data)
4707 {
4708 struct Symbol * symbol = data->symbol;
4709
4710 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4711 {
4712 if(inCompiler)
4713 {
4714 if(!symbol)
4715 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4716 }
4717 if(!data->dataType)
4718 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4719 DeclareType(data->dataType, 0x1, 0x1);
4720 if(inCompiler)
4721 {
4722 if(!symbol->pointerExternal)
4723 {
4724 struct Declaration * decl;
4725 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4726 struct Declarator * d;
4727 struct External * external;
4728
4729 specifiers = MkList();
4730 declarators = MkList();
4731 ListAdd(specifiers, MkSpecifier(EXTERN));
4732 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4733 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4734 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4735 decl = MkDeclaration(specifiers, declarators);
4736 external = MkExternalDeclaration(decl);
4737 if(curExternal)
4738 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4739 external->symbol = symbol;
4740 symbol->pointerExternal = external;
4741 }
4742 else
4743 {
4744 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4745 }
4746 if(curExternal)
4747 symbol->id = curExternal->symbol->idCode;
4748 }
4749 }
4750 }
4751
4752 struct Conversion
4753 {
4754 struct Conversion * prev, * next;
4755 struct __ecereNameSpace__ecere__com__Property * convert;
4756 unsigned int isGet;
4757 struct Type * resultType;
4758 } __attribute__ ((gcc_struct));
4759
4760 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4761
4762 extern void Compiler_Warning(char *  format, ...);
4763
4764 void PrintType(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
4765
4766 unsigned int MatchTypes(struct Type * source, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, struct __ecereNameSpace__ecere__com__Class * owningClassSource, struct __ecereNameSpace__ecere__com__Class * owningClassDest, unsigned int doConversion, unsigned int enumBaseType, unsigned int acceptReversedParams, unsigned int isConversionExploration)
4767 {
4768 if(source && dest)
4769 {
4770 if(source->kind == 20 && dest->kind != 20)
4771 {
4772 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4773
4774 if(type)
4775 source = type;
4776 }
4777 if(dest->kind == 20 && source->kind != 20)
4778 {
4779 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4780
4781 if(type)
4782 dest = type;
4783 }
4784 if(dest->classObjectType == 2)
4785 {
4786 if(source->classObjectType != 3)
4787 return 0x1;
4788 else
4789 {
4790 if((dest->_class && strcmp(dest->_class->string, "class")) || (source->_class && strcmp(source->_class->string, "class")))
4791 {
4792 return 0x1;
4793 }
4794 }
4795 }
4796 else
4797 {
4798 if(source->classObjectType == 3)
4799 return 0x1;
4800 if(dest->classObjectType == 3 && source->classObjectType != 2)
4801 return 0x1;
4802 }
4803 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4804 {
4805 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4806 return 0x1;
4807 }
4808 if(dest->kind == 14 && source->kind != 0)
4809 return 0x1;
4810 if(dest->kind == 13 && dest->type->kind == 0 && ((source->kind == 8 && (!source->_class || !source->_class->registered || source->_class->registered->type == 1 || source->_class->registered->type == 0 || source->_class->registered->type == 5 || source->_class->registered->type == 1000)) || source->kind == 19 || source->kind == 13 || source->kind == 12 || source->kind == 11 || source->kind == 21))
4811 return 0x1;
4812 if(!isConversionExploration && source->kind == 13 && source->type->kind == 0 && ((dest->kind == 8 && (!dest->_class || !dest->_class->registered || dest->_class->registered->type == 1 || dest->_class->registered->type == 0 || dest->_class->registered->type == 5 || dest->_class->registered->type == 1000)) || dest->kind == 19 || dest->kind == 13 || dest->kind == 12 || dest->kind == 11 || dest->kind == 21))
4813 return 0x1;
4814 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4815 {
4816 if(source->_class->registered && source->_class->registered->type == 3)
4817 {
4818 if(conversions != (((void *)0)))
4819 {
4820 if(source->_class->registered == dest->_class->registered)
4821 return 0x1;
4822 }
4823 else
4824 {
4825 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4826
4827 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4828 ;
4829 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4830 ;
4831 if(sourceBase == destBase)
4832 return 0x1;
4833 }
4834 }
4835 else if(source->_class && dest->_class && (dest->classObjectType == source->classObjectType || !dest->classObjectType) && (enumBaseType || (!source->_class->registered || source->_class->registered->type != 4) || (!dest->_class->registered || dest->_class->registered->type != 4)) && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, dest->_class->registered))
4836 return 0x1;
4837 else
4838 {
4839 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4 && ((source->_class && source->_class->registered && source->_class->registered->type != 4) || source->kind == 8))
4840 {
4841 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4842 {
4843 return 0x1;
4844 }
4845 }
4846 }
4847 }
4848 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
4849 return 0x1;
4850 if(doConversion)
4851 {
4852 if(source->kind == 8)
4853 {
4854 struct __ecereNameSpace__ecere__com__Class * _class;
4855
4856 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4857 {
4858 struct __ecereNameSpace__ecere__com__Property * convert;
4859
4860 for(convert = _class->conversions.first; convert; convert = convert->next)
4861 {
4862 if(convert->memberAccess == 1 || _class->module == privateModule)
4863 {
4864 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4865
4866 if(!convert->dataType)
4867 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4868 if(MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x0, 0x1, 0x0, 0x1))
4869 {
4870 if(!conversions && !convert->Get)
4871 return 0x1;
4872 else if(conversions != (((void *)0)))
4873 {
4874 if(_class->type == 3 && convert->dataType->kind == 8 && convert->dataType->_class && convert->dataType->_class->registered && _class->base == convert->dataType->_class->registered->base && (dest->kind != 8 || dest->_class->registered != _class->base))
4875 return 0x1;
4876 else
4877 {
4878 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4879
4880 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4881 return 0x1;
4882 }
4883 }
4884 }
4885 }
4886 }
4887 }
4888 }
4889 if(dest->kind == 8)
4890 {
4891 struct __ecereNameSpace__ecere__com__Class * _class;
4892
4893 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4894 {
4895 struct __ecereNameSpace__ecere__com__Property * convert;
4896
4897 for(convert = _class->conversions.first; convert; convert = convert->next)
4898 {
4899 if(convert->memberAccess == 1 || _class->module == privateModule)
4900 {
4901 if(!convert->dataType)
4902 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4903 if(convert->dataType != dest && MatchTypes(source, convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1))
4904 {
4905 if(!conversions && !convert->Set)
4906 return 0x1;
4907 else if(conversions != (((void *)0)))
4908 {
4909 if(_class->type == 3 && convert->dataType->kind == 8 && convert->dataType->_class && convert->dataType->_class->registered && _class->base == convert->dataType->_class->registered->base && (source->kind != 8 || source->_class->registered != _class->base))
4910 return 0x1;
4911 else
4912 {
4913 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4914
4915 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4916 return 0x1;
4917 }
4918 }
4919 }
4920 }
4921 }
4922 }
4923 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
4924 {
4925 if(!dest->_class->registered->dataType)
4926 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
4927 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
4928 {
4929 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4930 {
4931 return 0x1;
4932 }
4933 }
4934 }
4935 }
4936 if(source->kind == 8)
4937 {
4938 struct __ecereNameSpace__ecere__com__Class * _class;
4939
4940 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4941 {
4942 struct __ecereNameSpace__ecere__com__Property * convert;
4943
4944 for(convert = _class->conversions.first; convert; convert = convert->next)
4945 {
4946 if(convert->memberAccess == 1 || _class->module == privateModule)
4947 {
4948 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4949
4950 if(!convert->dataType)
4951 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4952 if(convert->dataType != source && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x1))
4953 {
4954 if(!conversions && !convert->Get)
4955 return 0x1;
4956 else if(conversions != (((void *)0)))
4957 {
4958 if(_class->type == 3 && convert->dataType->kind == 8 && convert->dataType->_class && convert->dataType->_class->registered && _class->base == convert->dataType->_class->registered->base && (dest->kind != 8 || dest->_class->registered != _class->base))
4959 return 0x1;
4960 else
4961 {
4962 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4963
4964 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4965 return 0x1;
4966 }
4967 }
4968 }
4969 }
4970 }
4971 }
4972 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
4973 {
4974 if(!source->_class->registered->dataType)
4975 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
4976 if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4977 {
4978 return 0x1;
4979 }
4980 }
4981 }
4982 }
4983 if(source->kind == 8 || source->kind == 19)
4984 ;
4985 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
4986 return 0x1;
4987 else if(dest->kind == 7 && source->kind == 6)
4988 return 0x1;
4989 else if(dest->kind == 2 && (source->kind == 1 || source->kind == 24))
4990 return 0x1;
4991 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 23))
4992 return 0x1;
4993 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 22 || source->kind == 23))
4994 return 0x1;
4995 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 23 || source->kind == 4))
4996 return 0x1;
4997 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 4 || source->kind == 22))
4998 return 0x1;
4999 else if(source->kind == 15 && (dest->kind == 3 || dest->kind == 2 || dest->kind == 1 || source->kind == 24 || dest->kind == 5 || dest->kind == 4 || dest->kind == 22 || dest->kind == 23))
5000 return 0x1;
5001 else if(dest->kind == 15 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 5 || source->kind == 4 || source->kind == 22 || source->kind == 23))
5002 return 0x1;
5003 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && ((source->kind == 11 || (source->kind == 13 && source->type->kind == 11) || source->kind == 16)))
5004 {
5005 struct Type * paramSource, * paramDest;
5006
5007 if(dest->kind == 16)
5008 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
5009 if(source->kind == 16)
5010 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
5011 if(dest->kind == 13 && dest->type->kind == 11)
5012 dest = dest->type;
5013 if(source->kind == 13 && source->type->kind == 11)
5014 source = source->type;
5015 if(dest->kind == 16)
5016 dest = dest->method->dataType;
5017 if(source->kind == 16)
5018 source = source->method->dataType;
5019 paramSource = source->params.first;
5020 if(paramSource && paramSource->kind == 0)
5021 paramSource = (((void *)0));
5022 paramDest = dest->params.first;
5023 if(paramDest && paramDest->kind == 0)
5024 paramDest = (((void *)0));
5025 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
5026 {
5027 if(!paramDest || (!(paramDest->kind == 13 && paramDest->type && paramDest->type->kind == 0) && (paramDest->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, paramDest->_class->registered))))
5028 {
5029 if(paramDest && paramDest->kind == 8)
5030 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), paramDest->_class->string);
5031 else
5032 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class should not take an object\n", (((void *)0))));
5033 return 0x0;
5034 }
5035 paramDest = paramDest->next;
5036 }
5037 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
5038 {
5039 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
5040 {
5041 if(dest->thisClass)
5042 {
5043 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
5044 {
5045 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
5046 return 0x0;
5047 }
5048 }
5049 else
5050 {
5051 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
5052 {
5053 if(owningClassDest)
5054 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
5055 else
5056 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "overriding class expected to be derived from method class\n", (((void *)0))));
5057 return 0x0;
5058 }
5059 }
5060 paramSource = paramSource->next;
5061 }
5062 else
5063 {
5064 if(dest->thisClass)
5065 {
5066 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
5067 {
5068 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
5069 return 0x0;
5070 }
5071 }
5072 else
5073 {
5074 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
5075 {
5076 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), source->thisClass->registered->fullName);
5077 return 0x0;
5078 }
5079 }
5080 }
5081 }
5082 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5083 {
5084 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible return type for function\n", (((void *)0))));
5085 return 0x0;
5086 }
5087 for(; paramDest; paramDest = paramDest->next)
5088 {
5089 if(!paramSource)
5090 {
5091 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "not enough parameters\n", (((void *)0))));
5092 return 0x0;
5093 }
5094 {
5095 struct Type * paramDestType = paramDest;
5096 struct Type * paramSourceType = paramSource;
5097 struct Type * type = paramDestType;
5098
5099 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
5100 {
5101 int id = 0;
5102 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
5103 struct __ecereNameSpace__ecere__com__Class * sClass;
5104
5105 for(sClass = owningClassSource; sClass; sClass = sClass->base)
5106 {
5107 id = 0;
5108 if(sClass->templateClass)
5109 sClass = sClass->templateClass;
5110 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
5111 {
5112 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
5113 {
5114 for(sClass = sClass->base; sClass; sClass = sClass->base)
5115 {
5116 if(sClass->templateClass)
5117 sClass = sClass->templateClass;
5118 id += sClass->templateParams.count;
5119 }
5120 break;
5121 }
5122 id++;
5123 }
5124 if(curParam)
5125 break;
5126 }
5127 if(curParam)
5128 {
5129 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
5130
5131 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
5132 }
5133 }
5134 if(!MatchTypes(paramDestType, paramSourceType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0) && (!acceptReversedParams || !MatchTypes(paramSourceType, paramDestType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0)))
5135 {
5136 char type[1024];
5137
5138 type[0] = (char)0;
5139 PrintType(paramDest, type, 0x0, 0x1);
5140 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
5141 if(paramDestType != paramDest)
5142 FreeType(paramDestType);
5143 return 0x0;
5144 }
5145 if(paramDestType != paramDest)
5146 FreeType(paramDestType);
5147 }
5148 paramSource = paramSource->next;
5149 }
5150 if(paramSource)
5151 {
5152 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many parameters\n", (((void *)0))));
5153 return 0x0;
5154 }
5155 return 0x1;
5156 }
5157 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
5158 {
5159 return 0x1;
5160 }
5161 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
5162 {
5163 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5164 return 0x1;
5165 }
5166 }
5167 return 0x0;
5168 }
5169
5170 static void FreeConvert(struct Conversion * convert)
5171 {
5172 if(convert->resultType)
5173 FreeType(convert->resultType);
5174 }
5175
5176 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
5177
5178 struct __ecereNameSpace__ecere__com__BTNamedLink
5179 {
5180 char *  name;
5181 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
5182 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
5183 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
5184 int depth;
5185 void *  data;
5186 } __attribute__ ((gcc_struct));
5187
5188 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
5189
5190 struct __ecereNameSpace__ecere__com__EnumClassData
5191 {
5192 struct __ecereNameSpace__ecere__sys__OldList values;
5193 int largest;
5194 } __attribute__ ((gcc_struct));
5195
5196 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
5197
5198 struct __ecereNameSpace__ecere__sys__NamedLink
5199 {
5200 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
5201 struct __ecereNameSpace__ecere__sys__NamedLink * next;
5202 char *  name;
5203 void *  data;
5204 } __attribute__ ((gcc_struct));
5205
5206 extern void FreeExpContents(struct Expression * exp);
5207
5208 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
5209
5210 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
5211
5212 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
5213
5214 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
5215
5216 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (*  freeFn)(void * ));
5217
5218 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5219 {
5220 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
5221
5222 for(link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(&nameSpace->classes); link; link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(((struct __ecereNameSpace__ecere__sys__BTNode *)link)))
5223 {
5224 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
5225
5226 if(_class->type == 4)
5227 {
5228 struct __ecereNameSpace__ecere__sys__OldList converts = 
5229 {
5230 0, 0, 0, 0, 0
5231 };
5232 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5233
5234 type->kind = 8;
5235 if(!_class->symbol)
5236 _class->symbol = FindClass(_class->fullName);
5237 type->_class = _class->symbol;
5238 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0))
5239 {
5240 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5241 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5242
5243 if(enumClass)
5244 {
5245 struct __ecereNameSpace__ecere__com__Class * baseClass;
5246
5247 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
5248 {
5249 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
5250
5251 for(value = e->values.first; value; value = value->next)
5252 {
5253 if(!strcmp(value->name, string))
5254 break;
5255 }
5256 if(value)
5257 {
5258 FreeExpContents(sourceExp);
5259 FreeType(sourceExp->expType);
5260 sourceExp->isConstant = 0x1;
5261 sourceExp->expType = MkClassType(baseClass->fullName);
5262 {
5263 char constant[256];
5264
5265 sourceExp->type = 2;
5266 if(!strcmp(baseClass->dataTypeString, "int"))
5267 sprintf(constant, "%d", (int)value->data);
5268 else
5269 sprintf(constant, "0x%X", (int)value->data);
5270 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5271 }
5272 while(converts.first)
5273 {
5274 struct Conversion * convert = converts.first;
5275
5276 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
5277 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5278 }
5279 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5280 return 0x1;
5281 }
5282 }
5283 }
5284 }
5285 if(converts.first)
5286 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
5287 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5288 }
5289 }
5290 for(nameSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(&nameSpace->nameSpaces); nameSpace != (((void *)0)); nameSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(((struct __ecereNameSpace__ecere__sys__BTNode *)nameSpace)))
5291 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5292 return 0x1;
5293 return 0x0;
5294 }
5295
5296 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5297
5298 struct __ecereNameSpace__ecere__com__SubModule
5299 {
5300 struct __ecereNameSpace__ecere__com__SubModule * prev;
5301 struct __ecereNameSpace__ecere__com__SubModule * next;
5302 struct __ecereNameSpace__ecere__com__Instance * module;
5303 int importMode;
5304 } __attribute__ ((gcc_struct));
5305
5306 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5307 {
5308 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5309
5310 if(searchFor == searchIn)
5311 return 0x1;
5312 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
5313 {
5314 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->application)
5315 {
5316 if(ModuleVisibility(subModule->module, searchFor))
5317 return 0x1;
5318 }
5319 }
5320 return 0x0;
5321 }
5322
5323 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5324
5325 struct __ecereNameSpace__ecere__com__Application
5326 {
5327 int argc;
5328 char * *  argv;
5329 int exitCode;
5330 unsigned int isGUIApp;
5331 struct __ecereNameSpace__ecere__sys__OldList allModules;
5332 char *  parsedCommand;
5333 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5334 } __attribute__ ((gcc_struct));
5335
5336 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5337 {
5338 struct __ecereNameSpace__ecere__com__Instance * module;
5339
5340 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + structSize_Instance)))->application + structSize_Module)))->systemNameSpace, sourceExp, dest, string, conversions))
5341 return 0x1;
5342 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + structSize_Instance)))->application + structSize_Instance)))->privateNameSpace, sourceExp, dest, string, conversions))
5343 return 0x1;
5344 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + structSize_Instance)))->application + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5345 return 0x1;
5346 for(module = ((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + structSize_Instance)))->application + structSize_Module)))->allModules.first; module; module = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->next)
5347 {
5348 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5349 return 0x1;
5350 }
5351 return 0x0;
5352 }
5353
5354 extern unsigned long strtoul(const char *  nptr, char * *  endptr, int base);
5355
5356 void ReadString(char *  output, char *  string);
5357
5358 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5359
5360 extern struct TypeName * QMkClass(char *  spec, struct Declarator * decl);
5361
5362 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5363
5364 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
5365 {
5366 struct Type * source = sourceExp->expType;
5367 struct Type * realDest = dest;
5368 struct Type * backupSourceExpType = (((void *)0));
5369
5370 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
5371 return 0x1;
5372 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5373 {
5374 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
5375 {
5376 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5377
5378 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5379 ;
5380 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5381 ;
5382 if(sourceBase == destBase)
5383 return 0x1;
5384 }
5385 }
5386 if(source)
5387 {
5388 struct __ecereNameSpace__ecere__sys__OldList * specs;
5389 unsigned int flag = 0x0;
5390 long long value = (((int)0x7fffffff));
5391
5392 source->refCount++;
5393 dest->refCount++;
5394 if(sourceExp->type == 2)
5395 {
5396 if(source->isSigned)
5397 value = strtoll(sourceExp->constant, (((void *)0)), 0);
5398 else
5399 value = strtoull(sourceExp->constant, (((void *)0)), 0);
5400 }
5401 else if(sourceExp->type == 4 && sourceExp->op.op == '-' && !sourceExp->op.exp1 && sourceExp->op.exp2 && sourceExp->op.exp2->type == 2)
5402 {
5403 if(source->isSigned)
5404 value = -strtoll(sourceExp->op.exp2->constant, (((void *)0)), 0);
5405 else
5406 value = -strtoull(sourceExp->op.exp2->constant, (((void *)0)), 0);
5407 }
5408 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
5409 {
5410 FreeType(source);
5411 source = __extension__ ({
5412 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5413
5414 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0x0, __ecereInstance1->refCount = 1, __ecereInstance1;
5415 });
5416 }
5417 if(dest->kind == 8)
5418 {
5419 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5420
5421 if(_class && _class->type == 3)
5422 {
5423 if(source->kind != 8)
5424 {
5425 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5426 struct Type * tempDest, * tempSource;
5427
5428 for(; _class->base->type != 1000; _class = _class->base)
5429 ;
5430 tempSource = dest;
5431 tempDest = tempType;
5432 tempType->kind = 8;
5433 if(!_class->symbol)
5434 _class->symbol = FindClass(_class->fullName);
5435 tempType->_class = _class->symbol;
5436 tempType->truth = dest->truth;
5437 if(tempType->_class)
5438 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5439 backupSourceExpType = sourceExp->expType;
5440 sourceExp->expType = dest;
5441 dest->refCount++;
5442 flag = 0x1;
5443 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5444 }
5445 }
5446 if(_class && _class->type == 2 && source->kind != 8)
5447 {
5448 if(!dest->_class->registered->dataType)
5449 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5450 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5451 {
5452 FreeType(source);
5453 FreeType(sourceExp->expType);
5454 source = sourceExp->expType = MkClassType(dest->_class->string);
5455 source->refCount++;
5456 }
5457 }
5458 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5459 {
5460 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5461 struct Declarator * decl;
5462 char string[1024];
5463
5464 ReadString(string, sourceExp->string);
5465 decl = SpecDeclFromString(string, specs, (((void *)0)));
5466 FreeExpContents(sourceExp);
5467 FreeType(sourceExp->expType);
5468 sourceExp->type = 24;
5469 sourceExp->_classExp.specifiers = specs;
5470 sourceExp->_classExp.decl = decl;
5471 sourceExp->expType = dest;
5472 dest->refCount++;
5473 FreeType(source);
5474 FreeType(dest);
5475 if(backupSourceExpType)
5476 FreeType(backupSourceExpType);
5477 return 0x1;
5478 }
5479 }
5480 else if(source->kind == 8)
5481 {
5482 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5483
5484 if(_class && (_class->type == 3 || !strcmp(_class->fullName, "bool") || _class->type == 2))
5485 {
5486 if(dest->kind != 8)
5487 {
5488 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5489 struct Type * tempDest, * tempSource;
5490
5491 if(!source->_class->registered->dataType)
5492 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5493 for(; _class->base->type != 1000; _class = _class->base)
5494 ;
5495 tempDest = source;
5496 tempSource = tempType;
5497 tempType->kind = 8;
5498 tempType->_class = FindClass(_class->fullName);
5499 tempType->truth = source->truth;
5500 tempType->classObjectType = source->classObjectType;
5501 if(tempType->_class)
5502 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5503 if(conversions->last)
5504 {
5505 ((struct Conversion *)conversions->last)->resultType = dest;
5506 dest->refCount++;
5507 }
5508 FreeType(sourceExp->expType);
5509 sourceExp->expType = MkClassType(_class->fullName);
5510 sourceExp->expType->truth = source->truth;
5511 sourceExp->expType->classObjectType = source->classObjectType;
5512 if(!sourceExp->destType)
5513 {
5514 FreeType(sourceExp->destType);
5515 sourceExp->destType = sourceExp->expType;
5516 if(sourceExp->expType)
5517 sourceExp->expType->refCount++;
5518 }
5519 if(!_class->dataType)
5520 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5521 FreeType(dest);
5522 dest = MkClassType(source->_class->string);
5523 dest->truth = source->truth;
5524 dest->classObjectType = source->classObjectType;
5525 FreeType(source);
5526 source = _class->dataType;
5527 source->refCount++;
5528 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5529 }
5530 }
5531 }
5532 if(!flag)
5533 {
5534 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5535 {
5536 FreeType(source);
5537 FreeType(dest);
5538 return 0x1;
5539 }
5540 }
5541 if(dest->kind == 8)
5542 {
5543 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5544
5545 if(_class && !dest->truth && (_class->type == 3 || !strcmp(_class->fullName, "bool") || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5546 {
5547 if(_class->type == 0 || _class->type == 5)
5548 {
5549 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5550
5551 *newExp = *sourceExp;
5552 if(sourceExp->destType)
5553 sourceExp->destType->refCount++;
5554 if(sourceExp->expType)
5555 sourceExp->expType->refCount++;
5556 sourceExp->type = 11;
5557 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5558 sourceExp->cast.exp = newExp;
5559 FreeType(sourceExp->expType);
5560 sourceExp->expType = (((void *)0));
5561 ProcessExpressionType(sourceExp);
5562 if(!inCompiler)
5563 {
5564 FreeType(sourceExp->expType);
5565 sourceExp->expType = dest;
5566 }
5567 FreeType(source);
5568 if(inCompiler)
5569 FreeType(dest);
5570 if(backupSourceExpType)
5571 FreeType(backupSourceExpType);
5572 return 0x1;
5573 }
5574 if(!_class->dataType)
5575 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5576 FreeType(dest);
5577 dest = _class->dataType;
5578 dest->refCount++;
5579 }
5580 if(dest->kind == 7 && (source->kind == 7 || source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24))
5581 {
5582 specs = MkListOne(MkSpecifier(DOUBLE));
5583 }
5584 else if(dest->kind == 6 && (source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 7))
5585 {
5586 specs = MkListOne(MkSpecifier(FLOAT));
5587 }
5588 else if(dest->kind == 4 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
5589 {
5590 specs = MkList();
5591 if(!dest->isSigned)
5592 ListAdd(specs, MkSpecifier(UNSIGNED));
5593 ListAdd(specs, MkSpecifier(INT64));
5594 }
5595 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
5596 {
5597 specs = MkList();
5598 if(!dest->isSigned)
5599 ListAdd(specs, MkSpecifier(UNSIGNED));
5600 ListAdd(specs, MkSpecifier(INT));
5601 }
5602 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5603 {
5604 specs = MkList();
5605 if(!dest->isSigned)
5606 ListAdd(specs, MkSpecifier(UNSIGNED));
5607 ListAdd(specs, MkSpecifier(SHORT));
5608 }
5609 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 24 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5610 {
5611 specs = MkList();
5612 if(!dest->isSigned)
5613 ListAdd(specs, MkSpecifier(UNSIGNED));
5614 ListAdd(specs, MkSpecifier(CHAR));
5615 }
5616 else
5617 {
5618 FreeType(source);
5619 FreeType(dest);
5620 if(backupSourceExpType)
5621 {
5622 if(sourceExp->expType)
5623 FreeType(sourceExp->expType);
5624 sourceExp->expType = backupSourceExpType;
5625 }
5626 return 0x0;
5627 }
5628 }
5629 else if(dest->kind == 7 && (source->kind == 7 || source->kind == 6 || source->kind == 4 || source->kind == 3 || source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1))
5630 {
5631 specs = MkListOne(MkSpecifier(DOUBLE));
5632 }
5633 else if(dest->kind == 6 && (source->kind == 6 || source->kind == 15 || source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
5634 {
5635 specs = MkListOne(MkSpecifier(FLOAT));
5636 }
5637 else if(dest->kind == 24 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (value == 1 || value == 0))
5638 {
5639 specs = MkList();
5640 ListAdd(specs, MkSpecifier(BOOL));
5641 }
5642 else if(dest->kind == 1 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (dest->isSigned ? (value >= -128 && value <= 127) : (value >= 0 && value <= 255)))
5643 {
5644 specs = MkList();
5645 if(!dest->isSigned)
5646 ListAdd(specs, MkSpecifier(UNSIGNED));
5647 ListAdd(specs, MkSpecifier(CHAR));
5648 }
5649 else if(dest->kind == 2 && (source->kind == 15 || source->kind == 24 || source->kind == 1 || source->kind == 2 || (source->kind == 3 && (dest->isSigned ? (value >= -32768 && value <= 32767) : (value >= 0 && value <= 65535)))))
5650 {
5651 specs = MkList();
5652 if(!dest->isSigned)
5653 ListAdd(specs, MkSpecifier(UNSIGNED));
5654 ListAdd(specs, MkSpecifier(SHORT));
5655 }
5656 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3))
5657 {
5658 specs = MkList();
5659 if(!dest->isSigned)
5660 ListAdd(specs, MkSpecifier(UNSIGNED));
5661 ListAdd(specs, MkSpecifier(INT));
5662 }
5663 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5664 {
5665 specs = MkList();
5666 if(!dest->isSigned)
5667 ListAdd(specs, MkSpecifier(UNSIGNED));
5668 ListAdd(specs, MkSpecifier(INT64));
5669 }
5670 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
5671 {
5672 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5673 }
5674 else
5675 {
5676 FreeType(source);
5677 FreeType(dest);
5678 if(backupSourceExpType)
5679 {
5680 if(sourceExp->expType)
5681 FreeType(sourceExp->expType);
5682 sourceExp->expType = backupSourceExpType;
5683 }
5684 return 0x0;
5685 }
5686 if(!flag)
5687 {
5688 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5689
5690 *newExp = *sourceExp;
5691 newExp->prev = (((void *)0));
5692 newExp->next = (((void *)0));
5693 if(sourceExp->destType)
5694 sourceExp->destType->refCount++;
5695 if(sourceExp->expType)
5696 sourceExp->expType->refCount++;
5697 sourceExp->type = 11;
5698 if(realDest->kind == 8)
5699 {
5700 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5701 FreeList(specs, FreeSpecifier);
5702 }
5703 else
5704 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5705 if(newExp->type == 4)
5706 {
5707 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5708 }
5709 else
5710 sourceExp->cast.exp = newExp;
5711 FreeType(sourceExp->expType);
5712 sourceExp->expType = (((void *)0));
5713 ProcessExpressionType(sourceExp);
5714 }
5715 else
5716 FreeList(specs, FreeSpecifier);
5717 FreeType(dest);
5718 FreeType(source);
5719 if(backupSourceExpType)
5720 FreeType(backupSourceExpType);
5721 return 0x1;
5722 }
5723 else
5724 {
5725 while((sourceExp->type == 5 || sourceExp->type == 32) && sourceExp->list)
5726 sourceExp = (*sourceExp->list).last;
5727 if(sourceExp->type == 0)
5728 {
5729 struct Identifier * id = sourceExp->identifier;
5730
5731 if(dest->kind == 8)
5732 {
5733 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5734 {
5735 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5736 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5737
5738 if(enumClass)
5739 {
5740 for(; _class && _class->type == 4; _class = _class->base)
5741 {
5742 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5743 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5744
5745 for(value = e->values.first; value; value = value->next)
5746 {
5747 if(!strcmp(value->name, id->string))
5748 break;
5749 }
5750 if(value)
5751 {
5752 FreeExpContents(sourceExp);
5753 FreeType(sourceExp->expType);
5754 sourceExp->isConstant = 0x1;
5755 sourceExp->expType = MkClassType(_class->fullName);
5756 {
5757 char constant[256];
5758
5759 sourceExp->type = 2;
5760 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5761 sprintf(constant, "%d", (int)value->data);
5762 else
5763 sprintf(constant, "0x%X", (int)value->data);
5764 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5765 }
5766 return 0x1;
5767 }
5768 }
5769 }
5770 }
5771 }
5772 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5773 return 0x1;
5774 }
5775 }
5776 return 0x0;
5777 }
5778
5779 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5780 {
5781 int value2 = op2->i;
5782
5783 exp->type = 2;
5784 exp->string = PrintInt(op1->i + value2);
5785 if(!exp->expType)
5786 {
5787 exp->expType = op1->type;
5788 if(op1->type)
5789 op1->type->refCount++;
5790 }
5791 return 0x1;
5792 }
5793
5794 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5795 {
5796 unsigned int value2 = op2->ui;
5797
5798 exp->type = 2;
5799 exp->string = PrintUInt(op1->ui + value2);
5800 if(!exp->expType)
5801 {
5802 exp->expType = op1->type;
5803 if(op1->type)
5804 op1->type->refCount++;
5805 }
5806 return 0x1;
5807 }
5808
5809 static unsigned int Int64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5810 {
5811 long long value2 = op2->i64;
5812
5813 exp->type = 2;
5814 exp->string = PrintInt64(op1->i64 + value2);
5815 if(!exp->expType)
5816 {
5817 exp->expType = op1->type;
5818 if(op1->type)
5819 op1->type->refCount++;
5820 }
5821 return 0x1;
5822 }
5823
5824 static unsigned int UInt64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5825 {
5826 uint64 value2 = op2->ui64;
5827
5828 exp->type = 2;
5829 exp->string = PrintUInt64(op1->ui64 + value2);
5830 if(!exp->expType)
5831 {
5832 exp->expType = op1->type;
5833 if(op1->type)
5834 op1->type->refCount++;
5835 }
5836 return 0x1;
5837 }
5838
5839 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5840 {
5841 short value2 = op2->s;
5842
5843 exp->type = 2;
5844 exp->string = PrintShort(op1->s + value2);
5845 if(!exp->expType)
5846 {
5847 exp->expType = op1->type;
5848 if(op1->type)
5849 op1->type->refCount++;
5850 }
5851 return 0x1;
5852 }
5853
5854 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5855 {
5856 unsigned short value2 = op2->us;
5857
5858 exp->type = 2;
5859 exp->string = PrintUShort(op1->us + value2);
5860 if(!exp->expType)
5861 {
5862 exp->expType = op1->type;
5863 if(op1->type)
5864 op1->type->refCount++;
5865 }
5866 return 0x1;
5867 }
5868
5869 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5870 {
5871 char value2 = op2->c;
5872
5873 exp->type = 2;
5874 exp->string = PrintChar(op1->c + value2);
5875 if(!exp->expType)
5876 {
5877 exp->expType = op1->type;
5878 if(op1->type)
5879 op1->type->refCount++;
5880 }
5881 return 0x1;
5882 }
5883
5884 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5885 {
5886 unsigned char value2 = op2->uc;
5887
5888 exp->type = 2;
5889 exp->string = PrintUChar(op1->uc + value2);
5890 if(!exp->expType)
5891 {
5892 exp->expType = op1->type;
5893 if(op1->type)
5894 op1->type->refCount++;
5895 }
5896 return 0x1;
5897 }
5898
5899 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5900 {
5901 float value2 = op2->f;
5902
5903 exp->type = 2;
5904 exp->string = PrintFloat(op1->f + value2);
5905 if(!exp->expType)
5906 {
5907 exp->expType = op1->type;
5908 if(op1->type)
5909 op1->type->refCount++;
5910 }
5911 return 0x1;
5912 }
5913
5914 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5915 {
5916 double value2 = op2->d;
5917
5918 exp->type = 2;
5919 exp->string = PrintDouble(op1->d + value2);
5920 if(!exp->expType)
5921 {
5922 exp->expType = op1->type;
5923 if(op1->type)
5924 op1->type->refCount++;
5925 }
5926 return 0x1;
5927 }
5928
5929 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5930 {
5931 int value2 = op2->i;
5932
5933 exp->type = 2;
5934 exp->string = PrintInt(op1->i - value2);
5935 if(!exp->expType)
5936 {
5937 exp->expType = op1->type;
5938 if(op1->type)
5939 op1->type->refCount++;
5940 }
5941 return 0x1;
5942 }
5943
5944 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5945 {
5946 unsigned int value2 = op2->ui;
5947
5948 exp->type = 2;
5949 exp->string = PrintUInt(op1->ui - value2);
5950 if(!exp->expType)
5951 {
5952 exp->expType = op1->type;
5953 if(op1->type)
5954 op1->type->refCount++;
5955 }
5956 return 0x1;
5957 }
5958
5959 static unsigned int Int64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5960 {
5961 long long value2 = op2->i64;
5962
5963 exp->type = 2;
5964 exp->string = PrintInt64(op1->i64 - value2);
5965 if(!exp->expType)
5966 {
5967 exp->expType = op1->type;
5968 if(op1->type)
5969 op1->type->refCount++;
5970 }
5971 return 0x1;
5972 }
5973
5974 static unsigned int UInt64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5975 {
5976 uint64 value2 = op2->ui64;
5977
5978 exp->type = 2;
5979 exp->string = PrintUInt64(op1->ui64 - value2);
5980 if(!exp->expType)
5981 {
5982 exp->expType = op1->type;
5983 if(op1->type)
5984 op1->type->refCount++;
5985 }
5986 return 0x1;
5987 }
5988
5989 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5990 {
5991 short value2 = op2->s;
5992
5993 exp->type = 2;
5994 exp->string = PrintShort(op1->s - value2);
5995 if(!exp->expType)
5996 {
5997 exp->expType = op1->type;
5998 if(op1->type)
5999 op1->type->refCount++;
6000 }
6001 return 0x1;
6002 }
6003
6004 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6005 {
6006 unsigned short value2 = op2->us;
6007
6008 exp->type = 2;
6009 exp->string = PrintUShort(op1->us - value2);
6010 if(!exp->expType)
6011 {
6012 exp->expType = op1->type;
6013 if(op1->type)
6014 op1->type->refCount++;
6015 }
6016 return 0x1;
6017 }
6018
6019 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6020 {
6021 char value2 = op2->c;
6022
6023 exp->type = 2;
6024 exp->string = PrintChar(op1->c - value2);
6025 if(!exp->expType)
6026 {
6027 exp->expType = op1->type;
6028 if(op1->type)
6029 op1->type->refCount++;
6030 }
6031 return 0x1;
6032 }
6033
6034 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6035 {
6036 unsigned char value2 = op2->uc;
6037
6038 exp->type = 2;
6039 exp->string = PrintUChar(op1->uc - value2);
6040 if(!exp->expType)
6041 {
6042 exp->expType = op1->type;
6043 if(op1->type)
6044 op1->type->refCount++;
6045 }
6046 return 0x1;
6047 }
6048
6049 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6050 {
6051 float value2 = op2->f;
6052
6053 exp->type = 2;
6054 exp->string = PrintFloat(op1->f - value2);
6055 if(!exp->expType)
6056 {
6057 exp->expType = op1->type;
6058 if(op1->type)
6059 op1->type->refCount++;
6060 }
6061 return 0x1;
6062 }
6063
6064 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6065 {
6066 double value2 = op2->d;
6067
6068 exp->type = 2;
6069 exp->string = PrintDouble(op1->d - value2);
6070 if(!exp->expType)
6071 {
6072 exp->expType = op1->type;
6073 if(op1->type)
6074 op1->type->refCount++;
6075 }
6076 return 0x1;
6077 }
6078
6079 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6080 {
6081 int value2 = op2->i;
6082
6083 exp->type = 2;
6084 exp->string = PrintInt(op1->i * value2);
6085 if(!exp->expType)
6086 {
6087 exp->expType = op1->type;
6088 if(op1->type)
6089 op1->type->refCount++;
6090 }
6091 return 0x1;
6092 }
6093
6094 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6095 {
6096 unsigned int value2 = op2->ui;
6097
6098 exp->type = 2;
6099 exp->string = PrintUInt(op1->ui * value2);
6100 if(!exp->expType)
6101 {
6102 exp->expType = op1->type;
6103 if(op1->type)
6104 op1->type->refCount++;
6105 }
6106 return 0x1;
6107 }
6108
6109 static unsigned int Int64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6110 {
6111 long long value2 = op2->i64;
6112
6113 exp->type = 2;
6114 exp->string = PrintInt64(op1->i64 * value2);
6115 if(!exp->expType)
6116 {
6117 exp->expType = op1->type;
6118 if(op1->type)
6119 op1->type->refCount++;
6120 }
6121 return 0x1;
6122 }
6123
6124 static unsigned int UInt64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6125 {
6126 uint64 value2 = op2->ui64;
6127
6128 exp->type = 2;
6129 exp->string = PrintUInt64(op1->ui64 * value2);
6130 if(!exp->expType)
6131 {
6132 exp->expType = op1->type;
6133 if(op1->type)
6134 op1->type->refCount++;
6135 }
6136 return 0x1;
6137 }
6138
6139 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6140 {
6141 short value2 = op2->s;
6142
6143 exp->type = 2;
6144 exp->string = PrintShort(op1->s * value2);
6145 if(!exp->expType)
6146 {
6147 exp->expType = op1->type;
6148 if(op1->type)
6149 op1->type->refCount++;
6150 }
6151 return 0x1;
6152 }
6153
6154 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6155 {
6156 unsigned short value2 = op2->us;
6157
6158 exp->type = 2;
6159 exp->string = PrintUShort(op1->us * value2);
6160 if(!exp->expType)
6161 {
6162 exp->expType = op1->type;
6163 if(op1->type)
6164 op1->type->refCount++;
6165 }
6166 return 0x1;
6167 }
6168
6169 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6170 {
6171 char value2 = op2->c;
6172
6173 exp->type = 2;
6174 exp->string = PrintChar(op1->c * value2);
6175 if(!exp->expType)
6176 {
6177 exp->expType = op1->type;
6178 if(op1->type)
6179 op1->type->refCount++;
6180 }
6181 return 0x1;
6182 }
6183
6184 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6185 {
6186 unsigned char value2 = op2->uc;
6187
6188 exp->type = 2;
6189 exp->string = PrintUChar(op1->uc * value2);
6190 if(!exp->expType)
6191 {
6192 exp->expType = op1->type;
6193 if(op1->type)
6194 op1->type->refCount++;
6195 }
6196 return 0x1;
6197 }
6198
6199 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6200 {
6201 float value2 = op2->f;
6202
6203 exp->type = 2;
6204 exp->string = PrintFloat(op1->f * value2);
6205 if(!exp->expType)
6206 {
6207 exp->expType = op1->type;
6208 if(op1->type)
6209 op1->type->refCount++;
6210 }
6211 return 0x1;
6212 }
6213
6214 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6215 {
6216 double value2 = op2->d;
6217
6218 exp->type = 2;
6219 exp->string = PrintDouble(op1->d * value2);
6220 if(!exp->expType)
6221 {
6222 exp->expType = op1->type;
6223 if(op1->type)
6224 op1->type->refCount++;
6225 }
6226 return 0x1;
6227 }
6228
6229 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6230 {
6231 int value2 = op2->i;
6232
6233 exp->type = 2;
6234 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
6235 if(!exp->expType)
6236 {
6237 exp->expType = op1->type;
6238 if(op1->type)
6239 op1->type->refCount++;
6240 }
6241 return 0x1;
6242 }
6243
6244 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6245 {
6246 unsigned int value2 = op2->ui;
6247
6248 exp->type = 2;
6249 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
6250 if(!exp->expType)
6251 {
6252 exp->expType = op1->type;
6253 if(op1->type)
6254 op1->type->refCount++;
6255 }
6256 return 0x1;
6257 }
6258
6259 static unsigned int Int64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6260 {
6261 long long value2 = op2->i64;
6262
6263 exp->type = 2;
6264 exp->string = PrintInt64(value2 ? (op1->i64 / value2) : 0);
6265 if(!exp->expType)
6266 {
6267 exp->expType = op1->type;
6268 if(op1->type)
6269 op1->type->refCount++;
6270 }
6271 return 0x1;
6272 }
6273
6274 static unsigned int UInt64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6275 {
6276 uint64 value2 = op2->ui64;
6277
6278 exp->type = 2;
6279 exp->string = PrintUInt64(value2 ? (op1->ui64 / value2) : 0);
6280 if(!exp->expType)
6281 {
6282 exp->expType = op1->type;
6283 if(op1->type)
6284 op1->type->refCount++;
6285 }
6286 return 0x1;
6287 }
6288
6289 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6290 {
6291 short value2 = op2->s;
6292
6293 exp->type = 2;
6294 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
6295 if(!exp->expType)
6296 {
6297 exp->expType = op1->type;
6298 if(op1->type)
6299 op1->type->refCount++;
6300 }
6301 return 0x1;
6302 }
6303
6304 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6305 {
6306 unsigned short value2 = op2->us;
6307
6308 exp->type = 2;
6309 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
6310 if(!exp->expType)
6311 {
6312 exp->expType = op1->type;
6313 if(op1->type)
6314 op1->type->refCount++;
6315 }
6316 return 0x1;
6317 }
6318
6319 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6320 {
6321 char value2 = op2->c;
6322
6323 exp->type = 2;
6324 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
6325 if(!exp->expType)
6326 {
6327 exp->expType = op1->type;
6328 if(op1->type)
6329 op1->type->refCount++;
6330 }
6331 return 0x1;
6332 }
6333
6334 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6335 {
6336 unsigned char value2 = op2->uc;
6337
6338 exp->type = 2;
6339 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
6340 if(!exp->expType)
6341 {
6342 exp->expType = op1->type;
6343 if(op1->type)
6344 op1->type->refCount++;
6345 }
6346 return 0x1;
6347 }
6348
6349 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6350 {
6351 float value2 = op2->f;
6352
6353 exp->type = 2;
6354 exp->string = PrintFloat(op1->f / value2);
6355 if(!exp->expType)
6356 {
6357 exp->expType = op1->type;
6358 if(op1->type)
6359 op1->type->refCount++;
6360 }
6361 return 0x1;
6362 }
6363
6364 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6365 {
6366 double value2 = op2->d;
6367
6368 exp->type = 2;
6369 exp->string = PrintDouble(op1->d / value2);
6370 if(!exp->expType)
6371 {
6372 exp->expType = op1->type;
6373 if(op1->type)
6374 op1->type->refCount++;
6375 }
6376 return 0x1;
6377 }
6378
6379 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6380 {
6381 int value2 = op2->i;
6382
6383 exp->type = 2;
6384 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
6385 if(!exp->expType)
6386 {
6387 exp->expType = op1->type;
6388 if(op1->type)
6389 op1->type->refCount++;
6390 }
6391 return 0x1;
6392 }
6393
6394 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6395 {
6396 unsigned int value2 = op2->ui;
6397
6398 exp->type = 2;
6399 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
6400 if(!exp->expType)
6401 {
6402 exp->expType = op1->type;
6403 if(op1->type)
6404 op1->type->refCount++;
6405 }
6406 return 0x1;
6407 }
6408
6409 static unsigned int Int64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6410 {
6411 long long value2 = op2->i64;
6412
6413 exp->type = 2;
6414 exp->string = PrintInt64(value2 ? (op1->i64 % value2) : 0);
6415 if(!exp->expType)
6416 {
6417 exp->expType = op1->type;
6418 if(op1->type)
6419 op1->type->refCount++;
6420 }
6421 return 0x1;
6422 }
6423
6424 static unsigned int UInt64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6425 {
6426 uint64 value2 = op2->ui64;
6427
6428 exp->type = 2;
6429 exp->string = PrintUInt64(value2 ? (op1->ui64 % value2) : 0);
6430 if(!exp->expType)
6431 {
6432 exp->expType = op1->type;
6433 if(op1->type)
6434 op1->type->refCount++;
6435 }
6436 return 0x1;
6437 }
6438
6439 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6440 {
6441 short value2 = op2->s;
6442
6443 exp->type = 2;
6444 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
6445 if(!exp->expType)
6446 {
6447 exp->expType = op1->type;
6448 if(op1->type)
6449 op1->type->refCount++;
6450 }
6451 return 0x1;
6452 }
6453
6454 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6455 {
6456 unsigned short value2 = op2->us;
6457
6458 exp->type = 2;
6459 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
6460 if(!exp->expType)
6461 {
6462 exp->expType = op1->type;
6463 if(op1->type)
6464 op1->type->refCount++;
6465 }
6466 return 0x1;
6467 }
6468
6469 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6470 {
6471 char value2 = op2->c;
6472
6473 exp->type = 2;
6474 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
6475 if(!exp->expType)
6476 {
6477 exp->expType = op1->type;
6478 if(op1->type)
6479 op1->type->refCount++;
6480 }
6481 return 0x1;
6482 }
6483
6484 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6485 {
6486 unsigned char value2 = op2->uc;
6487
6488 exp->type = 2;
6489 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
6490 if(!exp->expType)
6491 {
6492 exp->expType = op1->type;
6493 if(op1->type)
6494 op1->type->refCount++;
6495 }
6496 return 0x1;
6497 }
6498
6499 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6500 {
6501 exp->type = 2;
6502 exp->string = PrintInt((-op1->i));
6503 if(!exp->expType)
6504 {
6505 exp->expType = op1->type;
6506 if(op1->type)
6507 op1->type->refCount++;
6508 }
6509 return 0x1;
6510 }
6511
6512 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6513 {
6514 exp->type = 2;
6515 exp->string = PrintUInt((unsigned int)(-op1->ui));
6516 if(!exp->expType)
6517 {
6518 exp->expType = op1->type;
6519 if(op1->type)
6520 op1->type->refCount++;
6521 }
6522 return 0x1;
6523 }
6524
6525 static unsigned int Int64Neg(struct Expression * exp, struct Operand * op1)
6526 {
6527 exp->type = 2;
6528 exp->string = PrintInt64((-op1->i64));
6529 if(!exp->expType)
6530 {
6531 exp->expType = op1->type;
6532 if(op1->type)
6533 op1->type->refCount++;
6534 }
6535 return 0x1;
6536 }
6537
6538 static unsigned int UInt64Neg(struct Expression * exp, struct Operand * op1)
6539 {
6540 exp->type = 2;
6541 exp->string = PrintUInt64((uint64)(-op1->ui64));
6542 if(!exp->expType)
6543 {
6544 exp->expType = op1->type;
6545 if(op1->type)
6546 op1->type->refCount++;
6547 }
6548 return 0x1;
6549 }
6550
6551 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6552 {
6553 exp->type = 2;
6554 exp->string = PrintShort((-op1->s));
6555 if(!exp->expType)
6556 {
6557 exp->expType = op1->type;
6558 if(op1->type)
6559 op1->type->refCount++;
6560 }
6561 return 0x1;
6562 }
6563
6564 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6565 {
6566 exp->type = 2;
6567 exp->string = PrintUShort((unsigned short)(-op1->us));
6568 if(!exp->expType)
6569 {
6570 exp->expType = op1->type;
6571 if(op1->type)
6572 op1->type->refCount++;
6573 }
6574 return 0x1;
6575 }
6576
6577 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6578 {
6579 exp->type = 2;
6580 exp->string = PrintChar((-op1->c));
6581 if(!exp->expType)
6582 {
6583 exp->expType = op1->type;
6584 if(op1->type)
6585 op1->type->refCount++;
6586 }
6587 return 0x1;
6588 }
6589
6590 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6591 {
6592 exp->type = 2;
6593 exp->string = PrintUChar((unsigned char)(-op1->uc));
6594 if(!exp->expType)
6595 {
6596 exp->expType = op1->type;
6597 if(op1->type)
6598 op1->type->refCount++;
6599 }
6600 return 0x1;
6601 }
6602
6603 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6604 {
6605 exp->type = 2;
6606 exp->string = PrintFloat((float)(-op1->f));
6607 if(!exp->expType)
6608 {
6609 exp->expType = op1->type;
6610 if(op1->type)
6611 op1->type->refCount++;
6612 }
6613 return 0x1;
6614 }
6615
6616 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6617 {
6618 exp->type = 2;
6619 exp->string = PrintDouble((double)(-op1->d));
6620 if(!exp->expType)
6621 {
6622 exp->expType = op1->type;
6623 if(op1->type)
6624 op1->type->refCount++;
6625 }
6626 return 0x1;
6627 }
6628
6629 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6630 {
6631 exp->type = 2;
6632 exp->string = PrintInt((++op1->i));
6633 if(!exp->expType)
6634 {
6635 exp->expType = op1->type;
6636 if(op1->type)
6637 op1->type->refCount++;
6638 }
6639 return 0x1;
6640 }
6641
6642 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6643 {
6644 exp->type = 2;
6645 exp->string = PrintUInt((++op1->ui));
6646 if(!exp->expType)
6647 {
6648 exp->expType = op1->type;
6649 if(op1->type)
6650 op1->type->refCount++;
6651 }
6652 return 0x1;
6653 }
6654
6655 static unsigned int Int64Inc(struct Expression * exp, struct Operand * op1)
6656 {
6657 exp->type = 2;
6658 exp->string = PrintInt64((++op1->i64));
6659 if(!exp->expType)
6660 {
6661 exp->expType = op1->type;
6662 if(op1->type)
6663 op1->type->refCount++;
6664 }
6665 return 0x1;
6666 }
6667
6668 static unsigned int UInt64Inc(struct Expression * exp, struct Operand * op1)
6669 {
6670 exp->type = 2;
6671 exp->string = PrintUInt64((++op1->ui64));
6672 if(!exp->expType)
6673 {
6674 exp->expType = op1->type;
6675 if(op1->type)
6676 op1->type->refCount++;
6677 }
6678 return 0x1;
6679 }
6680
6681 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6682 {
6683 exp->type = 2;
6684 exp->string = PrintShort((++op1->s));
6685 if(!exp->expType)
6686 {
6687 exp->expType = op1->type;
6688 if(op1->type)
6689 op1->type->refCount++;
6690 }
6691 return 0x1;
6692 }
6693
6694 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6695 {
6696 exp->type = 2;
6697 exp->string = PrintUShort((++op1->us));
6698 if(!exp->expType)
6699 {
6700 exp->expType = op1->type;
6701 if(op1->type)
6702 op1->type->refCount++;
6703 }
6704 return 0x1;
6705 }
6706
6707 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6708 {
6709 exp->type = 2;
6710 exp->string = PrintChar((++op1->c));
6711 if(!exp->expType)
6712 {
6713 exp->expType = op1->type;
6714 if(op1->type)
6715 op1->type->refCount++;
6716 }
6717 return 0x1;
6718 }
6719
6720 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6721 {
6722 exp->type = 2;
6723 exp->string = PrintUChar((++op1->uc));
6724 if(!exp->expType)
6725 {
6726 exp->expType = op1->type;
6727 if(op1->type)
6728 op1->type->refCount++;
6729 }
6730 return 0x1;
6731 }
6732
6733 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6734 {
6735 exp->type = 2;
6736 exp->string = PrintFloat((float)(++op1->f));
6737 if(!exp->expType)
6738 {
6739 exp->expType = op1->type;
6740 if(op1->type)
6741 op1->type->refCount++;
6742 }
6743 return 0x1;
6744 }
6745
6746 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6747 {
6748 exp->type = 2;
6749 exp->string = PrintDouble((double)(++op1->d));
6750 if(!exp->expType)
6751 {
6752 exp->expType = op1->type;
6753 if(op1->type)
6754 op1->type->refCount++;
6755 }
6756 return 0x1;
6757 }
6758
6759 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6760 {
6761 exp->type = 2;
6762 exp->string = PrintInt((--op1->i));
6763 if(!exp->expType)
6764 {
6765 exp->expType = op1->type;
6766 if(op1->type)
6767 op1->type->refCount++;
6768 }
6769 return 0x1;
6770 }
6771
6772 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6773 {
6774 exp->type = 2;
6775 exp->string = PrintUInt((--op1->ui));
6776 if(!exp->expType)
6777 {
6778 exp->expType = op1->type;
6779 if(op1->type)
6780 op1->type->refCount++;
6781 }
6782 return 0x1;
6783 }
6784
6785 static unsigned int Int64Dec(struct Expression * exp, struct Operand * op1)
6786 {
6787 exp->type = 2;
6788 exp->string = PrintInt64((--op1->i64));
6789 if(!exp->expType)
6790 {
6791 exp->expType = op1->type;
6792 if(op1->type)
6793 op1->type->refCount++;
6794 }
6795 return 0x1;
6796 }
6797
6798 static unsigned int UInt64Dec(struct Expression * exp, struct Operand * op1)
6799 {
6800 exp->type = 2;
6801 exp->string = PrintUInt64((--op1->ui64));
6802 if(!exp->expType)
6803 {
6804 exp->expType = op1->type;
6805 if(op1->type)
6806 op1->type->refCount++;
6807 }
6808 return 0x1;
6809 }
6810
6811 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6812 {
6813 exp->type = 2;
6814 exp->string = PrintShort((--op1->s));
6815 if(!exp->expType)
6816 {
6817 exp->expType = op1->type;
6818 if(op1->type)
6819 op1->type->refCount++;
6820 }
6821 return 0x1;
6822 }
6823
6824 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6825 {
6826 exp->type = 2;
6827 exp->string = PrintUShort((--op1->us));
6828 if(!exp->expType)
6829 {
6830 exp->expType = op1->type;
6831 if(op1->type)
6832 op1->type->refCount++;
6833 }
6834 return 0x1;
6835 }
6836
6837 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6838 {
6839 exp->type = 2;
6840 exp->string = PrintChar((--op1->c));
6841 if(!exp->expType)
6842 {
6843 exp->expType = op1->type;
6844 if(op1->type)
6845 op1->type->refCount++;
6846 }
6847 return 0x1;
6848 }
6849
6850 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6851 {
6852 exp->type = 2;
6853 exp->string = PrintUChar((--op1->uc));
6854 if(!exp->expType)
6855 {
6856 exp->expType = op1->type;
6857 if(op1->type)
6858 op1->type->refCount++;
6859 }
6860 return 0x1;
6861 }
6862
6863 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6864 {
6865 exp->type = 2;
6866 exp->string = PrintFloat((float)(--op1->f));
6867 if(!exp->expType)
6868 {
6869 exp->expType = op1->type;
6870 if(op1->type)
6871 op1->type->refCount++;
6872 }
6873 return 0x1;
6874 }
6875
6876 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6877 {
6878 exp->type = 2;
6879 exp->string = PrintDouble((double)(--op1->d));
6880 if(!exp->expType)
6881 {
6882 exp->expType = op1->type;
6883 if(op1->type)
6884 op1->type->refCount++;
6885 }
6886 return 0x1;
6887 }
6888
6889 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6890 {
6891 int value2 = op2->i;
6892
6893 exp->type = 2;
6894 exp->string = PrintInt(op1->i = value2);
6895 if(!exp->expType)
6896 {
6897 exp->expType = op1->type;
6898 if(op1->type)
6899 op1->type->refCount++;
6900 }
6901 return 0x1;
6902 }
6903
6904 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6905 {
6906 unsigned int value2 = op2->ui;
6907
6908 exp->type = 2;
6909 exp->string = PrintUInt(op1->ui = value2);
6910 if(!exp->expType)
6911 {
6912 exp->expType = op1->type;
6913 if(op1->type)
6914 op1->type->refCount++;
6915 }
6916 return 0x1;
6917 }
6918
6919 static unsigned int Int64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6920 {
6921 long long value2 = op2->i64;
6922
6923 exp->type = 2;
6924 exp->string = PrintInt64(op1->i64 = value2);
6925 if(!exp->expType)
6926 {
6927 exp->expType = op1->type;
6928 if(op1->type)
6929 op1->type->refCount++;
6930 }
6931 return 0x1;
6932 }
6933
6934 static unsigned int UInt64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6935 {
6936 uint64 value2 = op2->ui64;
6937
6938 exp->type = 2;
6939 exp->string = PrintUInt64(op1->ui64 = value2);
6940 if(!exp->expType)
6941 {
6942 exp->expType = op1->type;
6943 if(op1->type)
6944 op1->type->refCount++;
6945 }
6946 return 0x1;
6947 }
6948
6949 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6950 {
6951 short value2 = op2->s;
6952
6953 exp->type = 2;
6954 exp->string = PrintShort(op1->s = value2);
6955 if(!exp->expType)
6956 {
6957 exp->expType = op1->type;
6958 if(op1->type)
6959 op1->type->refCount++;
6960 }
6961 return 0x1;
6962 }
6963
6964 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6965 {
6966 unsigned short value2 = op2->us;
6967
6968 exp->type = 2;
6969 exp->string = PrintUShort(op1->us = value2);
6970 if(!exp->expType)
6971 {
6972 exp->expType = op1->type;
6973 if(op1->type)
6974 op1->type->refCount++;
6975 }
6976 return 0x1;
6977 }
6978
6979 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6980 {
6981 char value2 = op2->c;
6982
6983 exp->type = 2;
6984 exp->string = PrintChar(op1->c = value2);
6985 if(!exp->expType)
6986 {
6987 exp->expType = op1->type;
6988 if(op1->type)
6989 op1->type->refCount++;
6990 }
6991 return 0x1;
6992 }
6993
6994 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6995 {
6996 unsigned char value2 = op2->uc;
6997
6998 exp->type = 2;
6999 exp->string = PrintUChar(op1->uc = value2);
7000 if(!exp->expType)
7001 {
7002 exp->expType = op1->type;
7003 if(op1->type)
7004 op1->type->refCount++;
7005 }
7006 return 0x1;
7007 }
7008
7009 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7010 {
7011 float value2 = op2->f;
7012
7013 exp->type = 2;
7014 exp->string = PrintFloat(op1->f = value2);
7015 if(!exp->expType)
7016 {
7017 exp->expType = op1->type;
7018 if(op1->type)
7019 op1->type->refCount++;
7020 }
7021 return 0x1;
7022 }
7023
7024 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7025 {
7026 double value2 = op2->d;
7027
7028 exp->type = 2;
7029 exp->string = PrintDouble(op1->d = value2);
7030 if(!exp->expType)
7031 {
7032 exp->expType = op1->type;
7033 if(op1->type)
7034 op1->type->refCount++;
7035 }
7036 return 0x1;
7037 }
7038
7039 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7040 {
7041 int value2 = op2->i;
7042
7043 exp->type = 2;
7044 exp->string = PrintInt(op1->i += value2);
7045 if(!exp->expType)
7046 {
7047 exp->expType = op1->type;
7048 if(op1->type)
7049 op1->type->refCount++;
7050 }
7051 return 0x1;
7052 }
7053
7054 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7055 {
7056 unsigned int value2 = op2->ui;
7057
7058 exp->type = 2;
7059 exp->string = PrintUInt(op1->ui += value2);
7060 if(!exp->expType)
7061 {
7062 exp->expType = op1->type;
7063 if(op1->type)
7064 op1->type->refCount++;
7065 }
7066 return 0x1;
7067 }
7068
7069 static unsigned int Int64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7070 {
7071 long long value2 = op2->i64;
7072
7073 exp->type = 2;
7074 exp->string = PrintInt64(op1->i64 += value2);
7075 if(!exp->expType)
7076 {
7077 exp->expType = op1->type;
7078 if(op1->type)
7079 op1->type->refCount++;
7080 }
7081 return 0x1;
7082 }
7083
7084 static unsigned int UInt64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7085 {
7086 uint64 value2 = op2->ui64;
7087
7088 exp->type = 2;
7089 exp->string = PrintUInt64(op1->ui64 += value2);
7090 if(!exp->expType)
7091 {
7092 exp->expType = op1->type;
7093 if(op1->type)
7094 op1->type->refCount++;
7095 }
7096 return 0x1;
7097 }
7098
7099 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7100 {
7101 short value2 = op2->s;
7102
7103 exp->type = 2;
7104 exp->string = PrintShort(op1->s += value2);
7105 if(!exp->expType)
7106 {
7107 exp->expType = op1->type;
7108 if(op1->type)
7109 op1->type->refCount++;
7110 }
7111 return 0x1;
7112 }
7113
7114 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7115 {
7116 unsigned short value2 = op2->us;
7117
7118 exp->type = 2;
7119 exp->string = PrintUShort(op1->us += value2);
7120 if(!exp->expType)
7121 {
7122 exp->expType = op1->type;
7123 if(op1->type)
7124 op1->type->refCount++;
7125 }
7126 return 0x1;
7127 }
7128
7129 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7130 {
7131 char value2 = op2->c;
7132
7133 exp->type = 2;
7134 exp->string = PrintChar(op1->c += value2);
7135 if(!exp->expType)
7136 {
7137 exp->expType = op1->type;
7138 if(op1->type)
7139 op1->type->refCount++;
7140 }
7141 return 0x1;
7142 }
7143
7144 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7145 {
7146 unsigned char value2 = op2->uc;
7147
7148 exp->type = 2;
7149 exp->string = PrintUChar(op1->uc += value2);
7150 if(!exp->expType)
7151 {
7152 exp->expType = op1->type;
7153 if(op1->type)
7154 op1->type->refCount++;
7155 }
7156 return 0x1;
7157 }
7158
7159 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7160 {
7161 float value2 = op2->f;
7162
7163 exp->type = 2;
7164 exp->string = PrintFloat(op1->f += value2);
7165 if(!exp->expType)
7166 {
7167 exp->expType = op1->type;
7168 if(op1->type)
7169 op1->type->refCount++;
7170 }
7171 return 0x1;
7172 }
7173
7174 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7175 {
7176 double value2 = op2->d;
7177
7178 exp->type = 2;
7179 exp->string = PrintDouble(op1->d += value2);
7180 if(!exp->expType)
7181 {
7182 exp->expType = op1->type;
7183 if(op1->type)
7184 op1->type->refCount++;
7185 }
7186 return 0x1;
7187 }
7188
7189 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7190 {
7191 int value2 = op2->i;
7192
7193 exp->type = 2;
7194 exp->string = PrintInt(op1->i -= value2);
7195 if(!exp->expType)
7196 {
7197 exp->expType = op1->type;
7198 if(op1->type)
7199 op1->type->refCount++;
7200 }
7201 return 0x1;
7202 }
7203
7204 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7205 {
7206 unsigned int value2 = op2->ui;
7207
7208 exp->type = 2;
7209 exp->string = PrintUInt(op1->ui -= value2);
7210 if(!exp->expType)
7211 {
7212 exp->expType = op1->type;
7213 if(op1->type)
7214 op1->type->refCount++;
7215 }
7216 return 0x1;
7217 }
7218
7219 static unsigned int Int64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7220 {
7221 long long value2 = op2->i64;
7222
7223 exp->type = 2;
7224 exp->string = PrintInt64(op1->i64 -= value2);
7225 if(!exp->expType)
7226 {
7227 exp->expType = op1->type;
7228 if(op1->type)
7229 op1->type->refCount++;
7230 }
7231 return 0x1;
7232 }
7233
7234 static unsigned int UInt64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7235 {
7236 uint64 value2 = op2->ui64;
7237
7238 exp->type = 2;
7239 exp->string = PrintUInt64(op1->ui64 -= value2);
7240 if(!exp->expType)
7241 {
7242 exp->expType = op1->type;
7243 if(op1->type)
7244 op1->type->refCount++;
7245 }
7246 return 0x1;
7247 }
7248
7249 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7250 {
7251 short value2 = op2->s;
7252
7253 exp->type = 2;
7254 exp->string = PrintShort(op1->s -= value2);
7255 if(!exp->expType)
7256 {
7257 exp->expType = op1->type;
7258 if(op1->type)
7259 op1->type->refCount++;
7260 }
7261 return 0x1;
7262 }
7263
7264 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7265 {
7266 unsigned short value2 = op2->us;
7267
7268 exp->type = 2;
7269 exp->string = PrintUShort(op1->us -= value2);
7270 if(!exp->expType)
7271 {
7272 exp->expType = op1->type;
7273 if(op1->type)
7274 op1->type->refCount++;
7275 }
7276 return 0x1;
7277 }
7278
7279 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7280 {
7281 char value2 = op2->c;
7282
7283 exp->type = 2;
7284 exp->string = PrintChar(op1->c -= value2);
7285 if(!exp->expType)
7286 {
7287 exp->expType = op1->type;
7288 if(op1->type)
7289 op1->type->refCount++;
7290 }
7291 return 0x1;
7292 }
7293
7294 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7295 {
7296 unsigned char value2 = op2->uc;
7297
7298 exp->type = 2;
7299 exp->string = PrintUChar(op1->uc -= value2);
7300 if(!exp->expType)
7301 {
7302 exp->expType = op1->type;
7303 if(op1->type)
7304 op1->type->refCount++;
7305 }
7306 return 0x1;
7307 }
7308
7309 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7310 {
7311 float value2 = op2->f;
7312
7313 exp->type = 2;
7314 exp->string = PrintFloat(op1->f -= value2);
7315 if(!exp->expType)
7316 {
7317 exp->expType = op1->type;
7318 if(op1->type)
7319 op1->type->refCount++;
7320 }
7321 return 0x1;
7322 }
7323
7324 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7325 {
7326 double value2 = op2->d;
7327
7328 exp->type = 2;
7329 exp->string = PrintDouble(op1->d -= value2);
7330 if(!exp->expType)
7331 {
7332 exp->expType = op1->type;
7333 if(op1->type)
7334 op1->type->refCount++;
7335 }
7336 return 0x1;
7337 }
7338
7339 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7340 {
7341 int value2 = op2->i;
7342
7343 exp->type = 2;
7344 exp->string = PrintInt(op1->i *= value2);
7345 if(!exp->expType)
7346 {
7347 exp->expType = op1->type;
7348 if(op1->type)
7349 op1->type->refCount++;
7350 }
7351 return 0x1;
7352 }
7353
7354 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7355 {
7356 unsigned int value2 = op2->ui;
7357
7358 exp->type = 2;
7359 exp->string = PrintUInt(op1->ui *= value2);
7360 if(!exp->expType)
7361 {
7362 exp->expType = op1->type;
7363 if(op1->type)
7364 op1->type->refCount++;
7365 }
7366 return 0x1;
7367 }
7368
7369 static unsigned int Int64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7370 {
7371 long long value2 = op2->i64;
7372
7373 exp->type = 2;
7374 exp->string = PrintInt64(op1->i64 *= value2);
7375 if(!exp->expType)
7376 {
7377 exp->expType = op1->type;
7378 if(op1->type)
7379 op1->type->refCount++;
7380 }
7381 return 0x1;
7382 }
7383
7384 static unsigned int UInt64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7385 {
7386 uint64 value2 = op2->ui64;
7387
7388 exp->type = 2;
7389 exp->string = PrintUInt64(op1->ui64 *= value2);
7390 if(!exp->expType)
7391 {
7392 exp->expType = op1->type;
7393 if(op1->type)
7394 op1->type->refCount++;
7395 }
7396 return 0x1;
7397 }
7398
7399 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7400 {
7401 short value2 = op2->s;
7402
7403 exp->type = 2;
7404 exp->string = PrintShort(op1->s *= value2);
7405 if(!exp->expType)
7406 {
7407 exp->expType = op1->type;
7408 if(op1->type)
7409 op1->type->refCount++;
7410 }
7411 return 0x1;
7412 }
7413
7414 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7415 {
7416 unsigned short value2 = op2->us;
7417
7418 exp->type = 2;
7419 exp->string = PrintUShort(op1->us *= value2);
7420 if(!exp->expType)
7421 {
7422 exp->expType = op1->type;
7423 if(op1->type)
7424 op1->type->refCount++;
7425 }
7426 return 0x1;
7427 }
7428
7429 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7430 {
7431 char value2 = op2->c;
7432
7433 exp->type = 2;
7434 exp->string = PrintChar(op1->c *= value2);
7435 if(!exp->expType)
7436 {
7437 exp->expType = op1->type;
7438 if(op1->type)
7439 op1->type->refCount++;
7440 }
7441 return 0x1;
7442 }
7443
7444 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7445 {
7446 unsigned char value2 = op2->uc;
7447
7448 exp->type = 2;
7449 exp->string = PrintUChar(op1->uc *= value2);
7450 if(!exp->expType)
7451 {
7452 exp->expType = op1->type;
7453 if(op1->type)
7454 op1->type->refCount++;
7455 }
7456 return 0x1;
7457 }
7458
7459 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7460 {
7461 float value2 = op2->f;
7462
7463 exp->type = 2;
7464 exp->string = PrintFloat(op1->f *= value2);
7465 if(!exp->expType)
7466 {
7467 exp->expType = op1->type;
7468 if(op1->type)
7469 op1->type->refCount++;
7470 }
7471 return 0x1;
7472 }
7473
7474 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7475 {
7476 double value2 = op2->d;
7477
7478 exp->type = 2;
7479 exp->string = PrintDouble(op1->d *= value2);
7480 if(!exp->expType)
7481 {
7482 exp->expType = op1->type;
7483 if(op1->type)
7484 op1->type->refCount++;
7485 }
7486 return 0x1;
7487 }
7488
7489 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7490 {
7491 int value2 = op2->i;
7492
7493 exp->type = 2;
7494 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
7495 if(!exp->expType)
7496 {
7497 exp->expType = op1->type;
7498 if(op1->type)
7499 op1->type->refCount++;
7500 }
7501 return 0x1;
7502 }
7503
7504 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7505 {
7506 unsigned int value2 = op2->ui;
7507
7508 exp->type = 2;
7509 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
7510 if(!exp->expType)
7511 {
7512 exp->expType = op1->type;
7513 if(op1->type)
7514 op1->type->refCount++;
7515 }
7516 return 0x1;
7517 }
7518
7519 static unsigned int Int64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7520 {
7521 long long value2 = op2->i64;
7522
7523 exp->type = 2;
7524 exp->string = PrintInt64(value2 ? (op1->i64 /= value2) : 0);
7525 if(!exp->expType)
7526 {
7527 exp->expType = op1->type;
7528 if(op1->type)
7529 op1->type->refCount++;
7530 }
7531 return 0x1;
7532 }
7533
7534 static unsigned int UInt64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7535 {
7536 uint64 value2 = op2->ui64;
7537
7538 exp->type = 2;
7539 exp->string = PrintUInt64(value2 ? (op1->ui64 /= value2) : 0);
7540 if(!exp->expType)
7541 {
7542 exp->expType = op1->type;
7543 if(op1->type)
7544 op1->type->refCount++;
7545 }
7546 return 0x1;
7547 }
7548
7549 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7550 {
7551 short value2 = op2->s;
7552
7553 exp->type = 2;
7554 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
7555 if(!exp->expType)
7556 {
7557 exp->expType = op1->type;
7558 if(op1->type)
7559 op1->type->refCount++;
7560 }
7561 return 0x1;
7562 }
7563
7564 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7565 {
7566 unsigned short value2 = op2->us;
7567
7568 exp->type = 2;
7569 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
7570 if(!exp->expType)
7571 {
7572 exp->expType = op1->type;
7573 if(op1->type)
7574 op1->type->refCount++;
7575 }
7576 return 0x1;
7577 }
7578
7579 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7580 {
7581 char value2 = op2->c;
7582
7583 exp->type = 2;
7584 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
7585 if(!exp->expType)
7586 {
7587 exp->expType = op1->type;
7588 if(op1->type)
7589 op1->type->refCount++;
7590 }
7591 return 0x1;
7592 }
7593
7594 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7595 {
7596 unsigned char value2 = op2->uc;
7597
7598 exp->type = 2;
7599 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
7600 if(!exp->expType)
7601 {
7602 exp->expType = op1->type;
7603 if(op1->type)
7604 op1->type->refCount++;
7605 }
7606 return 0x1;
7607 }
7608
7609 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7610 {
7611 float value2 = op2->f;
7612
7613 exp->type = 2;
7614 exp->string = PrintFloat(op1->f /= value2);
7615 if(!exp->expType)
7616 {
7617 exp->expType = op1->type;
7618 if(op1->type)
7619 op1->type->refCount++;
7620 }
7621 return 0x1;
7622 }
7623
7624 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7625 {
7626 double value2 = op2->d;
7627
7628 exp->type = 2;
7629 exp->string = PrintDouble(op1->d /= value2);
7630 if(!exp->expType)
7631 {
7632 exp->expType = op1->type;
7633 if(op1->type)
7634 op1->type->refCount++;
7635 }
7636 return 0x1;
7637 }
7638
7639 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7640 {
7641 int value2 = op2->i;
7642
7643 exp->type = 2;
7644 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
7645 if(!exp->expType)
7646 {
7647 exp->expType = op1->type;
7648 if(op1->type)
7649 op1->type->refCount++;
7650 }
7651 return 0x1;
7652 }
7653
7654 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7655 {
7656 unsigned int value2 = op2->ui;
7657
7658 exp->type = 2;
7659 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
7660 if(!exp->expType)
7661 {
7662 exp->expType = op1->type;
7663 if(op1->type)
7664 op1->type->refCount++;
7665 }
7666 return 0x1;
7667 }
7668
7669 static unsigned int Int64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7670 {
7671 long long value2 = op2->i64;
7672
7673 exp->type = 2;
7674 exp->string = PrintInt64(value2 ? (op1->i64 %= value2) : 0);
7675 if(!exp->expType)
7676 {
7677 exp->expType = op1->type;
7678 if(op1->type)
7679 op1->type->refCount++;
7680 }
7681 return 0x1;
7682 }
7683
7684 static unsigned int UInt64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7685 {
7686 uint64 value2 = op2->ui64;
7687
7688 exp->type = 2;
7689 exp->string = PrintUInt64(value2 ? (op1->ui64 %= value2) : 0);
7690 if(!exp->expType)
7691 {
7692 exp->expType = op1->type;
7693 if(op1->type)
7694 op1->type->refCount++;
7695 }
7696 return 0x1;
7697 }
7698
7699 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7700 {
7701 short value2 = op2->s;
7702
7703 exp->type = 2;
7704 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
7705 if(!exp->expType)
7706 {
7707 exp->expType = op1->type;
7708 if(op1->type)
7709 op1->type->refCount++;
7710 }
7711 return 0x1;
7712 }
7713
7714 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7715 {
7716 unsigned short value2 = op2->us;
7717
7718 exp->type = 2;
7719 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
7720 if(!exp->expType)
7721 {
7722 exp->expType = op1->type;
7723 if(op1->type)
7724 op1->type->refCount++;
7725 }
7726 return 0x1;
7727 }
7728
7729 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7730 {
7731 char value2 = op2->c;
7732
7733 exp->type = 2;
7734 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
7735 if(!exp->expType)
7736 {
7737 exp->expType = op1->type;
7738 if(op1->type)
7739 op1->type->refCount++;
7740 }
7741 return 0x1;
7742 }
7743
7744 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7745 {
7746 unsigned char value2 = op2->uc;
7747
7748 exp->type = 2;
7749 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
7750 if(!exp->expType)
7751 {
7752 exp->expType = op1->type;
7753 if(op1->type)
7754 op1->type->refCount++;
7755 }
7756 return 0x1;
7757 }
7758
7759 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7760 {
7761 int value2 = op2->i;
7762
7763 exp->type = 2;
7764 exp->string = PrintInt(op1->i & value2);
7765 if(!exp->expType)
7766 {
7767 exp->expType = op1->type;
7768 if(op1->type)
7769 op1->type->refCount++;
7770 }
7771 return 0x1;
7772 }
7773
7774 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7775 {
7776 unsigned int value2 = op2->ui;
7777
7778 exp->type = 2;
7779 exp->string = PrintUInt(op1->ui & value2);
7780 if(!exp->expType)
7781 {
7782 exp->expType = op1->type;
7783 if(op1->type)
7784 op1->type->refCount++;
7785 }
7786 return 0x1;
7787 }
7788
7789 static unsigned int Int64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7790 {
7791 long long value2 = op2->i64;
7792
7793 exp->type = 2;
7794 exp->string = PrintInt64(op1->i64 & value2);
7795 if(!exp->expType)
7796 {
7797 exp->expType = op1->type;
7798 if(op1->type)
7799 op1->type->refCount++;
7800 }
7801 return 0x1;
7802 }
7803
7804 static unsigned int UInt64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7805 {
7806 uint64 value2 = op2->ui64;
7807
7808 exp->type = 2;
7809 exp->string = PrintUInt64(op1->ui64 & value2);
7810 if(!exp->expType)
7811 {
7812 exp->expType = op1->type;
7813 if(op1->type)
7814 op1->type->refCount++;
7815 }
7816 return 0x1;
7817 }
7818
7819 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7820 {
7821 short value2 = op2->s;
7822
7823 exp->type = 2;
7824 exp->string = PrintShort(op1->s & value2);
7825 if(!exp->expType)
7826 {
7827 exp->expType = op1->type;
7828 if(op1->type)
7829 op1->type->refCount++;
7830 }
7831 return 0x1;
7832 }
7833
7834 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7835 {
7836 unsigned short value2 = op2->us;
7837
7838 exp->type = 2;
7839 exp->string = PrintUShort(op1->us & value2);
7840 if(!exp->expType)
7841 {
7842 exp->expType = op1->type;
7843 if(op1->type)
7844 op1->type->refCount++;
7845 }
7846 return 0x1;
7847 }
7848
7849 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7850 {
7851 char value2 = op2->c;
7852
7853 exp->type = 2;
7854 exp->string = PrintChar(op1->c & value2);
7855 if(!exp->expType)
7856 {
7857 exp->expType = op1->type;
7858 if(op1->type)
7859 op1->type->refCount++;
7860 }
7861 return 0x1;
7862 }
7863
7864 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7865 {
7866 unsigned char value2 = op2->uc;
7867
7868 exp->type = 2;
7869 exp->string = PrintUChar(op1->uc & value2);
7870 if(!exp->expType)
7871 {
7872 exp->expType = op1->type;
7873 if(op1->type)
7874 op1->type->refCount++;
7875 }
7876 return 0x1;
7877 }
7878
7879 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7880 {
7881 int value2 = op2->i;
7882
7883 exp->type = 2;
7884 exp->string = PrintInt(op1->i | value2);
7885 if(!exp->expType)
7886 {
7887 exp->expType = op1->type;
7888 if(op1->type)
7889 op1->type->refCount++;
7890 }
7891 return 0x1;
7892 }
7893
7894 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7895 {
7896 unsigned int value2 = op2->ui;
7897
7898 exp->type = 2;
7899 exp->string = PrintUInt(op1->ui | value2);
7900 if(!exp->expType)
7901 {
7902 exp->expType = op1->type;
7903 if(op1->type)
7904 op1->type->refCount++;
7905 }
7906 return 0x1;
7907 }
7908
7909 static unsigned int Int64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7910 {
7911 long long value2 = op2->i64;
7912
7913 exp->type = 2;
7914 exp->string = PrintInt64(op1->i64 | value2);
7915 if(!exp->expType)
7916 {
7917 exp->expType = op1->type;
7918 if(op1->type)
7919 op1->type->refCount++;
7920 }
7921 return 0x1;
7922 }
7923
7924 static unsigned int UInt64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7925 {
7926 uint64 value2 = op2->ui64;
7927
7928 exp->type = 2;
7929 exp->string = PrintUInt64(op1->ui64 | value2);
7930 if(!exp->expType)
7931 {
7932 exp->expType = op1->type;
7933 if(op1->type)
7934 op1->type->refCount++;
7935 }
7936 return 0x1;
7937 }
7938
7939 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7940 {
7941 short value2 = op2->s;
7942
7943 exp->type = 2;
7944 exp->string = PrintShort(op1->s | value2);
7945 if(!exp->expType)
7946 {
7947 exp->expType = op1->type;
7948 if(op1->type)
7949 op1->type->refCount++;
7950 }
7951 return 0x1;
7952 }
7953
7954 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7955 {
7956 unsigned short value2 = op2->us;
7957
7958 exp->type = 2;
7959 exp->string = PrintUShort(op1->us | value2);
7960 if(!exp->expType)
7961 {
7962 exp->expType = op1->type;
7963 if(op1->type)
7964 op1->type->refCount++;
7965 }
7966 return 0x1;
7967 }
7968
7969 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7970 {
7971 char value2 = op2->c;
7972
7973 exp->type = 2;
7974 exp->string = PrintChar(op1->c | value2);
7975 if(!exp->expType)
7976 {
7977 exp->expType = op1->type;
7978 if(op1->type)
7979 op1->type->refCount++;
7980 }
7981 return 0x1;
7982 }
7983
7984 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7985 {
7986 unsigned char value2 = op2->uc;
7987
7988 exp->type = 2;
7989 exp->string = PrintUChar(op1->uc | value2);
7990 if(!exp->expType)
7991 {
7992 exp->expType = op1->type;
7993 if(op1->type)
7994 op1->type->refCount++;
7995 }
7996 return 0x1;
7997 }
7998
7999 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8000 {
8001 int value2 = op2->i;
8002
8003 exp->type = 2;
8004 exp->string = PrintInt(op1->i ^ value2);
8005 if(!exp->expType)
8006 {
8007 exp->expType = op1->type;
8008 if(op1->type)
8009 op1->type->refCount++;
8010 }
8011 return 0x1;
8012 }
8013
8014 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8015 {
8016 unsigned int value2 = op2->ui;
8017
8018 exp->type = 2;
8019 exp->string = PrintUInt(op1->ui ^ value2);
8020 if(!exp->expType)
8021 {
8022 exp->expType = op1->type;
8023 if(op1->type)
8024 op1->type->refCount++;
8025 }
8026 return 0x1;
8027 }
8028
8029 static unsigned int Int64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8030 {
8031 long long value2 = op2->i64;
8032
8033 exp->type = 2;
8034 exp->string = PrintInt64(op1->i64 ^ value2);
8035 if(!exp->expType)
8036 {
8037 exp->expType = op1->type;
8038 if(op1->type)
8039 op1->type->refCount++;
8040 }
8041 return 0x1;
8042 }
8043
8044 static unsigned int UInt64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8045 {
8046 uint64 value2 = op2->ui64;
8047
8048 exp->type = 2;
8049 exp->string = PrintUInt64(op1->ui64 ^ value2);
8050 if(!exp->expType)
8051 {
8052 exp->expType = op1->type;
8053 if(op1->type)
8054 op1->type->refCount++;
8055 }
8056 return 0x1;
8057 }
8058
8059 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8060 {
8061 short value2 = op2->s;
8062
8063 exp->type = 2;
8064 exp->string = PrintShort(op1->s ^ value2);
8065 if(!exp->expType)
8066 {
8067 exp->expType = op1->type;
8068 if(op1->type)
8069 op1->type->refCount++;
8070 }
8071 return 0x1;
8072 }
8073
8074 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8075 {
8076 unsigned short value2 = op2->us;
8077
8078 exp->type = 2;
8079 exp->string = PrintUShort(op1->us ^ value2);
8080 if(!exp->expType)
8081 {
8082 exp->expType = op1->type;
8083 if(op1->type)
8084 op1->type->refCount++;
8085 }
8086 return 0x1;
8087 }
8088
8089 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8090 {
8091 char value2 = op2->c;
8092
8093 exp->type = 2;
8094 exp->string = PrintChar(op1->c ^ value2);
8095 if(!exp->expType)
8096 {
8097 exp->expType = op1->type;
8098 if(op1->type)
8099 op1->type->refCount++;
8100 }
8101 return 0x1;
8102 }
8103
8104 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8105 {
8106 unsigned char value2 = op2->uc;
8107
8108 exp->type = 2;
8109 exp->string = PrintUChar(op1->uc ^ value2);
8110 if(!exp->expType)
8111 {
8112 exp->expType = op1->type;
8113 if(op1->type)
8114 op1->type->refCount++;
8115 }
8116 return 0x1;
8117 }
8118
8119 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8120 {
8121 int value2 = op2->i;
8122
8123 exp->type = 2;
8124 exp->string = PrintInt(op1->i << value2);
8125 if(!exp->expType)
8126 {
8127 exp->expType = op1->type;
8128 if(op1->type)
8129 op1->type->refCount++;
8130 }
8131 return 0x1;
8132 }
8133
8134 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8135 {
8136 unsigned int value2 = op2->ui;
8137
8138 exp->type = 2;
8139 exp->string = PrintUInt(op1->ui << value2);
8140 if(!exp->expType)
8141 {
8142 exp->expType = op1->type;
8143 if(op1->type)
8144 op1->type->refCount++;
8145 }
8146 return 0x1;
8147 }
8148
8149 static unsigned int Int64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8150 {
8151 long long value2 = op2->i64;
8152
8153 exp->type = 2;
8154 exp->string = PrintInt64(op1->i64 << value2);
8155 if(!exp->expType)
8156 {
8157 exp->expType = op1->type;
8158 if(op1->type)
8159 op1->type->refCount++;
8160 }
8161 return 0x1;
8162 }
8163
8164 static unsigned int UInt64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8165 {
8166 uint64 value2 = op2->ui64;
8167
8168 exp->type = 2;
8169 exp->string = PrintUInt64(op1->ui64 << value2);
8170 if(!exp->expType)
8171 {
8172 exp->expType = op1->type;
8173 if(op1->type)
8174 op1->type->refCount++;
8175 }
8176 return 0x1;
8177 }
8178
8179 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8180 {
8181 short value2 = op2->s;
8182
8183 exp->type = 2;
8184 exp->string = PrintShort(op1->s << value2);
8185 if(!exp->expType)
8186 {
8187 exp->expType = op1->type;
8188 if(op1->type)
8189 op1->type->refCount++;
8190 }
8191 return 0x1;
8192 }
8193
8194 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8195 {
8196 unsigned short value2 = op2->us;
8197
8198 exp->type = 2;
8199 exp->string = PrintUShort(op1->us << value2);
8200 if(!exp->expType)
8201 {
8202 exp->expType = op1->type;
8203 if(op1->type)
8204 op1->type->refCount++;
8205 }
8206 return 0x1;
8207 }
8208
8209 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8210 {
8211 char value2 = op2->c;
8212
8213 exp->type = 2;
8214 exp->string = PrintChar(op1->c << value2);
8215 if(!exp->expType)
8216 {
8217 exp->expType = op1->type;
8218 if(op1->type)
8219 op1->type->refCount++;
8220 }
8221 return 0x1;
8222 }
8223
8224 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8225 {
8226 unsigned char value2 = op2->uc;
8227
8228 exp->type = 2;
8229 exp->string = PrintUChar(op1->uc << value2);
8230 if(!exp->expType)
8231 {
8232 exp->expType = op1->type;
8233 if(op1->type)
8234 op1->type->refCount++;
8235 }
8236 return 0x1;
8237 }
8238
8239 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8240 {
8241 int value2 = op2->i;
8242
8243 exp->type = 2;
8244 exp->string = PrintInt(op1->i >> value2);
8245 if(!exp->expType)
8246 {
8247 exp->expType = op1->type;
8248 if(op1->type)
8249 op1->type->refCount++;
8250 }
8251 return 0x1;
8252 }
8253
8254 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8255 {
8256 unsigned int value2 = op2->ui;
8257
8258 exp->type = 2;
8259 exp->string = PrintUInt(op1->ui >> value2);
8260 if(!exp->expType)
8261 {
8262 exp->expType = op1->type;
8263 if(op1->type)
8264 op1->type->refCount++;
8265 }
8266 return 0x1;
8267 }
8268
8269 static unsigned int Int64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8270 {
8271 long long value2 = op2->i64;
8272
8273 exp->type = 2;
8274 exp->string = PrintInt64(op1->i64 >> value2);
8275 if(!exp->expType)
8276 {
8277 exp->expType = op1->type;
8278 if(op1->type)
8279 op1->type->refCount++;
8280 }
8281 return 0x1;
8282 }
8283
8284 static unsigned int UInt64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8285 {
8286 uint64 value2 = op2->ui64;
8287
8288 exp->type = 2;
8289 exp->string = PrintUInt64(op1->ui64 >> value2);
8290 if(!exp->expType)
8291 {
8292 exp->expType = op1->type;
8293 if(op1->type)
8294 op1->type->refCount++;
8295 }
8296 return 0x1;
8297 }
8298
8299 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8300 {
8301 short value2 = op2->s;
8302
8303 exp->type = 2;
8304 exp->string = PrintShort(op1->s >> value2);
8305 if(!exp->expType)
8306 {
8307 exp->expType = op1->type;
8308 if(op1->type)
8309 op1->type->refCount++;
8310 }
8311 return 0x1;
8312 }
8313
8314 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8315 {
8316 unsigned short value2 = op2->us;
8317
8318 exp->type = 2;
8319 exp->string = PrintUShort(op1->us >> value2);
8320 if(!exp->expType)
8321 {
8322 exp->expType = op1->type;
8323 if(op1->type)
8324 op1->type->refCount++;
8325 }
8326 return 0x1;
8327 }
8328
8329 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8330 {
8331 char value2 = op2->c;
8332
8333 exp->type = 2;
8334 exp->string = PrintChar(op1->c >> value2);
8335 if(!exp->expType)
8336 {
8337 exp->expType = op1->type;
8338 if(op1->type)
8339 op1->type->refCount++;
8340 }
8341 return 0x1;
8342 }
8343
8344 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8345 {
8346 unsigned char value2 = op2->uc;
8347
8348 exp->type = 2;
8349 exp->string = PrintUChar(op1->uc >> value2);
8350 if(!exp->expType)
8351 {
8352 exp->expType = op1->type;
8353 if(op1->type)
8354 op1->type->refCount++;
8355 }
8356 return 0x1;
8357 }
8358
8359 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
8360 {
8361 exp->type = 2;
8362 exp->string = PrintInt((~op1->i));
8363 if(!exp->expType)
8364 {
8365 exp->expType = op1->type;
8366 if(op1->type)
8367 op1->type->refCount++;
8368 }
8369 return 0x1;
8370 }
8371
8372 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
8373 {
8374 exp->type = 2;
8375 exp->string = PrintUInt((unsigned int)(~op1->ui));
8376 if(!exp->expType)
8377 {
8378 exp->expType = op1->type;
8379 if(op1->type)
8380 op1->type->refCount++;
8381 }
8382 return 0x1;
8383 }
8384
8385 static unsigned int Int64BitNot(struct Expression * exp, struct Operand * op1)
8386 {
8387 exp->type = 2;
8388 exp->string = PrintInt64((long long)(~op1->i64));
8389 if(!exp->expType)
8390 {
8391 exp->expType = op1->type;
8392 if(op1->type)
8393 op1->type->refCount++;
8394 }
8395 return 0x1;
8396 }
8397
8398 static unsigned int UInt64BitNot(struct Expression * exp, struct Operand * op1)
8399 {
8400 exp->type = 2;
8401 exp->string = PrintUInt64((uint64)(~op1->ui64));
8402 if(!exp->expType)
8403 {
8404 exp->expType = op1->type;
8405 if(op1->type)
8406 op1->type->refCount++;
8407 }
8408 return 0x1;
8409 }
8410
8411 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
8412 {
8413 exp->type = 2;
8414 exp->string = PrintShort((short)(~op1->s));
8415 if(!exp->expType)
8416 {
8417 exp->expType = op1->type;
8418 if(op1->type)
8419 op1->type->refCount++;
8420 }
8421 return 0x1;
8422 }
8423
8424 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
8425 {
8426 exp->type = 2;
8427 exp->string = PrintUShort((unsigned short)(~op1->us));
8428 if(!exp->expType)
8429 {
8430 exp->expType = op1->type;
8431 if(op1->type)
8432 op1->type->refCount++;
8433 }
8434 return 0x1;
8435 }
8436
8437 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
8438 {
8439 exp->type = 2;
8440 exp->string = PrintChar((char)(~op1->c));
8441 if(!exp->expType)
8442 {
8443 exp->expType = op1->type;
8444 if(op1->type)
8445 op1->type->refCount++;
8446 }
8447 return 0x1;
8448 }
8449
8450 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
8451 {
8452 exp->type = 2;
8453 exp->string = PrintUChar((unsigned char)(~op1->uc));
8454 if(!exp->expType)
8455 {
8456 exp->expType = op1->type;
8457 if(op1->type)
8458 op1->type->refCount++;
8459 }
8460 return 0x1;
8461 }
8462
8463 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8464 {
8465 int value2 = op2->i;
8466
8467 exp->type = 2;
8468 exp->string = PrintInt(op1->i &= value2);
8469 if(!exp->expType)
8470 {
8471 exp->expType = op1->type;
8472 if(op1->type)
8473 op1->type->refCount++;
8474 }
8475 return 0x1;
8476 }
8477
8478 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8479 {
8480 unsigned int value2 = op2->ui;
8481
8482 exp->type = 2;
8483 exp->string = PrintUInt(op1->ui &= value2);
8484 if(!exp->expType)
8485 {
8486 exp->expType = op1->type;
8487 if(op1->type)
8488 op1->type->refCount++;
8489 }
8490 return 0x1;
8491 }
8492
8493 static unsigned int Int64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8494 {
8495 long long value2 = op2->i64;
8496
8497 exp->type = 2;
8498 exp->string = PrintInt64(op1->i64 &= value2);
8499 if(!exp->expType)
8500 {
8501 exp->expType = op1->type;
8502 if(op1->type)
8503 op1->type->refCount++;
8504 }
8505 return 0x1;
8506 }
8507
8508 static unsigned int UInt64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8509 {
8510 uint64 value2 = op2->ui64;
8511
8512 exp->type = 2;
8513 exp->string = PrintUInt64(op1->ui64 &= value2);
8514 if(!exp->expType)
8515 {
8516 exp->expType = op1->type;
8517 if(op1->type)
8518 op1->type->refCount++;
8519 }
8520 return 0x1;
8521 }
8522
8523 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8524 {
8525 short value2 = op2->s;
8526
8527 exp->type = 2;
8528 exp->string = PrintShort(op1->s &= value2);
8529 if(!exp->expType)
8530 {
8531 exp->expType = op1->type;
8532 if(op1->type)
8533 op1->type->refCount++;
8534 }
8535 return 0x1;
8536 }
8537
8538 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8539 {
8540 unsigned short value2 = op2->us;
8541
8542 exp->type = 2;
8543 exp->string = PrintUShort(op1->us &= value2);
8544 if(!exp->expType)
8545 {
8546 exp->expType = op1->type;
8547 if(op1->type)
8548 op1->type->refCount++;
8549 }
8550 return 0x1;
8551 }
8552
8553 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8554 {
8555 char value2 = op2->c;
8556
8557 exp->type = 2;
8558 exp->string = PrintChar(op1->c &= value2);
8559 if(!exp->expType)
8560 {
8561 exp->expType = op1->type;
8562 if(op1->type)
8563 op1->type->refCount++;
8564 }
8565 return 0x1;
8566 }
8567
8568 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8569 {
8570 unsigned char value2 = op2->uc;
8571
8572 exp->type = 2;
8573 exp->string = PrintUChar(op1->uc &= value2);
8574 if(!exp->expType)
8575 {
8576 exp->expType = op1->type;
8577 if(op1->type)
8578 op1->type->refCount++;
8579 }
8580 return 0x1;
8581 }
8582
8583 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8584 {
8585 int value2 = op2->i;
8586
8587 exp->type = 2;
8588 exp->string = PrintInt(op1->i |= value2);
8589 if(!exp->expType)
8590 {
8591 exp->expType = op1->type;
8592 if(op1->type)
8593 op1->type->refCount++;
8594 }
8595 return 0x1;
8596 }
8597
8598 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8599 {
8600 unsigned int value2 = op2->ui;
8601
8602 exp->type = 2;
8603 exp->string = PrintUInt(op1->ui |= value2);
8604 if(!exp->expType)
8605 {
8606 exp->expType = op1->type;
8607 if(op1->type)
8608 op1->type->refCount++;
8609 }
8610 return 0x1;
8611 }
8612
8613 static unsigned int Int64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8614 {
8615 long long value2 = op2->i64;
8616
8617 exp->type = 2;
8618 exp->string = PrintInt64(op1->i64 |= value2);
8619 if(!exp->expType)
8620 {
8621 exp->expType = op1->type;
8622 if(op1->type)
8623 op1->type->refCount++;
8624 }
8625 return 0x1;
8626 }
8627
8628 static unsigned int UInt64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8629 {
8630 uint64 value2 = op2->ui64;
8631
8632 exp->type = 2;
8633 exp->string = PrintUInt64(op1->ui64 |= value2);
8634 if(!exp->expType)
8635 {
8636 exp->expType = op1->type;
8637 if(op1->type)
8638 op1->type->refCount++;
8639 }
8640 return 0x1;
8641 }
8642
8643 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8644 {
8645 short value2 = op2->s;
8646
8647 exp->type = 2;
8648 exp->string = PrintShort(op1->s |= value2);
8649 if(!exp->expType)
8650 {
8651 exp->expType = op1->type;
8652 if(op1->type)
8653 op1->type->refCount++;
8654 }
8655 return 0x1;
8656 }
8657
8658 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8659 {
8660 unsigned short value2 = op2->us;
8661
8662 exp->type = 2;
8663 exp->string = PrintUShort(op1->us |= value2);
8664 if(!exp->expType)
8665 {
8666 exp->expType = op1->type;
8667 if(op1->type)
8668 op1->type->refCount++;
8669 }
8670 return 0x1;
8671 }
8672
8673 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8674 {
8675 char value2 = op2->c;
8676
8677 exp->type = 2;
8678 exp->string = PrintChar(op1->c |= value2);
8679 if(!exp->expType)
8680 {
8681 exp->expType = op1->type;
8682 if(op1->type)
8683 op1->type->refCount++;
8684 }
8685 return 0x1;
8686 }
8687
8688 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8689 {
8690 unsigned char value2 = op2->uc;
8691
8692 exp->type = 2;
8693 exp->string = PrintUChar(op1->uc |= value2);
8694 if(!exp->expType)
8695 {
8696 exp->expType = op1->type;
8697 if(op1->type)
8698 op1->type->refCount++;
8699 }
8700 return 0x1;
8701 }
8702
8703 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8704 {
8705 int value2 = op2->i;
8706
8707 exp->type = 2;
8708 exp->string = PrintInt(op1->i ^= value2);
8709 if(!exp->expType)
8710 {
8711 exp->expType = op1->type;
8712 if(op1->type)
8713 op1->type->refCount++;
8714 }
8715 return 0x1;
8716 }
8717
8718 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8719 {
8720 unsigned int value2 = op2->ui;
8721
8722 exp->type = 2;
8723 exp->string = PrintUInt(op1->ui ^= value2);
8724 if(!exp->expType)
8725 {
8726 exp->expType = op1->type;
8727 if(op1->type)
8728 op1->type->refCount++;
8729 }
8730 return 0x1;
8731 }
8732
8733 static unsigned int Int64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8734 {
8735 long long value2 = op2->i64;
8736
8737 exp->type = 2;
8738 exp->string = PrintInt64(op1->i64 ^= value2);
8739 if(!exp->expType)
8740 {
8741 exp->expType = op1->type;
8742 if(op1->type)
8743 op1->type->refCount++;
8744 }
8745 return 0x1;
8746 }
8747
8748 static unsigned int UInt64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8749 {
8750 uint64 value2 = op2->ui64;
8751
8752 exp->type = 2;
8753 exp->string = PrintUInt64(op1->ui64 ^= value2);
8754 if(!exp->expType)
8755 {
8756 exp->expType = op1->type;
8757 if(op1->type)
8758 op1->type->refCount++;
8759 }
8760 return 0x1;
8761 }
8762
8763 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8764 {
8765 short value2 = op2->s;
8766
8767 exp->type = 2;
8768 exp->string = PrintShort(op1->s ^= value2);
8769 if(!exp->expType)
8770 {
8771 exp->expType = op1->type;
8772 if(op1->type)
8773 op1->type->refCount++;
8774 }
8775 return 0x1;
8776 }
8777
8778 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8779 {
8780 unsigned short value2 = op2->us;
8781
8782 exp->type = 2;
8783 exp->string = PrintUShort(op1->us ^= value2);
8784 if(!exp->expType)
8785 {
8786 exp->expType = op1->type;
8787 if(op1->type)
8788 op1->type->refCount++;
8789 }
8790 return 0x1;
8791 }
8792
8793 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8794 {
8795 char value2 = op2->c;
8796
8797 exp->type = 2;
8798 exp->string = PrintChar(op1->c ^= value2);
8799 if(!exp->expType)
8800 {
8801 exp->expType = op1->type;
8802 if(op1->type)
8803 op1->type->refCount++;
8804 }
8805 return 0x1;
8806 }
8807
8808 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8809 {
8810 unsigned char value2 = op2->uc;
8811
8812 exp->type = 2;
8813 exp->string = PrintUChar(op1->uc ^= value2);
8814 if(!exp->expType)
8815 {
8816 exp->expType = op1->type;
8817 if(op1->type)
8818 op1->type->refCount++;
8819 }
8820 return 0x1;
8821 }
8822
8823 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8824 {
8825 int value2 = op2->i;
8826
8827 exp->type = 2;
8828 exp->string = PrintInt(op1->i <<= value2);
8829 if(!exp->expType)
8830 {
8831 exp->expType = op1->type;
8832 if(op1->type)
8833 op1->type->refCount++;
8834 }
8835 return 0x1;
8836 }
8837
8838 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8839 {
8840 unsigned int value2 = op2->ui;
8841
8842 exp->type = 2;
8843 exp->string = PrintUInt(op1->ui <<= value2);
8844 if(!exp->expType)
8845 {
8846 exp->expType = op1->type;
8847 if(op1->type)
8848 op1->type->refCount++;
8849 }
8850 return 0x1;
8851 }
8852
8853 static unsigned int Int64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8854 {
8855 long long value2 = op2->i64;
8856
8857 exp->type = 2;
8858 exp->string = PrintInt64(op1->i64 <<= value2);
8859 if(!exp->expType)
8860 {
8861 exp->expType = op1->type;
8862 if(op1->type)
8863 op1->type->refCount++;
8864 }
8865 return 0x1;
8866 }
8867
8868 static unsigned int UInt64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8869 {
8870 uint64 value2 = op2->ui64;
8871
8872 exp->type = 2;
8873 exp->string = PrintUInt64(op1->ui64 <<= value2);
8874 if(!exp->expType)
8875 {
8876 exp->expType = op1->type;
8877 if(op1->type)
8878 op1->type->refCount++;
8879 }
8880 return 0x1;
8881 }
8882
8883 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8884 {
8885 short value2 = op2->s;
8886
8887 exp->type = 2;
8888 exp->string = PrintShort(op1->s <<= value2);
8889 if(!exp->expType)
8890 {
8891 exp->expType = op1->type;
8892 if(op1->type)
8893 op1->type->refCount++;
8894 }
8895 return 0x1;
8896 }
8897
8898 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8899 {
8900 unsigned short value2 = op2->us;
8901
8902 exp->type = 2;
8903 exp->string = PrintUShort(op1->us <<= value2);
8904 if(!exp->expType)
8905 {
8906 exp->expType = op1->type;
8907 if(op1->type)
8908 op1->type->refCount++;
8909 }
8910 return 0x1;
8911 }
8912
8913 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8914 {
8915 char value2 = op2->c;
8916
8917 exp->type = 2;
8918 exp->string = PrintChar(op1->c <<= value2);
8919 if(!exp->expType)
8920 {
8921 exp->expType = op1->type;
8922 if(op1->type)
8923 op1->type->refCount++;
8924 }
8925 return 0x1;
8926 }
8927
8928 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8929 {
8930 unsigned char value2 = op2->uc;
8931
8932 exp->type = 2;
8933 exp->string = PrintUChar(op1->uc <<= value2);
8934 if(!exp->expType)
8935 {
8936 exp->expType = op1->type;
8937 if(op1->type)
8938 op1->type->refCount++;
8939 }
8940 return 0x1;
8941 }
8942
8943 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8944 {
8945 int value2 = op2->i;
8946
8947 exp->type = 2;
8948 exp->string = PrintInt(op1->i >>= value2);
8949 if(!exp->expType)
8950 {
8951 exp->expType = op1->type;
8952 if(op1->type)
8953 op1->type->refCount++;
8954 }
8955 return 0x1;
8956 }
8957
8958 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8959 {
8960 unsigned int value2 = op2->ui;
8961
8962 exp->type = 2;
8963 exp->string = PrintUInt(op1->ui >>= value2);
8964 if(!exp->expType)
8965 {
8966 exp->expType = op1->type;
8967 if(op1->type)
8968 op1->type->refCount++;
8969 }
8970 return 0x1;
8971 }
8972
8973 static unsigned int Int64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8974 {
8975 long long value2 = op2->i64;
8976
8977 exp->type = 2;
8978 exp->string = PrintInt64(op1->i64 >>= value2);
8979 if(!exp->expType)
8980 {
8981 exp->expType = op1->type;
8982 if(op1->type)
8983 op1->type->refCount++;
8984 }
8985 return 0x1;
8986 }
8987
8988 static unsigned int UInt64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8989 {
8990 uint64 value2 = op2->ui64;
8991
8992 exp->type = 2;
8993 exp->string = PrintUInt64(op1->ui64 >>= value2);
8994 if(!exp->expType)
8995 {
8996 exp->expType = op1->type;
8997 if(op1->type)
8998 op1->type->refCount++;
8999 }
9000 return 0x1;
9001 }
9002
9003 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9004 {
9005 short value2 = op2->s;
9006
9007 exp->type = 2;
9008 exp->string = PrintShort(op1->s >>= value2);
9009 if(!exp->expType)
9010 {
9011 exp->expType = op1->type;
9012 if(op1->type)
9013 op1->type->refCount++;
9014 }
9015 return 0x1;
9016 }
9017
9018 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9019 {
9020 unsigned short value2 = op2->us;
9021
9022 exp->type = 2;
9023 exp->string = PrintUShort(op1->us >>= value2);
9024 if(!exp->expType)
9025 {
9026 exp->expType = op1->type;
9027 if(op1->type)
9028 op1->type->refCount++;
9029 }
9030 return 0x1;
9031 }
9032
9033 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9034 {
9035 char value2 = op2->c;
9036
9037 exp->type = 2;
9038 exp->string = PrintChar(op1->c >>= value2);
9039 if(!exp->expType)
9040 {
9041 exp->expType = op1->type;
9042 if(op1->type)
9043 op1->type->refCount++;
9044 }
9045 return 0x1;
9046 }
9047
9048 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9049 {
9050 unsigned char value2 = op2->uc;
9051
9052 exp->type = 2;
9053 exp->string = PrintUChar(op1->uc >>= value2);
9054 if(!exp->expType)
9055 {
9056 exp->expType = op1->type;
9057 if(op1->type)
9058 op1->type->refCount++;
9059 }
9060 return 0x1;
9061 }
9062
9063 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
9064 {
9065 exp->type = 2;
9066 exp->string = PrintInt((int)(!op1->i));
9067 if(!exp->expType)
9068 {
9069 exp->expType = op1->type;
9070 if(op1->type)
9071 op1->type->refCount++;
9072 }
9073 return 0x1;
9074 }
9075
9076 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
9077 {
9078 exp->type = 2;
9079 exp->string = PrintUInt((unsigned int)(!op1->ui));
9080 if(!exp->expType)
9081 {
9082 exp->expType = op1->type;
9083 if(op1->type)
9084 op1->type->refCount++;
9085 }
9086 return 0x1;
9087 }
9088
9089 static unsigned int Int64Not(struct Expression * exp, struct Operand * op1)
9090 {
9091 exp->type = 2;
9092 exp->string = PrintInt64((long long)(!op1->i64));
9093 if(!exp->expType)
9094 {
9095 exp->expType = op1->type;
9096 if(op1->type)
9097 op1->type->refCount++;
9098 }
9099 return 0x1;
9100 }
9101
9102 static unsigned int UInt64Not(struct Expression * exp, struct Operand * op1)
9103 {
9104 exp->type = 2;
9105 exp->string = PrintUInt64((uint64)(!op1->ui64));
9106 if(!exp->expType)
9107 {
9108 exp->expType = op1->type;
9109 if(op1->type)
9110 op1->type->refCount++;
9111 }
9112 return 0x1;
9113 }
9114
9115 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
9116 {
9117 exp->type = 2;
9118 exp->string = PrintShort((short)(!op1->s));
9119 if(!exp->expType)
9120 {
9121 exp->expType = op1->type;
9122 if(op1->type)
9123 op1->type->refCount++;
9124 }
9125 return 0x1;
9126 }
9127
9128 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
9129 {
9130 exp->type = 2;
9131 exp->string = PrintUShort((unsigned short)(!op1->us));
9132 if(!exp->expType)
9133 {
9134 exp->expType = op1->type;
9135 if(op1->type)
9136 op1->type->refCount++;
9137 }
9138 return 0x1;
9139 }
9140
9141 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
9142 {
9143 exp->type = 2;
9144 exp->string = PrintChar((char)(!op1->c));
9145 if(!exp->expType)
9146 {
9147 exp->expType = op1->type;
9148 if(op1->type)
9149 op1->type->refCount++;
9150 }
9151 return 0x1;
9152 }
9153
9154 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
9155 {
9156 exp->type = 2;
9157 exp->string = PrintUChar((unsigned char)(!op1->uc));
9158 if(!exp->expType)
9159 {
9160 exp->expType = op1->type;
9161 if(op1->type)
9162 op1->type->refCount++;
9163 }
9164 return 0x1;
9165 }
9166
9167 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9168 {
9169 int value2 = op2->i;
9170
9171 exp->type = 2;
9172 exp->string = PrintInt(op1->i == value2);
9173 if(!exp->expType)
9174 {
9175 exp->expType = op1->type;
9176 if(op1->type)
9177 op1->type->refCount++;
9178 }
9179 return 0x1;
9180 }
9181
9182 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9183 {
9184 unsigned int value2 = op2->ui;
9185
9186 exp->type = 2;
9187 exp->string = PrintUInt(op1->ui == value2);
9188 if(!exp->expType)
9189 {
9190 exp->expType = op1->type;
9191 if(op1->type)
9192 op1->type->refCount++;
9193 }
9194 return 0x1;
9195 }
9196
9197 static unsigned int Int64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9198 {
9199 long long value2 = op2->i64;
9200
9201 exp->type = 2;
9202 exp->string = PrintInt64(op1->i64 == value2);
9203 if(!exp->expType)
9204 {
9205 exp->expType = op1->type;
9206 if(op1->type)
9207 op1->type->refCount++;
9208 }
9209 return 0x1;
9210 }
9211
9212 static unsigned int UInt64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9213 {
9214 uint64 value2 = op2->ui64;
9215
9216 exp->type = 2;
9217 exp->string = PrintUInt64(op1->ui64 == value2);
9218 if(!exp->expType)
9219 {
9220 exp->expType = op1->type;
9221 if(op1->type)
9222 op1->type->refCount++;
9223 }
9224 return 0x1;
9225 }
9226
9227 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9228 {
9229 short value2 = op2->s;
9230
9231 exp->type = 2;
9232 exp->string = PrintShort(op1->s == value2);
9233 if(!exp->expType)
9234 {
9235 exp->expType = op1->type;
9236 if(op1->type)
9237 op1->type->refCount++;
9238 }
9239 return 0x1;
9240 }
9241
9242 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9243 {
9244 unsigned short value2 = op2->us;
9245
9246 exp->type = 2;
9247 exp->string = PrintUShort(op1->us == value2);
9248 if(!exp->expType)
9249 {
9250 exp->expType = op1->type;
9251 if(op1->type)
9252 op1->type->refCount++;
9253 }
9254 return 0x1;
9255 }
9256
9257 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9258 {
9259 char value2 = op2->c;
9260
9261 exp->type = 2;
9262 exp->string = PrintChar(op1->c == value2);
9263 if(!exp->expType)
9264 {
9265 exp->expType = op1->type;
9266 if(op1->type)
9267 op1->type->refCount++;
9268 }
9269 return 0x1;
9270 }
9271
9272 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9273 {
9274 unsigned char value2 = op2->uc;
9275
9276 exp->type = 2;
9277 exp->string = PrintUChar(op1->uc == value2);
9278 if(!exp->expType)
9279 {
9280 exp->expType = op1->type;
9281 if(op1->type)
9282 op1->type->refCount++;
9283 }
9284 return 0x1;
9285 }
9286
9287 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9288 {
9289 float value2 = op2->f;
9290
9291 exp->type = 2;
9292 exp->string = PrintFloat(op1->f == value2);
9293 if(!exp->expType)
9294 {
9295 exp->expType = op1->type;
9296 if(op1->type)
9297 op1->type->refCount++;
9298 }
9299 return 0x1;
9300 }
9301
9302 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9303 {
9304 double value2 = op2->d;
9305
9306 exp->type = 2;
9307 exp->string = PrintDouble(op1->d == value2);
9308 if(!exp->expType)
9309 {
9310 exp->expType = op1->type;
9311 if(op1->type)
9312 op1->type->refCount++;
9313 }
9314 return 0x1;
9315 }
9316
9317 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9318 {
9319 int value2 = op2->i;
9320
9321 exp->type = 2;
9322 exp->string = PrintInt(op1->i != value2);
9323 if(!exp->expType)
9324 {
9325 exp->expType = op1->type;
9326 if(op1->type)
9327 op1->type->refCount++;
9328 }
9329 return 0x1;
9330 }
9331
9332 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9333 {
9334 unsigned int value2 = op2->ui;
9335
9336 exp->type = 2;
9337 exp->string = PrintUInt(op1->ui != value2);
9338 if(!exp->expType)
9339 {
9340 exp->expType = op1->type;
9341 if(op1->type)
9342 op1->type->refCount++;
9343 }
9344 return 0x1;
9345 }
9346
9347 static unsigned int Int64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9348 {
9349 long long value2 = op2->i64;
9350
9351 exp->type = 2;
9352 exp->string = PrintInt64(op1->i64 != value2);
9353 if(!exp->expType)
9354 {
9355 exp->expType = op1->type;
9356 if(op1->type)
9357 op1->type->refCount++;
9358 }
9359 return 0x1;
9360 }
9361
9362 static unsigned int UInt64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9363 {
9364 uint64 value2 = op2->ui64;
9365
9366 exp->type = 2;
9367 exp->string = PrintUInt64(op1->ui64 != value2);
9368 if(!exp->expType)
9369 {
9370 exp->expType = op1->type;
9371 if(op1->type)
9372 op1->type->refCount++;
9373 }
9374 return 0x1;
9375 }
9376
9377 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9378 {
9379 short value2 = op2->s;
9380
9381 exp->type = 2;
9382 exp->string = PrintShort(op1->s != value2);
9383 if(!exp->expType)
9384 {
9385 exp->expType = op1->type;
9386 if(op1->type)
9387 op1->type->refCount++;
9388 }
9389 return 0x1;
9390 }
9391
9392 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9393 {
9394 unsigned short value2 = op2->us;
9395
9396 exp->type = 2;
9397 exp->string = PrintUShort(op1->us != value2);
9398 if(!exp->expType)
9399 {
9400 exp->expType = op1->type;
9401 if(op1->type)
9402 op1->type->refCount++;
9403 }
9404 return 0x1;
9405 }
9406
9407 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9408 {
9409 char value2 = op2->c;
9410
9411 exp->type = 2;
9412 exp->string = PrintChar(op1->c != value2);
9413 if(!exp->expType)
9414 {
9415 exp->expType = op1->type;
9416 if(op1->type)
9417 op1->type->refCount++;
9418 }
9419 return 0x1;
9420 }
9421
9422 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9423 {
9424 unsigned char value2 = op2->uc;
9425
9426 exp->type = 2;
9427 exp->string = PrintUChar(op1->uc != value2);
9428 if(!exp->expType)
9429 {
9430 exp->expType = op1->type;
9431 if(op1->type)
9432 op1->type->refCount++;
9433 }
9434 return 0x1;
9435 }
9436
9437 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9438 {
9439 float value2 = op2->f;
9440
9441 exp->type = 2;
9442 exp->string = PrintFloat(op1->f != value2);
9443 if(!exp->expType)
9444 {
9445 exp->expType = op1->type;
9446 if(op1->type)
9447 op1->type->refCount++;
9448 }
9449 return 0x1;
9450 }
9451
9452 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9453 {
9454 double value2 = op2->d;
9455
9456 exp->type = 2;
9457 exp->string = PrintDouble(op1->d != value2);
9458 if(!exp->expType)
9459 {
9460 exp->expType = op1->type;
9461 if(op1->type)
9462 op1->type->refCount++;
9463 }
9464 return 0x1;
9465 }
9466
9467 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9468 {
9469 int value2 = op2->i;
9470
9471 exp->type = 2;
9472 exp->string = PrintInt(op1->i && value2);
9473 if(!exp->expType)
9474 {
9475 exp->expType = op1->type;
9476 if(op1->type)
9477 op1->type->refCount++;
9478 }
9479 return 0x1;
9480 }
9481
9482 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9483 {
9484 unsigned int value2 = op2->ui;
9485
9486 exp->type = 2;
9487 exp->string = PrintUInt(op1->ui && value2);
9488 if(!exp->expType)
9489 {
9490 exp->expType = op1->type;
9491 if(op1->type)
9492 op1->type->refCount++;
9493 }
9494 return 0x1;
9495 }
9496
9497 static unsigned int Int64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9498 {
9499 long long value2 = op2->i64;
9500
9501 exp->type = 2;
9502 exp->string = PrintInt64(op1->i64 && value2);
9503 if(!exp->expType)
9504 {
9505 exp->expType = op1->type;
9506 if(op1->type)
9507 op1->type->refCount++;
9508 }
9509 return 0x1;
9510 }
9511
9512 static unsigned int UInt64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9513 {
9514 uint64 value2 = op2->ui64;
9515
9516 exp->type = 2;
9517 exp->string = PrintUInt64(op1->ui64 && value2);
9518 if(!exp->expType)
9519 {
9520 exp->expType = op1->type;
9521 if(op1->type)
9522 op1->type->refCount++;
9523 }
9524 return 0x1;
9525 }
9526
9527 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9528 {
9529 short value2 = op2->s;
9530
9531 exp->type = 2;
9532 exp->string = PrintShort(op1->s && value2);
9533 if(!exp->expType)
9534 {
9535 exp->expType = op1->type;
9536 if(op1->type)
9537 op1->type->refCount++;
9538 }
9539 return 0x1;
9540 }
9541
9542 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9543 {
9544 unsigned short value2 = op2->us;
9545
9546 exp->type = 2;
9547 exp->string = PrintUShort(op1->us && value2);
9548 if(!exp->expType)
9549 {
9550 exp->expType = op1->type;
9551 if(op1->type)
9552 op1->type->refCount++;
9553 }
9554 return 0x1;
9555 }
9556
9557 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9558 {
9559 char value2 = op2->c;
9560
9561 exp->type = 2;
9562 exp->string = PrintChar(op1->c && value2);
9563 if(!exp->expType)
9564 {
9565 exp->expType = op1->type;
9566 if(op1->type)
9567 op1->type->refCount++;
9568 }
9569 return 0x1;
9570 }
9571
9572 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9573 {
9574 unsigned char value2 = op2->uc;
9575
9576 exp->type = 2;
9577 exp->string = PrintUChar(op1->uc && value2);
9578 if(!exp->expType)
9579 {
9580 exp->expType = op1->type;
9581 if(op1->type)
9582 op1->type->refCount++;
9583 }
9584 return 0x1;
9585 }
9586
9587 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9588 {
9589 float value2 = op2->f;
9590
9591 exp->type = 2;
9592 exp->string = PrintFloat(op1->f && value2);
9593 if(!exp->expType)
9594 {
9595 exp->expType = op1->type;
9596 if(op1->type)
9597 op1->type->refCount++;
9598 }
9599 return 0x1;
9600 }
9601
9602 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9603 {
9604 double value2 = op2->d;
9605
9606 exp->type = 2;
9607 exp->string = PrintDouble(op1->d && value2);
9608 if(!exp->expType)
9609 {
9610 exp->expType = op1->type;
9611 if(op1->type)
9612 op1->type->refCount++;
9613 }
9614 return 0x1;
9615 }
9616
9617 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9618 {
9619 int value2 = op2->i;
9620
9621 exp->type = 2;
9622 exp->string = PrintInt(op1->i || value2);
9623 if(!exp->expType)
9624 {
9625 exp->expType = op1->type;
9626 if(op1->type)
9627 op1->type->refCount++;
9628 }
9629 return 0x1;
9630 }
9631
9632 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9633 {
9634 unsigned int value2 = op2->ui;
9635
9636 exp->type = 2;
9637 exp->string = PrintUInt(op1->ui || value2);
9638 if(!exp->expType)
9639 {
9640 exp->expType = op1->type;
9641 if(op1->type)
9642 op1->type->refCount++;
9643 }
9644 return 0x1;
9645 }
9646
9647 static unsigned int Int64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9648 {
9649 long long value2 = op2->i64;
9650
9651 exp->type = 2;
9652 exp->string = PrintInt64(op1->i64 || value2);
9653 if(!exp->expType)
9654 {
9655 exp->expType = op1->type;
9656 if(op1->type)
9657 op1->type->refCount++;
9658 }
9659 return 0x1;
9660 }
9661
9662 static unsigned int UInt64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9663 {
9664 uint64 value2 = op2->ui64;
9665
9666 exp->type = 2;
9667 exp->string = PrintUInt64(op1->ui64 || value2);
9668 if(!exp->expType)
9669 {
9670 exp->expType = op1->type;
9671 if(op1->type)
9672 op1->type->refCount++;
9673 }
9674 return 0x1;
9675 }
9676
9677 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9678 {
9679 short value2 = op2->s;
9680
9681 exp->type = 2;
9682 exp->string = PrintShort(op1->s || value2);
9683 if(!exp->expType)
9684 {
9685 exp->expType = op1->type;
9686 if(op1->type)
9687 op1->type->refCount++;
9688 }
9689 return 0x1;
9690 }
9691
9692 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9693 {
9694 unsigned short value2 = op2->us;
9695
9696 exp->type = 2;
9697 exp->string = PrintUShort(op1->us || value2);
9698 if(!exp->expType)
9699 {
9700 exp->expType = op1->type;
9701 if(op1->type)
9702 op1->type->refCount++;
9703 }
9704 return 0x1;
9705 }
9706
9707 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9708 {
9709 char value2 = op2->c;
9710
9711 exp->type = 2;
9712 exp->string = PrintChar(op1->c || value2);
9713 if(!exp->expType)
9714 {
9715 exp->expType = op1->type;
9716 if(op1->type)
9717 op1->type->refCount++;
9718 }
9719 return 0x1;
9720 }
9721
9722 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9723 {
9724 unsigned char value2 = op2->uc;
9725
9726 exp->type = 2;
9727 exp->string = PrintUChar(op1->uc || value2);
9728 if(!exp->expType)
9729 {
9730 exp->expType = op1->type;
9731 if(op1->type)
9732 op1->type->refCount++;
9733 }
9734 return 0x1;
9735 }
9736
9737 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9738 {
9739 float value2 = op2->f;
9740
9741 exp->type = 2;
9742 exp->string = PrintFloat(op1->f || value2);
9743 if(!exp->expType)
9744 {
9745 exp->expType = op1->type;
9746 if(op1->type)
9747 op1->type->refCount++;
9748 }
9749 return 0x1;
9750 }
9751
9752 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9753 {
9754 double value2 = op2->d;
9755
9756 exp->type = 2;
9757 exp->string = PrintDouble(op1->d || value2);
9758 if(!exp->expType)
9759 {
9760 exp->expType = op1->type;
9761 if(op1->type)
9762 op1->type->refCount++;
9763 }
9764 return 0x1;
9765 }
9766
9767 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9768 {
9769 int value2 = op2->i;
9770
9771 exp->type = 2;
9772 exp->string = PrintInt(op1->i > value2);
9773 if(!exp->expType)
9774 {
9775 exp->expType = op1->type;
9776 if(op1->type)
9777 op1->type->refCount++;
9778 }
9779 return 0x1;
9780 }
9781
9782 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9783 {
9784 unsigned int value2 = op2->ui;
9785
9786 exp->type = 2;
9787 exp->string = PrintUInt(op1->ui > value2);
9788 if(!exp->expType)
9789 {
9790 exp->expType = op1->type;
9791 if(op1->type)
9792 op1->type->refCount++;
9793 }
9794 return 0x1;
9795 }
9796
9797 static unsigned int Int64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9798 {
9799 long long value2 = op2->i64;
9800
9801 exp->type = 2;
9802 exp->string = PrintInt64(op1->i64 > value2);
9803 if(!exp->expType)
9804 {
9805 exp->expType = op1->type;
9806 if(op1->type)
9807 op1->type->refCount++;
9808 }
9809 return 0x1;
9810 }
9811
9812 static unsigned int UInt64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9813 {
9814 uint64 value2 = op2->ui64;
9815
9816 exp->type = 2;
9817 exp->string = PrintUInt64(op1->ui64 > value2);
9818 if(!exp->expType)
9819 {
9820 exp->expType = op1->type;
9821 if(op1->type)
9822 op1->type->refCount++;
9823 }
9824 return 0x1;
9825 }
9826
9827 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9828 {
9829 short value2 = op2->s;
9830
9831 exp->type = 2;
9832 exp->string = PrintShort(op1->s > value2);
9833 if(!exp->expType)
9834 {
9835 exp->expType = op1->type;
9836 if(op1->type)
9837 op1->type->refCount++;
9838 }
9839 return 0x1;
9840 }
9841
9842 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9843 {
9844 unsigned short value2 = op2->us;
9845
9846 exp->type = 2;
9847 exp->string = PrintUShort(op1->us > value2);
9848 if(!exp->expType)
9849 {
9850 exp->expType = op1->type;
9851 if(op1->type)
9852 op1->type->refCount++;
9853 }
9854 return 0x1;
9855 }
9856
9857 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9858 {
9859 char value2 = op2->c;
9860
9861 exp->type = 2;
9862 exp->string = PrintChar(op1->c > value2);
9863 if(!exp->expType)
9864 {
9865 exp->expType = op1->type;
9866 if(op1->type)
9867 op1->type->refCount++;
9868 }
9869 return 0x1;
9870 }
9871
9872 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9873 {
9874 unsigned char value2 = op2->uc;
9875
9876 exp->type = 2;
9877 exp->string = PrintUChar(op1->uc > value2);
9878 if(!exp->expType)
9879 {
9880 exp->expType = op1->type;
9881 if(op1->type)
9882 op1->type->refCount++;
9883 }
9884 return 0x1;
9885 }
9886
9887 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9888 {
9889 float value2 = op2->f;
9890
9891 exp->type = 2;
9892 exp->string = PrintFloat(op1->f > value2);
9893 if(!exp->expType)
9894 {
9895 exp->expType = op1->type;
9896 if(op1->type)
9897 op1->type->refCount++;
9898 }
9899 return 0x1;
9900 }
9901
9902 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9903 {
9904 double value2 = op2->d;
9905
9906 exp->type = 2;
9907 exp->string = PrintDouble(op1->d > value2);
9908 if(!exp->expType)
9909 {
9910 exp->expType = op1->type;
9911 if(op1->type)
9912 op1->type->refCount++;
9913 }
9914 return 0x1;
9915 }
9916
9917 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9918 {
9919 int value2 = op2->i;
9920
9921 exp->type = 2;
9922 exp->string = PrintInt(op1->i < value2);
9923 if(!exp->expType)
9924 {
9925 exp->expType = op1->type;
9926 if(op1->type)
9927 op1->type->refCount++;
9928 }
9929 return 0x1;
9930 }
9931
9932 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9933 {
9934 unsigned int value2 = op2->ui;
9935
9936 exp->type = 2;
9937 exp->string = PrintUInt(op1->ui < value2);
9938 if(!exp->expType)
9939 {
9940 exp->expType = op1->type;
9941 if(op1->type)
9942 op1->type->refCount++;
9943 }
9944 return 0x1;
9945 }
9946
9947 static unsigned int Int64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9948 {
9949 long long value2 = op2->i64;
9950
9951 exp->type = 2;
9952 exp->string = PrintInt64(op1->i64 < value2);
9953 if(!exp->expType)
9954 {
9955 exp->expType = op1->type;
9956 if(op1->type)
9957 op1->type->refCount++;
9958 }
9959 return 0x1;
9960 }
9961
9962 static unsigned int UInt64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9963 {
9964 uint64 value2 = op2->ui64;
9965
9966 exp->type = 2;
9967 exp->string = PrintUInt64(op1->ui64 < value2);
9968 if(!exp->expType)
9969 {
9970 exp->expType = op1->type;
9971 if(op1->type)
9972 op1->type->refCount++;
9973 }
9974 return 0x1;
9975 }
9976
9977 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9978 {
9979 short value2 = op2->s;
9980
9981 exp->type = 2;
9982 exp->string = PrintShort(op1->s < value2);
9983 if(!exp->expType)
9984 {
9985 exp->expType = op1->type;
9986 if(op1->type)
9987 op1->type->refCount++;
9988 }
9989 return 0x1;
9990 }
9991
9992 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9993 {
9994 unsigned short value2 = op2->us;
9995
9996 exp->type = 2;
9997 exp->string = PrintUShort(op1->us < value2);
9998 if(!exp->expType)
9999 {
10000 exp->expType = op1->type;
10001 if(op1->type)
10002 op1->type->refCount++;
10003 }
10004 return 0x1;
10005 }
10006
10007 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10008 {
10009 char value2 = op2->c;
10010
10011 exp->type = 2;
10012 exp->string = PrintChar(op1->c < value2);
10013 if(!exp->expType)
10014 {
10015 exp->expType = op1->type;
10016 if(op1->type)
10017 op1->type->refCount++;
10018 }
10019 return 0x1;
10020 }
10021
10022 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10023 {
10024 unsigned char value2 = op2->uc;
10025
10026 exp->type = 2;
10027 exp->string = PrintUChar(op1->uc < value2);
10028 if(!exp->expType)
10029 {
10030 exp->expType = op1->type;
10031 if(op1->type)
10032 op1->type->refCount++;
10033 }
10034 return 0x1;
10035 }
10036
10037 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10038 {
10039 float value2 = op2->f;
10040
10041 exp->type = 2;
10042 exp->string = PrintFloat(op1->f < value2);
10043 if(!exp->expType)
10044 {
10045 exp->expType = op1->type;
10046 if(op1->type)
10047 op1->type->refCount++;
10048 }
10049 return 0x1;
10050 }
10051
10052 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10053 {
10054 double value2 = op2->d;
10055
10056 exp->type = 2;
10057 exp->string = PrintDouble(op1->d < value2);
10058 if(!exp->expType)
10059 {
10060 exp->expType = op1->type;
10061 if(op1->type)
10062 op1->type->refCount++;
10063 }
10064 return 0x1;
10065 }
10066
10067 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10068 {
10069 int value2 = op2->i;
10070
10071 exp->type = 2;
10072 exp->string = PrintInt(op1->i >= value2);
10073 if(!exp->expType)
10074 {
10075 exp->expType = op1->type;
10076 if(op1->type)
10077 op1->type->refCount++;
10078 }
10079 return 0x1;
10080 }
10081
10082 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10083 {
10084 unsigned int value2 = op2->ui;
10085
10086 exp->type = 2;
10087 exp->string = PrintUInt(op1->ui >= value2);
10088 if(!exp->expType)
10089 {
10090 exp->expType = op1->type;
10091 if(op1->type)
10092 op1->type->refCount++;
10093 }
10094 return 0x1;
10095 }
10096
10097 static unsigned int Int64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10098 {
10099 long long value2 = op2->i64;
10100
10101 exp->type = 2;
10102 exp->string = PrintInt64(op1->i64 >= value2);
10103 if(!exp->expType)
10104 {
10105 exp->expType = op1->type;
10106 if(op1->type)
10107 op1->type->refCount++;
10108 }
10109 return 0x1;
10110 }
10111
10112 static unsigned int UInt64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10113 {
10114 uint64 value2 = op2->ui64;
10115
10116 exp->type = 2;
10117 exp->string = PrintUInt64(op1->ui64 >= value2);
10118 if(!exp->expType)
10119 {
10120 exp->expType = op1->type;
10121 if(op1->type)
10122 op1->type->refCount++;
10123 }
10124 return 0x1;
10125 }
10126
10127 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10128 {
10129 short value2 = op2->s;
10130
10131 exp->type = 2;
10132 exp->string = PrintShort(op1->s >= value2);
10133 if(!exp->expType)
10134 {
10135 exp->expType = op1->type;
10136 if(op1->type)
10137 op1->type->refCount++;
10138 }
10139 return 0x1;
10140 }
10141
10142 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10143 {
10144 unsigned short value2 = op2->us;
10145
10146 exp->type = 2;
10147 exp->string = PrintUShort(op1->us >= value2);
10148 if(!exp->expType)
10149 {
10150 exp->expType = op1->type;
10151 if(op1->type)
10152 op1->type->refCount++;
10153 }
10154 return 0x1;
10155 }
10156
10157 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10158 {
10159 char value2 = op2->c;
10160
10161 exp->type = 2;
10162 exp->string = PrintChar(op1->c >= value2);
10163 if(!exp->expType)
10164 {
10165 exp->expType = op1->type;
10166 if(op1->type)
10167 op1->type->refCount++;
10168 }
10169 return 0x1;
10170 }
10171
10172 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10173 {
10174 unsigned char value2 = op2->uc;
10175
10176 exp->type = 2;
10177 exp->string = PrintUChar(op1->uc >= value2);
10178 if(!exp->expType)
10179 {
10180 exp->expType = op1->type;
10181 if(op1->type)
10182 op1->type->refCount++;
10183 }
10184 return 0x1;
10185 }
10186
10187 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10188 {
10189 float value2 = op2->f;
10190
10191 exp->type = 2;
10192 exp->string = PrintFloat(op1->f >= value2);
10193 if(!exp->expType)
10194 {
10195 exp->expType = op1->type;
10196 if(op1->type)
10197 op1->type->refCount++;
10198 }
10199 return 0x1;
10200 }
10201
10202 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10203 {
10204 double value2 = op2->d;
10205
10206 exp->type = 2;
10207 exp->string = PrintDouble(op1->d >= value2);
10208 if(!exp->expType)
10209 {
10210 exp->expType = op1->type;
10211 if(op1->type)
10212 op1->type->refCount++;
10213 }
10214 return 0x1;
10215 }
10216
10217 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10218 {
10219 int value2 = op2->i;
10220
10221 exp->type = 2;
10222 exp->string = PrintInt(op1->i <= value2);
10223 if(!exp->expType)
10224 {
10225 exp->expType = op1->type;
10226 if(op1->type)
10227 op1->type->refCount++;
10228 }
10229 return 0x1;
10230 }
10231
10232 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10233 {
10234 unsigned int value2 = op2->ui;
10235
10236 exp->type = 2;
10237 exp->string = PrintUInt(op1->ui <= value2);
10238 if(!exp->expType)
10239 {
10240 exp->expType = op1->type;
10241 if(op1->type)
10242 op1->type->refCount++;
10243 }
10244 return 0x1;
10245 }
10246
10247 static unsigned int Int64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10248 {
10249 long long value2 = op2->i64;
10250
10251 exp->type = 2;
10252 exp->string = PrintInt64(op1->i64 <= value2);
10253 if(!exp->expType)
10254 {
10255 exp->expType = op1->type;
10256 if(op1->type)
10257 op1->type->refCount++;
10258 }
10259 return 0x1;
10260 }
10261
10262 static unsigned int UInt64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10263 {
10264 uint64 value2 = op2->ui64;
10265
10266 exp->type = 2;
10267 exp->string = PrintUInt64(op1->ui64 <= value2);
10268 if(!exp->expType)
10269 {
10270 exp->expType = op1->type;
10271 if(op1->type)
10272 op1->type->refCount++;
10273 }
10274 return 0x1;
10275 }
10276
10277 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10278 {
10279 short value2 = op2->s;
10280
10281 exp->type = 2;
10282 exp->string = PrintShort(op1->s <= value2);
10283 if(!exp->expType)
10284 {
10285 exp->expType = op1->type;
10286 if(op1->type)
10287 op1->type->refCount++;
10288 }
10289 return 0x1;
10290 }
10291
10292 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10293 {
10294 unsigned short value2 = op2->us;
10295
10296 exp->type = 2;
10297 exp->string = PrintUShort(op1->us <= value2);
10298 if(!exp->expType)
10299 {
10300 exp->expType = op1->type;
10301 if(op1->type)
10302 op1->type->refCount++;
10303 }
10304 return 0x1;
10305 }
10306
10307 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10308 {
10309 char value2 = op2->c;
10310
10311 exp->type = 2;
10312 exp->string = PrintChar(op1->c <= value2);
10313 if(!exp->expType)
10314 {
10315 exp->expType = op1->type;
10316 if(op1->type)
10317 op1->type->refCount++;
10318 }
10319 return 0x1;
10320 }
10321
10322 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10323 {
10324 unsigned char value2 = op2->uc;
10325
10326 exp->type = 2;
10327 exp->string = PrintUChar(op1->uc <= value2);
10328 if(!exp->expType)
10329 {
10330 exp->expType = op1->type;
10331 if(op1->type)
10332 op1->type->refCount++;
10333 }
10334 return 0x1;
10335 }
10336
10337 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10338 {
10339 float value2 = op2->f;
10340
10341 exp->type = 2;
10342 exp->string = PrintFloat(op1->f <= value2);
10343 if(!exp->expType)
10344 {
10345 exp->expType = op1->type;
10346 if(op1->type)
10347 op1->type->refCount++;
10348 }
10349 return 0x1;
10350 }
10351
10352 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10353 {
10354 double value2 = op2->d;
10355
10356 exp->type = 2;
10357 exp->string = PrintDouble(op1->d <= value2);
10358 if(!exp->expType)
10359 {
10360 exp->expType = op1->type;
10361 if(op1->type)
10362 op1->type->refCount++;
10363 }
10364 return 0x1;
10365 }
10366
10367 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10368 {
10369 exp->type = 2;
10370 exp->string = PrintInt(op1->i ? op2->i : op3->i);
10371 if(!exp->expType)
10372 {
10373 exp->expType = op1->type;
10374 if(op1->type)
10375 op1->type->refCount++;
10376 }
10377 return 0x1;
10378 }
10379
10380 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10381 {
10382 exp->type = 2;
10383 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
10384 if(!exp->expType)
10385 {
10386 exp->expType = op1->type;
10387 if(op1->type)
10388 op1->type->refCount++;
10389 }
10390 return 0x1;
10391 }
10392
10393 static unsigned int Int64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10394 {
10395 exp->type = 2;
10396 exp->string = PrintInt64(op1->i64 ? op2->i64 : op3->i64);
10397 if(!exp->expType)
10398 {
10399 exp->expType = op1->type;
10400 if(op1->type)
10401 op1->type->refCount++;
10402 }
10403 return 0x1;
10404 }
10405
10406 static unsigned int UInt64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10407 {
10408 exp->type = 2;
10409 exp->string = PrintUInt64(op1->ui64 ? op2->ui64 : op3->ui64);
10410 if(!exp->expType)
10411 {
10412 exp->expType = op1->type;
10413 if(op1->type)
10414 op1->type->refCount++;
10415 }
10416 return 0x1;
10417 }
10418
10419 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10420 {
10421 exp->type = 2;
10422 exp->string = PrintShort(op1->s ? op2->s : op3->s);
10423 if(!exp->expType)
10424 {
10425 exp->expType = op1->type;
10426 if(op1->type)
10427 op1->type->refCount++;
10428 }
10429 return 0x1;
10430 }
10431
10432 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10433 {
10434 exp->type = 2;
10435 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
10436 if(!exp->expType)
10437 {
10438 exp->expType = op1->type;
10439 if(op1->type)
10440 op1->type->refCount++;
10441 }
10442 return 0x1;
10443 }
10444
10445 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10446 {
10447 exp->type = 2;
10448 exp->string = PrintChar(op1->c ? op2->c : op3->c);
10449 if(!exp->expType)
10450 {
10451 exp->expType = op1->type;
10452 if(op1->type)
10453 op1->type->refCount++;
10454 }
10455 return 0x1;
10456 }
10457
10458 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10459 {
10460 exp->type = 2;
10461 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
10462 if(!exp->expType)
10463 {
10464 exp->expType = op1->type;
10465 if(op1->type)
10466 op1->type->refCount++;
10467 }
10468 return 0x1;
10469 }
10470
10471 static unsigned int FloatCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10472 {
10473 exp->type = 2;
10474 exp->string = PrintFloat(op1->f ? op2->f : op3->f);
10475 if(!exp->expType)
10476 {
10477 exp->expType = op1->type;
10478 if(op1->type)
10479 op1->type->refCount++;
10480 }
10481 return 0x1;
10482 }
10483
10484 static unsigned int DoubleCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10485 {
10486 exp->type = 2;
10487 exp->string = PrintDouble(op1->d ? op2->d : op3->d);
10488 if(!exp->expType)
10489 {
10490 exp->expType = op1->type;
10491 if(op1->type)
10492 op1->type->refCount++;
10493 }
10494 return 0x1;
10495 }
10496
10497 struct OpTable intOps = 
10498 {
10499 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
10500 };
10501
10502 struct OpTable uintOps = 
10503 {
10504 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
10505 };
10506
10507 struct OpTable int64Ops = 
10508 {
10509 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
10510 };
10511
10512 struct OpTable uint64Ops = 
10513 {
10514 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
10515 };
10516
10517 struct OpTable shortOps = 
10518 {
10519 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
10520 };
10521
10522 struct OpTable ushortOps = 
10523 {
10524 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
10525 };
10526
10527 struct OpTable floatOps = 
10528 {
10529 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
10530 };
10531
10532 struct OpTable doubleOps = 
10533 {
10534 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
10535 };
10536
10537 struct OpTable charOps = 
10538 {
10539 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
10540 };
10541
10542 struct OpTable ucharOps = 
10543 {
10544 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
10545 };
10546
10547 void ReadString(char * output, char * string)
10548 {
10549 int len = strlen(string);
10550 int c, d = 0;
10551 unsigned int quoted = 0x0, escaped = 0x0;
10552
10553 for(c = 0; c < len; c++)
10554 {
10555 char ch = string[c];
10556
10557 if(escaped)
10558 {
10559 switch(ch)
10560 {
10561 case 'n':
10562 output[d] = '\n';
10563 break;
10564 case 't':
10565 output[d] = '\t';
10566 break;
10567 case 'a':
10568 output[d] = '\a';
10569 break;
10570 case 'b':
10571 output[d] = '\b';
10572 break;
10573 case 'f':
10574 output[d] = '\f';
10575 break;
10576 case 'r':
10577 output[d] = '\r';
10578 break;
10579 case 'v':
10580 output[d] = '\v';
10581 break;
10582 case '\\':
10583 output[d] = '\\';
10584 break;
10585 case '\"':
10586 output[d] = '\"';
10587 break;
10588 case '\'':
10589 output[d] = '\'';
10590 break;
10591 default:
10592 output[d] = ch;
10593 }
10594 d++;
10595 escaped = 0x0;
10596 }
10597 else
10598 {
10599 if(ch == '\"')
10600 quoted ^= 0x1;
10601 else if(quoted)
10602 {
10603 if(ch == '\\')
10604 escaped = 0x1;
10605 else
10606 output[d++] = ch;
10607 }
10608 }
10609 }
10610 output[d] = '\0';
10611 }
10612
10613 int UnescapeString(char * d, char * s, int len)
10614 {
10615 int j = 0, k = 0;
10616 char ch;
10617
10618 while(j < len && (ch = s[j]))
10619 {
10620 switch(ch)
10621 {
10622 case '\\':
10623 switch((ch = s[++j]))
10624 {
10625 case 'n':
10626 d[k] = '\n';
10627 break;
10628 case 't':
10629 d[k] = '\t';
10630 break;
10631 case 'a':
10632 d[k] = '\a';
10633 break;
10634 case 'b':
10635 d[k] = '\b';
10636 break;
10637 case 'f':
10638 d[k] = '\f';
10639 break;
10640 case 'r':
10641 d[k] = '\r';
10642 break;
10643 case 'v':
10644 d[k] = '\v';
10645 break;
10646 case '\\':
10647 d[k] = '\\';
10648 break;
10649 case '\"':
10650 d[k] = '\"';
10651 break;
10652 case '\'':
10653 d[k] = '\'';
10654 break;
10655 default:
10656 d[k] = '\\';
10657 d[k] = ch;
10658 }
10659 break;
10660 default:
10661 d[k] = ch;
10662 }
10663 j++, k++;
10664 }
10665 d[k] = '\0';
10666 return k;
10667 }
10668
10669 char * OffsetEscapedString(char * s, int len, int offset)
10670 {
10671 char ch;
10672 int j = 0, k = 0;
10673
10674 while(j < len && k < offset && (ch = s[j]))
10675 {
10676 if(ch == '\\')
10677 ++j;
10678 j++, k++;
10679 }
10680 return (k == offset) ? s + j : (((void *)0));
10681 }
10682
10683 extern long long __ecereNameSpace__ecere__com___strtoi64(char *  string, char * *  endString, int base);
10684
10685 extern uint64 __ecereNameSpace__ecere__com___strtoui64(char *  string, char * *  endString, int base);
10686
10687 extern double strtod(char * , char * * );
10688
10689 extern float (* __ecereMethod_float_inf)(void);
10690
10691 extern float (* __ecereMethod_float_nan)(void);
10692
10693 extern double (* __ecereMethod_double_inf)(void);
10694
10695 extern double (* __ecereMethod_double_nan)(void);
10696
10697 struct Operand GetOperand(struct Expression * exp)
10698 {
10699 struct Operand op = 
10700 {
10701 0, 0, 0, 0, 
10702 {
10703 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10704 }
10705 };
10706 struct Type * type = exp->expType;
10707
10708 if(type)
10709 {
10710 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
10711 {
10712 if(!type->_class->registered->dataType)
10713 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
10714 type = type->_class->registered->dataType;
10715 }
10716 if(exp->type == 3 && op.kind == 13)
10717 {
10718 op.ui64 = (uint64)exp->string;
10719 op.kind = 13;
10720 op.ops = uint64Ops;
10721 }
10722 else if(exp->isConstant && exp->type == 2)
10723 {
10724 op.kind = type->kind;
10725 op.type = exp->expType;
10726 switch(op.kind)
10727 {
10728 case 24:
10729 case 1:
10730 {
10731 if(exp->constant[0] == '\'')
10732 {
10733 op.c = exp->constant[1];
10734 op.ops = charOps;
10735 }
10736 else if(type->isSigned)
10737 {
10738 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
10739 op.ops = charOps;
10740 }
10741 else
10742 {
10743 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
10744 op.ops = ucharOps;
10745 }
10746 break;
10747 }
10748 case 2:
10749 if(type->isSigned)
10750 {
10751 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
10752 op.ops = shortOps;
10753 }
10754 else
10755 {
10756 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
10757 op.ops = ushortOps;
10758 }
10759 break;
10760 case 3:
10761 case 5:
10762 if(type->isSigned)
10763 {
10764 op.i = strtol(exp->constant, (((void *)0)), 0);
10765 op.ops = intOps;
10766 }
10767 else
10768 {
10769 op.ui = strtoul(exp->constant, (((void *)0)), 0);
10770 op.ops = uintOps;
10771 }
10772 op.kind = 3;
10773 break;
10774 case 4:
10775 if(type->isSigned)
10776 {
10777 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10778 op.ops = int64Ops;
10779 }
10780 else
10781 {
10782 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10783 op.ops = uint64Ops;
10784 }
10785 op.kind = 4;
10786 break;
10787 case 22:
10788 if(type->isSigned)
10789 {
10790 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10791 op.ops = int64Ops;
10792 }
10793 else
10794 {
10795 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10796 op.ops = uint64Ops;
10797 }
10798 op.kind = 4;
10799 break;
10800 case 23:
10801 if(type->isSigned)
10802 {
10803 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10804 op.ops = int64Ops;
10805 }
10806 else
10807 {
10808 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10809 op.ops = uint64Ops;
10810 }
10811 op.kind = 4;
10812 break;
10813 case 6:
10814 if(!strcmp(exp->constant, "inf"))
10815 op.f = __ecereMethod_float_inf();
10816 else if(!strcmp(exp->constant, "-inf"))
10817 op.f = -__ecereMethod_float_inf();
10818 else if(!strcmp(exp->constant, "nan"))
10819 op.f = __ecereMethod_float_nan();
10820 else if(!strcmp(exp->constant, "-nan"))
10821 op.f = -__ecereMethod_float_nan();
10822 else
10823 op.f = (float)strtod(exp->constant, (((void *)0)));
10824 op.ops = floatOps;
10825 break;
10826 case 7:
10827 if(!strcmp(exp->constant, "inf"))
10828 op.d = __ecereMethod_double_inf();
10829 else if(!strcmp(exp->constant, "-inf"))
10830 op.d = -__ecereMethod_double_inf();
10831 else if(!strcmp(exp->constant, "nan"))
10832 op.d = __ecereMethod_double_nan();
10833 else if(!strcmp(exp->constant, "-nan"))
10834 op.d = -__ecereMethod_double_nan();
10835 else
10836 op.d = (double)strtod(exp->constant, (((void *)0)));
10837 op.ops = doubleOps;
10838 break;
10839 case 12:
10840 case 13:
10841 case 8:
10842 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10843 op.kind = 13;
10844 op.ops = uint64Ops;
10845 break;
10846 }
10847 }
10848 }
10849 return op;
10850 }
10851
10852 int __ecereVMethodID_class_OnGetString;
10853
10854 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
10855
10856 static void UnusedFunction()
10857 {
10858 int a;
10859
10860 ((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);
10861 }
10862
10863 extern int __ecereVMethodID_class_OnGetString;
10864
10865 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
10866 {
10867 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10868
10869 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
10870 {
10871 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
10872 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
10873 else
10874 {
10875 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10876 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
10877 struct Type * type;
10878 void * ptr = inst->data + dataMember->offset + offset;
10879 char * result = (((void *)0));
10880
10881 exp->loc = member->loc = inst->loc;
10882 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
10883 if(!dataMember->dataType)
10884 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
10885 type = dataMember->dataType;
10886 if(type->kind == 8)
10887 {
10888 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10889
10890 if(_class->type == 4)
10891 {
10892 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
10893
10894 if(enumClass)
10895 {
10896 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
10897 struct __ecereNameSpace__ecere__sys__NamedLink * item;
10898
10899 for(item = e->values.first; item; item = item->next)
10900 {
10901 if((int)item->data == *(int *)ptr)
10902 {
10903 result = item->name;
10904 break;
10905 }
10906 }
10907 if(result)
10908 {
10909 exp->identifier = MkIdentifier(result);
10910 exp->type = 0;
10911 exp->destType = MkClassType(_class->fullName);
10912 ProcessExpressionType(exp);
10913 }
10914 }
10915 }
10916 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
10917 {
10918 if(!_class->dataType)
10919 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10920 type = _class->dataType;
10921 }
10922 }
10923 if(!result)
10924 {
10925 switch(type->kind)
10926 {
10927 case 6:
10928 {
10929 FreeExpContents(exp);
10930 exp->constant = PrintFloat(*(float *)ptr);
10931 exp->type = 2;
10932 break;
10933 }
10934 case 7:
10935 {
10936 FreeExpContents(exp);
10937 exp->constant = PrintDouble(*(double *)ptr);
10938 exp->type = 2;
10939 break;
10940 }
10941 case 3:
10942 {
10943 FreeExpContents(exp);
10944 exp->constant = PrintInt(*(int *)ptr);
10945 exp->type = 2;
10946 break;
10947 }
10948 case 4:
10949 {
10950 FreeExpContents(exp);
10951 exp->constant = PrintInt64(*(long long *)ptr);
10952 exp->type = 2;
10953 break;
10954 }
10955 case 22:
10956 {
10957 FreeExpContents(exp);
10958 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
10959 exp->type = 2;
10960 break;
10961 }
10962 case 23:
10963 {
10964 FreeExpContents(exp);
10965 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
10966 exp->type = 2;
10967 break;
10968 }
10969 default:
10970 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
10971 }
10972 }
10973 ListAdd(memberList, member);
10974 }
10975 if(parentDataMember->type == 1)
10976 break;
10977 }
10978 }
10979
10980 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
10981
10982 void PopulateInstance(struct Instantiation * inst)
10983 {
10984 struct Symbol * classSym = inst->_class->symbol;
10985 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
10986 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10987 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
10988
10989 if(!inst->members)
10990 inst->members = MkListOne(MkMembersInitList(memberList));
10991 else
10992 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
10993 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
10994 {
10995 if(!dataMember->isProperty)
10996 {
10997 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
10998 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
10999 else
11000 {
11001 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11002 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
11003 struct Type * type;
11004 void * ptr = inst->data + dataMember->offset;
11005 char * result = (((void *)0));
11006
11007 exp->loc = member->loc = inst->loc;
11008 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
11009 if(!dataMember->dataType)
11010 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
11011 type = dataMember->dataType;
11012 if(type->kind == 8)
11013 {
11014 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11015
11016 if(_class->type == 4)
11017 {
11018 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11019
11020 if(enumClass)
11021 {
11022 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
11023 struct __ecereNameSpace__ecere__sys__NamedLink * item;
11024
11025 for(item = e->values.first; item; item = item->next)
11026 {
11027 if((int)item->data == *(int *)ptr)
11028 {
11029 result = item->name;
11030 break;
11031 }
11032 }
11033 }
11034 if(result)
11035 {
11036 exp->identifier = MkIdentifier(result);
11037 exp->type = 0;
11038 exp->destType = MkClassType(_class->fullName);
11039 ProcessExpressionType(exp);
11040 }
11041 }
11042 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
11043 {
11044 if(!_class->dataType)
11045 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11046 type = _class->dataType;
11047 }
11048 }
11049 if(!result)
11050 {
11051 switch(type->kind)
11052 {
11053 case 6:
11054 {
11055 exp->constant = PrintFloat(*(float *)ptr);
11056 exp->type = 2;
11057 break;
11058 }
11059 case 7:
11060 {
11061 exp->constant = PrintDouble(*(double *)ptr);
11062 exp->type = 2;
11063 break;
11064 }
11065 case 3:
11066 {
11067 exp->constant = PrintInt(*(int *)ptr);
11068 exp->type = 2;
11069 break;
11070 }
11071 case 4:
11072 {
11073 exp->constant = PrintInt64(*(long long *)ptr);
11074 exp->type = 2;
11075 break;
11076 }
11077 case 22:
11078 {
11079 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
11080 exp->type = 2;
11081 break;
11082 }
11083 default:
11084 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
11085 }
11086 }
11087 ListAdd(memberList, member);
11088 }
11089 }
11090 }
11091 }
11092
11093 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);
11094
11095 extern void FreeInstance(struct Instantiation * inst);
11096
11097 void ComputeInstantiation(struct Expression * exp)
11098 {
11099 struct Instantiation * inst = exp->instance;
11100 struct MembersInit * members;
11101 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
11102 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
11103 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
11104 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
11105 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
11106 int subMemberStackPos = 0;
11107 uint64 bits = 0;
11108
11109 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11110 {
11111 if(inst->data)
11112 return ;
11113 if(_class->type == 0 || _class->type == 5)
11114 {
11115 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
11116 if(_class->type == 0)
11117 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)inst->data))->_refCount++;
11118 }
11119 else
11120 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11121 }
11122 if(inst->members)
11123 {
11124 for(members = (*inst->members).first; members; members = members->next)
11125 {
11126 switch(members->type)
11127 {
11128 case 0:
11129 {
11130 if(members->dataMembers)
11131 {
11132 struct MemberInit * member;
11133
11134 for(member = (*members->dataMembers).first; member; member = member->next)
11135 {
11136 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
11137 unsigned int found = 0x0;
11138 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11139 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
11140 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
11141 unsigned int dataMemberOffset;
11142
11143 if(!ident)
11144 {
11145 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
11146 if(curMember)
11147 {
11148 if(curMember->isProperty)
11149 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
11150 else
11151 {
11152 dataMember = curMember;
11153 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11154 if(_class->type == 0)
11155 dataMemberOffset += _class->base->structSize;
11156 }
11157 found = 0x1;
11158 }
11159 }
11160 else
11161 {
11162 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
11163 if(prop)
11164 {
11165 found = 0x1;
11166 if(prop->memberAccess == 1)
11167 {
11168 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
11169 curClass = prop->_class;
11170 }
11171 }
11172 else
11173 {
11174 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
11175 int _subMemberStackPos = 0;
11176
11177 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
11178 if(dataMember)
11179 {
11180 found = 0x1;
11181 if(dataMember->memberAccess == 1)
11182 {
11183 curMember = dataMember;
11184 curClass = dataMember->_class;
11185 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
11186 subMemberStackPos = _subMemberStackPos;
11187 }
11188 }
11189 }
11190 }
11191 if(found && member->initializer && member->initializer->type == 0)
11192 {
11193 struct Expression * value = member->initializer->exp;
11194 struct Type * type = (((void *)0));
11195 unsigned int deepMember = 0x0;
11196
11197 if(prop)
11198 {
11199 type = prop->dataType;
11200 }
11201 else if(dataMember)
11202 {
11203 if(!dataMember->dataType)
11204 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
11205 type = dataMember->dataType;
11206 }
11207 if(ident && ident->next)
11208 {
11209 deepMember = 0x1;
11210 for(ident = ident->next; ident && type; ident = ident->next)
11211 {
11212 if(type->kind == 8)
11213 {
11214 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
11215 if(prop)
11216 type = prop->dataType;
11217 else
11218 {
11219 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11220 if(dataMember)
11221 type = dataMember->dataType;
11222 }
11223 }
11224 else if(type->kind == 9 || type->kind == 10)
11225 {
11226 struct Type * memberType;
11227
11228 for(memberType = type->members.first; memberType; memberType = memberType->next)
11229 {
11230 if(!strcmp(memberType->name, ident->string))
11231 {
11232 type = memberType;
11233 break;
11234 }
11235 }
11236 }
11237 }
11238 }
11239 if(value)
11240 {
11241 FreeType(value->destType);
11242 value->destType = type;
11243 if(type)
11244 type->refCount++;
11245 ComputeExpression(value);
11246 }
11247 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11248 {
11249 if(type->kind == 8)
11250 {
11251 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11252
11253 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
11254 {
11255 if(!_class->dataType)
11256 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11257 type = _class->dataType;
11258 }
11259 }
11260 if(dataMember)
11261 {
11262 void * ptr = inst->data + dataMemberOffset;
11263
11264 if(value->type == 2)
11265 {
11266 switch(type->kind)
11267 {
11268 case 3:
11269 {
11270 GetInt(value, (int *)ptr);
11271 break;
11272 }
11273 case 4:
11274 {
11275 GetInt64(value, (long long *)ptr);
11276 break;
11277 }
11278 case 22:
11279 {
11280 GetIntPtr(value, (intptr_t *)ptr);
11281 break;
11282 }
11283 case 23:
11284 {
11285 GetIntSize(value, (ssize_t *)ptr);
11286 break;
11287 }
11288 case 6:
11289 {
11290 GetFloat(value, (float *)ptr);
11291 break;
11292 }
11293 case 7:
11294 {
11295 GetDouble(value, (double *)ptr);
11296 break;
11297 }
11298 }
11299 }
11300 else if(value->type == 1)
11301 {
11302 if(type->kind == 8)
11303 {
11304 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11305
11306 if(_class->type == 1)
11307 {
11308 ComputeTypeSize(type);
11309 if(value->instance->data)
11310 memcpy(ptr, value->instance->data, type->size);
11311 }
11312 }
11313 }
11314 }
11315 else if(prop)
11316 {
11317 if(value->type == 1 && value->instance->data)
11318 {
11319 if(type->kind == 8)
11320 {
11321 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11322
11323 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)))
11324 {
11325 void (* Set)(void *, void *) = (void *)prop->Set;
11326
11327 Set(inst->data, value->instance->data);
11328 PopulateInstance(inst);
11329 }
11330 }
11331 }
11332 else if(value->type == 2)
11333 {
11334 switch(type->kind)
11335 {
11336 case 7:
11337 {
11338 void (* Set)(void *, double) = (void *)prop->Set;
11339
11340 Set(inst->data, strtod(value->constant, (((void *)0))));
11341 break;
11342 }
11343 case 6:
11344 {
11345 void (* Set)(void *, float) = (void *)prop->Set;
11346
11347 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
11348 break;
11349 }
11350 case 3:
11351 {
11352 void (* Set)(void *, int) = (void *)prop->Set;
11353
11354 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
11355 break;
11356 }
11357 case 4:
11358 {
11359 void (* Set)(void *, long long) = (void *)prop->Set;
11360
11361 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11362 break;
11363 }
11364 case 22:
11365 {
11366 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11367
11368 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11369 break;
11370 }
11371 case 23:
11372 {
11373 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11374
11375 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11376 break;
11377 }
11378 }
11379 }
11380 else if(value->type == 3)
11381 {
11382 char temp[1024];
11383
11384 ReadString(temp, value->string);
11385 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
11386 }
11387 }
11388 }
11389 else if(!deepMember && type && _class->type == 3)
11390 {
11391 if(prop)
11392 {
11393 if(value->type == 2)
11394 {
11395 if(type->kind == 8)
11396 {
11397 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11398
11399 if(_class->type == 3)
11400 {
11401 if(!_class->dataType)
11402 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11403 type = _class->dataType;
11404 }
11405 }
11406 switch(type->kind)
11407 {
11408 case 6:
11409 {
11410 float fValue;
11411 float (* Set)(float) = (void *)prop->Set;
11412
11413 GetFloat(member->initializer->exp, &fValue);
11414 exp->constant = PrintFloat(Set(fValue));
11415 exp->type = 2;
11416 break;
11417 }
11418 case 7:
11419 {
11420 double dValue;
11421 double (* Set)(double) = (void *)prop->Set;
11422
11423 GetDouble(member->initializer->exp, &dValue);
11424 exp->constant = PrintDouble(Set(dValue));
11425 exp->type = 2;
11426 break;
11427 }
11428 }
11429 }
11430 }
11431 }
11432 else if(!deepMember && type && _class->type == 2)
11433 {
11434 if(prop)
11435 {
11436 if(value->type == 1 && value->instance->data)
11437 {
11438 unsigned int (* Set)(void *) = (void *)prop->Set;
11439
11440 bits = Set(value->instance->data);
11441 }
11442 else if(value->type == 2)
11443 {
11444 }
11445 }
11446 else if(dataMember)
11447 {
11448 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
11449 struct Type * type;
11450 int part = 0;
11451
11452 GetInt(value, &part);
11453 bits = (bits & ~bitMember->mask);
11454 if(!bitMember->dataType)
11455 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
11456 type = bitMember->dataType;
11457 if(type->kind == 8 && type->_class && type->_class->registered)
11458 {
11459 if(!type->_class->registered->dataType)
11460 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
11461 type = type->_class->registered->dataType;
11462 }
11463 switch(type->kind)
11464 {
11465 case 24:
11466 case 1:
11467 if(type->isSigned)
11468 bits |= ((char)part << bitMember->pos);
11469 else
11470 bits |= ((unsigned char)part << bitMember->pos);
11471 break;
11472 case 2:
11473 if(type->isSigned)
11474 bits |= ((short)part << bitMember->pos);
11475 else
11476 bits |= ((unsigned short)part << bitMember->pos);
11477 break;
11478 case 3:
11479 case 5:
11480 if(type->isSigned)
11481 bits |= (part << bitMember->pos);
11482 else
11483 bits |= ((unsigned int)part << bitMember->pos);
11484 break;
11485 case 4:
11486 if(type->isSigned)
11487 bits |= ((long long)part << bitMember->pos);
11488 else
11489 bits |= ((uint64)part << bitMember->pos);
11490 break;
11491 case 22:
11492 if(type->isSigned)
11493 {
11494 bits |= ((intptr_t)part << bitMember->pos);
11495 }
11496 else
11497 {
11498 bits |= ((uintptr_t)part << bitMember->pos);
11499 }
11500 break;
11501 case 23:
11502 if(type->isSigned)
11503 {
11504 bits |= ((ssize_t)part << bitMember->pos);
11505 }
11506 else
11507 {
11508 bits |= ((size_t)part << bitMember->pos);
11509 }
11510 break;
11511 }
11512 }
11513 }
11514 }
11515 else
11516 {
11517 if(_class && _class->type == 3)
11518 {
11519 ComputeExpression(member->initializer->exp);
11520 exp->constant = member->initializer->exp->constant;
11521 exp->type = 2;
11522 member->initializer->exp->constant = (((void *)0));
11523 }
11524 }
11525 }
11526 }
11527 break;
11528 }
11529 }
11530 }
11531 }
11532 if(_class && _class->type == 2)
11533 {
11534 exp->constant = PrintHexUInt(bits);
11535 exp->type = 2;
11536 }
11537 if(exp->type != 1)
11538 {
11539 FreeInstance(inst);
11540 }
11541 }
11542
11543 static unsigned int Promote(struct Operand * op, int kind, unsigned int isSigned)
11544 {
11545 unsigned int result = 0x0;
11546
11547 switch(kind)
11548 {
11549 case 2:
11550 if(op->kind == 1 || op->kind == 15 || op->kind == 24)
11551 result = isSigned ? GetOpShort(op, &op->s) : GetOpUShort(op, &op->us);
11552 break;
11553 case 3:
11554 case 5:
11555 if(op->kind == 1 || op->kind == 2 || op->kind == 15 || op->kind == 24)
11556 result = isSigned ? GetOpInt(op, &op->i) : GetOpUInt(op, &op->ui);
11557 break;
11558 case 4:
11559 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)
11560 result = isSigned ? GetOpInt64(op, &op->i64) : GetOpUInt64(op, &op->ui64);
11561 break;
11562 case 6:
11563 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)
11564 result = GetOpFloat(op, &op->f);
11565 break;
11566 case 7:
11567 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)
11568 result = GetOpDouble(op, &op->d);
11569 break;
11570 case 13:
11571 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)
11572 result = GetOpUIntPtr(op, &op->ui64);
11573 break;
11574 case 15:
11575 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)
11576 result = isSigned ? GetOpInt(op, &op->i) : GetOpUInt(op, &op->ui);
11577 break;
11578 case 22:
11579 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11580 result = isSigned ? GetOpIntPtr(op, &op->i64) : GetOpUIntPtr(op, &op->i64);
11581 break;
11582 case 23:
11583 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11584 result = isSigned ? GetOpIntSize(op, &op->ui64) : GetOpUIntSize(op, &op->ui64);
11585 break;
11586 }
11587 return result;
11588 }
11589
11590 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
11591 {
11592 if(exp->op.op == SIZEOF)
11593 {
11594 FreeExpContents(exp);
11595 exp->type = 2;
11596 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
11597 }
11598 else
11599 {
11600 if(!exp->op.exp1)
11601 {
11602 switch(exp->op.op)
11603 {
11604 case '+':
11605 {
11606 struct Expression * exp2 = exp->op.exp2;
11607
11608 exp->op.exp2 = (((void *)0));
11609 FreeExpContents(exp);
11610 FreeType(exp->expType);
11611 FreeType(exp->destType);
11612 *exp = *exp2;
11613 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
11614 break;
11615 }
11616 case '-':
11617 if(op1->ops.Neg)
11618 {
11619 FreeExpContents(exp);
11620 op1->ops.Neg(exp, op1);
11621 }
11622 break;
11623 case '~':
11624 if(op1->ops.BitNot)
11625 {
11626 FreeExpContents(exp);
11627 op1->ops.BitNot(exp, op1);
11628 }
11629 break;
11630 case '!':
11631 if(op1->ops.Not)
11632 {
11633 FreeExpContents(exp);
11634 op1->ops.Not(exp, op1);
11635 }
11636 break;
11637 }
11638 }
11639 else
11640 {
11641 if(op1 && op2 && op1->type && op2->type && op1->kind != op2->kind)
11642 {
11643 if(Promote(op2, op1->kind, op1->type->isSigned))
11644 op2->kind = op1->kind, op2->ops = op1->ops;
11645 else if(Promote(op1, op2->kind, op2->type->isSigned))
11646 op1->kind = op2->kind, op1->ops = op2->ops;
11647 }
11648 switch(exp->op.op)
11649 {
11650 case '+':
11651 if(op1->ops.Add)
11652 {
11653 FreeExpContents(exp);
11654 op1->ops.Add(exp, op1, op2);
11655 }
11656 break;
11657 case '-':
11658 if(op1->ops.Sub)
11659 {
11660 FreeExpContents(exp);
11661 op1->ops.Sub(exp, op1, op2);
11662 }
11663 break;
11664 case '*':
11665 if(op1->ops.Mul)
11666 {
11667 FreeExpContents(exp);
11668 op1->ops.Mul(exp, op1, op2);
11669 }
11670 break;
11671 case '/':
11672 if(op1->ops.Div)
11673 {
11674 FreeExpContents(exp);
11675 op1->ops.Div(exp, op1, op2);
11676 }
11677 break;
11678 case '%':
11679 if(op1->ops.Mod)
11680 {
11681 FreeExpContents(exp);
11682 op1->ops.Mod(exp, op1, op2);
11683 }
11684 break;
11685 case '&':
11686 if(exp->op.exp2)
11687 {
11688 if(op1->ops.BitAnd)
11689 {
11690 FreeExpContents(exp);
11691 op1->ops.BitAnd(exp, op1, op2);
11692 }
11693 }
11694 break;
11695 case '|':
11696 if(op1->ops.BitOr)
11697 {
11698 FreeExpContents(exp);
11699 op1->ops.BitOr(exp, op1, op2);
11700 }
11701 break;
11702 case '^':
11703 if(op1->ops.BitXor)
11704 {
11705 FreeExpContents(exp);
11706 op1->ops.BitXor(exp, op1, op2);
11707 }
11708 break;
11709 case LEFT_OP:
11710 if(op1->ops.LShift)
11711 {
11712 FreeExpContents(exp);
11713 op1->ops.LShift(exp, op1, op2);
11714 }
11715 break;
11716 case RIGHT_OP:
11717 if(op1->ops.RShift)
11718 {
11719 FreeExpContents(exp);
11720 op1->ops.RShift(exp, op1, op2);
11721 }
11722 break;
11723 case EQ_OP:
11724 if(op1->ops.Equ)
11725 {
11726 FreeExpContents(exp);
11727 op1->ops.Equ(exp, op1, op2);
11728 }
11729 break;
11730 case NE_OP:
11731 if(op1->ops.Nqu)
11732 {
11733 FreeExpContents(exp);
11734 op1->ops.Nqu(exp, op1, op2);
11735 }
11736 break;
11737 case AND_OP:
11738 if(op1->ops.And)
11739 {
11740 FreeExpContents(exp);
11741 op1->ops.And(exp, op1, op2);
11742 }
11743 break;
11744 case OR_OP:
11745 if(op1->ops.Or)
11746 {
11747 FreeExpContents(exp);
11748 op1->ops.Or(exp, op1, op2);
11749 }
11750 break;
11751 case '>':
11752 if(op1->ops.Grt)
11753 {
11754 FreeExpContents(exp);
11755 op1->ops.Grt(exp, op1, op2);
11756 }
11757 break;
11758 case '<':
11759 if(op1->ops.Sma)
11760 {
11761 FreeExpContents(exp);
11762 op1->ops.Sma(exp, op1, op2);
11763 }
11764 break;
11765 case GE_OP:
11766 if(op1->ops.GrtEqu)
11767 {
11768 FreeExpContents(exp);
11769 op1->ops.GrtEqu(exp, op1, op2);
11770 }
11771 break;
11772 case LE_OP:
11773 if(op1->ops.SmaEqu)
11774 {
11775 FreeExpContents(exp);
11776 op1->ops.SmaEqu(exp, op1, op2);
11777 }
11778 break;
11779 }
11780 }
11781 }
11782 }
11783
11784 void PrintTypeNoConst(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
11785
11786 extern struct Expression * MkExpIdentifier(struct Identifier * id);
11787
11788 void ComputeExpression(struct Expression * exp)
11789 {
11790 char expString[10240];
11791
11792 expString[0] = '\0';
11793 switch(exp->type)
11794 {
11795 case 1:
11796 {
11797 ComputeInstantiation(exp);
11798 break;
11799 }
11800 case 4:
11801 {
11802 struct Expression * exp1, * exp2 = (((void *)0));
11803 struct Operand op1 = 
11804 {
11805 0, 0, 0, 0, 
11806 {
11807 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11808 }
11809 };
11810 struct Operand op2 = 
11811 {
11812 0, 0, 0, 0, 
11813 {
11814 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11815 }
11816 };
11817
11818 if(exp->op.exp2)
11819 {
11820 struct Expression * e = exp->op.exp2;
11821
11822 while((e->type == 5 || e->type == 32 || e->type == 23) && e->list)
11823 {
11824 if(e->type == 5 || e->type == 32 || e->type == 23)
11825 {
11826 if(e->type == 23)
11827 e = (*((struct Statement *)(*e->compound->compound.statements).last)->expressions).last;
11828 else
11829 e = (*e->list).last;
11830 }
11831 }
11832 if(exp->op.op == 261 && e && e->expType)
11833 {
11834 if(e->type == 3 && e->string)
11835 {
11836 char * string = e->string;
11837 int len = strlen(string);
11838 char * tmp = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (len - 2 + 1));
11839
11840 len = UnescapeString(tmp, string + 1, len - 2);
11841 (__ecereNameSpace__ecere__com__eSystem_Delete(tmp), tmp = 0);
11842 FreeExpContents(exp);
11843 exp->type = 2;
11844 exp->constant = PrintUInt(len + 1);
11845 }
11846 else
11847 {
11848 struct Type * type = e->expType;
11849
11850 type->refCount++;
11851 FreeExpContents(exp);
11852 exp->type = 2;
11853 exp->constant = PrintUInt(ComputeTypeSize(type));
11854 FreeType(type);
11855 }
11856 break;
11857 }
11858 else
11859 ComputeExpression(exp->op.exp2);
11860 }
11861 if(exp->op.exp1)
11862 {
11863 ComputeExpression(exp->op.exp1);
11864 exp1 = exp->op.exp1;
11865 exp2 = exp->op.exp2;
11866 op1 = GetOperand(exp1);
11867 if(op1.type)
11868 op1.type->refCount++;
11869 if(exp2)
11870 {
11871 op2 = GetOperand(exp2);
11872 if(op2.type)
11873 op2.type->refCount++;
11874 }
11875 }
11876 else
11877 {
11878 exp1 = exp->op.exp2;
11879 op1 = GetOperand(exp1);
11880 if(op1.type)
11881 op1.type->refCount++;
11882 }
11883 CallOperator(exp, exp1, exp2, &op1, &op2);
11884 if(op1.type)
11885 FreeType(op1.type);
11886 if(op2.type)
11887 FreeType(op2.type);
11888 break;
11889 }
11890 case 5:
11891 case 32:
11892 {
11893 struct Expression * e, * n;
11894
11895 for(e = (*exp->list).first; e; e = n)
11896 {
11897 n = e->next;
11898 if(!n)
11899 {
11900 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
11901
11902 ComputeExpression(e);
11903 FreeType(exp->expType);
11904 FreeType(exp->destType);
11905 *exp = *e;
11906 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
11907 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
11908 }
11909 else
11910 {
11911 FreeExpression(e);
11912 }
11913 }
11914 break;
11915 }
11916 case 8:
11917 {
11918 struct Expression * memberExp = exp->member.exp;
11919 struct Identifier * memberID = exp->member.member;
11920 struct Type * type;
11921
11922 ComputeExpression(exp->member.exp);
11923 type = exp->member.exp->expType;
11924 if(type)
11925 {
11926 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)));
11927 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11928 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11929 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
11930
11931 if(type->kind == 19 && exp->member.exp->type == 24)
11932 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
11933 if(!_class)
11934 {
11935 char string[256];
11936 struct Symbol * classSym;
11937
11938 string[0] = '\0';
11939 PrintTypeNoConst(type, string, 0x0, 0x1);
11940 classSym = FindClass(string);
11941 _class = classSym ? classSym->registered : (((void *)0));
11942 }
11943 if(exp->member.member)
11944 {
11945 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
11946 if(!prop)
11947 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
11948 }
11949 if(!prop && !member && _class && exp->member.member)
11950 {
11951 struct Symbol * classSym = FindClass(exp->member.member->string);
11952
11953 convertTo = _class;
11954 _class = classSym ? classSym->registered : (((void *)0));
11955 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
11956 }
11957 if(prop)
11958 {
11959 if(prop->compiled)
11960 {
11961 struct Type * type = prop->dataType;
11962
11963 if(_class->type == 3)
11964 {
11965 if(type->kind == 8)
11966 {
11967 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11968
11969 if(_class->type == 3)
11970 {
11971 if(!_class->dataType)
11972 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11973 type = _class->dataType;
11974 }
11975 }
11976 switch(type->kind)
11977 {
11978 case 6:
11979 {
11980 float value;
11981 float (* Get)(float) = (void *)prop->Get;
11982
11983 GetFloat(exp->member.exp, &value);
11984 exp->constant = PrintFloat(Get ? Get(value) : value);
11985 exp->type = 2;
11986 break;
11987 }
11988 case 7:
11989 {
11990 double value;
11991 double (* Get)(double);
11992
11993 GetDouble(exp->member.exp, &value);
11994 if(convertTo)
11995 Get = (void *)prop->Set;
11996 else
11997 Get = (void *)prop->Get;
11998 exp->constant = PrintDouble(Get ? Get(value) : value);
11999 exp->type = 2;
12000 break;
12001 }
12002 }
12003 }
12004 else
12005 {
12006 if(convertTo)
12007 {
12008 struct Expression * value = exp->member.exp;
12009 struct Type * type;
12010
12011 if(!prop->dataType)
12012 ProcessPropertyType(prop);
12013 type = prop->dataType;
12014 if(!type)
12015 {
12016 }
12017 else if(_class->type == 1)
12018 {
12019 switch(type->kind)
12020 {
12021 case 8:
12022 {
12023 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
12024
12025 if(propertyClass->type == 1 && value->type == 1)
12026 {
12027 void (* Set)(void *, void *) = (void *)prop->Set;
12028
12029 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12030 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12031 exp->instance->_class = MkSpecifierName(_class->fullName);
12032 exp->instance->loc = exp->loc;
12033 exp->type = 1;
12034 Set(exp->instance->data, value->instance->data);
12035 PopulateInstance(exp->instance);
12036 }
12037 break;
12038 }
12039 case 3:
12040 {
12041 int intValue;
12042 void (* Set)(void *, int) = (void *)prop->Set;
12043
12044 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12045 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12046 exp->instance->_class = MkSpecifierName(_class->fullName);
12047 exp->instance->loc = exp->loc;
12048 exp->type = 1;
12049 GetInt(value, &intValue);
12050 Set(exp->instance->data, intValue);
12051 PopulateInstance(exp->instance);
12052 break;
12053 }
12054 case 4:
12055 {
12056 long long intValue;
12057 void (* Set)(void *, long long) = (void *)prop->Set;
12058
12059 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12060 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12061 exp->instance->_class = MkSpecifierName(_class->fullName);
12062 exp->instance->loc = exp->loc;
12063 exp->type = 1;
12064 GetInt64(value, &intValue);
12065 Set(exp->instance->data, intValue);
12066 PopulateInstance(exp->instance);
12067 break;
12068 }
12069 case 22:
12070 {
12071 intptr_t intValue;
12072 void (* Set)(void *, intptr_t) = (void *)prop->Set;
12073
12074 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12075 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12076 exp->instance->_class = MkSpecifierName(_class->fullName);
12077 exp->instance->loc = exp->loc;
12078 exp->type = 1;
12079 GetIntPtr(value, &intValue);
12080 Set(exp->instance->data, intValue);
12081 PopulateInstance(exp->instance);
12082 break;
12083 }
12084 case 23:
12085 {
12086 ssize_t intValue;
12087 void (* Set)(void *, ssize_t) = (void *)prop->Set;
12088
12089 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12090 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12091 exp->instance->_class = MkSpecifierName(_class->fullName);
12092 exp->instance->loc = exp->loc;
12093 exp->type = 1;
12094 GetIntSize(value, &intValue);
12095 Set(exp->instance->data, intValue);
12096 PopulateInstance(exp->instance);
12097 break;
12098 }
12099 case 6:
12100 {
12101 float floatValue;
12102 void (* Set)(void *, float) = (void *)prop->Set;
12103
12104 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12105 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12106 exp->instance->_class = MkSpecifierName(_class->fullName);
12107 exp->instance->loc = exp->loc;
12108 exp->type = 1;
12109 GetFloat(value, &floatValue);
12110 Set(exp->instance->data, floatValue);
12111 PopulateInstance(exp->instance);
12112 break;
12113 }
12114 case 7:
12115 {
12116 double doubleValue;
12117 void (* Set)(void *, double) = (void *)prop->Set;
12118
12119 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12120 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12121 exp->instance->_class = MkSpecifierName(_class->fullName);
12122 exp->instance->loc = exp->loc;
12123 exp->type = 1;
12124 GetDouble(value, &doubleValue);
12125 Set(exp->instance->data, doubleValue);
12126 PopulateInstance(exp->instance);
12127 break;
12128 }
12129 }
12130 }
12131 else if(_class->type == 2)
12132 {
12133 switch(type->kind)
12134 {
12135 case 8:
12136 {
12137 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
12138
12139 if(propertyClass->type == 1 && value->instance->data)
12140 {
12141 unsigned int (* Set)(void *) = (void *)prop->Set;
12142 unsigned int bits = Set(value->instance->data);
12143
12144 exp->constant = PrintHexUInt(bits);
12145 exp->type = 2;
12146 break;
12147 }
12148 else if(_class->type == 2)
12149 {
12150 unsigned int value;
12151 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
12152 unsigned int bits;
12153
12154 GetUInt(exp->member.exp, &value);
12155 bits = Set(value);
12156 exp->constant = PrintHexUInt(bits);
12157 exp->type = 2;
12158 }
12159 }
12160 }
12161 }
12162 }
12163 else
12164 {
12165 if(_class->type == 2)
12166 {
12167 unsigned int value;
12168
12169 GetUInt(exp->member.exp, &value);
12170 switch(type->kind)
12171 {
12172 case 8:
12173 {
12174 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12175
12176 if(_class->type == 1)
12177 {
12178 void (* Get)(unsigned int, void *) = (void *)prop->Get;
12179
12180 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12181 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12182 exp->instance->_class = MkSpecifierName(_class->fullName);
12183 exp->instance->loc = exp->loc;
12184 exp->type = 1;
12185 Get(value, exp->instance->data);
12186 PopulateInstance(exp->instance);
12187 }
12188 else if(_class->type == 2)
12189 {
12190 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
12191 uint64 bits = Get(value);
12192
12193 exp->constant = PrintHexUInt64(bits);
12194 exp->type = 2;
12195 }
12196 break;
12197 }
12198 }
12199 }
12200 else if(_class->type == 1)
12201 {
12202 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
12203
12204 switch(type->kind)
12205 {
12206 case 8:
12207 {
12208 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12209
12210 if(_class->type == 1 && value)
12211 {
12212 void (* Get)(void *, void *) = (void *)prop->Get;
12213
12214 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12215 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12216 exp->instance->_class = MkSpecifierName(_class->fullName);
12217 exp->instance->loc = exp->loc;
12218 exp->type = 1;
12219 Get(value, exp->instance->data);
12220 PopulateInstance(exp->instance);
12221 }
12222 break;
12223 }
12224 }
12225 }
12226 }
12227 }
12228 }
12229 else
12230 {
12231 exp->isConstant = 0x0;
12232 }
12233 }
12234 else if(member)
12235 {
12236 }
12237 }
12238 if(exp->type != 8)
12239 {
12240 FreeExpression(memberExp);
12241 FreeIdentifier(memberID);
12242 }
12243 break;
12244 }
12245 case 10:
12246 {
12247 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
12248
12249 FreeExpContents(exp);
12250 exp->constant = PrintUInt(ComputeTypeSize(type));
12251 exp->type = 2;
12252 FreeType(type);
12253 break;
12254 }
12255 case 15:
12256 {
12257 struct Symbol * classSym = exp->_class->symbol;
12258
12259 if(classSym && classSym->registered)
12260 {
12261 if(classSym->registered->fixed)
12262 {
12263 FreeSpecifier(exp->_class);
12264 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
12265 exp->type = 2;
12266 }
12267 else
12268 {
12269 char className[1024];
12270
12271 strcpy(className, "__ecereClass_");
12272 FullClassNameCat(className, classSym->string, 0x1);
12273 MangleClassName(className);
12274 DeclareClass(classSym, className);
12275 FreeExpContents(exp);
12276 exp->type = 9;
12277 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
12278 exp->member.member = MkIdentifier("structSize");
12279 }
12280 }
12281 break;
12282 }
12283 case 11:
12284 {
12285 struct Type * type;
12286 struct Expression * e = exp;
12287
12288 if(exp->type == 11)
12289 {
12290 if(exp->cast.exp)
12291 ComputeExpression(exp->cast.exp);
12292 e = exp->cast.exp;
12293 }
12294 if(e && exp->expType)
12295 {
12296 type = exp->expType;
12297 if(type->kind == 8)
12298 {
12299 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12300
12301 if(_class && (_class->type == 3 || _class->type == 2))
12302 {
12303 if(!_class->dataType)
12304 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
12305 type = _class->dataType;
12306 }
12307 }
12308 switch(type->kind)
12309 {
12310 case 24:
12311 case 1:
12312 if(type->isSigned)
12313 {
12314 char value = (char)0;
12315
12316 if(GetChar(e, &value))
12317 {
12318 FreeExpContents(exp);
12319 exp->constant = PrintChar(value);
12320 exp->type = 2;
12321 }
12322 }
12323 else
12324 {
12325 unsigned char value = (unsigned char)0;
12326
12327 if(GetUChar(e, &value))
12328 {
12329 FreeExpContents(exp);
12330 exp->constant = PrintUChar(value);
12331 exp->type = 2;
12332 }
12333 }
12334 break;
12335 case 2:
12336 if(type->isSigned)
12337 {
12338 short value = (short)0;
12339
12340 if(GetShort(e, &value))
12341 {
12342 FreeExpContents(exp);
12343 exp->constant = PrintShort(value);
12344 exp->type = 2;
12345 }
12346 }
12347 else
12348 {
12349 unsigned short value = (unsigned short)0;
12350
12351 if(GetUShort(e, &value))
12352 {
12353 FreeExpContents(exp);
12354 exp->constant = PrintUShort(value);
12355 exp->type = 2;
12356 }
12357 }
12358 break;
12359 case 3:
12360 if(type->isSigned)
12361 {
12362 int value = 0;
12363
12364 if(GetInt(e, &value))
12365 {
12366 FreeExpContents(exp);
12367 exp->constant = PrintInt(value);
12368 exp->type = 2;
12369 }
12370 }
12371 else
12372 {
12373 unsigned int value = 0;
12374
12375 if(GetUInt(e, &value))
12376 {
12377 FreeExpContents(exp);
12378 exp->constant = PrintUInt(value);
12379 exp->type = 2;
12380 }
12381 }
12382 break;
12383 case 4:
12384 if(type->isSigned)
12385 {
12386 long long value = 0;
12387
12388 if(GetInt64(e, &value))
12389 {
12390 FreeExpContents(exp);
12391 exp->constant = PrintInt64(value);
12392 exp->type = 2;
12393 }
12394 }
12395 else
12396 {
12397 uint64 value = 0;
12398
12399 if(GetUInt64(e, &value))
12400 {
12401 FreeExpContents(exp);
12402 exp->constant = PrintUInt64(value);
12403 exp->type = 2;
12404 }
12405 }
12406 break;
12407 case 22:
12408 if(type->isSigned)
12409 {
12410 intptr_t value = 0;
12411
12412 if(GetIntPtr(e, &value))
12413 {
12414 FreeExpContents(exp);
12415 exp->constant = PrintInt64((long long)value);
12416 exp->type = 2;
12417 }
12418 }
12419 else
12420 {
12421 uintptr_t value = 0;
12422
12423 if(GetUIntPtr(e, &value))
12424 {
12425 FreeExpContents(exp);
12426 exp->constant = PrintUInt64((uint64)value);
12427 exp->type = 2;
12428 }
12429 }
12430 break;
12431 case 23:
12432 if(type->isSigned)
12433 {
12434 ssize_t value = 0;
12435
12436 if(GetIntSize(e, &value))
12437 {
12438 FreeExpContents(exp);
12439 exp->constant = PrintInt64((long long)value);
12440 exp->type = 2;
12441 }
12442 }
12443 else
12444 {
12445 size_t value = 0;
12446
12447 if(GetUIntSize(e, &value))
12448 {
12449 FreeExpContents(exp);
12450 exp->constant = PrintUInt64((uint64)value);
12451 exp->type = 2;
12452 }
12453 }
12454 break;
12455 case 6:
12456 {
12457 float value = 0;
12458
12459 if(GetFloat(e, &value))
12460 {
12461 FreeExpContents(exp);
12462 exp->constant = PrintFloat(value);
12463 exp->type = 2;
12464 }
12465 break;
12466 }
12467 case 7:
12468 {
12469 double value = 0;
12470
12471 if(GetDouble(e, &value))
12472 {
12473 FreeExpContents(exp);
12474 exp->constant = PrintDouble(value);
12475 exp->type = 2;
12476 }
12477 break;
12478 }
12479 }
12480 }
12481 break;
12482 }
12483 case 12:
12484 {
12485 struct Operand op1 = 
12486 {
12487 0, 0, 0, 0, 
12488 {
12489 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12490 }
12491 };
12492 struct Operand op2 = 
12493 {
12494 0, 0, 0, 0, 
12495 {
12496 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12497 }
12498 };
12499 struct Operand op3 = 
12500 {
12501 0, 0, 0, 0, 
12502 {
12503 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12504 }
12505 };
12506
12507 if(exp->cond.exp)
12508 ComputeExpression((*exp->cond.exp).last);
12509 if(exp->cond.elseExp)
12510 ComputeExpression(exp->cond.elseExp);
12511 if(exp->cond.cond)
12512 ComputeExpression(exp->cond.cond);
12513 op1 = GetOperand(exp->cond.cond);
12514 if(op1.type)
12515 op1.type->refCount++;
12516 op2 = GetOperand((*exp->cond.exp).last);
12517 if(op2.type)
12518 op2.type->refCount++;
12519 op3 = GetOperand(exp->cond.elseExp);
12520 if(op3.type)
12521 op3.type->refCount++;
12522 if(op1.ops.Cond)
12523 {
12524 FreeExpContents(exp);
12525 op1.ops.Cond(exp, &op1, &op2, &op3);
12526 }
12527 if(op1.type)
12528 FreeType(op1.type);
12529 if(op2.type)
12530 FreeType(op2.type);
12531 if(op3.type)
12532 FreeType(op3.type);
12533 break;
12534 }
12535 }
12536 }
12537
12538 void ApplyAnyObjectLogic(struct Expression * e);
12539
12540 extern void CopyTypeInto(struct Type * type, struct Type * src);
12541
12542 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
12543 {
12544 unsigned int result = 0x1;
12545
12546 if(destType)
12547 {
12548 struct __ecereNameSpace__ecere__sys__OldList converts = 
12549 {
12550 0, 0, 0, 0, 0
12551 };
12552 struct Conversion * convert;
12553
12554 if(destType->kind == 0)
12555 return 0x0;
12556 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
12557 result = 0x0;
12558 if(converts.count)
12559 {
12560 for(convert = converts.first; convert; convert = convert->next)
12561 {
12562 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
12563
12564 if(!empty)
12565 {
12566 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12567 int objectType = exp->expType ? exp->expType->classObjectType : 0;
12568
12569 *newExp = *exp;
12570 newExp->destType = (((void *)0));
12571 if(convert->isGet)
12572 {
12573 exp->type = 8;
12574 exp->addedThis = 0x1;
12575 exp->member.exp = newExp;
12576 FreeType(exp->member.exp->expType);
12577 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
12578 exp->member.exp->expType->classObjectType = objectType;
12579 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
12580 exp->member.memberType = 1;
12581 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12582 exp->needCast = 0x1;
12583 if(exp->expType)
12584 exp->expType->refCount++;
12585 ApplyAnyObjectLogic(exp->member.exp);
12586 }
12587 else
12588 {
12589 {
12590 exp->type = 8;
12591 exp->addedThis = 0x1;
12592 exp->member.exp = newExp;
12593 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
12594 {
12595 newExp->byReference = 0x1;
12596 }
12597 FreeType(exp->member.exp->expType);
12598 exp->member.exp->expType = (((void *)0));
12599 if(convert->convert->dataType)
12600 {
12601 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12602 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
12603 exp->member.exp->expType->refCount = 1;
12604 exp->member.exp->expType->classObjectType = objectType;
12605 ApplyAnyObjectLogic(exp->member.exp);
12606 }
12607 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
12608 exp->member.memberType = 4;
12609 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12610 exp->needCast = 0x1;
12611 if(convert->resultType)
12612 convert->resultType->refCount++;
12613 }
12614 }
12615 }
12616 else
12617 {
12618 FreeType(exp->expType);
12619 if(convert->isGet)
12620 {
12621 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12622 exp->needCast = 0x1;
12623 if(exp->expType)
12624 exp->expType->refCount++;
12625 }
12626 else
12627 {
12628 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12629 exp->needCast = 0x1;
12630 if(convert->resultType)
12631 convert->resultType->refCount++;
12632 }
12633 }
12634 }
12635 if(exp->isConstant && inCompiler)
12636 ComputeExpression(exp);
12637 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
12638 }
12639 if(!result && exp->expType && converts.count)
12640 {
12641 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
12642 }
12643 if(!result && exp->expType && exp->destType)
12644 {
12645 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))
12646 result = 0x1;
12647 }
12648 }
12649 return result;
12650 }
12651
12652 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
12653
12654 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
12655
12656 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
12657
12658 void CheckTemplateTypes(struct Expression * exp)
12659 {
12660 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
12661 {
12662 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12663 struct Statement * compound;
12664 struct Context * context;
12665
12666 *newExp = *exp;
12667 if(exp->destType)
12668 exp->destType->refCount++;
12669 if(exp->expType)
12670 exp->expType->refCount++;
12671 newExp->prev = (((void *)0));
12672 newExp->next = (((void *)0));
12673 switch(exp->expType->kind)
12674 {
12675 case 7:
12676 if(exp->destType->classObjectType)
12677 {
12678 if(exp->destType)
12679 exp->destType->refCount--;
12680 if(exp->expType)
12681 exp->expType->refCount--;
12682 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12683 }
12684 else
12685 {
12686 struct __ecereNameSpace__ecere__sys__OldList * specs;
12687 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12688 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12689
12690 context = PushContext();
12691 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12692 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12693 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12694 exp->type = 23;
12695 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12696 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
12697 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
12698 exp->compound->compound.context = context;
12699 PopContext(context);
12700 }
12701 break;
12702 default:
12703 exp->type = 11;
12704 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
12705 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12706 break;
12707 }
12708 }
12709 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
12710 {
12711 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12712 struct Statement * compound;
12713 struct Context * context;
12714
12715 *newExp = *exp;
12716 if(exp->destType)
12717 exp->destType->refCount++;
12718 if(exp->expType)
12719 exp->expType->refCount++;
12720 newExp->prev = (((void *)0));
12721 newExp->next = (((void *)0));
12722 switch(exp->expType->kind)
12723 {
12724 case 7:
12725 if(exp->destType->classObjectType)
12726 {
12727 if(exp->destType)
12728 exp->destType->refCount--;
12729 if(exp->expType)
12730 exp->expType->refCount--;
12731 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12732 }
12733 else
12734 {
12735 struct __ecereNameSpace__ecere__sys__OldList * specs;
12736 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12737 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12738
12739 context = PushContext();
12740 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12741 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12742 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12743 exp->type = 23;
12744 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12745 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
12746 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
12747 exp->compound->compound.context = context;
12748 PopContext(context);
12749 }
12750 break;
12751 case 8:
12752 {
12753 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
12754 {
12755 exp->type = 5;
12756 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
12757 ProcessExpressionType((*exp->list).first);
12758 break;
12759 }
12760 else
12761 {
12762 exp->type = 5;
12763 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
12764 newExp->needCast = 0x1;
12765 ProcessExpressionType((*exp->list).first);
12766 break;
12767 }
12768 }
12769 default:
12770 {
12771 if(exp->expType->kind == 20)
12772 {
12773 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
12774
12775 if(type)
12776 {
12777 FreeType(exp->destType);
12778 FreeType(exp->expType);
12779 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12780 break;
12781 }
12782 }
12783 if(newExp->type == 8 && newExp->member.memberType == 3)
12784 {
12785 exp->type = 4;
12786 exp->op.op = '*';
12787 exp->op.exp1 = (((void *)0));
12788 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
12789 }
12790 else
12791 {
12792 char typeString[1024];
12793 struct Declarator * decl;
12794 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12795
12796 typeString[0] = '\0';
12797 PrintType(exp->expType, typeString, 0x0, 0x0);
12798 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12799 exp->type = 11;
12800 exp->cast.typeName = MkTypeName(specs, decl);
12801 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12802 exp->cast.exp->needCast = 0x1;
12803 }
12804 break;
12805 }
12806 }
12807 }
12808 }
12809
12810 extern int strncmp(const char * , const char * , size_t n);
12811
12812 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char *  key);
12813
12814 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
12815 {
12816 int nsLen = strlen(nameSpace);
12817 struct Symbol * symbol;
12818
12819 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)))
12820 {
12821 char * s = symbol->string;
12822
12823 if(!strncmp(s, nameSpace, nsLen))
12824 {
12825 int c;
12826 char * namePart;
12827
12828 for(c = strlen(s) - 1; c >= 0; c--)
12829 if(s[c] == ':')
12830 break;
12831 namePart = s + c + 1;
12832 if(!strcmp(namePart, name))
12833 {
12834 return symbol;
12835 }
12836 }
12837 else
12838 break;
12839 }
12840 return (((void *)0));
12841 }
12842
12843 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
12844 {
12845 int c;
12846 char nameSpace[1024];
12847 char * namePart;
12848 unsigned int gotColon = 0x0;
12849
12850 nameSpace[0] = '\0';
12851 for(c = strlen(name) - 1; c >= 0; c--)
12852 if(name[c] == ':')
12853 {
12854 gotColon = 0x1;
12855 break;
12856 }
12857 namePart = name + c + 1;
12858 while(c >= 0 && name[c] == ':')
12859 c--;
12860 if(c >= 0)
12861 {
12862 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
12863
12864 if(symbol)
12865 return symbol;
12866 memcpy(nameSpace, name, c + 1);
12867 nameSpace[c + 1] = (char)0;
12868 return ScanWithNameSpace(tree, nameSpace, namePart);
12869 }
12870 else if(gotColon)
12871 {
12872 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12873
12874 return symbol;
12875 }
12876 else
12877 {
12878 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12879
12880 if(symbol)
12881 return symbol;
12882 return ScanWithNameSpace(tree, "", namePart);
12883 }
12884 return (((void *)0));
12885 }
12886
12887 static void ProcessDeclaration(struct Declaration * decl);
12888
12889 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
12890 {
12891 struct Context * ctx;
12892 struct Symbol * symbol = (((void *)0));
12893
12894 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
12895 {
12896 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
12897 {
12898 symbol = (((void *)0));
12899 if(thisNameSpace)
12900 {
12901 char curName[1024];
12902
12903 strcpy(curName, thisNameSpace);
12904 strcat(curName, "::");
12905 strcat(curName, name);
12906 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
12907 }
12908 if(!symbol)
12909 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
12910 }
12911 else
12912 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
12913 if(symbol || ctx == endContext)
12914 break;
12915 }
12916 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
12917 {
12918 if(symbol->pointerExternal->type == 0)
12919 {
12920 struct FunctionDefinition * function = symbol->pointerExternal->function;
12921 struct Context * tmpContext = curContext;
12922
12923 curContext = (((void *)0));
12924 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
12925 curContext = tmpContext;
12926 symbol->pointerExternal->symbol = symbol;
12927 DeclareType(symbol->type, 0x1, 0x1);
12928 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
12929 symbol->id = curExternal->symbol->idCode;
12930 }
12931 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
12932 {
12933 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
12934 symbol->id = curExternal->symbol->idCode;
12935 }
12936 }
12937 return symbol;
12938 }
12939
12940 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
12941 {
12942 if(!type->isSigned && type->kind != 22 && type->kind != 23)
12943 ListAdd(specs, MkSpecifier(UNSIGNED));
12944 switch(type->kind)
12945 {
12946 case 8:
12947 {
12948 if(type->_class->registered)
12949 {
12950 if(!type->_class->registered->dataType)
12951 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
12952 GetTypeSpecs(type->_class->registered->dataType, specs);
12953 }
12954 break;
12955 }
12956 case 7:
12957 ListAdd(specs, MkSpecifier(DOUBLE));
12958 break;
12959 case 6:
12960 ListAdd(specs, MkSpecifier(FLOAT));
12961 break;
12962 case 1:
12963 ListAdd(specs, MkSpecifier(CHAR));
12964 break;
12965 case 24:
12966 ListAdd(specs, MkSpecifier(_BOOL));
12967 break;
12968 case 2:
12969 ListAdd(specs, MkSpecifier(SHORT));
12970 break;
12971 case 4:
12972 ListAdd(specs, MkSpecifier(INT64));
12973 break;
12974 case 22:
12975 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
12976 break;
12977 case 23:
12978 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
12979 break;
12980 case 3:
12981 default:
12982 ListAdd(specs, MkSpecifier(INT));
12983 break;
12984 }
12985 }
12986
12987 static void PrintArraySize(struct Type * arrayType, char * string)
12988 {
12989 char size[256];
12990
12991 size[0] = '\0';
12992 strcat(size, "[");
12993 if(arrayType->enumClass)
12994 strcat(size, arrayType->enumClass->string);
12995 else if(arrayType->arraySizeExp)
12996 PrintExpression(arrayType->arraySizeExp, size);
12997 strcat(size, "]");
12998 strcat(string, size);
12999 }
13000
13001 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
13002 {
13003 if(type)
13004 {
13005 if(printConst && type->constant)
13006 strcat(string, "const ");
13007 switch(type->kind)
13008 {
13009 case 8:
13010 {
13011 struct Symbol * c = type->_class;
13012
13013 if(type->classObjectType == 2)
13014 strcat(string, "typed_object");
13015 else if(type->classObjectType == 3)
13016 strcat(string, "any_object");
13017 else
13018 {
13019 if(c && c->string)
13020 strcat(string, (fullName || !c->registered) ? c->string : c->registered->name);
13021 }
13022 if(type->byReference)
13023 strcat(string, " &");
13024 break;
13025 }
13026 case 0:
13027 strcat(string, "void");
13028 break;
13029 case 3:
13030 strcat(string, type->isSigned ? "int" : "uint");
13031 break;
13032 case 4:
13033 strcat(string, type->isSigned ? "int64" : "uint64");
13034 break;
13035 case 22:
13036 strcat(string, type->isSigned ? "intptr" : "uintptr");
13037 break;
13038 case 23:
13039 strcat(string, type->isSigned ? "intsize" : "uintsize");
13040 break;
13041 case 1:
13042 strcat(string, type->isSigned ? "char" : "byte");
13043 break;
13044 case 24:
13045 strcat(string, "_Bool");
13046 break;
13047 case 2:
13048 strcat(string, type->isSigned ? "short" : "uint16");
13049 break;
13050 case 6:
13051 strcat(string, "float");
13052 break;
13053 case 7:
13054 strcat(string, "double");
13055 break;
13056 case 9:
13057 if(type->enumName)
13058 {
13059 strcat(string, "struct ");
13060 strcat(string, type->enumName);
13061 }
13062 else if(type->typeName)
13063 strcat(string, type->typeName);
13064 else
13065 {
13066 struct Type * member;
13067
13068 strcat(string, "struct { ");
13069 for(member = type->members.first; member; member = member->next)
13070 {
13071 PrintType(member, string, 0x1, fullName);
13072 strcat(string, "; ");
13073 }
13074 strcat(string, "}");
13075 }
13076 break;
13077 case 10:
13078 if(type->enumName)
13079 {
13080 strcat(string, "union ");
13081 strcat(string, type->enumName);
13082 }
13083 else if(type->typeName)
13084 strcat(string, type->typeName);
13085 else
13086 {
13087 strcat(string, "union ");
13088 strcat(string, "(unnamed)");
13089 }
13090 break;
13091 case 15:
13092 if(type->enumName)
13093 {
13094 strcat(string, "enum ");
13095 strcat(string, type->enumName);
13096 }
13097 else if(type->typeName)
13098 strcat(string, type->typeName);
13099 else
13100 strcat(string, "int");
13101 break;
13102 case 14:
13103 strcat(string, "...");
13104 break;
13105 case 19:
13106 strcat(string, "subclass(");
13107 strcat(string, type->_class ? type->_class->string : "int");
13108 strcat(string, ")");
13109 break;
13110 case 20:
13111 strcat(string, type->templateParameter->identifier->string);
13112 break;
13113 case 21:
13114 strcat(string, "thisclass");
13115 break;
13116 case 17:
13117 strcat(string, "__builtin_va_list");
13118 break;
13119 }
13120 }
13121 }
13122
13123 extern char *  __ecereNameSpace__ecere__sys__RSearchString(char *  buffer, char *  subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
13124
13125 static void PrintName(struct Type * type, char * string, unsigned int fullName)
13126 {
13127 if(type->name && type->name[0])
13128 {
13129 if(fullName)
13130 strcat(string, type->name);
13131 else
13132 {
13133 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
13134
13135 if(name)
13136 name += 2;
13137 else
13138 name = type->name;
13139 strcat(string, name);
13140 }
13141 }
13142 }
13143
13144 static void PrintAttribs(struct Type * type, char * string)
13145 {
13146 if(type)
13147 {
13148 if(type->dllExport)
13149 strcat(string, "dllexport ");
13150 if(type->attrStdcall)
13151 strcat(string, "stdcall ");
13152 }
13153 }
13154
13155 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
13156 {
13157 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13158 {
13159 struct Type * attrType = (((void *)0));
13160
13161 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
13162 PrintAttribs(type, string);
13163 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
13164 strcat(string, " const");
13165 PrePrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName, type, printConst);
13166 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
13167 strcat(string, " (");
13168 if(type->kind == 13)
13169 {
13170 if(type->type->kind == 11 || type->type->kind == 16)
13171 PrintAttribs(type->type, string);
13172 }
13173 if(type->kind == 13)
13174 {
13175 if(type->type->kind == 11 || type->type->kind == 16 || type->type->kind == 12)
13176 strcat(string, "*");
13177 else
13178 strcat(string, " *");
13179 }
13180 if(printConst && type->constant && type->kind == 13)
13181 strcat(string, " const");
13182 }
13183 else
13184 PrintTypeSpecs(type, string, fullName, printConst);
13185 }
13186
13187 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
13188 {
13189 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
13190 strcat(string, ")");
13191 if(type->kind == 12)
13192 PrintArraySize(type, string);
13193 else if(type->kind == 11)
13194 {
13195 struct Type * param;
13196
13197 strcat(string, "(");
13198 for(param = type->params.first; param; param = param->next)
13199 {
13200 PrintType(param, string, 0x1, fullName);
13201 if(param->next)
13202 strcat(string, ", ");
13203 }
13204 strcat(string, ")");
13205 }
13206 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13207 PostPrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName);
13208 }
13209
13210 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
13211 {
13212 PrePrintType(type, string, fullName, (((void *)0)), printConst);
13213 if(type->thisClass || (printName && type->name && type->name[0]))
13214 strcat(string, " ");
13215 if((type->thisClass || type->staticMethod))
13216 {
13217 struct Symbol * _class = type->thisClass;
13218
13219 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
13220 {
13221 if(type->classObjectType == 1)
13222 strcat(string, "class");
13223 else
13224 strcat(string, type->byReference ? "typed_object&" : "typed_object");
13225 }
13226 else if(_class && _class->string)
13227 {
13228 char * s = _class->string;
13229
13230 if(fullName)
13231 strcat(string, s);
13232 else
13233 {
13234 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 0x1, 0x0);
13235
13236 if(name)
13237 name += 2;
13238 else
13239 name = s;
13240 strcat(string, name);
13241 }
13242 }
13243 strcat(string, "::");
13244 }
13245 if(printName && type->name)
13246 PrintName(type, string, fullName);
13247 PostPrintType(type, string, fullName);
13248 if(type->bitFieldCount)
13249 {
13250 char count[100];
13251
13252 sprintf(count, ":%d", type->bitFieldCount);
13253 strcat(string, count);
13254 }
13255 }
13256
13257 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13258 {
13259 _PrintType(type, string, printName, fullName, 0x1);
13260 }
13261
13262 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13263 {
13264 _PrintType(type, string, printName, fullName, 0x0);
13265 }
13266
13267 static struct Type * FindMember(struct Type * type, char * string)
13268 {
13269 struct Type * memberType;
13270
13271 for(memberType = type->members.first; memberType; memberType = memberType->next)
13272 {
13273 if(!memberType->name)
13274 {
13275 struct Type * subType = FindMember(memberType, string);
13276
13277 if(subType)
13278 return subType;
13279 }
13280 else if(!strcmp(memberType->name, string))
13281 return memberType;
13282 }
13283 return (((void *)0));
13284 }
13285
13286 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
13287 {
13288 struct Type * memberType;
13289
13290 for(memberType = type->members.first; memberType; memberType = memberType->next)
13291 {
13292 if(!memberType->name)
13293 {
13294 struct Type * subType = FindMember(memberType, string);
13295
13296 if(subType)
13297 {
13298 *offset += memberType->offset;
13299 return subType;
13300 }
13301 }
13302 else if(!strcmp(memberType->name, string))
13303 {
13304 *offset += memberType->offset;
13305 return memberType;
13306 }
13307 }
13308 return (((void *)0));
13309 }
13310
13311 extern unsigned int parseError;
13312
13313 unsigned int GetParseError()
13314 {
13315 return parseError;
13316 }
13317
13318 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
13319
13320 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
13321
13322 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
13323
13324 struct Expression * ParseExpressionString(char * expression)
13325 {
13326 parseError = 0x0;
13327 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13328 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__extension__ ({
13329 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13330
13331 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13332 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
13333 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13334 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13335
13336 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13337 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13338 echoOn = 0x0;
13339 parsedExpression = (((void *)0));
13340 resetScanner();
13341 expression_yyparse();
13342 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13343 return parsedExpression;
13344 }
13345
13346 extern char *  QMkString(char *  source);
13347
13348 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
13349 {
13350 struct Identifier * id = exp->identifier;
13351 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13352 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13353 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13354 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13355
13356 if(_class && _class->type == 4)
13357 {
13358 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
13359 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
13360
13361 if(enumClass)
13362 {
13363 struct __ecereNameSpace__ecere__com__Class * baseClass;
13364
13365 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
13366 {
13367 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
13368
13369 for(value = e->values.first; value; value = value->next)
13370 {
13371 if(!strcmp(value->name, id->string))
13372 break;
13373 }
13374 if(value)
13375 {
13376 char constant[256];
13377
13378 FreeExpContents(exp);
13379 exp->type = 2;
13380 exp->isConstant = 0x1;
13381 if(!strcmp(baseClass->dataTypeString, "int"))
13382 sprintf(constant, "%d", (int)value->data);
13383 else
13384 sprintf(constant, "0x%X", (int)value->data);
13385 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13386 exp->expType = MkClassType(baseClass->fullName);
13387 break;
13388 }
13389 }
13390 }
13391 if(value)
13392 return 0x1;
13393 }
13394 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
13395 {
13396 ProcessMethodType(method);
13397 exp->expType = __extension__ ({
13398 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13399
13400 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1->methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
13401 });
13402 return 0x1;
13403 }
13404 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
13405 {
13406 if(!prop->dataType)
13407 ProcessPropertyType(prop);
13408 exp->expType = prop->dataType;
13409 if(prop->dataType)
13410 prop->dataType->refCount++;
13411 return 0x1;
13412 }
13413 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
13414 {
13415 if(!member->dataType)
13416 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13417 exp->expType = member->dataType;
13418 if(member->dataType)
13419 member->dataType->refCount++;
13420 return 0x1;
13421 }
13422 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
13423 {
13424 if(!classProp->dataType)
13425 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
13426 if(classProp->constant)
13427 {
13428 FreeExpContents(exp);
13429 exp->isConstant = 0x1;
13430 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
13431 {
13432 exp->type = 3;
13433 exp->constant = QMkString((char *)classProp->Get(_class));
13434 }
13435 else
13436 {
13437 char constant[256];
13438
13439 exp->type = 2;
13440 sprintf(constant, "%d", (int)classProp->Get(_class));
13441 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13442 }
13443 }
13444 else
13445 {
13446 }
13447 exp->expType = classProp->dataType;
13448 if(classProp->dataType)
13449 classProp->dataType->refCount++;
13450 return 0x1;
13451 }
13452 return 0x0;
13453 }
13454
13455 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
13456 {
13457 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
13458 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
13459 struct __ecereNameSpace__ecere__com__NameSpace * child;
13460
13461 if(!data)
13462 {
13463 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)))
13464 {
13465 data = ScanGlobalData(child, name);
13466 if(data)
13467 break;
13468 }
13469 }
13470 return data;
13471 }
13472
13473 extern struct __ecereNameSpace__ecere__com__NameSpace *  globalData;
13474
13475 extern char *  strncpy(char * , const char * , size_t n);
13476
13477 static struct GlobalData * FindGlobalData(char * name)
13478 {
13479 int start = 0, c;
13480 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13481
13482 nameSpace = globalData;
13483 for(c = 0; name[c]; c++)
13484 {
13485 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
13486 {
13487 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
13488 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
13489
13490 strncpy(spaceName, name + start, c - start);
13491 spaceName[c - start] = '\0';
13492 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
13493 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
13494 if(!newSpace)
13495 return (((void *)0));
13496 nameSpace = newSpace;
13497 if(name[c] == ':')
13498 c++;
13499 start = c + 1;
13500 }
13501 }
13502 if(c - start)
13503 {
13504 return ScanGlobalData(nameSpace, name + start);
13505 }
13506 return (((void *)0));
13507 }
13508
13509 static int definedExpStackPos;
13510
13511 static void * definedExpStack[512];
13512
13513 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
13514 {
13515 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
13516
13517 FreeExpContents(checkedExp);
13518 FreeType(checkedExp->expType);
13519 FreeType(checkedExp->destType);
13520 *checkedExp = *newExp;
13521 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13522 checkedExp->prev = prev;
13523 checkedExp->next = next;
13524 }
13525
13526 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
13527
13528 extern int printf(char * , ...);
13529
13530 void __ecereMethod_Expression_Clear();
13531
13532 void ApplyAnyObjectLogic(struct Expression * e)
13533 {
13534 struct Type * destType = e->destType;
13535
13536 if(destType && (destType->classObjectType == 3))
13537 {
13538 if(e && e->expType)
13539 {
13540 struct Type * type = e->expType;
13541 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
13542
13543 if(type->kind == 8 && type->_class && type->_class->registered)
13544 {
13545 _class = type->_class->registered;
13546 }
13547 else if(type->kind == 19)
13548 {
13549 _class = FindClass("ecere::com::Class")->registered;
13550 }
13551 else
13552 {
13553 char string[1024] = "";
13554 struct Symbol * classSym;
13555
13556 PrintTypeNoConst(type, string, 0x0, 0x1);
13557 classSym = FindClass(string);
13558 if(classSym)
13559 _class = classSym->registered;
13560 }
13561 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)))
13562 {
13563 if(!_class || strcmp(_class->fullName, "char *"))
13564 {
13565 struct Expression * checkedExp = e, * newExp;
13566
13567 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->list) || checkedExp->type == 11)
13568 {
13569 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13570 {
13571 if(checkedExp->type == 23)
13572 {
13573 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13574 }
13575 else
13576 checkedExp = (*checkedExp->list).last;
13577 }
13578 else if(checkedExp->type == 11)
13579 checkedExp = checkedExp->cast.exp;
13580 }
13581 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
13582 {
13583 newExp = checkedExp->op.exp2;
13584 checkedExp->op.exp2 = (((void *)0));
13585 FreeExpContents(checkedExp);
13586 if(e->expType && e->expType->passAsTemplate)
13587 {
13588 char size[100];
13589
13590 ComputeTypeSize(e->expType);
13591 sprintf(size, "%d", e->expType->size);
13592 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))))));
13593 }
13594 ReplaceExpContents(checkedExp, newExp);
13595 e->byReference = 0x1;
13596 }
13597 else if(!e->byReference || (_class && _class->type == 5))
13598 {
13599 struct Expression * checkedExp, * newExp;
13600
13601 {
13602 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;
13603
13604 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
13605 {
13606 struct Context * context = PushContext();
13607 struct Declarator * decl;
13608 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13609 char typeString[1024];
13610 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13611
13612 typeString[0] = '\0';
13613 *newExp = *e;
13614 newExp->prev = (((void *)0));
13615 newExp->next = (((void *)0));
13616 newExp->expType = (((void *)0));
13617 PrintTypeNoConst(e->expType, typeString, 0x0, 0x1);
13618 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13619 newExp->destType = ProcessType(specs, decl);
13620 curContext = context;
13621 if(curCompound)
13622 {
13623 char name[100];
13624 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
13625
13626 e->type = 23;
13627 sprintf(name, "__internalValue%03X", internalValueCounter++);
13628 if(!curCompound->compound.declarations)
13629 curCompound->compound.declarations = MkList();
13630 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
13631 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
13632 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
13633 e->compound = MkCompoundStmt((((void *)0)), stmts);
13634 }
13635 else
13636 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
13637 {
13638 struct Type * type = e->destType;
13639
13640 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13641 CopyTypeInto(e->destType, type);
13642 e->destType->refCount = 1;
13643 e->destType->classObjectType = 0;
13644 FreeType(type);
13645 }
13646 e->compound->compound.context = context;
13647 PopContext(context);
13648 curContext = context->parent;
13649 }
13650 }
13651 checkedExp = e;
13652 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->list) || checkedExp->type == 11)
13653 {
13654 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13655 {
13656 if(checkedExp->type == 23)
13657 {
13658 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13659 }
13660 else
13661 checkedExp = (*checkedExp->list).last;
13662 }
13663 else if(checkedExp->type == 11)
13664 checkedExp = checkedExp->cast.exp;
13665 }
13666 {
13667 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13668
13669 *operand = *checkedExp;
13670 checkedExp->destType = (((void *)0));
13671 checkedExp->expType = (((void *)0));
13672 __ecereMethod_Expression_Clear(checkedExp);
13673 checkedExp->type = 4;
13674 checkedExp->op.op = '&';
13675 checkedExp->op.exp1 = (((void *)0));
13676 checkedExp->op.exp2 = operand;
13677 }
13678 }
13679 }
13680 }
13681 }
13682 }
13683 {
13684 }
13685 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))))
13686 {
13687 if(e->expType->classObjectType && destType && destType->classObjectType)
13688 {
13689 return ;
13690 }
13691 else
13692 {
13693 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13694
13695 *thisExp = *e;
13696 thisExp->prev = (((void *)0));
13697 thisExp->next = (((void *)0));
13698 __ecereMethod_Expression_Clear(e);
13699 e->type = 5;
13700 e->list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
13701 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
13702 ((struct Expression *)(*e->list).first)->byReference = 0x1;
13703 {
13704 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13705 CopyTypeInto(e->expType, thisExp->expType);
13706 e->expType->byReference = 0x0;
13707 e->expType->refCount = 1;
13708 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))
13709 {
13710 e->expType->classObjectType = 0;
13711 }
13712 }
13713 }
13714 }
13715 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
13716 {
13717 if(destType->kind == 14)
13718 {
13719 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unspecified type\n", (((void *)0))));
13720 }
13721 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
13722 {
13723 unsigned int byReference = e->expType->byReference;
13724 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13725 struct Declarator * decl;
13726 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13727 char typeString[1024];
13728 struct Type * type;
13729 int backupClassObjectType;
13730 unsigned int backupByReference;
13731
13732 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
13733 type = e->expType;
13734 else
13735 type = destType;
13736 backupClassObjectType = type->classObjectType;
13737 backupByReference = type->byReference;
13738 type->classObjectType = 0;
13739 type->byReference = 0x0;
13740 typeString[0] = '\0';
13741 PrintType(type, typeString, 0x0, 0x1);
13742 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13743 type->classObjectType = backupClassObjectType;
13744 type->byReference = backupByReference;
13745 *thisExp = *e;
13746 thisExp->prev = (((void *)0));
13747 thisExp->next = (((void *)0));
13748 __ecereMethod_Expression_Clear(e);
13749 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)))
13750 {
13751 e->type = 4;
13752 e->op.op = '*';
13753 e->op.exp1 = (((void *)0));
13754 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
13755 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13756 CopyTypeInto(e->expType, type);
13757 e->expType->byReference = 0x0;
13758 e->expType->refCount = 1;
13759 }
13760 else
13761 {
13762 e->type = 11;
13763 e->cast.typeName = MkTypeName(specs, decl);
13764 e->cast.exp = thisExp;
13765 e->byReference = 0x1;
13766 e->expType = type;
13767 type->refCount++;
13768 }
13769 e->destType = destType;
13770 destType->refCount++;
13771 }
13772 }
13773 }
13774
13775 extern char *  strstr(const char * , const char * );
13776
13777 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
13778
13779 struct __ecereNameSpace__ecere__com__DefinedExpression
13780 {
13781 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
13782 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
13783 char *  name;
13784 char *  value;
13785 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
13786 } __attribute__ ((gcc_struct));
13787
13788 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
13789
13790 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
13791
13792 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char *  string, int *  numBytes);
13793
13794 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
13795
13796 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
13797
13798 extern struct Expression * CopyExpression(struct Expression * exp);
13799
13800 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
13801
13802 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList *  specifiers, struct Declarator * decl);
13803
13804 static void ProcessStatement(struct Statement * stmt);
13805
13806 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
13807
13808 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
13809
13810 extern char *  __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, void * object, ...);
13811
13812 extern char *  sourceFile;
13813
13814 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
13815
13816 void ProcessExpressionType(struct Expression * exp)
13817 {
13818 unsigned int unresolved = 0x0;
13819 struct Location oldyylloc = yylloc;
13820 unsigned int notByReference = 0x0;
13821
13822 if(!exp || exp->expType)
13823 return ;
13824 yylloc = exp->loc;
13825 switch(exp->type)
13826 {
13827 case 0:
13828 {
13829 struct Identifier * id = exp->identifier;
13830
13831 if(!id || !topContext)
13832 return ;
13833 if(id->_class && id->_class->name)
13834 {
13835 id->classSym = id->_class->symbol;
13836 }
13837 if(strstr(id->string, "__ecereClass") == id->string)
13838 {
13839 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
13840 break;
13841 }
13842 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
13843 {
13844 ReplaceClassMembers(exp, thisClass);
13845 if(exp->type != 0)
13846 {
13847 ProcessExpressionType(exp);
13848 break;
13849 }
13850 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
13851 break;
13852 }
13853 else
13854 {
13855 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13856
13857 if(!symbol)
13858 {
13859 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
13860 break;
13861 else
13862 {
13863 if(thisClass)
13864 {
13865 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
13866 if(exp->type != 0)
13867 {
13868 ProcessExpressionType(exp);
13869 break;
13870 }
13871 }
13872 else if(currentClass && !id->_class)
13873 {
13874 if(ResolveIdWithClass(exp, currentClass, 0x1))
13875 break;
13876 }
13877 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13878 }
13879 }
13880 if(symbol)
13881 {
13882 struct Type * type = symbol->type;
13883 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
13884
13885 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
13886 {
13887 struct Context * context = SetupTemplatesContext(_class);
13888
13889 type = ReplaceThisClassType(_class);
13890 FinishTemplatesContext(context);
13891 if(type)
13892 type->refCount = 0;
13893 }
13894 FreeSpecifier(id->_class);
13895 id->_class = (((void *)0));
13896 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13897 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
13898 id->classSym = (((void *)0));
13899 exp->expType = type;
13900 if(type)
13901 type->refCount++;
13902 if(type && (type->kind == 15 || (_class && _class->type == 4)))
13903 exp->isConstant = 0x1;
13904 if(symbol->isParam || !strcmp(id->string, "this"))
13905 {
13906 if(_class && _class->type == 1 && !type->declaredWithStruct)
13907 exp->byReference = 0x1;
13908 }
13909 if(symbol->isIterator)
13910 {
13911 if(symbol->isIterator == 3)
13912 {
13913 exp->type = 5;
13914 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
13915 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
13916 exp->expType = (((void *)0));
13917 ProcessExpressionType(exp);
13918 }
13919 else if(symbol->isIterator != 4)
13920 {
13921 exp->type = 8;
13922 exp->member.exp = MkExpIdentifier(exp->identifier);
13923 exp->member.exp->expType = exp->expType;
13924 exp->member.member = MkIdentifier("data");
13925 exp->expType = (((void *)0));
13926 ProcessExpressionType(exp);
13927 }
13928 }
13929 break;
13930 }
13931 else
13932 {
13933 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
13934
13935 if(thisNameSpace && !(id->_class && !id->_class->name))
13936 {
13937 char name[1024];
13938
13939 strcpy(name, thisNameSpace);
13940 strcat(name, "::");
13941 strcat(name, id->string);
13942 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
13943 }
13944 if(!definedExp)
13945 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
13946 if(definedExp)
13947 {
13948 int c;
13949
13950 for(c = 0; c < definedExpStackPos; c++)
13951 if(definedExpStack[c] == definedExp)
13952 break;
13953 if(c == definedExpStackPos && c < sizeof (definedExpStack) / sizeof(void *))
13954 {
13955 struct Location backupYylloc = yylloc;
13956 struct __ecereNameSpace__ecere__com__Instance * backInput = fileInput;
13957
13958 definedExpStack[definedExpStackPos++] = definedExp;
13959 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13960 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__extension__ ({
13961 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13962
13963 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13964 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
13965 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13966 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13967
13968 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13969 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13970 echoOn = 0x0;
13971 parsedExpression = (((void *)0));
13972 resetScanner();
13973 expression_yyparse();
13974 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13975 if(backInput)
13976 fileInput = backInput;
13977 yylloc = backupYylloc;
13978 if(parsedExpression)
13979 {
13980 FreeIdentifier(id);
13981 exp->type = 5;
13982 exp->list = MkListOne(parsedExpression);
13983 parsedExpression->loc = yylloc;
13984 ProcessExpressionType(exp);
13985 definedExpStackPos--;
13986 return ;
13987 }
13988 definedExpStackPos--;
13989 }
13990 else
13991 {
13992 if(inCompiler)
13993 {
13994 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Recursion in defined expression %s\n", (((void *)0))), id->string);
13995 }
13996 }
13997 }
13998 else
13999 {
14000 struct GlobalData * data = (((void *)0));
14001
14002 if(thisNameSpace && !(id->_class && !id->_class->name))
14003 {
14004 char name[1024];
14005
14006 strcpy(name, thisNameSpace);
14007 strcat(name, "::");
14008 strcat(name, id->string);
14009 data = FindGlobalData(name);
14010 }
14011 if(!data)
14012 data = FindGlobalData(id->string);
14013 if(data)
14014 {
14015 DeclareGlobalData(data);
14016 exp->expType = data->dataType;
14017 if(data->dataType)
14018 data->dataType->refCount++;
14019 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14020 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
14021 FreeSpecifier(id->_class);
14022 id->_class = (((void *)0));
14023 break;
14024 }
14025 else
14026 {
14027 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
14028
14029 if(thisNameSpace && !(id->_class && !id->_class->name))
14030 {
14031 char name[1024];
14032
14033 strcpy(name, thisNameSpace);
14034 strcat(name, "::");
14035 strcat(name, id->string);
14036 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
14037 }
14038 if(!function)
14039 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
14040 if(function)
14041 {
14042 char name[1024];
14043
14044 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14045 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
14046 name[0] = (char)0;
14047 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
14048 strcpy(name, "__ecereFunction_");
14049 FullClassNameCat(name, id->string, 0x0);
14050 if(DeclareFunction(function, name))
14051 {
14052 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14053 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
14054 }
14055 exp->expType = function->dataType;
14056 if(function->dataType)
14057 function->dataType->refCount++;
14058 FreeSpecifier(id->_class);
14059 id->_class = (((void *)0));
14060 break;
14061 }
14062 }
14063 }
14064 }
14065 }
14066 unresolved = 0x1;
14067 break;
14068 }
14069 case 1:
14070 {
14071 struct __ecereNameSpace__ecere__com__Class * _class;
14072
14073 if(!exp->instance->_class)
14074 {
14075 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
14076 {
14077 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
14078 }
14079 }
14080 ProcessInstantiationType(exp->instance);
14081 exp->isConstant = exp->instance->isConstant;
14082 if(exp->instance->_class)
14083 {
14084 exp->expType = MkClassType(exp->instance->_class->name);
14085 }
14086 break;
14087 }
14088 case 2:
14089 {
14090 if(!exp->expType)
14091 {
14092 char * constant = exp->constant;
14093 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
14094
14095 exp->expType = type;
14096 if(constant[0] == '\'')
14097 {
14098 if((int)((unsigned char *)constant)[1] > 127)
14099 {
14100 int nb;
14101 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
14102
14103 if(nb < 2)
14104 ch = constant[1];
14105 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
14106 exp->constant = PrintUInt(ch);
14107 type->kind = 8;
14108 type->_class = FindClass("unichar");
14109 type->isSigned = 0x0;
14110 }
14111 else
14112 {
14113 type->kind = 1;
14114 type->isSigned = 0x1;
14115 }
14116 }
14117 else
14118 {
14119 char * dot = strchr(constant, '.');
14120 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
14121 char * exponent;
14122
14123 if(isHex)
14124 {
14125 exponent = strchr(constant, 'p');
14126 if(!exponent)
14127 exponent = strchr(constant, 'P');
14128 }
14129 else
14130 {
14131 exponent = strchr(constant, 'e');
14132 if(!exponent)
14133 exponent = strchr(constant, 'E');
14134 }
14135 if(dot || exponent)
14136 {
14137 if(strchr(constant, 'f') || strchr(constant, 'F'))
14138 type->kind = 6;
14139 else
14140 type->kind = 7;
14141 type->isSigned = 0x1;
14142 }
14143 else
14144 {
14145 unsigned int isSigned = constant[0] == '-';
14146 char * endP = (((void *)0));
14147 long long i64 = strtoll(constant, &endP, 0);
14148 uint64 ui64 = strtoull(constant, &endP, 0);
14149 unsigned int is64Bit = endP && (!strcmp(endP, "LL") || !strcmp(endP, "ll"));
14150
14151 if(isSigned)
14152 {
14153 if(i64 < (((int)0x80000000)))
14154 is64Bit = 0x1;
14155 }
14156 else
14157 {
14158 if(ui64 > (((int)0x7fffffff)))
14159 {
14160 if(ui64 > (0xffffffff))
14161 {
14162 is64Bit = 0x1;
14163 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
14164 isSigned = 0x1;
14165 }
14166 }
14167 else if(constant[0] != '0' || !constant[1])
14168 isSigned = 0x1;
14169 }
14170 type->kind = is64Bit ? 4 : 3;
14171 type->isSigned = isSigned;
14172 }
14173 }
14174 exp->isConstant = 0x1;
14175 if(exp->destType && exp->destType->kind == 7)
14176 type->kind = 7;
14177 else if(exp->destType && exp->destType->kind == 6)
14178 type->kind = 6;
14179 else if(exp->destType && exp->destType->kind == 4)
14180 type->kind = 4;
14181 }
14182 break;
14183 }
14184 case 3:
14185 {
14186 exp->isConstant = 0x1;
14187 exp->expType = __extension__ ({
14188 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14189
14190 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
14191 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14192
14193 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 1, __ecereInstance1->constant = 0x1, __ecereInstance1->isSigned = 0x1, __ecereInstance1;
14194 }), __ecereInstance2;
14195 });
14196 break;
14197 }
14198 case 13:
14199 case 26:
14200 ProcessExpressionType(exp->_new.size);
14201 exp->expType = __extension__ ({
14202 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14203
14204 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_new.typeName->qualifiers, exp->_new.typeName->declarator), __ecereInstance1;
14205 });
14206 DeclareType(exp->expType->type, 0x0, 0x0);
14207 break;
14208 case 14:
14209 case 27:
14210 ProcessExpressionType(exp->_renew.size);
14211 ProcessExpressionType(exp->_renew.exp);
14212 exp->expType = __extension__ ({
14213 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14214
14215 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_renew.typeName->qualifiers, exp->_renew.typeName->declarator), __ecereInstance1;
14216 });
14217 DeclareType(exp->expType->type, 0x0, 0x0);
14218 break;
14219 case 4:
14220 {
14221 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
14222 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
14223 unsigned int useDestType = 0x0, useSideType = 0x0;
14224 struct Location oldyylloc = yylloc;
14225 unsigned int useSideUnit = 0x0;
14226 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
14227
14228 switch(exp->op.op)
14229 {
14230 case '=':
14231 case MUL_ASSIGN:
14232 case DIV_ASSIGN:
14233 case MOD_ASSIGN:
14234 case ADD_ASSIGN:
14235 case SUB_ASSIGN:
14236 case LEFT_ASSIGN:
14237 case RIGHT_ASSIGN:
14238 case AND_ASSIGN:
14239 case XOR_ASSIGN:
14240 case OR_ASSIGN:
14241 assign = 0x1;
14242 break;
14243 case '!':
14244 break;
14245 case AND_OP:
14246 case OR_OP:
14247 boolOps = 0x1;
14248 boolResult = 0x1;
14249 break;
14250 case EQ_OP:
14251 case '<':
14252 case '>':
14253 case LE_OP:
14254 case GE_OP:
14255 case NE_OP:
14256 boolResult = 0x1;
14257 useSideType = 0x1;
14258 break;
14259 case '+':
14260 case '-':
14261 useSideUnit = 0x1;
14262 case '|':
14263 case '&':
14264 case '^':
14265 case '/':
14266 case '%':
14267 case '*':
14268 if(exp->op.op != '*' || exp->op.exp1)
14269 {
14270 useSideType = 0x1;
14271 useDestType = 0x1;
14272 }
14273 break;
14274 }
14275 if(exp->op.op == '&')
14276 {
14277 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
14278 {
14279 struct Identifier * id = exp->op.exp2->identifier;
14280 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
14281
14282 if(symbol && symbol->isIterator == 2)
14283 {
14284 exp->type = 8;
14285 exp->member.exp = exp->op.exp2;
14286 exp->member.member = MkIdentifier("key");
14287 exp->expType = (((void *)0));
14288 exp->op.exp2->expType = symbol->type;
14289 symbol->type->refCount++;
14290 ProcessExpressionType(exp);
14291 FreeType(dummy);
14292 break;
14293 }
14294 }
14295 }
14296 if(exp->op.exp1)
14297 {
14298 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))
14299 {
14300 if(exp->op.exp1->destType)
14301 FreeType(exp->op.exp1->destType);
14302 exp->op.exp1->destType = exp->destType;
14303 if(exp->destType)
14304 exp->destType->refCount++;
14305 }
14306 else if(!assign)
14307 {
14308 if(exp->op.exp1->destType)
14309 FreeType(exp->op.exp1->destType);
14310 exp->op.exp1->destType = dummy;
14311 dummy->refCount++;
14312 }
14313 if(exp->op.exp1->destType && exp->op.op != '=')
14314 exp->op.exp1->destType->count++;
14315 ProcessExpressionType(exp->op.exp1);
14316 if(exp->op.exp1->destType && exp->op.op != '=')
14317 exp->op.exp1->destType->count--;
14318 if(exp->op.exp1->destType == dummy)
14319 {
14320 FreeType(dummy);
14321 exp->op.exp1->destType = (((void *)0));
14322 }
14323 type1 = exp->op.exp1->expType;
14324 }
14325 if(exp->op.exp2)
14326 {
14327 char expString[10240];
14328
14329 expString[0] = '\0';
14330 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
14331 {
14332 if(exp->op.exp1)
14333 {
14334 exp->op.exp2->destType = exp->op.exp1->expType;
14335 if(exp->op.exp1->expType)
14336 exp->op.exp1->expType->refCount++;
14337 }
14338 else
14339 {
14340 exp->op.exp2->destType = exp->destType;
14341 if(exp->destType)
14342 exp->destType->refCount++;
14343 }
14344 if(type1)
14345 type1->refCount++;
14346 exp->expType = type1;
14347 }
14348 else if(assign)
14349 {
14350 if(inCompiler)
14351 PrintExpression(exp->op.exp2, expString);
14352 if(type1 && type1->kind == 13)
14353 {
14354 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)
14355 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
14356 else if(exp->op.op == '=')
14357 {
14358 if(exp->op.exp2->destType)
14359 FreeType(exp->op.exp2->destType);
14360 exp->op.exp2->destType = type1;
14361 if(type1)
14362 type1->refCount++;
14363 }
14364 }
14365 else
14366 {
14367 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)
14368 ;
14369 else
14370 {
14371 if(exp->op.exp2->destType)
14372 FreeType(exp->op.exp2->destType);
14373 exp->op.exp2->destType = type1;
14374 if(type1)
14375 type1->refCount++;
14376 }
14377 }
14378 if(type1)
14379 type1->refCount++;
14380 exp->expType = type1;
14381 }
14382 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)))
14383 {
14384 if(exp->op.exp2->destType)
14385 FreeType(exp->op.exp2->destType);
14386 exp->op.exp2->destType = exp->destType;
14387 if(exp->destType)
14388 exp->destType->refCount++;
14389 }
14390 else
14391 {
14392 if(exp->op.exp2->destType)
14393 FreeType(exp->op.exp2->destType);
14394 exp->op.exp2->destType = dummy;
14395 dummy->refCount++;
14396 }
14397 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
14398 {
14399 FreeType(exp->op.exp2->destType);
14400 exp->op.exp2->destType = type1;
14401 type1->refCount++;
14402 }
14403 if(exp->op.exp2->destType && exp->op.op != '=')
14404 exp->op.exp2->destType->count++;
14405 if(exp->op.op == SIZEOF)
14406 {
14407 struct Expression * e = exp->op.exp2;
14408
14409 while((e->type == 5 || e->type == 32 || e->type == 23) && e->list)
14410 {
14411 if(e->type == 5 || e->type == 32 || e->type == 23)
14412 {
14413 if(e->type == 23)
14414 e = (*((struct Statement *)(*e->compound->compound.statements).last)->expressions).last;
14415 else
14416 e = (*e->list).last;
14417 }
14418 }
14419 if(e->type == 11 && e->cast.exp)
14420 e->cast.exp->needCast = 0x1;
14421 }
14422 ProcessExpressionType(exp->op.exp2);
14423 if(exp->op.exp2->destType && exp->op.op != '=')
14424 exp->op.exp2->destType->count--;
14425 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
14426 {
14427 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)
14428 {
14429 if(exp->op.op != '=' && type1->type->kind == 0)
14430 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14431 }
14432 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)))
14433 {
14434 if(exp->op.op == ADD_ASSIGN)
14435 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14436 }
14437 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))
14438 {
14439 if(exp->op.op == ADD_ASSIGN)
14440 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14441 }
14442 else if(inCompiler)
14443 {
14444 char type1String[1024];
14445 char type2String[1024];
14446
14447 type1String[0] = '\0';
14448 type2String[0] = '\0';
14449 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
14450 PrintType(type1, type2String, 0x0, 0x1);
14451 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14452 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
14453 }
14454 }
14455 if(exp->op.exp2->destType == dummy)
14456 {
14457 FreeType(dummy);
14458 exp->op.exp2->destType = (((void *)0));
14459 }
14460 if(exp->op.op == '-' && !exp->op.exp1 && exp->op.exp2->expType && !exp->op.exp2->expType->isSigned)
14461 {
14462 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14463 type2->refCount = 1;
14464 CopyTypeInto(type2, exp->op.exp2->expType);
14465 type2->isSigned = 0x1;
14466 }
14467 else if(exp->op.op == '~' && !exp->op.exp1 && exp->op.exp2->expType && (!exp->op.exp2->expType->isSigned || exp->op.exp2->expType->kind != 3))
14468 {
14469 type2 = __extension__ ({
14470 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14471
14472 __ecereInstance1->kind = 3, __ecereInstance1;
14473 });
14474 type2->refCount = 1;
14475 type2->isSigned = 0x1;
14476 }
14477 else
14478 {
14479 type2 = exp->op.exp2->expType;
14480 if(type2)
14481 type2->refCount++;
14482 }
14483 }
14484 dummy->kind = 0;
14485 if(exp->op.op == SIZEOF)
14486 {
14487 exp->expType = __extension__ ({
14488 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14489
14490 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
14491 });
14492 exp->isConstant = 0x1;
14493 }
14494 else if(exp->op.op == '*' && !exp->op.exp1)
14495 {
14496 exp->expType = Dereference(type2);
14497 if(type2 && type2->kind == 8)
14498 notByReference = 0x1;
14499 }
14500 else if(exp->op.op == '&' && !exp->op.exp1)
14501 exp->expType = Reference(type2);
14502 else if(!assign)
14503 {
14504 if(boolOps)
14505 {
14506 if(exp->op.exp1)
14507 {
14508 if(exp->op.exp1->destType)
14509 FreeType(exp->op.exp1->destType);
14510 exp->op.exp1->destType = MkClassType("bool");
14511 exp->op.exp1->destType->truth = 0x1;
14512 if(!exp->op.exp1->expType)
14513 ProcessExpressionType(exp->op.exp1);
14514 else
14515 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14516 FreeType(exp->op.exp1->expType);
14517 exp->op.exp1->expType = MkClassType("bool");
14518 exp->op.exp1->expType->truth = 0x1;
14519 }
14520 if(exp->op.exp2)
14521 {
14522 if(exp->op.exp2->destType)
14523 FreeType(exp->op.exp2->destType);
14524 exp->op.exp2->destType = MkClassType("bool");
14525 exp->op.exp2->destType->truth = 0x1;
14526 if(!exp->op.exp2->expType)
14527 ProcessExpressionType(exp->op.exp2);
14528 else
14529 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14530 FreeType(exp->op.exp2->expType);
14531 exp->op.exp2->expType = MkClassType("bool");
14532 exp->op.exp2->expType->truth = 0x1;
14533 }
14534 }
14535 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")))))
14536 {
14537 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
14538 {
14539 if(exp->op.exp2->destType)
14540 FreeType(exp->op.exp2->destType);
14541 exp->op.exp2->destType = type1;
14542 type1->refCount++;
14543 if(exp->op.exp1->destType)
14544 FreeType(exp->op.exp1->destType);
14545 exp->op.exp1->destType = type2;
14546 type2->refCount++;
14547 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)
14548 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);
14549 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
14550 {
14551 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14552
14553 if(argExp)
14554 {
14555 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14556
14557 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
14558 ProcessExpressionType(exp->op.exp1);
14559 if(type2->kind != 13)
14560 {
14561 ProcessExpressionType(classExp);
14562 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"))))))));
14563 if(!exp->op.exp2->expType)
14564 {
14565 if(type2)
14566 FreeType(type2);
14567 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
14568 type2->refCount++;
14569 }
14570 ProcessExpressionType(exp->op.exp2);
14571 }
14572 }
14573 }
14574 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)))
14575 {
14576 if(type1->kind != 8 && type1->type->kind == 0)
14577 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14578 exp->expType = type1;
14579 if(type1)
14580 type1->refCount++;
14581 }
14582 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)))
14583 {
14584 if(type2->kind != 8 && type2->type->kind == 0)
14585 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14586 exp->expType = type2;
14587 if(type2)
14588 type2->refCount++;
14589 }
14590 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))
14591 {
14592 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "different levels of indirection\n", (((void *)0))));
14593 }
14594 else
14595 {
14596 unsigned int success = 0x0;
14597
14598 if(type1->kind == 13 && type2->kind == 13)
14599 {
14600 if(exp->op.op == '+')
14601 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14602 else if(exp->op.op == '-')
14603 {
14604 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
14605 {
14606 exp->expType = __extension__ ({
14607 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14608
14609 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
14610 });
14611 success = 0x1;
14612 if(type1->type->kind == 20)
14613 {
14614 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14615
14616 if(argExp)
14617 {
14618 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14619
14620 ProcessExpressionType(classExp);
14621 exp->type = 5;
14622 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")))))));
14623 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
14624 FreeType(dummy);
14625 return ;
14626 }
14627 }
14628 }
14629 }
14630 }
14631 if(!success && exp->op.exp1->type == 2)
14632 {
14633 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14634 {
14635 if(exp->expType)
14636 FreeType(exp->expType);
14637 exp->expType = exp->op.exp1->destType;
14638 if(exp->op.exp1->destType)
14639 exp->op.exp1->destType->refCount++;
14640 success = 0x1;
14641 }
14642 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14643 {
14644 if(exp->expType)
14645 FreeType(exp->expType);
14646 exp->expType = exp->op.exp2->destType;
14647 if(exp->op.exp2->destType)
14648 exp->op.exp2->destType->refCount++;
14649 success = 0x1;
14650 }
14651 }
14652 else if(!success)
14653 {
14654 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14655 {
14656 if(exp->expType)
14657 FreeType(exp->expType);
14658 exp->expType = exp->op.exp2->destType;
14659 if(exp->op.exp2->destType)
14660 exp->op.exp2->destType->refCount++;
14661 success = 0x1;
14662 }
14663 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14664 {
14665 if(exp->expType)
14666 FreeType(exp->expType);
14667 exp->expType = exp->op.exp1->destType;
14668 if(exp->op.exp1->destType)
14669 exp->op.exp1->destType->refCount++;
14670 success = 0x1;
14671 }
14672 }
14673 if(!success)
14674 {
14675 char expString1[10240];
14676 char expString2[10240];
14677 char type1[1024];
14678 char type2[1024];
14679
14680 expString1[0] = '\0';
14681 expString2[0] = '\0';
14682 type1[0] = '\0';
14683 type2[0] = '\0';
14684 if(inCompiler)
14685 {
14686 PrintExpression(exp->op.exp1, expString1);
14687 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
14688 PrintExpression(exp->op.exp2, expString2);
14689 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
14690 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
14691 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
14692 }
14693 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
14694 }
14695 }
14696 }
14697 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
14698 {
14699 if(exp->op.exp1->destType)
14700 FreeType(exp->op.exp1->destType);
14701 exp->op.exp1->destType = type2->_class->registered->dataType;
14702 if(type2->_class->registered->dataType)
14703 type2->_class->registered->dataType->refCount++;
14704 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14705 exp->expType = type2;
14706 if(type2)
14707 type2->refCount++;
14708 }
14709 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
14710 {
14711 if(exp->op.exp2->destType)
14712 FreeType(exp->op.exp2->destType);
14713 exp->op.exp2->destType = type1->_class->registered->dataType;
14714 if(type1->_class->registered->dataType)
14715 type1->_class->registered->dataType->refCount++;
14716 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14717 exp->expType = type1;
14718 if(type1)
14719 type1->refCount++;
14720 }
14721 else if(type1)
14722 {
14723 unsigned int valid = 0x0;
14724
14725 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
14726 {
14727 if(exp->op.exp2->destType)
14728 FreeType(exp->op.exp2->destType);
14729 if(!type1->_class->registered->dataType)
14730 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
14731 exp->op.exp2->destType = type1->_class->registered->dataType;
14732 exp->op.exp2->destType->refCount++;
14733 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14734 if(type2)
14735 FreeType(type2);
14736 type2 = exp->op.exp2->destType;
14737 if(type2)
14738 type2->refCount++;
14739 exp->expType = type2;
14740 type2->refCount++;
14741 }
14742 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
14743 {
14744 if(exp->op.exp1->destType)
14745 FreeType(exp->op.exp1->destType);
14746 if(!type2->_class->registered->dataType)
14747 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
14748 exp->op.exp1->destType = type2->_class->registered->dataType;
14749 exp->op.exp1->destType->refCount++;
14750 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14751 type1 = exp->op.exp1->destType;
14752 exp->expType = type1;
14753 type1->refCount++;
14754 }
14755 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
14756 {
14757 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
14758 {
14759 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
14760 {
14761 if(exp->expType)
14762 FreeType(exp->expType);
14763 exp->expType = exp->op.exp1->expType;
14764 if(exp->op.exp2->expType)
14765 exp->op.exp1->expType->refCount++;
14766 valid = 0x1;
14767 }
14768 }
14769 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
14770 {
14771 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
14772 {
14773 if(exp->expType)
14774 FreeType(exp->expType);
14775 exp->expType = exp->op.exp2->expType;
14776 if(exp->op.exp2->expType)
14777 exp->op.exp2->expType->refCount++;
14778 valid = 0x1;
14779 }
14780 }
14781 }
14782 if(!valid)
14783 {
14784 if(exp->op.exp2->destType)
14785 FreeType(exp->op.exp2->destType);
14786 exp->op.exp2->destType = type1;
14787 type1->refCount++;
14788 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14789 {
14790 if(exp->expType)
14791 FreeType(exp->expType);
14792 exp->expType = exp->op.exp2->destType;
14793 if(exp->op.exp2->destType)
14794 exp->op.exp2->destType->refCount++;
14795 }
14796 else if(type1 && type2)
14797 {
14798 char expString1[10240];
14799 char expString2[10240];
14800 char type1String[1024];
14801 char type2String[1024];
14802
14803 expString1[0] = '\0';
14804 expString2[0] = '\0';
14805 type1String[0] = '\0';
14806 type2String[0] = '\0';
14807 if(inCompiler)
14808 {
14809 PrintExpression(exp->op.exp1, expString1);
14810 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
14811 PrintExpression(exp->op.exp2, expString2);
14812 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
14813 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
14814 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
14815 }
14816 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
14817 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
14818 {
14819 exp->expType = exp->op.exp1->expType;
14820 if(exp->op.exp1->expType)
14821 exp->op.exp1->expType->refCount++;
14822 }
14823 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
14824 {
14825 exp->expType = exp->op.exp2->expType;
14826 if(exp->op.exp2->expType)
14827 exp->op.exp2->expType->refCount++;
14828 }
14829 }
14830 }
14831 }
14832 else if(type2)
14833 {
14834 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
14835 {
14836 struct Type * oldType = exp->op.exp1->expType;
14837
14838 exp->op.exp1->expType = (((void *)0));
14839 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14840 FreeType(oldType);
14841 else
14842 exp->op.exp1->expType = oldType;
14843 }
14844 if(exp->op.exp1->destType)
14845 FreeType(exp->op.exp1->destType);
14846 exp->op.exp1->destType = type2;
14847 type2->refCount++;
14848 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14849 {
14850 if(exp->expType)
14851 FreeType(exp->expType);
14852 exp->expType = exp->op.exp1->destType;
14853 if(exp->op.exp1->destType)
14854 exp->op.exp1->destType->refCount++;
14855 }
14856 }
14857 }
14858 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
14859 {
14860 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
14861 {
14862 if(exp->op.exp1->destType)
14863 FreeType(exp->op.exp1->destType);
14864 exp->op.exp1->destType = type2->_class->registered->dataType;
14865 if(type2->_class->registered->dataType)
14866 type2->_class->registered->dataType->refCount++;
14867 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14868 }
14869 if(exp->op.op == '!')
14870 {
14871 exp->expType = MkClassType("bool");
14872 exp->expType->truth = 0x1;
14873 }
14874 else
14875 {
14876 exp->expType = type2;
14877 if(type2)
14878 type2->refCount++;
14879 }
14880 }
14881 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
14882 {
14883 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
14884 {
14885 if(exp->op.exp2->destType)
14886 FreeType(exp->op.exp2->destType);
14887 exp->op.exp2->destType = type1->_class->registered->dataType;
14888 if(type1->_class->registered->dataType)
14889 type1->_class->registered->dataType->refCount++;
14890 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14891 }
14892 exp->expType = type1;
14893 if(type1)
14894 type1->refCount++;
14895 }
14896 }
14897 yylloc = exp->loc;
14898 if(exp->op.exp1 && !exp->op.exp1->expType)
14899 {
14900 char expString[10000];
14901
14902 expString[0] = '\0';
14903 if(inCompiler)
14904 {
14905 PrintExpression(exp->op.exp1, expString);
14906 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14907 }
14908 if(expString[0])
14909 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
14910 }
14911 if(exp->op.exp2 && !exp->op.exp2->expType)
14912 {
14913 char expString[10240];
14914
14915 expString[0] = '\0';
14916 if(inCompiler)
14917 {
14918 PrintExpression(exp->op.exp2, expString);
14919 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14920 }
14921 if(expString[0])
14922 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
14923 }
14924 if(boolResult)
14925 {
14926 FreeType(exp->expType);
14927 exp->expType = MkClassType("bool");
14928 exp->expType->truth = 0x1;
14929 }
14930 if(exp->op.op != SIZEOF)
14931 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
14932 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
14933 {
14934 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
14935 }
14936 yylloc = oldyylloc;
14937 FreeType(dummy);
14938 if(type2)
14939 FreeType(type2);
14940 break;
14941 }
14942 case 5:
14943 case 32:
14944 {
14945 struct Expression * e;
14946
14947 exp->isConstant = 0x1;
14948 for(e = (*exp->list).first; e; e = e->next)
14949 {
14950 unsigned int inced = 0x0;
14951
14952 if(!e->next)
14953 {
14954 FreeType(e->destType);
14955 e->destType = exp->destType;
14956 if(e->destType)
14957 {
14958 exp->destType->refCount++;
14959 e->destType->count++;
14960 inced = 0x1;
14961 }
14962 }
14963 ProcessExpressionType(e);
14964 if(inced)
14965 exp->destType->count--;
14966 if(!exp->expType && !e->next)
14967 {
14968 exp->expType = e->expType;
14969 if(e->expType)
14970 e->expType->refCount++;
14971 }
14972 if(!e->isConstant)
14973 exp->isConstant = 0x0;
14974 }
14975 e = (*exp->list).first;
14976 if(!e->next && e->type == 8)
14977 {
14978 struct Expression * next = exp->next, * prev = exp->prev;
14979
14980 FreeType(exp->expType);
14981 FreeType(exp->destType);
14982 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14983 *exp = *e;
14984 exp->prev = prev;
14985 exp->next = next;
14986 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
14987 ProcessExpressionType(exp);
14988 }
14989 break;
14990 }
14991 case 6:
14992 {
14993 struct Expression * e;
14994
14995 exp->isConstant = 0x1;
14996 ProcessExpressionType(exp->index.exp);
14997 if(!exp->index.exp->isConstant)
14998 exp->isConstant = 0x0;
14999 if(exp->index.exp->expType)
15000 {
15001 struct Type * source = exp->index.exp->expType;
15002
15003 if(source->kind == 8 && source->_class && source->_class->registered)
15004 {
15005 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
15006 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
15007
15008 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
15009 {
15010 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
15011 if(exp->index.index && (*exp->index.index).last)
15012 {
15013 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
15014 }
15015 }
15016 }
15017 }
15018 for(e = (*exp->index.index).first; e; e = e->next)
15019 {
15020 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
15021 {
15022 if(e->destType)
15023 FreeType(e->destType);
15024 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
15025 }
15026 ProcessExpressionType(e);
15027 if(!e->next)
15028 {
15029 }
15030 if(!e->isConstant)
15031 exp->isConstant = 0x0;
15032 }
15033 if(!exp->expType)
15034 exp->expType = Dereference(exp->index.exp->expType);
15035 if(exp->expType)
15036 DeclareType(exp->expType, 0x0, 0x0);
15037 break;
15038 }
15039 case 7:
15040 {
15041 struct Expression * e;
15042 struct Type * functionType;
15043 struct Type * methodType = (((void *)0));
15044 char name[1024];
15045
15046 name[0] = '\0';
15047 if(inCompiler)
15048 {
15049 PrintExpression(exp->call.exp, name);
15050 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
15051 {
15052 PrintExpression(exp->call.exp, name);
15053 }
15054 }
15055 if(exp->call.exp->type == 0)
15056 {
15057 struct Expression * idExp = exp->call.exp;
15058 struct Identifier * id = idExp->identifier;
15059
15060 if(!strcmp(id->string, "__builtin_frame_address"))
15061 {
15062 exp->expType = ProcessTypeString("void *", 0x1);
15063 if(exp->call.arguments && (*exp->call.arguments).first)
15064 ProcessExpressionType((*exp->call.arguments).first);
15065 break;
15066 }
15067 else if(!strcmp(id->string, "__ENDIAN_PAD"))
15068 {
15069 exp->expType = ProcessTypeString("int", 0x1);
15070 if(exp->call.arguments && (*exp->call.arguments).first)
15071 ProcessExpressionType((*exp->call.arguments).first);
15072 break;
15073 }
15074 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
15075 {
15076 struct Expression * a = (((void *)0));
15077 struct Expression * b = (((void *)0));
15078 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
15079
15080 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
15081 {
15082 a = (*exp->call.arguments).first;
15083 b = (*exp->call.arguments).last;
15084 tempExp1 = a;
15085 tempExp2 = b;
15086 }
15087 else if((*exp->call.arguments).count == 1)
15088 {
15089 a = (*exp->call.arguments).first;
15090 tempExp1 = a;
15091 }
15092 if(a)
15093 {
15094 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
15095 idExp->identifier = (((void *)0));
15096 FreeExpContents(exp);
15097 ProcessExpressionType(a);
15098 if(b)
15099 ProcessExpressionType(b);
15100 exp->type = 5;
15101 exp->list = MkList();
15102 if(a->expType && (!b || b->expType))
15103 {
15104 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
15105 {
15106 if(inCompiler)
15107 {
15108 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15109 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
15110 struct Declaration * decl;
15111 char temp1[1024], temp2[1024];
15112
15113 GetTypeSpecs(a->expType, specs);
15114 if(a && !a->isConstant && a->type != 0)
15115 {
15116 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
15117 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
15118 tempExp1 = QMkExpId(temp1);
15119 tempExp1->expType = a->expType;
15120 if(a->expType)
15121 a->expType->refCount++;
15122 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
15123 }
15124 if(b && !b->isConstant && b->type != 0)
15125 {
15126 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
15127 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
15128 tempExp2 = QMkExpId(temp2);
15129 tempExp2->expType = b->expType;
15130 if(b->expType)
15131 b->expType->refCount++;
15132 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
15133 }
15134 decl = MkDeclaration(specs, decls);
15135 if(!curCompound->compound.declarations)
15136 curCompound->compound.declarations = MkList();
15137 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
15138 }
15139 }
15140 }
15141 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
15142 {
15143 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
15144
15145 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
15146 exp->expType = a->expType;
15147 if(a->expType)
15148 a->expType->refCount++;
15149 }
15150 else if(!strcmp(id->string, "Abs"))
15151 {
15152 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
15153 exp->expType = a->expType;
15154 if(a->expType)
15155 a->expType->refCount++;
15156 }
15157 else if(!strcmp(id->string, "Sgn"))
15158 {
15159 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"))))));
15160 exp->expType = ProcessTypeString("int", 0x0);
15161 }
15162 FreeExpression(tempExp1);
15163 if(tempExp2)
15164 FreeExpression(tempExp2);
15165 FreeIdentifier(id);
15166 break;
15167 }
15168 }
15169 }
15170 {
15171 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
15172
15173 if(!exp->call.exp->destType)
15174 {
15175 exp->call.exp->destType = dummy;
15176 dummy->refCount++;
15177 }
15178 ProcessExpressionType(exp->call.exp);
15179 if(exp->call.exp->destType == dummy)
15180 {
15181 FreeType(dummy);
15182 exp->call.exp->destType = (((void *)0));
15183 }
15184 FreeType(dummy);
15185 }
15186 functionType = exp->call.exp->expType;
15187 if(functionType && functionType->kind == 16)
15188 {
15189 methodType = functionType;
15190 functionType = methodType->method->dataType;
15191 if(exp->call.exp->expType->usedClass)
15192 {
15193 char typeString[1024];
15194
15195 typeString[0] = '\0';
15196 {
15197 struct Symbol * back = functionType->thisClass;
15198
15199 functionType->thisClass = (((void *)0));
15200 PrintType(functionType, typeString, 0x1, 0x1);
15201 functionType->thisClass = back;
15202 }
15203 if(strstr(typeString, "thisclass"))
15204 {
15205 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15206 struct Declarator * decl;
15207
15208 {
15209 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
15210
15211 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
15212 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
15213 thisClassParams = 0x0;
15214 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
15215 {
15216 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
15217
15218 thisClass = exp->call.exp->expType->usedClass;
15219 ProcessDeclarator(decl);
15220 thisClass = backupThisClass;
15221 }
15222 thisClassParams = 0x1;
15223 functionType = ProcessType(specs, decl);
15224 functionType->refCount = 0;
15225 FinishTemplatesContext(context);
15226 }
15227 FreeList(specs, FreeSpecifier);
15228 FreeDeclarator(decl);
15229 }
15230 }
15231 }
15232 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
15233 {
15234 struct Type * type = functionType->type;
15235
15236 if(!functionType->refCount)
15237 {
15238 functionType->type = (((void *)0));
15239 FreeType(functionType);
15240 }
15241 functionType = type;
15242 }
15243 if(functionType && functionType->kind != 11)
15244 {
15245 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "called object %s is not a function\n", (((void *)0))), name);
15246 }
15247 else if(functionType)
15248 {
15249 unsigned int emptyParams = 0x0, noParams = 0x0;
15250 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
15251 struct Type * type = functionType->params.first;
15252 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
15253 int extra = 0;
15254 struct Location oldyylloc = yylloc;
15255
15256 if(!type)
15257 emptyParams = 0x1;
15258 if(functionType->extraParam && e && functionType->thisClass)
15259 {
15260 e->destType = MkClassType(functionType->thisClass->string);
15261 e = e->next;
15262 }
15263 if(!functionType->staticMethod && !functionType->extraParam)
15264 {
15265 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
15266 {
15267 type = MkClassType(memberExp->member.exp->expType->_class->string);
15268 if(e)
15269 {
15270 e->destType = type;
15271 e = e->next;
15272 type = functionType->params.first;
15273 }
15274 else
15275 type->refCount = 0;
15276 }
15277 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
15278 {
15279 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
15280 type->byReference = functionType->byReference;
15281 type->typedByReference = functionType->typedByReference;
15282 if(e)
15283 {
15284 if(e->next && type->kind == 8 && (functionType && functionType->thisClass) && functionType->classObjectType == 2)
15285 e = e->next;
15286 e->destType = type;
15287 e = e->next;
15288 type = functionType->params.first;
15289 }
15290 else
15291 type->refCount = 0;
15292 }
15293 }
15294 if(type && type->kind == 0)
15295 {
15296 noParams = 0x1;
15297 if(!type->refCount)
15298 FreeType(type);
15299 type = (((void *)0));
15300 }
15301 for(; e; e = e->next)
15302 {
15303 if(!type && !emptyParams)
15304 {
15305 yylloc = e->loc;
15306 if(methodType && methodType->methodClass)
15307 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);
15308 else
15309 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);
15310 break;
15311 }
15312 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
15313 {
15314 struct Type * templatedType = (((void *)0));
15315 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
15316 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15317 int id = 0;
15318
15319 if(_class && _class->templateArgs)
15320 {
15321 struct __ecereNameSpace__ecere__com__Class * sClass;
15322
15323 for(sClass = _class; sClass; sClass = sClass->base)
15324 {
15325 if(sClass->templateClass)
15326 sClass = sClass->templateClass;
15327 id = 0;
15328 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15329 {
15330 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
15331 {
15332 struct __ecereNameSpace__ecere__com__Class * nextClass;
15333
15334 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15335 {
15336 if(nextClass->templateClass)
15337 nextClass = nextClass->templateClass;
15338 id += nextClass->templateParams.count;
15339 }
15340 break;
15341 }
15342 id++;
15343 }
15344 if(curParam)
15345 break;
15346 }
15347 }
15348 if(curParam && _class->templateArgs[id].dataTypeString)
15349 {
15350 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
15351
15352 {
15353 struct Context * context = SetupTemplatesContext(_class);
15354
15355 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
15356 FinishTemplatesContext(context);
15357 }
15358 e->destType = templatedType;
15359 if(templatedType)
15360 {
15361 templatedType->passAsTemplate = 0x1;
15362 }
15363 }
15364 else
15365 {
15366 e->destType = type;
15367 if(type)
15368 type->refCount++;
15369 }
15370 }
15371 else
15372 {
15373 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
15374 {
15375 e->destType = type->prev;
15376 e->destType->refCount++;
15377 }
15378 else
15379 {
15380 e->destType = type;
15381 if(type)
15382 type->refCount++;
15383 }
15384 }
15385 if(type && type->kind != 14)
15386 {
15387 struct Type * next = type->next;
15388
15389 if(!type->refCount)
15390 FreeType(type);
15391 type = next;
15392 }
15393 }
15394 if(type && type->kind != 14)
15395 {
15396 if(methodType && methodType->methodClass)
15397 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);
15398 else
15399 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);
15400 }
15401 yylloc = oldyylloc;
15402 if(type && !type->refCount)
15403 FreeType(type);
15404 }
15405 else
15406 {
15407 functionType = __extension__ ({
15408 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15409
15410 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
15411 });
15412 if(exp->call.exp->type == 0)
15413 {
15414 char * string = exp->call.exp->identifier->string;
15415
15416 if(inCompiler)
15417 {
15418 struct Symbol * symbol;
15419 struct Location oldyylloc = yylloc;
15420
15421 yylloc = exp->call.exp->identifier->loc;
15422 if(strstr(string, "__builtin_") == string)
15423 {
15424 if(exp->destType)
15425 {
15426 functionType->returnType = exp->destType;
15427 exp->destType->refCount++;
15428 }
15429 }
15430 else
15431 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s undefined; assuming extern returning int\n", (((void *)0))), string);
15432 symbol = __extension__ ({
15433 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
15434
15435 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 0x1), __ecereInstance1;
15436 });
15437 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
15438 if(strstr(symbol->string, "::"))
15439 globalContext->hasNameSpace = 0x1;
15440 yylloc = oldyylloc;
15441 }
15442 }
15443 else if(exp->call.exp->type == 8)
15444 {
15445 }
15446 else
15447 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "callable object undefined; extern assuming returning int\n", (((void *)0))));
15448 if(!functionType->returnType)
15449 {
15450 functionType->returnType = __extension__ ({
15451 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15452
15453 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15454 });
15455 }
15456 }
15457 if(functionType && functionType->kind == 11)
15458 {
15459 exp->expType = functionType->returnType;
15460 if(functionType->returnType)
15461 functionType->returnType->refCount++;
15462 if(!functionType->refCount)
15463 FreeType(functionType);
15464 }
15465 if(exp->call.arguments)
15466 {
15467 for(e = (*exp->call.arguments).first; e; e = e->next)
15468 {
15469 struct Type * destType = e->destType;
15470
15471 ProcessExpressionType(e);
15472 }
15473 }
15474 break;
15475 }
15476 case 8:
15477 {
15478 struct Type * type;
15479 struct Location oldyylloc = yylloc;
15480 unsigned int thisPtr;
15481 struct Expression * checkExp = exp->member.exp;
15482
15483 while(checkExp)
15484 {
15485 if(checkExp->type == 11)
15486 checkExp = checkExp->cast.exp;
15487 else if(checkExp->type == 5)
15488 checkExp = checkExp->list ? (*checkExp->list).first : (((void *)0));
15489 else
15490 break;
15491 }
15492 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->identifier->string, "this"));
15493 exp->thisPtr = thisPtr;
15494 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
15495 {
15496 exp->member.member->classSym = exp->member.member->_class->symbol;
15497 }
15498 ProcessExpressionType(exp->member.exp);
15499 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)
15500 {
15501 exp->isConstant = 0x0;
15502 }
15503 else
15504 exp->isConstant = exp->member.exp->isConstant;
15505 type = exp->member.exp->expType;
15506 yylloc = exp->loc;
15507 if(type && (type->kind == 20))
15508 {
15509 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
15510 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
15511
15512 if(_class)
15513 {
15514 for(param = _class->templateParams.first; param; param = param->next)
15515 {
15516 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
15517 break;
15518 }
15519 }
15520 if(param && param->defaultArg.member)
15521 {
15522 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
15523
15524 if(argExp)
15525 {
15526 struct Expression * expMember = exp->member.exp;
15527 struct Declarator * decl;
15528 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15529 char thisClassTypeString[1024];
15530
15531 FreeIdentifier(exp->member.member);
15532 ProcessExpressionType(argExp);
15533 {
15534 char * colon = strstr(param->defaultArg.memberString, "::");
15535
15536 if(colon)
15537 {
15538 char className[1024];
15539 struct __ecereNameSpace__ecere__com__Class * sClass;
15540
15541 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
15542 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
15543 }
15544 else
15545 strcpy(thisClassTypeString, _class->fullName);
15546 }
15547 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
15548 exp->expType = ProcessType(specs, decl);
15549 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
15550 {
15551 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
15552 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
15553 int c;
15554 int paramCount = 0;
15555 int lastParam = -1;
15556 char templateString[1024];
15557 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
15558
15559 sprintf(templateString, "%s<", expClass->templateClass->fullName);
15560 for(cClass = expClass; cClass; cClass = cClass->base)
15561 {
15562 int p = 0;
15563
15564 for(param = cClass->templateParams.first; param; param = param->next)
15565 {
15566 int id = p;
15567 struct __ecereNameSpace__ecere__com__Class * sClass;
15568 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
15569
15570 for(sClass = cClass->base; sClass; sClass = sClass->base)
15571 id += sClass->templateParams.count;
15572 arg = expClass->templateArgs[id];
15573 for(sClass = _class; sClass; sClass = sClass->base)
15574 {
15575 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
15576 int p = 0;
15577 struct __ecereNameSpace__ecere__com__Class * nextClass;
15578
15579 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15580 p += nextClass->templateParams.count;
15581 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
15582 {
15583 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
15584 {
15585 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15586 {
15587 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
15588 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
15589 break;
15590 }
15591 }
15592 }
15593 }
15594 {
15595 char argument[256];
15596
15597 argument[0] = '\0';
15598 switch(param->type)
15599 {
15600 case 2:
15601 {
15602 char expString[1024];
15603 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15604 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
15605 struct Expression * exp;
15606 char * string = PrintHexUInt64(arg.expression.ui64);
15607
15608 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
15609 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
15610 ProcessExpressionType(exp);
15611 ComputeExpression(exp);
15612 expString[0] = '\0';
15613 PrintExpression(exp, expString);
15614 strcat(argument, expString);
15615 FreeExpression(exp);
15616 break;
15617 }
15618 case 1:
15619 {
15620 strcat(argument, arg.member->name);
15621 break;
15622 }
15623 case 0:
15624 {
15625 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15626 {
15627 if(!strcmp(arg.dataTypeString, "thisclass"))
15628 strcat(argument, thisClassTypeString);
15629 else
15630 strcat(argument, arg.dataTypeString);
15631 }
15632 break;
15633 }
15634 }
15635 if(argument[0])
15636 {
15637 if(paramCount)
15638 strcat(templateString, ", ");
15639 if(lastParam != p - 1)
15640 {
15641 strcat(templateString, param->name);
15642 strcat(templateString, " = ");
15643 }
15644 strcat(templateString, argument);
15645 paramCount++;
15646 lastParam = p;
15647 }
15648 p++;
15649 }
15650 }
15651 }
15652 {
15653 int len = strlen(templateString);
15654
15655 if(templateString[len - 1] == '>')
15656 templateString[len++] = ' ';
15657 templateString[len++] = '>';
15658 templateString[len++] = '\0';
15659 }
15660 {
15661 struct Context * context = SetupTemplatesContext(_class);
15662
15663 FreeType(exp->expType);
15664 exp->expType = ProcessTypeString(templateString, 0x0);
15665 FinishTemplatesContext(context);
15666 }
15667 }
15668 exp->type = 5;
15669 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")))))))));
15670 }
15671 }
15672 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
15673 {
15674 type = ProcessTemplateParameterType(type->templateParameter);
15675 }
15676 }
15677 if(type && (type->kind == 20))
15678 ;
15679 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)))
15680 {
15681 struct Identifier * id = exp->member.member;
15682 int typeKind = type->kind;
15683 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));
15684
15685 if(typeKind == 19 && exp->member.exp->type == 24)
15686 {
15687 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
15688 typeKind = 8;
15689 }
15690 if(id)
15691 {
15692 if(typeKind == 3 || typeKind == 15)
15693 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
15694 else if(!_class)
15695 {
15696 if(type->kind == 8 && type->_class && type->_class->registered)
15697 {
15698 _class = type->_class->registered;
15699 }
15700 else if((type->kind == 12 || type->kind == 13) && type->type && type->type->kind == 1)
15701 {
15702 _class = FindClass("char *")->registered;
15703 }
15704 else if(type->kind == 13)
15705 {
15706 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
15707 FreeType(exp->expType);
15708 exp->expType = ProcessTypeString("uintptr", 0x0);
15709 exp->byReference = 0x1;
15710 }
15711 else
15712 {
15713 char string[1024] = "";
15714 struct Symbol * classSym;
15715
15716 PrintTypeNoConst(type, string, 0x0, 0x1);
15717 classSym = FindClass(string);
15718 if(classSym)
15719 _class = classSym->registered;
15720 }
15721 }
15722 }
15723 if(_class && id)
15724 {
15725 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
15726 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
15727 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
15728 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
15729 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
15730
15731 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
15732 exp->member.memberType = 1;
15733 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
15734 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
15735 if(typeKind != 19)
15736 {
15737 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
15738 {
15739 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
15740 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
15741 {
15742 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15743 if(prop)
15744 member = (((void *)0));
15745 }
15746 if(!member && !prop)
15747 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15748 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
15749 exp->member.thisPtr = 0x1;
15750 }
15751 else
15752 {
15753 if(!id->classSym)
15754 {
15755 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
15756 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
15757 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
15758 }
15759 if(!prop && !member)
15760 {
15761 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
15762 if(!method)
15763 {
15764 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15765 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
15766 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
15767 }
15768 }
15769 if(member && prop)
15770 {
15771 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
15772 prop = (((void *)0));
15773 else
15774 member = (((void *)0));
15775 }
15776 }
15777 }
15778 if(!prop && !member && !method)
15779 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
15780 if(!prop && !member && !method)
15781 {
15782 if(typeKind == 19)
15783 {
15784 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
15785 if(classProp)
15786 {
15787 exp->member.memberType = 5;
15788 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
15789 }
15790 else
15791 {
15792 char structName[1024];
15793 struct Identifier * id = exp->member.member;
15794 struct Expression * classExp = exp->member.exp;
15795
15796 type->refCount++;
15797 FreeType(classExp->expType);
15798 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
15799 strcpy(structName, "__ecereClassData_");
15800 FullClassNameCat(structName, type->_class->string, 0x0);
15801 exp->type = 9;
15802 exp->member.member = id;
15803 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"))))))));
15804 FreeType(type);
15805 ProcessExpressionType(exp);
15806 return ;
15807 }
15808 }
15809 else
15810 {
15811 struct Symbol * classSym = FindClass(id->string);
15812
15813 if(classSym)
15814 {
15815 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
15816
15817 if(convertClass)
15818 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
15819 }
15820 }
15821 }
15822 if(prop)
15823 {
15824 exp->member.memberType = 1;
15825 if(!prop->dataType)
15826 ProcessPropertyType(prop);
15827 exp->expType = prop->dataType;
15828 if(prop->dataType)
15829 prop->dataType->refCount++;
15830 }
15831 else if(member)
15832 {
15833 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
15834 {
15835 FreeExpContents(exp);
15836 exp->type = 0;
15837 exp->identifier = MkIdentifier("class");
15838 ProcessExpressionType(exp);
15839 return ;
15840 }
15841 exp->member.memberType = 3;
15842 DeclareStruct(_class->fullName, 0x0);
15843 if(!member->dataType)
15844 {
15845 struct Context * context = SetupTemplatesContext(_class);
15846
15847 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
15848 FinishTemplatesContext(context);
15849 }
15850 exp->expType = member->dataType;
15851 if(member->dataType)
15852 member->dataType->refCount++;
15853 }
15854 else if(revConvert)
15855 {
15856 exp->member.memberType = 4;
15857 exp->expType = MkClassType(revConvert->_class->fullName);
15858 }
15859 else if(method)
15860 {
15861 {
15862 exp->member.memberType = 2;
15863 }
15864 if(!method->dataType)
15865 ProcessMethodType(method);
15866 exp->expType = __extension__ ({
15867 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15868
15869 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1;
15870 });
15871 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
15872 exp->expType->usedClass = _class;
15873 }
15874 else if(!classProp)
15875 {
15876 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
15877 {
15878 FreeExpContents(exp);
15879 exp->type = 0;
15880 exp->identifier = MkIdentifier("class");
15881 FreeType(exp->expType);
15882 exp->expType = MkClassType("ecere::com::Class");
15883 return ;
15884 }
15885 yylloc = exp->member.member->loc;
15886 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
15887 if(inCompiler)
15888 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
15889 }
15890 if(_class && exp->expType)
15891 {
15892 struct __ecereNameSpace__ecere__com__Class * tClass;
15893
15894 tClass = _class;
15895 while(tClass && !tClass->templateClass)
15896 tClass = tClass->base;
15897 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
15898 {
15899 int id = 0;
15900 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15901 struct __ecereNameSpace__ecere__com__Class * sClass;
15902
15903 for(sClass = tClass; sClass; sClass = sClass->base)
15904 {
15905 id = 0;
15906 if(sClass->templateClass)
15907 sClass = sClass->templateClass;
15908 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15909 {
15910 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
15911 {
15912 for(sClass = sClass->base; sClass; sClass = sClass->base)
15913 id += sClass->templateParams.count;
15914 break;
15915 }
15916 id++;
15917 }
15918 if(curParam)
15919 break;
15920 }
15921 if(curParam && tClass->templateArgs[id].dataTypeString)
15922 {
15923 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
15924 struct Context * context = SetupTemplatesContext(tClass);
15925
15926 FreeType(exp->expType);
15927 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
15928 if(exp->expType)
15929 {
15930 if(exp->expType->kind == 21)
15931 {
15932 FreeType(exp->expType);
15933 exp->expType = ReplaceThisClassType(_class);
15934 }
15935 if(tClass->templateClass)
15936 exp->expType->passAsTemplate = 0x1;
15937 if(!exp->destType)
15938 {
15939 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
15940 if(exp->destType->kind == 21)
15941 {
15942 FreeType(exp->destType);
15943 exp->destType = ReplaceThisClassType(_class);
15944 }
15945 }
15946 }
15947 FinishTemplatesContext(context);
15948 }
15949 }
15950 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
15951 {
15952 int id = 0;
15953 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15954 struct __ecereNameSpace__ecere__com__Class * sClass;
15955
15956 for(sClass = tClass; sClass; sClass = sClass->base)
15957 {
15958 id = 0;
15959 if(sClass->templateClass)
15960 sClass = sClass->templateClass;
15961 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15962 {
15963 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
15964 {
15965 for(sClass = sClass->base; sClass; sClass = sClass->base)
15966 id += sClass->templateParams.count;
15967 break;
15968 }
15969 id++;
15970 }
15971 if(curParam)
15972 break;
15973 }
15974 if(curParam)
15975 {
15976 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
15977 struct Context * context = SetupTemplatesContext(tClass);
15978 struct Type * basicType;
15979
15980 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
15981 if(basicType)
15982 {
15983 if(basicType->kind == 21)
15984 {
15985 FreeType(basicType);
15986 basicType = ReplaceThisClassType(_class);
15987 }
15988 FreeType(exp->expType);
15989 exp->expType = __extension__ ({
15990 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15991
15992 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = basicType, __ecereInstance1;
15993 });
15994 if(!exp->destType)
15995 {
15996 exp->destType = exp->expType;
15997 exp->destType->refCount++;
15998 }
15999 {
16000 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16001 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16002 struct Declarator * decl;
16003
16004 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
16005 *newExp = *exp;
16006 if(exp->destType)
16007 exp->destType->refCount++;
16008 if(exp->expType)
16009 exp->expType->refCount++;
16010 exp->type = 11;
16011 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
16012 exp->cast.exp = newExp;
16013 }
16014 }
16015 FinishTemplatesContext(context);
16016 }
16017 }
16018 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
16019 {
16020 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
16021
16022 if(expClass)
16023 {
16024 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
16025 int c;
16026 int p = 0;
16027 int paramCount = 0;
16028 int lastParam = -1;
16029 char templateString[1024];
16030 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
16031
16032 sprintf(templateString, "%s<", expClass->templateClass->fullName);
16033 while(cClass != expClass)
16034 {
16035 struct __ecereNameSpace__ecere__com__Class * sClass;
16036
16037 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
16038 ;
16039 cClass = sClass;
16040 for(param = cClass->templateParams.first; param; param = param->next)
16041 {
16042 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
16043 int c;
16044 int cp = 0;
16045 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
16046 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
16047
16048 while(cClassCur != tClass && !paramCur)
16049 {
16050 struct __ecereNameSpace__ecere__com__Class * sClassCur;
16051
16052 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
16053 ;
16054 cClassCur = sClassCur;
16055 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
16056 {
16057 if(!strcmp(paramCur->name, param->name))
16058 {
16059 break;
16060 }
16061 cp++;
16062 }
16063 }
16064 if(paramCur && paramCur->type == 0)
16065 arg = tClass->templateArgs[cp];
16066 else
16067 arg = expClass->templateArgs[p];
16068 {
16069 char argument[256];
16070
16071 argument[0] = '\0';
16072 switch(param->type)
16073 {
16074 case 2:
16075 {
16076 char expString[1024];
16077 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16078 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
16079 struct Expression * exp;
16080 char * string = PrintHexUInt64(arg.expression.ui64);
16081
16082 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
16083 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
16084 ProcessExpressionType(exp);
16085 ComputeExpression(exp);
16086 expString[0] = '\0';
16087 PrintExpression(exp, expString);
16088 strcat(argument, expString);
16089 FreeExpression(exp);
16090 break;
16091 }
16092 case 1:
16093 {
16094 strcat(argument, arg.member->name);
16095 break;
16096 }
16097 case 0:
16098 {
16099 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
16100 strcat(argument, arg.dataTypeString);
16101 break;
16102 }
16103 }
16104 if(argument[0])
16105 {
16106 if(paramCount)
16107 strcat(templateString, ", ");
16108 if(lastParam != p - 1)
16109 {
16110 strcat(templateString, param->name);
16111 strcat(templateString, " = ");
16112 }
16113 strcat(templateString, argument);
16114 paramCount++;
16115 lastParam = p;
16116 }
16117 }
16118 p++;
16119 }
16120 }
16121 {
16122 int len = strlen(templateString);
16123
16124 if(templateString[len - 1] == '>')
16125 templateString[len++] = ' ';
16126 templateString[len++] = '>';
16127 templateString[len++] = '\0';
16128 }
16129 FreeType(exp->expType);
16130 {
16131 struct Context * context = SetupTemplatesContext(tClass);
16132
16133 exp->expType = ProcessTypeString(templateString, 0x0);
16134 FinishTemplatesContext(context);
16135 }
16136 }
16137 }
16138 }
16139 }
16140 else
16141 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)");
16142 }
16143 else if(type && (type->kind == 9 || type->kind == 10))
16144 {
16145 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
16146
16147 if(memberType)
16148 {
16149 exp->expType = memberType;
16150 if(memberType)
16151 memberType->refCount++;
16152 }
16153 }
16154 else
16155 {
16156 char expString[10240];
16157
16158 expString[0] = '\0';
16159 if(inCompiler)
16160 {
16161 PrintExpression(exp, expString);
16162 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16163 }
16164 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "member operator on non-structure type expression %s\n", (((void *)0))), expString);
16165 }
16166 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
16167 {
16168 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
16169 {
16170 struct Identifier * id = exp->member.member;
16171 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));
16172
16173 if(_class)
16174 {
16175 FreeType(exp->expType);
16176 exp->expType = ReplaceThisClassType(_class);
16177 }
16178 }
16179 }
16180 yylloc = oldyylloc;
16181 break;
16182 }
16183 case 9:
16184 {
16185 struct Type * destType = exp->destType;
16186
16187 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
16188 {
16189 exp->member.member->classSym = exp->member.member->_class->symbol;
16190 }
16191 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
16192 exp->type = 8;
16193 if(destType)
16194 destType->count++;
16195 ProcessExpressionType(exp);
16196 if(destType)
16197 destType->count--;
16198 break;
16199 }
16200 case 15:
16201 {
16202 struct Symbol * classSym = exp->_class->symbol;
16203
16204 if(classSym && classSym->registered)
16205 {
16206 if(classSym->registered->type == 5)
16207 {
16208 char name[1024];
16209
16210 name[0] = '\0';
16211 DeclareStruct(classSym->string, 0x0);
16212 FreeSpecifier(exp->_class);
16213 exp->type = 10;
16214 FullClassNameCat(name, classSym->string, 0x0);
16215 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
16216 }
16217 else
16218 {
16219 if(classSym->registered->fixed)
16220 {
16221 FreeSpecifier(exp->_class);
16222 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
16223 exp->type = 2;
16224 }
16225 else
16226 {
16227 char className[1024];
16228
16229 strcpy(className, "__ecereClass_");
16230 FullClassNameCat(className, classSym->string, 0x1);
16231 MangleClassName(className);
16232 DeclareClass(classSym, className);
16233 FreeExpContents(exp);
16234 exp->type = 9;
16235 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
16236 exp->member.member = MkIdentifier("structSize");
16237 }
16238 }
16239 }
16240 exp->expType = __extension__ ({
16241 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16242
16243 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
16244 });
16245 break;
16246 }
16247 case 10:
16248 {
16249 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
16250
16251 exp->expType = __extension__ ({
16252 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16253
16254 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
16255 });
16256 exp->isConstant = 0x1;
16257 DeclareType(type, 0x0, 0x0);
16258 FreeType(type);
16259 break;
16260 }
16261 case 11:
16262 {
16263 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
16264
16265 type->count = 1;
16266 FreeType(exp->cast.exp->destType);
16267 exp->cast.exp->destType = type;
16268 type->refCount++;
16269 ProcessExpressionType(exp->cast.exp);
16270 type->count = 0;
16271 exp->expType = type;
16272 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
16273 {
16274 void * prev = exp->prev, * next = exp->next;
16275 struct Type * expType = exp->cast.exp->destType;
16276 struct Expression * castExp = exp->cast.exp;
16277 struct Type * destType = exp->destType;
16278
16279 if(expType)
16280 expType->refCount++;
16281 FreeType(exp->expType);
16282 FreeTypeName(exp->cast.typeName);
16283 *exp = *castExp;
16284 FreeType(exp->expType);
16285 FreeType(exp->destType);
16286 exp->expType = expType;
16287 exp->destType = destType;
16288 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
16289 exp->prev = prev;
16290 exp->next = next;
16291 }
16292 else
16293 {
16294 exp->isConstant = exp->cast.exp->isConstant;
16295 }
16296 break;
16297 }
16298 case 33:
16299 {
16300 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
16301
16302 exp->expType = type;
16303 break;
16304 }
16305 case 34:
16306 {
16307 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
16308
16309 ProcessExpressionType(exp->vaArg.exp);
16310 exp->expType = type;
16311 break;
16312 }
16313 case 12:
16314 {
16315 struct Expression * e;
16316
16317 exp->isConstant = 0x1;
16318 FreeType(exp->cond.cond->destType);
16319 exp->cond.cond->destType = MkClassType("bool");
16320 exp->cond.cond->destType->truth = 0x1;
16321 ProcessExpressionType(exp->cond.cond);
16322 if(!exp->cond.cond->isConstant)
16323 exp->isConstant = 0x0;
16324 for(e = (*exp->cond.exp).first; e; e = e->next)
16325 {
16326 if(!e->next)
16327 {
16328 FreeType(e->destType);
16329 e->destType = exp->destType;
16330 if(e->destType)
16331 e->destType->refCount++;
16332 }
16333 ProcessExpressionType(e);
16334 if(!e->next)
16335 {
16336 exp->expType = e->expType;
16337 if(e->expType)
16338 e->expType->refCount++;
16339 }
16340 if(!e->isConstant)
16341 exp->isConstant = 0x0;
16342 }
16343 FreeType(exp->cond.elseExp->destType);
16344 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
16345 if(exp->cond.elseExp->destType)
16346 exp->cond.elseExp->destType->refCount++;
16347 ProcessExpressionType(exp->cond.elseExp);
16348 if(!exp->cond.elseExp->isConstant)
16349 exp->isConstant = 0x0;
16350 break;
16351 }
16352 case 23:
16353 {
16354 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
16355 {
16356 struct Statement * last = (*exp->compound->compound.statements).last;
16357
16358 if(last->type == 3 && last->expressions && (*last->expressions).last)
16359 {
16360 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
16361 if(exp->destType)
16362 exp->destType->refCount++;
16363 }
16364 ProcessStatement(exp->compound);
16365 exp->expType = (last->expressions && (*last->expressions).last) ? ((struct Expression *)(*last->expressions).last)->expType : (((void *)0));
16366 if(exp->expType)
16367 exp->expType->refCount++;
16368 }
16369 break;
16370 }
16371 case 24:
16372 {
16373 struct Specifier * spec = (*exp->_classExp.specifiers).first;
16374
16375 if(spec && spec->type == 1)
16376 {
16377 exp->expType = MkClassType(spec->name);
16378 exp->expType->kind = 19;
16379 exp->byReference = 0x1;
16380 }
16381 else
16382 {
16383 exp->expType = MkClassType("ecere::com::Class");
16384 exp->byReference = 0x1;
16385 }
16386 break;
16387 }
16388 case 25:
16389 {
16390 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
16391
16392 if(_class)
16393 {
16394 struct Identifier * id = exp->classData.id;
16395 char structName[1024];
16396 struct Expression * classExp;
16397
16398 strcpy(structName, "__ecereClassData_");
16399 FullClassNameCat(structName, _class->fullName, 0x0);
16400 exp->type = 9;
16401 exp->member.member = id;
16402 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
16403 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
16404 else
16405 classExp = MkExpIdentifier(MkIdentifier("class"));
16406 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"))))))));
16407 ProcessExpressionType(exp);
16408 return ;
16409 }
16410 break;
16411 }
16412 case 35:
16413 {
16414 struct Type * type = (((void *)0));
16415 char * typeString = (((void *)0));
16416 char typeStringBuf[1024];
16417
16418 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))
16419 {
16420 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
16421
16422 typeString = templateClass->templateArgs[2].dataTypeString;
16423 }
16424 else if(exp->list)
16425 {
16426 struct Expression * e;
16427
16428 for(e = (*exp->list).first; e; e = e->next)
16429 {
16430 ProcessExpressionType(e);
16431 if(e->expType)
16432 {
16433 if(!type)
16434 {
16435 type = e->expType;
16436 type->refCount++;
16437 }
16438 else
16439 {
16440 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
16441 {
16442 FreeType(type);
16443 type = e->expType;
16444 e->expType = (((void *)0));
16445 e = (*exp->list).first;
16446 ProcessExpressionType(e);
16447 if(e->expType)
16448 {
16449 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
16450 {
16451 FreeType(e->expType);
16452 e->expType = (((void *)0));
16453 FreeType(type);
16454 type = (((void *)0));
16455 break;
16456 }
16457 }
16458 }
16459 }
16460 if(e->expType)
16461 {
16462 FreeType(e->expType);
16463 e->expType = (((void *)0));
16464 }
16465 }
16466 }
16467 if(type)
16468 {
16469 typeStringBuf[0] = '\0';
16470 PrintTypeNoConst(type, typeStringBuf, 0x0, 0x1);
16471 typeString = typeStringBuf;
16472 FreeType(type);
16473 type = (((void *)0));
16474 }
16475 }
16476 if(typeString)
16477 {
16478 char templateString[1024];
16479 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
16480 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
16481 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16482 struct Expression * expExt;
16483 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16484
16485 sprintf(templateString, "Container<%s>", typeString);
16486 if(exp->list)
16487 {
16488 struct Expression * e;
16489
16490 type = ProcessTypeString(typeString, 0x0);
16491 while(e = (*exp->list).first)
16492 {
16493 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
16494 e->destType = type;
16495 type->refCount++;
16496 ProcessExpressionType(e);
16497 ListAdd(initializers, MkInitializerAssignment(e));
16498 }
16499 FreeType(type);
16500 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
16501 }
16502 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
16503 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
16504 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16505 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
16506 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16507 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
16508 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16509 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
16510 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16511 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
16512 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16513
16514 __ecereInstance1->type = 2, __ecereInstance1->constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, (void *)0), __ecereInstance1;
16515 })));
16516 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16517 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
16518 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16519 exp->expType = ProcessTypeString(templateString, 0x0);
16520 exp->type = 5;
16521 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
16522 ProcessExpressionType(expExt);
16523 }
16524 else
16525 {
16526 exp->expType = ProcessTypeString("Container", 0x0);
16527 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
16528 }
16529 break;
16530 }
16531 }
16532 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
16533 {
16534 FreeType(exp->expType);
16535 exp->expType = ReplaceThisClassType(thisClass);
16536 }
16537 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
16538 {
16539 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
16540
16541 if(symbol)
16542 {
16543 if(exp->expType->kind != 15)
16544 {
16545 struct Type * member;
16546 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
16547
16548 FreeType(exp->expType);
16549 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16550 exp->expType->kind = symbol->type->kind;
16551 exp->expType->refCount++;
16552 exp->expType->enumName = enumName;
16553 exp->expType->members = symbol->type->members;
16554 for(member = symbol->type->members.first; member; member = member->next)
16555 member->refCount++;
16556 }
16557 else
16558 {
16559 struct __ecereNameSpace__ecere__sys__NamedLink * member;
16560
16561 for(member = symbol->type->members.first; member; member = member->next)
16562 {
16563 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(structSize_NamedLink), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
16564
16565 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
16566 }
16567 }
16568 }
16569 }
16570 yylloc = exp->loc;
16571 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
16572 ;
16573 else if(exp->destType && !exp->destType->keepCast)
16574 {
16575 if(!CheckExpressionType(exp, exp->destType, 0x0))
16576 {
16577 if(!exp->destType->count || unresolved)
16578 {
16579 if(!exp->expType)
16580 {
16581 yylloc = exp->loc;
16582 if(exp->destType->kind != 14)
16583 {
16584 char type2[1024];
16585
16586 type2[0] = '\0';
16587 if(inCompiler)
16588 {
16589 char expString[10240];
16590
16591 expString[0] = '\0';
16592 PrintType(exp->destType, type2, 0x0, 0x1);
16593 if(inCompiler)
16594 {
16595 PrintExpression(exp, expString);
16596 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16597 }
16598 if(unresolved)
16599 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
16600 else if(exp->type != 16)
16601 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
16602 }
16603 }
16604 else
16605 {
16606 char expString[10240];
16607
16608 expString[0] = '\0';
16609 if(inCompiler)
16610 {
16611 PrintExpression(exp, expString);
16612 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16613 }
16614 if(unresolved)
16615 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), expString);
16616 else if(exp->type != 16)
16617 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16618 }
16619 }
16620 else
16621 {
16622 char type1[1024];
16623 char type2[1024];
16624
16625 type1[0] = '\0';
16626 type2[0] = '\0';
16627 if(inCompiler)
16628 {
16629 PrintType(exp->expType, type1, 0x0, 0x1);
16630 PrintType(exp->destType, type2, 0x0, 0x1);
16631 }
16632 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)))
16633 ;
16634 else
16635 {
16636 char expString[10240];
16637
16638 expString[0] = '\0';
16639 if(inCompiler)
16640 {
16641 PrintExpression(exp, expString);
16642 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16643 }
16644 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
16645 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
16646 FreeType(exp->expType);
16647 exp->destType->refCount++;
16648 exp->expType = exp->destType;
16649 }
16650 }
16651 }
16652 }
16653 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
16654 {
16655 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16656 char typeString[1024];
16657 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16658 struct Declarator * decl;
16659
16660 typeString[0] = '\0';
16661 *newExp = *exp;
16662 if(exp->expType)
16663 exp->expType->refCount++;
16664 if(exp->expType)
16665 exp->expType->refCount++;
16666 exp->type = 11;
16667 newExp->destType = exp->expType;
16668 PrintType(exp->expType, typeString, 0x0, 0x0);
16669 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16670 exp->cast.typeName = MkTypeName(specs, decl);
16671 exp->cast.exp = newExp;
16672 }
16673 }
16674 else if(unresolved)
16675 {
16676 if(exp->identifier->_class && exp->identifier->_class->name)
16677 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
16678 else if(exp->identifier->string && exp->identifier->string[0])
16679 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
16680 }
16681 else if(!exp->expType && exp->type != 16)
16682 {
16683 char expString[10240];
16684
16685 expString[0] = '\0';
16686 if(inCompiler)
16687 {
16688 PrintExpression(exp, expString);
16689 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16690 }
16691 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16692 }
16693 if(inCompiler)
16694 ApplyAnyObjectLogic(exp);
16695 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)))
16696 {
16697 exp->byReference = 0x1;
16698 }
16699 yylloc = oldyylloc;
16700 }
16701
16702 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)
16703 {
16704 if(*curMember)
16705 {
16706 *curMember = (*curMember)->next;
16707 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
16708 {
16709 *curMember = subMemberStack[--(*subMemberStackPos)];
16710 *curMember = (*curMember)->next;
16711 }
16712 while((*curMember) && (*curMember)->isProperty)
16713 *curMember = (*curMember)->next;
16714 if(subMemberStackPos)
16715 {
16716 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
16717 {
16718 subMemberStack[(*subMemberStackPos)++] = *curMember;
16719 *curMember = (*curMember)->members.first;
16720 while(*curMember && (*curMember)->isProperty)
16721 *curMember = (*curMember)->next;
16722 }
16723 }
16724 }
16725 while(!*curMember)
16726 {
16727 if(!*curMember)
16728 {
16729 if(subMemberStackPos && *subMemberStackPos)
16730 {
16731 *curMember = subMemberStack[--(*subMemberStackPos)];
16732 *curMember = (*curMember)->next;
16733 }
16734 else
16735 {
16736 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
16737
16738 if(*curClass == _class)
16739 break;
16740 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
16741 ;
16742 *curMember = (*curClass)->membersAndProperties.first;
16743 }
16744 while((*curMember) && (*curMember)->isProperty)
16745 *curMember = (*curMember)->next;
16746 if(subMemberStackPos)
16747 {
16748 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
16749 {
16750 subMemberStack[(*subMemberStackPos)++] = *curMember;
16751 *curMember = (*curMember)->members.first;
16752 while(*curMember && (*curMember)->isProperty)
16753 *curMember = (*curMember)->next;
16754 }
16755 }
16756 }
16757 }
16758 }
16759
16760 static void ProcessInitializer(struct Initializer * init, struct Type * type)
16761 {
16762 switch(init->type)
16763 {
16764 case 0:
16765 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
16766 {
16767 if(init->exp && !init->exp->destType)
16768 {
16769 FreeType(init->exp->destType);
16770 init->exp->destType = type;
16771 if(type)
16772 type->refCount++;
16773 }
16774 if(init->exp)
16775 {
16776 ProcessExpressionType(init->exp);
16777 init->isConstant = init->exp->isConstant;
16778 }
16779 break;
16780 }
16781 else
16782 {
16783 struct Expression * exp = init->exp;
16784 struct Instantiation * inst = exp->instance;
16785 struct MembersInit * members;
16786
16787 init->type = 1;
16788 init->list = MkList();
16789 if(inst->members)
16790 {
16791 for(members = (*inst->members).first; members; members = members->next)
16792 {
16793 if(members->type == 0)
16794 {
16795 struct MemberInit * member;
16796
16797 for(member = (*members->dataMembers).first; member; member = member->next)
16798 {
16799 ListAdd(init->list, member->initializer);
16800 member->initializer = (((void *)0));
16801 }
16802 }
16803 }
16804 }
16805 FreeExpression(exp);
16806 }
16807 case 1:
16808 {
16809 struct Initializer * i;
16810 struct Type * initializerType = (((void *)0));
16811 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
16812 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
16813 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
16814 int subMemberStackPos = 0;
16815
16816 if(type && type->kind == 12)
16817 initializerType = Dereference(type);
16818 else if(type && (type->kind == 9 || type->kind == 10))
16819 initializerType = type->members.first;
16820 for(i = (*init->list).first; i; i = i->next)
16821 {
16822 if(type && type->kind == 8 && type->_class && type->_class->registered)
16823 {
16824 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
16825 if(curMember)
16826 {
16827 if(!curMember->dataType)
16828 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
16829 initializerType = curMember->dataType;
16830 }
16831 }
16832 ProcessInitializer(i, initializerType);
16833 if(initializerType && type && (type->kind == 9 || type->kind == 10))
16834 initializerType = initializerType->next;
16835 if(!i->isConstant)
16836 init->isConstant = 0x0;
16837 }
16838 if(type && type->kind == 12)
16839 FreeType(initializerType);
16840 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
16841 {
16842 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Assigning list initializer to non list\n", (((void *)0))));
16843 }
16844 break;
16845 }
16846 }
16847 }
16848
16849 extern struct Symbol * FindType(struct Context * ctx, char *  name);
16850
16851 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
16852
16853 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
16854 {
16855 switch(spec->type)
16856 {
16857 case 0:
16858 {
16859 if(spec->specifier == THISCLASS)
16860 {
16861 if(thisClass)
16862 {
16863 spec->type = 1;
16864 spec->name = ReplaceThisClass(thisClass);
16865 spec->symbol = FindClass(spec->name);
16866 ProcessSpecifier(spec, declareStruct);
16867 }
16868 }
16869 break;
16870 }
16871 case 1:
16872 {
16873 struct Symbol * symbol = FindType(curContext, spec->name);
16874
16875 if(symbol)
16876 DeclareType(symbol->type, 0x1, 0x1);
16877 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
16878 DeclareStruct(spec->name, 0x0);
16879 break;
16880 }
16881 case 2:
16882 {
16883 struct Enumerator * e;
16884
16885 if(spec->list)
16886 {
16887 for(e = (*spec->list).first; e; e = e->next)
16888 {
16889 if(e->exp)
16890 ProcessExpressionType(e->exp);
16891 }
16892 }
16893 break;
16894 }
16895 case 3:
16896 case 4:
16897 {
16898 if(spec->definitions)
16899 {
16900 struct ClassDef * def;
16901 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
16902
16903 ProcessClass(spec->definitions, symbol);
16904 }
16905 break;
16906 }
16907 }
16908 }
16909
16910 static void ProcessDeclarator(struct Declarator * decl)
16911 {
16912 switch(decl->type)
16913 {
16914 case 1:
16915 if(decl->identifier->classSym)
16916 {
16917 FreeSpecifier(decl->identifier->_class);
16918 decl->identifier->_class = (((void *)0));
16919 }
16920 break;
16921 case 3:
16922 if(decl->array.exp)
16923 ProcessExpressionType(decl->array.exp);
16924 case 0:
16925 case 2:
16926 case 4:
16927 case 5:
16928 case 6:
16929 case 7:
16930 if(decl->declarator)
16931 ProcessDeclarator(decl->declarator);
16932 if(decl->type == 4)
16933 {
16934 struct Identifier * id = GetDeclId(decl);
16935
16936 if(id && id->_class)
16937 {
16938 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
16939
16940 if(!decl->function.parameters)
16941 decl->function.parameters = MkList();
16942 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
16943 id->_class = (((void *)0));
16944 }
16945 if(decl->function.parameters)
16946 {
16947 struct TypeName * param;
16948
16949 for(param = (*decl->function.parameters).first; param; param = param->next)
16950 {
16951 if(param->qualifiers && (*param->qualifiers).first)
16952 {
16953 struct Specifier * spec = (*param->qualifiers).first;
16954
16955 if(spec && spec->specifier == TYPED_OBJECT)
16956 {
16957 struct Declarator * d = param->declarator;
16958 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);
16959
16960 FreeList(param->qualifiers, FreeSpecifier);
16961 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
16962 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
16963 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
16964 param = newParam;
16965 }
16966 else if(spec && spec->specifier == ANY_OBJECT)
16967 {
16968 struct Declarator * d = param->declarator;
16969
16970 FreeList(param->qualifiers, FreeSpecifier);
16971 param->qualifiers = MkListOne(MkSpecifier(VOID));
16972 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
16973 }
16974 else if(spec->specifier == THISCLASS)
16975 {
16976 if(thisClass)
16977 {
16978 spec->type = 1;
16979 spec->name = ReplaceThisClass(thisClass);
16980 spec->symbol = FindClass(spec->name);
16981 ProcessSpecifier(spec, 0x0);
16982 }
16983 }
16984 }
16985 if(param->declarator)
16986 ProcessDeclarator(param->declarator);
16987 }
16988 }
16989 }
16990 break;
16991 }
16992 }
16993
16994 extern struct Identifier * CopyIdentifier(struct Identifier * id);
16995
16996 extern void FreeInitDeclarator(struct InitDeclarator * decl);
16997
16998 static void ProcessDeclaration(struct Declaration * decl)
16999 {
17000 yylloc = decl->loc;
17001 switch(decl->type)
17002 {
17003 case 1:
17004 {
17005 unsigned int declareStruct = 0x0;
17006
17007 if(decl->declarators)
17008 {
17009 struct InitDeclarator * d;
17010
17011 for(d = (*decl->declarators).first; d; d = d->next)
17012 {
17013 struct Type * type, * subType;
17014
17015 ProcessDeclarator(d->declarator);
17016 type = ProcessType(decl->specifiers, d->declarator);
17017 if(d->initializer)
17018 {
17019 ProcessInitializer(d->initializer, type);
17020 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
17021 {
17022 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
17023 {
17024 struct Instantiation * inst = d->initializer->exp->instance;
17025
17026 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
17027 d->initializer->exp->instance = (((void *)0));
17028 if(decl->specifiers)
17029 FreeList(decl->specifiers, FreeSpecifier);
17030 FreeList(decl->declarators, FreeInitDeclarator);
17031 d = (((void *)0));
17032 decl->type = 2;
17033 decl->inst = inst;
17034 }
17035 }
17036 }
17037 for(subType = type; subType; )
17038 {
17039 if(subType->kind == 8)
17040 {
17041 declareStruct = 0x1;
17042 break;
17043 }
17044 else if(subType->kind == 13)
17045 break;
17046 else if(subType->kind == 12)
17047 subType = subType->arrayType;
17048 else
17049 break;
17050 }
17051 FreeType(type);
17052 if(!d)
17053 break;
17054 }
17055 }
17056 if(decl->specifiers)
17057 {
17058 struct Specifier * s;
17059
17060 for(s = (*decl->specifiers).first; s; s = s->next)
17061 {
17062 ProcessSpecifier(s, declareStruct);
17063 }
17064 }
17065 break;
17066 }
17067 case 2:
17068 {
17069 ProcessInstantiationType(decl->inst);
17070 break;
17071 }
17072 case 0:
17073 {
17074 struct Specifier * spec;
17075 struct Declarator * d;
17076 unsigned int declareStruct = 0x0;
17077
17078 if(decl->declarators)
17079 {
17080 for(d = (*decl->declarators).first; d; d = d->next)
17081 {
17082 struct Type * type = ProcessType(decl->specifiers, d->declarator);
17083 struct Type * subType;
17084
17085 ProcessDeclarator(d);
17086 for(subType = type; subType; )
17087 {
17088 if(subType->kind == 8)
17089 {
17090 declareStruct = 0x1;
17091 break;
17092 }
17093 else if(subType->kind == 13)
17094 break;
17095 else if(subType->kind == 12)
17096 subType = subType->arrayType;
17097 else
17098 break;
17099 }
17100 FreeType(type);
17101 }
17102 }
17103 if(decl->specifiers)
17104 {
17105 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
17106 ProcessSpecifier(spec, declareStruct);
17107 }
17108 break;
17109 }
17110 }
17111 }
17112
17113 static struct FunctionDefinition * curFunction;
17114
17115 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
17116 {
17117 char propName[1024], propNameM[1024];
17118 char getName[1024], setName[1024];
17119 struct __ecereNameSpace__ecere__sys__OldList * args;
17120
17121 DeclareProperty(prop, setName, getName);
17122 strcpy(propName, "__ecereProp_");
17123 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17124 strcat(propName, "_");
17125 FullClassNameCat(propName, prop->name, 0x1);
17126 MangleClassName(propName);
17127 strcpy(propNameM, "__ecerePropM_");
17128 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
17129 strcat(propNameM, "_");
17130 FullClassNameCat(propNameM, prop->name, 0x1);
17131 MangleClassName(propNameM);
17132 if(prop->isWatchable)
17133 {
17134 args = MkList();
17135 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17136 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17137 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17138 args = MkList();
17139 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17140 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17141 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17142 }
17143 {
17144 args = MkList();
17145 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17146 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17147 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17148 args = MkList();
17149 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17150 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17151 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17152 }
17153 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
17154 curFunction->propSet->fireWatchersDone = 0x1;
17155 }
17156
17157 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
17158
17159 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
17160
17161 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
17162
17163 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
17164
17165 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
17166
17167 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
17168
17169 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
17170
17171 extern void FreePropertyWatch(struct PropertyWatch * watcher);
17172
17173 static void ProcessStatement(struct Statement * stmt)
17174 {
17175 yylloc = stmt->loc;
17176 switch(stmt->type)
17177 {
17178 case 0:
17179 ProcessStatement(stmt->labeled.stmt);
17180 break;
17181 case 1:
17182 if(stmt->caseStmt.exp)
17183 {
17184 FreeType(stmt->caseStmt.exp->destType);
17185 stmt->caseStmt.exp->destType = curSwitchType;
17186 if(curSwitchType)
17187 curSwitchType->refCount++;
17188 ProcessExpressionType(stmt->caseStmt.exp);
17189 ComputeExpression(stmt->caseStmt.exp);
17190 }
17191 if(stmt->caseStmt.stmt)
17192 ProcessStatement(stmt->caseStmt.stmt);
17193 break;
17194 case 2:
17195 {
17196 if(stmt->compound.context)
17197 {
17198 struct Declaration * decl;
17199 struct Statement * s;
17200 struct Statement * prevCompound = curCompound;
17201 struct Context * prevContext = curContext;
17202
17203 if(!stmt->compound.isSwitch)
17204 curCompound = stmt;
17205 curContext = stmt->compound.context;
17206 if(stmt->compound.declarations)
17207 {
17208 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
17209 ProcessDeclaration(decl);
17210 }
17211 if(stmt->compound.statements)
17212 {
17213 for(s = (*stmt->compound.statements).first; s; s = s->next)
17214 ProcessStatement(s);
17215 }
17216 curContext = prevContext;
17217 curCompound = prevCompound;
17218 }
17219 break;
17220 }
17221 case 3:
17222 {
17223 struct Expression * exp;
17224
17225 if(stmt->expressions)
17226 {
17227 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
17228 ProcessExpressionType(exp);
17229 }
17230 break;
17231 }
17232 case 4:
17233 {
17234 struct Expression * exp;
17235
17236 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
17237 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
17238 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
17239 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
17240 {
17241 ProcessExpressionType(exp);
17242 }
17243 if(stmt->ifStmt.stmt)
17244 ProcessStatement(stmt->ifStmt.stmt);
17245 if(stmt->ifStmt.elseStmt)
17246 ProcessStatement(stmt->ifStmt.elseStmt);
17247 break;
17248 }
17249 case 5:
17250 {
17251 struct Type * oldSwitchType = curSwitchType;
17252
17253 if(stmt->switchStmt.exp)
17254 {
17255 struct Expression * exp;
17256
17257 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
17258 {
17259 if(!exp->next)
17260 {
17261 ProcessExpressionType(exp);
17262 }
17263 if(!exp->next)
17264 curSwitchType = exp->expType;
17265 }
17266 }
17267 ProcessStatement(stmt->switchStmt.stmt);
17268 curSwitchType = oldSwitchType;
17269 break;
17270 }
17271 case 6:
17272 {
17273 if(stmt->whileStmt.exp)
17274 {
17275 struct Expression * exp;
17276
17277 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
17278 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
17279 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
17280 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
17281 {
17282 ProcessExpressionType(exp);
17283 }
17284 }
17285 if(stmt->whileStmt.stmt)
17286 ProcessStatement(stmt->whileStmt.stmt);
17287 break;
17288 }
17289 case 7:
17290 {
17291 if(stmt->doWhile.exp)
17292 {
17293 struct Expression * exp;
17294
17295 if((*stmt->doWhile.exp).last)
17296 {
17297 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
17298 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
17299 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
17300 }
17301 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
17302 {
17303 ProcessExpressionType(exp);
17304 }
17305 }
17306 if(stmt->doWhile.stmt)
17307 ProcessStatement(stmt->doWhile.stmt);
17308 break;
17309 }
17310 case 8:
17311 {
17312 struct Expression * exp;
17313
17314 if(stmt->forStmt.init)
17315 ProcessStatement(stmt->forStmt.init);
17316 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
17317 {
17318 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
17319 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
17320 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
17321 }
17322 if(stmt->forStmt.check)
17323 ProcessStatement(stmt->forStmt.check);
17324 if(stmt->forStmt.increment)
17325 {
17326 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
17327 ProcessExpressionType(exp);
17328 }
17329 if(stmt->forStmt.stmt)
17330 ProcessStatement(stmt->forStmt.stmt);
17331 break;
17332 }
17333 case 18:
17334 {
17335 struct Identifier * id = stmt->forEachStmt.id;
17336 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
17337 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
17338 struct Statement * block = stmt->forEachStmt.stmt;
17339 char iteratorType[1024];
17340 struct Type * source;
17341 struct Expression * e;
17342 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));
17343 struct Expression * arrayExp;
17344 char * typeString = (((void *)0));
17345 int builtinCount = 0;
17346
17347 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
17348 {
17349 if(!e->next)
17350 {
17351 FreeType(e->destType);
17352 e->destType = ProcessTypeString("Container", 0x0);
17353 }
17354 if(!isBuiltin || e->next)
17355 ProcessExpressionType(e);
17356 }
17357 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
17358 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
17359 {
17360 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
17361 struct Symbol * symbol;
17362 struct Expression * expIt = (((void *)0));
17363 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
17364 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
17365 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
17366 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
17367
17368 stmt->type = 2;
17369 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
17370 stmt->compound.context->parent = curContext;
17371 curContext = stmt->compound.context;
17372 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
17373 {
17374 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
17375 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
17376
17377 isCustomAVLTree = 0x1;
17378 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
17379 isAVLTree = 0x1;
17380 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
17381 isMap = 0x1;
17382 }
17383 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
17384 isArray = 0x1;
17385 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
17386 {
17387 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
17388
17389 isLinkList = 0x1;
17390 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
17391 }
17392 if(isArray)
17393 {
17394 struct Declarator * decl;
17395 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17396
17397 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
17398 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17399 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
17400 }
17401 else if(isBuiltin)
17402 {
17403 struct Type * type = (((void *)0));
17404 char typeStringBuf[1024];
17405
17406 arrayExp = (((struct Expression *)(*exp).last)->type == 35) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
17407 if(((struct Expression *)(*exp).last)->type == 11)
17408 {
17409 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
17410
17411 if(typeName)
17412 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
17413 }
17414 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)
17415 {
17416 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
17417
17418 typeString = templateClass->templateArgs[2].dataTypeString;
17419 }
17420 else if(arrayExp->list)
17421 {
17422 struct Expression * e;
17423
17424 for(e = (*arrayExp->list).first; e; e = e->next)
17425 {
17426 ProcessExpressionType(e);
17427 if(e->expType)
17428 {
17429 if(!type)
17430 {
17431 type = e->expType;
17432 type->refCount++;
17433 }
17434 else
17435 {
17436 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
17437 {
17438 FreeType(type);
17439 type = e->expType;
17440 e->expType = (((void *)0));
17441 e = (*arrayExp->list).first;
17442 ProcessExpressionType(e);
17443 if(e->expType)
17444 {
17445 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
17446 {
17447 FreeType(e->expType);
17448 e->expType = (((void *)0));
17449 FreeType(type);
17450 type = (((void *)0));
17451 break;
17452 }
17453 }
17454 }
17455 }
17456 if(e->expType)
17457 {
17458 FreeType(e->expType);
17459 e->expType = (((void *)0));
17460 }
17461 }
17462 }
17463 if(type)
17464 {
17465 typeStringBuf[0] = '\0';
17466 PrintType(type, typeStringBuf, 0x0, 0x1);
17467 typeString = typeStringBuf;
17468 FreeType(type);
17469 }
17470 }
17471 if(typeString)
17472 {
17473 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
17474 struct Declarator * decl;
17475 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17476
17477 if(arrayExp->list)
17478 {
17479 struct Expression * e;
17480
17481 builtinCount = (*arrayExp->list).count;
17482 type = ProcessTypeString(typeString, 0x0);
17483 while(e = (*arrayExp->list).first)
17484 {
17485 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
17486 e->destType = type;
17487 type->refCount++;
17488 ProcessExpressionType(e);
17489 ListAdd(initializers, MkInitializerAssignment(e));
17490 }
17491 FreeType(type);
17492 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
17493 }
17494 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
17495 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
17496 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
17497 FreeList(exp, FreeExpression);
17498 }
17499 else
17500 {
17501 arrayExp->expType = ProcessTypeString("Container", 0x0);
17502 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
17503 }
17504 }
17505 else if(isLinkList && !isList)
17506 {
17507 struct Declarator * decl;
17508 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17509
17510 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
17511 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17512 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
17513 }
17514 else if(_class->templateArgs)
17515 {
17516 if(isMap)
17517 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
17518 else
17519 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
17520 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
17521 }
17522 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
17523 if(block)
17524 {
17525 switch(block->type)
17526 {
17527 case 2:
17528 if(block->compound.context)
17529 block->compound.context->parent = stmt->compound.context;
17530 break;
17531 case 4:
17532 if(block->ifStmt.stmt && block->ifStmt.stmt->type == 2 && block->ifStmt.stmt->compound.context)
17533 block->ifStmt.stmt->compound.context->parent = stmt->compound.context;
17534 if(block->ifStmt.elseStmt && block->ifStmt.elseStmt->type == 2 && block->ifStmt.elseStmt->compound.context)
17535 block->ifStmt.elseStmt->compound.context->parent = stmt->compound.context;
17536 break;
17537 case 5:
17538 if(block->switchStmt.stmt && block->switchStmt.stmt->type == 2 && block->switchStmt.stmt->compound.context)
17539 block->switchStmt.stmt->compound.context->parent = stmt->compound.context;
17540 break;
17541 case 6:
17542 if(block->whileStmt.stmt && block->whileStmt.stmt->type == 2 && block->whileStmt.stmt->compound.context)
17543 block->whileStmt.stmt->compound.context->parent = stmt->compound.context;
17544 break;
17545 case 7:
17546 if(block->doWhile.stmt && block->doWhile.stmt->type == 2 && block->doWhile.stmt->compound.context)
17547 block->doWhile.stmt->compound.context->parent = stmt->compound.context;
17548 break;
17549 case 8:
17550 if(block->forStmt.stmt && block->forStmt.stmt->type == 2 && block->forStmt.stmt->compound.context)
17551 block->forStmt.stmt->compound.context->parent = stmt->compound.context;
17552 break;
17553 case 18:
17554 if(block->forEachStmt.stmt && block->forEachStmt.stmt->type == 2 && block->forEachStmt.stmt->compound.context)
17555 block->forEachStmt.stmt->compound.context->parent = stmt->compound.context;
17556 break;
17557 }
17558 }
17559 if(filter)
17560 {
17561 block = MkIfStmt(filter, block, (((void *)0)));
17562 }
17563 if(isArray)
17564 {
17565 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));
17566 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17567 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17568 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17569 }
17570 else if(isBuiltin)
17571 {
17572 char count[128];
17573
17574 sprintf(count, "%d", builtinCount);
17575 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));
17576 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17577 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17578 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17579 }
17580 else if(isLinkList && !isList)
17581 {
17582 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
17583 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
17584
17585 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
17586 {
17587 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));
17588 }
17589 else
17590 {
17591 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17592 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
17593
17594 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));
17595 }
17596 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17597 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17598 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17599 }
17600 else
17601 {
17602 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
17603 }
17604 ProcessExpressionType(expIt);
17605 if((*stmt->compound.declarations).first)
17606 ProcessDeclaration((*stmt->compound.declarations).first);
17607 if(symbol)
17608 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
17609 ProcessStatement(stmt);
17610 curContext = stmt->compound.context->parent;
17611 break;
17612 }
17613 else
17614 {
17615 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Expression is not a container\n", (((void *)0))));
17616 }
17617 break;
17618 }
17619 case 9:
17620 break;
17621 case 10:
17622 break;
17623 case 11:
17624 break;
17625 case 12:
17626 {
17627 struct Expression * exp;
17628
17629 if(stmt->expressions)
17630 {
17631 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
17632 {
17633 if(!exp->next)
17634 {
17635 if(curFunction && !curFunction->type)
17636 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
17637 FreeType(exp->destType);
17638 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
17639 if(exp->destType)
17640 exp->destType->refCount++;
17641 }
17642 ProcessExpressionType(exp);
17643 }
17644 }
17645 break;
17646 }
17647 case 14:
17648 {
17649 ProcessDeclaration(stmt->decl);
17650 break;
17651 }
17652 case 13:
17653 {
17654 struct AsmField * field;
17655
17656 if(stmt->asmStmt.inputFields)
17657 {
17658 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
17659 if(field->expression)
17660 ProcessExpressionType(field->expression);
17661 }
17662 if(stmt->asmStmt.outputFields)
17663 {
17664 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
17665 if(field->expression)
17666 ProcessExpressionType(field->expression);
17667 }
17668 if(stmt->asmStmt.clobberedFields)
17669 {
17670 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
17671 {
17672 if(field->expression)
17673 ProcessExpressionType(field->expression);
17674 }
17675 }
17676 break;
17677 }
17678 case 17:
17679 {
17680 struct PropertyWatch * propWatch;
17681 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17682 struct Expression * object = stmt->_watch.object;
17683 struct Expression * watcher = stmt->_watch.watcher;
17684
17685 if(watcher)
17686 ProcessExpressionType(watcher);
17687 if(object)
17688 ProcessExpressionType(object);
17689 if(inCompiler)
17690 {
17691 if(watcher || thisClass)
17692 {
17693 struct External * external = curExternal;
17694 struct Context * context = curContext;
17695
17696 stmt->type = 3;
17697 stmt->expressions = MkList();
17698 curExternal = external->prev;
17699 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
17700 {
17701 struct ClassFunction * func;
17702 char watcherName[1024];
17703 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
17704 struct External * createdExternal;
17705 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
17706
17707 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
17708 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
17709 if(propWatch->deleteWatch)
17710 strcat(watcherName, "_delete");
17711 else
17712 {
17713 struct Identifier * propID;
17714
17715 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
17716 {
17717 strcat(watcherName, "_");
17718 strcat(watcherName, propID->string);
17719 }
17720 }
17721 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
17722 {
17723 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
17724 ProcessClassFunctionBody(func, propWatch->compound);
17725 propWatch->compound = (((void *)0));
17726 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
17727 createdExternal->symbol->idCode = external->symbol->idCode;
17728 curExternal = createdExternal;
17729 ProcessFunction(createdExternal->function);
17730 {
17731 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
17732
17733 externalDecl->declaration = decl;
17734 if(decl->symbol && !decl->symbol->pointerExternal)
17735 decl->symbol->pointerExternal = externalDecl;
17736 }
17737 if(propWatch->deleteWatch)
17738 {
17739 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17740
17741 ListAdd(args, CopyExpression(object));
17742 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17743 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
17744 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
17745 }
17746 else
17747 {
17748 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
17749 struct Identifier * propID;
17750
17751 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
17752 {
17753 char propName[1024];
17754 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17755
17756 if(prop)
17757 {
17758 char getName[1024], setName[1024];
17759 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17760
17761 DeclareProperty(prop, setName, getName);
17762 strcpy(propName, "__ecereProp_");
17763 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17764 strcat(propName, "_");
17765 FullClassNameCat(propName, prop->name, 0x1);
17766 ListAdd(args, CopyExpression(object));
17767 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17768 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17769 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
17770 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
17771 }
17772 else
17773 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
17774 }
17775 }
17776 }
17777 else
17778 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid watched object\n", (((void *)0))));
17779 }
17780 curExternal = external;
17781 curContext = context;
17782 if(watcher)
17783 FreeExpression(watcher);
17784 if(object)
17785 FreeExpression(object);
17786 FreeList(watches, FreePropertyWatch);
17787 }
17788 else
17789 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a _class\n", (((void *)0))));
17790 }
17791 else
17792 {
17793 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
17794 {
17795 ProcessStatement(propWatch->compound);
17796 }
17797 }
17798 break;
17799 }
17800 case 15:
17801 {
17802 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17803 struct Expression * object = stmt->_watch.object;
17804 struct __ecereNameSpace__ecere__com__Class * _class;
17805
17806 if(object)
17807 ProcessExpressionType(object);
17808 if(inCompiler)
17809 {
17810 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
17811 if(_class)
17812 {
17813 struct Identifier * propID;
17814
17815 stmt->type = 3;
17816 stmt->expressions = MkList();
17817 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
17818 {
17819 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
17820 }
17821 else if(!watches)
17822 {
17823 }
17824 if(watches)
17825 {
17826 for(propID = (*watches).first; propID; propID = propID->next)
17827 {
17828 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17829
17830 if(prop)
17831 {
17832 CreateFireWatcher(prop, object, stmt);
17833 }
17834 else
17835 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
17836 }
17837 }
17838 else
17839 {
17840 struct __ecereNameSpace__ecere__com__Property * prop;
17841 struct __ecereNameSpace__ecere__com__Class * base;
17842
17843 for(base = _class; base; base = base->base)
17844 {
17845 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
17846 {
17847 if(prop->isProperty && prop->isWatchable)
17848 {
17849 CreateFireWatcher(prop, object, stmt);
17850 }
17851 }
17852 }
17853 }
17854 if(object)
17855 FreeExpression(object);
17856 FreeList(watches, FreeIdentifier);
17857 }
17858 else
17859 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
17860 }
17861 break;
17862 }
17863 case 16:
17864 {
17865 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17866 struct Expression * object = stmt->_watch.object;
17867 struct Expression * watcher = stmt->_watch.watcher;
17868 struct __ecereNameSpace__ecere__com__Class * _class;
17869
17870 if(object)
17871 ProcessExpressionType(object);
17872 if(watcher)
17873 ProcessExpressionType(watcher);
17874 if(inCompiler)
17875 {
17876 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
17877 if(watcher || thisClass)
17878 {
17879 if(_class)
17880 {
17881 struct Identifier * propID;
17882
17883 stmt->type = 3;
17884 stmt->expressions = MkList();
17885 if(!watches)
17886 {
17887 struct __ecereNameSpace__ecere__sys__OldList * args;
17888
17889 args = MkList();
17890 ListAdd(args, CopyExpression(object));
17891 ListAdd(args, MkExpConstant("0"));
17892 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17893 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
17894 }
17895 else
17896 {
17897 for(propID = (*watches).first; propID; propID = propID->next)
17898 {
17899 char propName[1024];
17900 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17901
17902 if(prop)
17903 {
17904 char getName[1024], setName[1024];
17905 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17906
17907 DeclareProperty(prop, setName, getName);
17908 strcpy(propName, "__ecereProp_");
17909 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17910 strcat(propName, "_");
17911 FullClassNameCat(propName, prop->name, 0x1);
17912 MangleClassName(propName);
17913 ListAdd(args, CopyExpression(object));
17914 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17915 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17916 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
17917 }
17918 else
17919 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
17920 }
17921 }
17922 if(object)
17923 FreeExpression(object);
17924 if(watcher)
17925 FreeExpression(watcher);
17926 FreeList(watches, FreeIdentifier);
17927 }
17928 else
17929 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
17930 }
17931 else
17932 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
17933 }
17934 break;
17935 }
17936 }
17937 }
17938
17939 extern struct Expression * QBrackets(struct Expression * exp);
17940
17941 extern struct TypeName * QMkType(char *  spec, struct Declarator * decl);
17942
17943 extern struct Declarator * QMkPtrDecl(char *  id);
17944
17945 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
17946
17947 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
17948
17949 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
17950
17951 static void ProcessFunction(struct FunctionDefinition * function)
17952 {
17953 struct Identifier * id = GetDeclId(function->declarator);
17954 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
17955 struct Type * type = symbol ? symbol->type : (((void *)0));
17956 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
17957 struct Context * oldTopContext = topContext;
17958
17959 yylloc = function->loc;
17960 if(type && type->thisClass)
17961 {
17962 struct Symbol * classSym = type->thisClass;
17963 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
17964 char className[1024];
17965 char structName[1024];
17966 struct Declarator * funcDecl;
17967 struct Symbol * thisSymbol;
17968 unsigned int typedObject = 0x0;
17969
17970 if(_class && !_class->base)
17971 {
17972 _class = currentClass;
17973 if(_class && !_class->symbol)
17974 _class->symbol = FindClass(_class->fullName);
17975 classSym = _class ? _class->symbol : (((void *)0));
17976 typedObject = 0x1;
17977 }
17978 thisClass = _class;
17979 if(inCompiler && _class)
17980 {
17981 if(type->kind == 11)
17982 {
17983 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
17984 {
17985 struct Type * param = symbol->type->params.first;
17986
17987 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
17988 FreeType(param);
17989 }
17990 if(type->classObjectType != 1)
17991 {
17992 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
17993 symbol->type->staticMethod = 0x1;
17994 symbol->type->thisClass = (((void *)0));
17995 symbol->type->extraParam = 0x0;
17996 }
17997 }
17998 strcpy(className, "__ecereClass_");
17999 FullClassNameCat(className, _class->fullName, 0x1);
18000 MangleClassName(className);
18001 structName[0] = (char)0;
18002 FullClassNameCat(structName, _class->fullName, 0x0);
18003 funcDecl = GetFuncDecl(function->declarator);
18004 if(funcDecl)
18005 {
18006 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
18007 {
18008 struct TypeName * param = (*funcDecl->function.parameters).first;
18009
18010 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
18011 {
18012 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
18013 FreeTypeName(param);
18014 }
18015 }
18016 if(!function->propertyNoThis)
18017 {
18018 struct TypeName * thisParam;
18019
18020 if(type->classObjectType != 1)
18021 {
18022 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18023 if(!funcDecl->function.parameters)
18024 funcDecl->function.parameters = MkList();
18025 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
18026 }
18027 if(typedObject)
18028 {
18029 if(type->classObjectType != 1)
18030 {
18031 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
18032 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
18033 }
18034 thisParam = __extension__ ({
18035 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
18036
18037 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
18038 });
18039 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
18040 }
18041 }
18042 }
18043 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
18044 {
18045 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
18046
18047 funcDecl = GetFuncDecl(initDecl->declarator);
18048 if(funcDecl)
18049 {
18050 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
18051 {
18052 struct TypeName * param = (*funcDecl->function.parameters).first;
18053
18054 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
18055 {
18056 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
18057 FreeTypeName(param);
18058 }
18059 }
18060 if(type->classObjectType != 1)
18061 {
18062 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
18063 {
18064 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18065
18066 if(!funcDecl->function.parameters)
18067 funcDecl->function.parameters = MkList();
18068 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
18069 }
18070 }
18071 }
18072 }
18073 }
18074 if(function->body)
18075 {
18076 if(type->classObjectType != 1)
18077 {
18078 thisSymbol = __extension__ ({
18079 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18080
18081 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
18082 });
18083 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18084 if(typedObject && thisSymbol->type)
18085 {
18086 thisSymbol->type->classObjectType = 2;
18087 thisSymbol->type->byReference = type->byReference;
18088 thisSymbol->type->typedByReference = type->byReference;
18089 }
18090 }
18091 }
18092 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
18093 {
18094 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
18095
18096 {
18097 struct __ecereNameSpace__ecere__com__Class * base;
18098
18099 for(base = _class; base && base->type != 1000; base = base->next)
18100 {
18101 for(member = base->membersAndProperties.first; member; member = member->next)
18102 if(!member->isProperty)
18103 break;
18104 if(member)
18105 break;
18106 }
18107 }
18108 for(member = _class->membersAndProperties.first; member; member = member->next)
18109 if(!member->isProperty)
18110 break;
18111 if(member)
18112 {
18113 char pointerName[1024];
18114 struct Declaration * decl;
18115 struct Initializer * initializer;
18116 struct Expression * exp, * bytePtr;
18117
18118 strcpy(pointerName, "__ecerePointer_");
18119 FullClassNameCat(pointerName, _class->fullName, 0x0);
18120 {
18121 char className[1024];
18122
18123 strcpy(className, "__ecereClass_");
18124 FullClassNameCat(className, classSym->string, 0x1);
18125 MangleClassName(className);
18126 DeclareClass(classSym, className);
18127 }
18128 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
18129 if(_class->fixed)
18130 {
18131 char string[256];
18132
18133 sprintf(string, "%d", _class->offset);
18134 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
18135 }
18136 else
18137 {
18138 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
18139 }
18140 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
18141 exp->expType = __extension__ ({
18142 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18143
18144 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
18145 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18146
18147 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
18148 }), __ecereInstance2;
18149 });
18150 if(function->body)
18151 {
18152 yylloc = function->body->loc;
18153 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
18154 {
18155 struct Context * prevContext = curContext;
18156
18157 curContext = function->body->compound.context;
18158 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
18159 curContext = prevContext;
18160 }
18161 decl->symbol = (((void *)0));
18162 if(!function->body->compound.declarations)
18163 function->body->compound.declarations = MkList();
18164 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
18165 }
18166 }
18167 }
18168 }
18169 else
18170 thisClass = (((void *)0));
18171 if(id)
18172 {
18173 FreeSpecifier(id->_class);
18174 id->_class = (((void *)0));
18175 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
18176 {
18177 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
18178
18179 id = GetDeclId(initDecl->declarator);
18180 FreeSpecifier(id->_class);
18181 id->_class = (((void *)0));
18182 }
18183 }
18184 if(function->body)
18185 topContext = function->body->compound.context;
18186 {
18187 struct FunctionDefinition * oldFunction = curFunction;
18188
18189 curFunction = function;
18190 if(function->body)
18191 ProcessStatement(function->body);
18192 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
18193 {
18194 struct Statement * prevCompound = curCompound;
18195 struct Context * prevContext = curContext;
18196 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
18197
18198 if(!function->body->compound.statements)
18199 function->body->compound.statements = MkList();
18200 ListAdd(function->body->compound.statements, fireWatchers);
18201 curCompound = function->body;
18202 curContext = function->body->compound.context;
18203 ProcessStatement(fireWatchers);
18204 curContext = prevContext;
18205 curCompound = prevCompound;
18206 }
18207 curFunction = oldFunction;
18208 }
18209 if(function->declarator)
18210 {
18211 ProcessDeclarator(function->declarator);
18212 }
18213 topContext = oldTopContext;
18214 thisClass = oldThisClass;
18215 }
18216
18217 extern void FreeSymbol(struct Symbol * symbol);
18218
18219 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
18220
18221 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
18222 {
18223 struct ClassDef * def;
18224 struct External * external = curExternal;
18225 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
18226
18227 for(def = definitions->first; def; def = def->next)
18228 {
18229 if(def->type == 0)
18230 {
18231 if(def->function->declarator)
18232 curExternal = def->function->declarator->symbol->pointerExternal;
18233 else
18234 curExternal = external;
18235 ProcessFunction((struct FunctionDefinition *)def->function);
18236 }
18237 else if(def->type == 2)
18238 {
18239 if(def->decl->type == 2)
18240 {
18241 thisClass = regClass;
18242 ProcessInstantiationType(def->decl->inst);
18243 thisClass = (((void *)0));
18244 }
18245 else
18246 {
18247 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
18248
18249 if(regClass)
18250 thisClass = regClass;
18251 ProcessDeclaration(def->decl);
18252 thisClass = backThisClass;
18253 }
18254 }
18255 else if(def->type == 1 && def->defProperties)
18256 {
18257 struct MemberInit * defProperty;
18258 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);
18259
18260 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18261 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
18262 {
18263 thisClass = regClass;
18264 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
18265 thisClass = (((void *)0));
18266 }
18267 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18268 FreeSymbol(thisSymbol);
18269 }
18270 else if(def->type == 3 && def->propertyDef)
18271 {
18272 struct PropertyDef * prop = def->propertyDef;
18273
18274 thisClass = regClass;
18275 if(prop->setStmt)
18276 {
18277 if(regClass)
18278 {
18279 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18280
18281 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18282 }
18283 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
18284 ProcessStatement(prop->setStmt);
18285 }
18286 if(prop->getStmt)
18287 {
18288 if(regClass)
18289 {
18290 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18291
18292 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18293 }
18294 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
18295 ProcessStatement(prop->getStmt);
18296 }
18297 if(prop->issetStmt)
18298 {
18299 if(regClass)
18300 {
18301 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18302
18303 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18304 }
18305 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
18306 ProcessStatement(prop->issetStmt);
18307 }
18308 thisClass = (((void *)0));
18309 }
18310 else if(def->type == 4 && def->propertyWatch)
18311 {
18312 struct PropertyWatch * propertyWatch = def->propertyWatch;
18313
18314 thisClass = regClass;
18315 if(propertyWatch->compound)
18316 {
18317 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);
18318
18319 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18320 curExternal = (((void *)0));
18321 ProcessStatement(propertyWatch->compound);
18322 }
18323 thisClass = (((void *)0));
18324 }
18325 }
18326 }
18327
18328 void DeclareFunctionUtil(char * s)
18329 {
18330 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
18331
18332 if(function)
18333 {
18334 char name[1024];
18335
18336 name[0] = (char)0;
18337 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
18338 strcpy(name, "__ecereFunction_");
18339 FullClassNameCat(name, s, 0x0);
18340 DeclareFunction(function, name);
18341 }
18342 }
18343
18344 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
18345
18346 void ComputeDataTypes()
18347 {
18348 struct External * external;
18349 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
18350 struct External * after = (((void *)0));
18351
18352 currentClass = (((void *)0));
18353 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
18354 for(external = (*ast).first; external; external = external->next)
18355 {
18356 if(external->type == 1)
18357 {
18358 struct Declaration * decl = external->declaration;
18359
18360 if(decl)
18361 {
18362 struct __ecereNameSpace__ecere__sys__OldList * decls = decl->declarators;
18363
18364 if(decls)
18365 {
18366 struct InitDeclarator * initDecl = (*decls).first;
18367
18368 if(initDecl)
18369 {
18370 struct Declarator * declarator = initDecl->declarator;
18371
18372 if(declarator && declarator->type == 1)
18373 {
18374 struct Identifier * id = declarator->identifier;
18375
18376 if(id && id->string)
18377 {
18378 if(!strcmp(id->string, "uintptr_t") || !strcmp(id->string, "intptr_t") || !strcmp(id->string, "size_t") || !strcmp(id->string, "ssize_t"))
18379 {
18380 external->symbol->id = -1001, external->symbol->idCode = -1001;
18381 after = external;
18382 }
18383 }
18384 }
18385 }
18386 }
18387 }
18388 }
18389 }
18390 temp->symbol = __extension__ ({
18391 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18392
18393 __ecereInstance1->id = -1000, __ecereInstance1->idCode = -1000, __ecereInstance1;
18394 });
18395 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
18396 curExternal = temp;
18397 DeclareFunctionUtil("eSystem_New");
18398 DeclareFunctionUtil("eSystem_New0");
18399 DeclareFunctionUtil("eSystem_Renew");
18400 DeclareFunctionUtil("eSystem_Renew0");
18401 DeclareFunctionUtil("eSystem_Delete");
18402 DeclareFunctionUtil("eClass_GetProperty");
18403 DeclareFunctionUtil("eInstance_FireSelfWatchers");
18404 DeclareStruct("ecere::com::Class", 0x0);
18405 DeclareStruct("ecere::com::Instance", 0x0);
18406 DeclareStruct("ecere::com::Property", 0x0);
18407 DeclareStruct("ecere::com::DataMember", 0x0);
18408 DeclareStruct("ecere::com::Method", 0x0);
18409 DeclareStruct("ecere::com::SerialBuffer", 0x0);
18410 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
18411 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
18412 for(external = (*ast).first; external; external = external->next)
18413 {
18414 afterExternal = curExternal = external;
18415 if(external->type == 0)
18416 {
18417 currentClass = external->function->_class;
18418 ProcessFunction(external->function);
18419 }
18420 else if(external->type == 1)
18421 {
18422 currentClass = (((void *)0));
18423 ProcessDeclaration(external->declaration);
18424 }
18425 else if(external->type == 2)
18426 {
18427 struct ClassDefinition * _class = external->_class;
18428
18429 currentClass = external->symbol->registered;
18430 if(_class->definitions)
18431 {
18432 ProcessClass(_class->definitions, _class->symbol);
18433 }
18434 if(inCompiler)
18435 {
18436 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
18437 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
18438 }
18439 }
18440 else if(external->type == 4)
18441 {
18442 thisNameSpace = external->id->string;
18443 }
18444 }
18445 currentClass = (((void *)0));
18446 thisNameSpace = (((void *)0));
18447 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
18448 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
18449 }
18450
18451 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);
18452
18453 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);
18454
18455 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
18456
18457 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
18458 {
18459 struct __ecereNameSpace__ecere__com__Class * class;
18460
18461 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
18462 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
18463 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
18464 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
18465 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
18466 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
18467 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
18468 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
18469 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
18470 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
18471 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
18472 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
18473 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
18474 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
18475 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
18476 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
18477 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
18478 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
18479 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt", "bool GetOpInt(Operand op2, int * value2)", GetOpInt, module, 1);
18480 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
18481 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt", "bool GetOpUInt(Operand op2, uint * value2)", GetOpUInt, module, 1);
18482 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
18483 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt64", "bool GetOpInt64(Operand op2, int64 * value2)", GetOpInt64, module, 1);
18484 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
18485 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt64", "bool GetOpUInt64(Operand op2, uint64 * value2)", GetOpUInt64, module, 1);
18486 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
18487 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntPtr", "bool GetOpIntPtr(Operand op2, intptr * value2)", GetOpIntPtr, module, 1);
18488 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
18489 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntPtr", "bool GetOpUIntPtr(Operand op2, uintptr * value2)", GetOpUIntPtr, module, 1);
18490 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
18491 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntSize", "bool GetOpIntSize(Operand op2, intsize * value2)", GetOpIntSize, module, 1);
18492 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
18493 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntSize", "bool GetOpUIntSize(Operand op2, uintsize * value2)", GetOpUIntSize, module, 1);
18494 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
18495 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpShort", "bool GetOpShort(Operand op2, short * value2)", GetOpShort, module, 1);
18496 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
18497 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUShort", "bool GetOpUShort(Operand op2, uint16 * value2)", GetOpUShort, module, 1);
18498 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
18499 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpChar", "bool GetOpChar(Operand op2, char * value2)", GetOpChar, module, 1);
18500 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
18501 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUChar", "bool GetOpUChar(Operand op2, byte * value2)", GetOpUChar, module, 1);
18502 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
18503 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpFloat", "bool GetOpFloat(Operand op2, float * value2)", GetOpFloat, module, 1);
18504 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
18505 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpDouble", "bool GetOpDouble(Operand op2, double * value2)", GetOpDouble, module, 1);
18506 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
18507 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
18508 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
18509 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
18510 __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);
18511 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
18512 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
18513 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
18514 __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);
18515 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
18516 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
18517 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
18518 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
18519 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
18520 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
18521 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
18522 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
18523 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
18524 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
18525 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
18526 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
18527 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
18528 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
18529 __ecereClass_Conversion = class;
18530 __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);
18531 __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);
18532 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
18533 __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);
18534 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
18535 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
18536 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("UnescapeString", "int UnescapeString(char * d, char * s, int len)", UnescapeString, module, 1);
18537 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("OffsetEscapedString", "char * OffsetEscapedString(char * s, int len, int offset)", OffsetEscapedString, module, 1);
18538 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
18539 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
18540 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
18541 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
18542 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
18543 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
18544 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
18545 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
18546 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
18547 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
18548 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetParseError", "bool GetParseError(void)", GetParseError, module, 1);
18549 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
18550 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
18551 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
18552 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
18553 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(String s)", DeclareFunctionUtil, module, 1);
18554 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
18555 }
18556
18557 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
18558 {
18559
18560 }
18561