compiler/libec: Fixed computation of expressions requiring promotions
[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 *  __ecereNameSpace__ecere__sys__CopyString(char *  string);
1476
1477 char * PrintInt(long long result)
1478 {
1479 char temp[100];
1480
1481 if(result > (((long long)0x7fffffffffffffffLL)))
1482 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1483 else
1484 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1485 return __ecereNameSpace__ecere__sys__CopyString(temp);
1486 }
1487
1488 char * PrintUInt(uint64 result)
1489 {
1490 char temp[100];
1491
1492 if(result > (0xffffffff))
1493 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1494 else if(result > (((int)0x7fffffff)))
1495 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1496 else
1497 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1498 return __ecereNameSpace__ecere__sys__CopyString(temp);
1499 }
1500
1501 char * PrintInt64(long long result)
1502 {
1503 char temp[100];
1504
1505 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1506 return __ecereNameSpace__ecere__sys__CopyString(temp);
1507 }
1508
1509 char * PrintUInt64(uint64 result)
1510 {
1511 char temp[100];
1512
1513 if(result > (((long long)0x7fffffffffffffffLL)))
1514 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1515 else
1516 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1517 return __ecereNameSpace__ecere__sys__CopyString(temp);
1518 }
1519
1520 char * PrintHexUInt(uint64 result)
1521 {
1522 char temp[100];
1523
1524 if(result > (0xffffffff))
1525 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1526 else
1527 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1528 return __ecereNameSpace__ecere__sys__CopyString(temp);
1529 }
1530
1531 char * PrintHexUInt64(uint64 result)
1532 {
1533 char temp[100];
1534
1535 if(result > (0xffffffff))
1536 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1537 else
1538 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1539 return __ecereNameSpace__ecere__sys__CopyString(temp);
1540 }
1541
1542 char * PrintShort(short result)
1543 {
1544 char temp[100];
1545
1546 sprintf(temp, "%d", (unsigned short)result);
1547 return __ecereNameSpace__ecere__sys__CopyString(temp);
1548 }
1549
1550 char * PrintUShort(unsigned short result)
1551 {
1552 char temp[100];
1553
1554 if(result > (unsigned short)32767)
1555 sprintf(temp, "0x%X", (int)result);
1556 else
1557 sprintf(temp, "%d", (int)result);
1558 return __ecereNameSpace__ecere__sys__CopyString(temp);
1559 }
1560
1561 extern int isprint(int c);
1562
1563 char * PrintChar(char result)
1564 {
1565 char temp[100];
1566
1567 if(result > (char)0 && isprint(result))
1568 sprintf(temp, "'%c'", result);
1569 else if(result < (char)0)
1570 sprintf(temp, "%d", (int)result);
1571 else
1572 sprintf(temp, "0x%X", (unsigned char)result);
1573 return __ecereNameSpace__ecere__sys__CopyString(temp);
1574 }
1575
1576 char * PrintUChar(unsigned char result)
1577 {
1578 char temp[100];
1579
1580 sprintf(temp, "0x%X", result);
1581 return __ecereNameSpace__ecere__sys__CopyString(temp);
1582 }
1583
1584 char * PrintFloat(float result)
1585 {
1586 char temp[350];
1587
1588 sprintf(temp, "%.16ff", result);
1589 return __ecereNameSpace__ecere__sys__CopyString(temp);
1590 }
1591
1592 char * PrintDouble(double result)
1593 {
1594 char temp[350];
1595
1596 sprintf(temp, "%.16f", result);
1597 return __ecereNameSpace__ecere__sys__CopyString(temp);
1598 }
1599
1600 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1601
1602 struct OpTable
1603 {
1604 unsigned int (*  Add)(struct Expression *, struct Operand *, struct Operand *);
1605 unsigned int (*  Sub)(struct Expression *, struct Operand *, struct Operand *);
1606 unsigned int (*  Mul)(struct Expression *, struct Operand *, struct Operand *);
1607 unsigned int (*  Div)(struct Expression *, struct Operand *, struct Operand *);
1608 unsigned int (*  Mod)(struct Expression *, struct Operand *, struct Operand *);
1609 unsigned int (*  Neg)(struct Expression *, struct Operand *);
1610 unsigned int (*  Inc)(struct Expression *, struct Operand *);
1611 unsigned int (*  Dec)(struct Expression *, struct Operand *);
1612 unsigned int (*  Asign)(struct Expression *, struct Operand *, struct Operand *);
1613 unsigned int (*  AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1614 unsigned int (*  SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1615 unsigned int (*  MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1616 unsigned int (*  DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1617 unsigned int (*  ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1618 unsigned int (*  BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1619 unsigned int (*  BitOr)(struct Expression *, struct Operand *, struct Operand *);
1620 unsigned int (*  BitXor)(struct Expression *, struct Operand *, struct Operand *);
1621 unsigned int (*  LShift)(struct Expression *, struct Operand *, struct Operand *);
1622 unsigned int (*  RShift)(struct Expression *, struct Operand *, struct Operand *);
1623 unsigned int (*  BitNot)(struct Expression *, struct Operand *);
1624 unsigned int (*  AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1625 unsigned int (*  OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1626 unsigned int (*  XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1627 unsigned int (*  LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1628 unsigned int (*  RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1629 unsigned int (*  Not)(struct Expression *, struct Operand *);
1630 unsigned int (*  Equ)(struct Expression *, struct Operand *, struct Operand *);
1631 unsigned int (*  Nqu)(struct Expression *, struct Operand *, struct Operand *);
1632 unsigned int (*  And)(struct Expression *, struct Operand *, struct Operand *);
1633 unsigned int (*  Or)(struct Expression *, struct Operand *, struct Operand *);
1634 unsigned int (*  Grt)(struct Expression *, struct Operand *, struct Operand *);
1635 unsigned int (*  Sma)(struct Expression *, struct Operand *, struct Operand *);
1636 unsigned int (*  GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1637 unsigned int (*  SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1638 unsigned int (*  Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1639 } __attribute__ ((gcc_struct));
1640
1641 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1642
1643 struct Operand
1644 {
1645 int kind;
1646 struct Type * type;
1647 unsigned int ptrSize;
1648 union
1649 {
1650 char c;
1651 unsigned char uc;
1652 short s;
1653 unsigned short us;
1654 int i;
1655 unsigned int ui;
1656 float f;
1657 double d;
1658 long long i64;
1659 uint64 ui64;
1660 } __attribute__ ((gcc_struct));
1661 struct OpTable ops;
1662 } __attribute__ ((gcc_struct));
1663
1664 unsigned int GetOpInt(struct Operand * op2, int * value2)
1665 {
1666 if(op2->kind == 3 && op2->type->isSigned)
1667 *value2 = op2->i;
1668 else if(op2->kind == 3)
1669 *value2 = (int)op2->ui;
1670 else if(op2->kind == 4 && op2->type->isSigned)
1671 *value2 = (int)op2->i64;
1672 else if(op2->kind == 4)
1673 *value2 = (int)op2->ui64;
1674 else if(op2->kind == 23 && op2->type->isSigned)
1675 *value2 = (int)op2->i64;
1676 else if(op2->kind == 23)
1677 *value2 = (int)op2->ui64;
1678 else if(op2->kind == 22 && op2->type->isSigned)
1679 *value2 = (int)op2->i64;
1680 else if(op2->kind == 22)
1681 *value2 = (int)op2->ui64;
1682 else if(op2->kind == 2 && op2->type->isSigned)
1683 *value2 = (int)op2->s;
1684 else if(op2->kind == 2)
1685 *value2 = (int)op2->us;
1686 else if(op2->kind == 1 && op2->type->isSigned)
1687 *value2 = (int)op2->c;
1688 else if(op2->kind == 24 || op2->kind == 1)
1689 *value2 = (int)op2->uc;
1690 else if(op2->kind == 6)
1691 *value2 = (int)op2->f;
1692 else if(op2->kind == 7)
1693 *value2 = (int)op2->d;
1694 else if(op2->kind == 13)
1695 *value2 = (int)op2->ui64;
1696 else
1697 return 0x0;
1698 return 0x1;
1699 }
1700
1701 struct Operand GetOperand(struct Expression * exp);
1702
1703 unsigned int GetInt(struct Expression * exp, int * value2)
1704 {
1705 struct Operand op2 = GetOperand(exp);
1706
1707 return GetOpInt(&op2, value2);
1708 }
1709
1710 unsigned int GetOpUInt(struct Operand * op2, unsigned int * value2)
1711 {
1712 if(op2->kind == 3 && op2->type->isSigned)
1713 *value2 = (unsigned int)op2->i;
1714 else if(op2->kind == 3)
1715 *value2 = op2->ui;
1716 else if(op2->kind == 4 && op2->type->isSigned)
1717 *value2 = (unsigned int)op2->i64;
1718 else if(op2->kind == 4)
1719 *value2 = (unsigned int)op2->ui64;
1720 else if(op2->kind == 23 && op2->type->isSigned)
1721 *value2 = (unsigned int)op2->i64;
1722 else if(op2->kind == 23)
1723 *value2 = (unsigned int)op2->ui64;
1724 else if(op2->kind == 22 && op2->type->isSigned)
1725 *value2 = (unsigned int)op2->i64;
1726 else if(op2->kind == 22)
1727 *value2 = (unsigned int)op2->ui64;
1728 else if(op2->kind == 2 && op2->type->isSigned)
1729 *value2 = (unsigned int)op2->s;
1730 else if(op2->kind == 2)
1731 *value2 = (unsigned int)op2->us;
1732 else if(op2->kind == 1 && op2->type->isSigned)
1733 *value2 = (unsigned int)op2->c;
1734 else if(op2->kind == 24 || op2->kind == 1)
1735 *value2 = (unsigned int)op2->uc;
1736 else if(op2->kind == 6)
1737 *value2 = (unsigned int)op2->f;
1738 else if(op2->kind == 7)
1739 *value2 = (unsigned int)op2->d;
1740 else if(op2->kind == 13)
1741 *value2 = (unsigned int)op2->ui64;
1742 else
1743 return 0x0;
1744 return 0x1;
1745 }
1746
1747 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1748 {
1749 struct Operand op2 = GetOperand(exp);
1750
1751 return GetOpUInt(&op2, value2);
1752 }
1753
1754 unsigned int GetOpInt64(struct Operand * op2, long long * value2)
1755 {
1756 if(op2->kind == 3 && op2->type->isSigned)
1757 *value2 = (long long)op2->i;
1758 else if(op2->kind == 3)
1759 *value2 = (long long)op2->ui;
1760 else if(op2->kind == 4 && op2->type->isSigned)
1761 *value2 = op2->i64;
1762 else if(op2->kind == 4)
1763 *value2 = (long long)op2->ui64;
1764 else if(op2->kind == 23 && op2->type->isSigned)
1765 *value2 = op2->i64;
1766 else if(op2->kind == 23)
1767 *value2 = (long long)op2->ui64;
1768 else if(op2->kind == 22 && op2->type->isSigned)
1769 *value2 = op2->i64;
1770 else if(op2->kind == 22)
1771 *value2 = (long long)op2->ui64;
1772 else if(op2->kind == 2 && op2->type->isSigned)
1773 *value2 = (long long)op2->s;
1774 else if(op2->kind == 2)
1775 *value2 = (long long)op2->us;
1776 else if(op2->kind == 1 && op2->type->isSigned)
1777 *value2 = (long long)op2->c;
1778 else if(op2->kind == 24 || op2->kind == 1)
1779 *value2 = (long long)op2->uc;
1780 else if(op2->kind == 6)
1781 *value2 = (long long)op2->f;
1782 else if(op2->kind == 7)
1783 *value2 = (long long)op2->d;
1784 else if(op2->kind == 13)
1785 *value2 = (long long)op2->ui64;
1786 else
1787 return 0x0;
1788 return 0x1;
1789 }
1790
1791 unsigned int GetInt64(struct Expression * exp, long long * value2)
1792 {
1793 struct Operand op2 = GetOperand(exp);
1794
1795 return GetOpInt64(&op2, value2);
1796 }
1797
1798 unsigned int GetOpUInt64(struct Operand * op2, uint64 * value2)
1799 {
1800 if(op2->kind == 3 && op2->type->isSigned)
1801 *value2 = (uint64)op2->i;
1802 else if(op2->kind == 3)
1803 *value2 = (uint64)op2->ui;
1804 else if(op2->kind == 4 && op2->type->isSigned)
1805 *value2 = (uint64)op2->i64;
1806 else if(op2->kind == 4)
1807 *value2 = op2->ui64;
1808 else if(op2->kind == 23 && op2->type->isSigned)
1809 *value2 = (uint64)op2->i64;
1810 else if(op2->kind == 23)
1811 *value2 = op2->ui64;
1812 else if(op2->kind == 22 && op2->type->isSigned)
1813 *value2 = (uint64)op2->i64;
1814 else if(op2->kind == 22)
1815 *value2 = op2->ui64;
1816 else if(op2->kind == 2 && op2->type->isSigned)
1817 *value2 = (uint64)op2->s;
1818 else if(op2->kind == 2)
1819 *value2 = (uint64)op2->us;
1820 else if(op2->kind == 1 && op2->type->isSigned)
1821 *value2 = (uint64)op2->c;
1822 else if(op2->kind == 24 || op2->kind == 1)
1823 *value2 = (uint64)op2->uc;
1824 else if(op2->kind == 6)
1825 *value2 = (uint64)op2->f;
1826 else if(op2->kind == 7)
1827 *value2 = (uint64)op2->d;
1828 else if(op2->kind == 13)
1829 *value2 = op2->ui64;
1830 else
1831 return 0x0;
1832 return 0x1;
1833 }
1834
1835 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1836 {
1837 struct Operand op2 = GetOperand(exp);
1838
1839 return GetOpUInt64(&op2, value2);
1840 }
1841
1842 unsigned int GetOpIntPtr(struct Operand * op2, intptr_t * value2)
1843 {
1844 if(op2->kind == 3 && op2->type->isSigned)
1845 *value2 = (intptr_t)op2->i;
1846 else if(op2->kind == 3)
1847 *value2 = (intptr_t)op2->ui;
1848 else if(op2->kind == 4 && op2->type->isSigned)
1849 *value2 = (intptr_t)op2->i64;
1850 else if(op2->kind == 4)
1851 *value2 = (intptr_t)op2->ui64;
1852 else if(op2->kind == 23 && op2->type->isSigned)
1853 *value2 = (intptr_t)op2->i64;
1854 else if(op2->kind == 23)
1855 *value2 = (intptr_t)op2->ui64;
1856 else if(op2->kind == 22 && op2->type->isSigned)
1857 *value2 = (intptr_t)op2->i64;
1858 else if(op2->kind == 22)
1859 *value2 = (intptr_t)op2->ui64;
1860 else if(op2->kind == 2 && op2->type->isSigned)
1861 *value2 = (intptr_t)op2->s;
1862 else if(op2->kind == 2)
1863 *value2 = (intptr_t)op2->us;
1864 else if(op2->kind == 1 && op2->type->isSigned)
1865 *value2 = (intptr_t)op2->c;
1866 else if(op2->kind == 24 || op2->kind == 1)
1867 *value2 = (intptr_t)op2->uc;
1868 else if(op2->kind == 6)
1869 *value2 = (intptr_t)op2->f;
1870 else if(op2->kind == 7)
1871 *value2 = (intptr_t)op2->d;
1872 else if(op2->kind == 13)
1873 *value2 = (intptr_t)op2->ui64;
1874 else
1875 return 0x0;
1876 return 0x1;
1877 }
1878
1879 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
1880 {
1881 struct Operand op2 = GetOperand(exp);
1882
1883 return GetOpIntPtr(&op2, value2);
1884 }
1885
1886 unsigned int GetOpUIntPtr(struct Operand * op2, uintptr_t * value2)
1887 {
1888 if(op2->kind == 3 && op2->type->isSigned)
1889 *value2 = (uintptr_t)op2->i;
1890 else if(op2->kind == 3)
1891 *value2 = (uintptr_t)op2->ui;
1892 else if(op2->kind == 4 && op2->type->isSigned)
1893 *value2 = (uintptr_t)op2->i64;
1894 else if(op2->kind == 4)
1895 *value2 = (uintptr_t)op2->ui64;
1896 else if(op2->kind == 23 && op2->type->isSigned)
1897 *value2 = (uintptr_t)op2->i64;
1898 else if(op2->kind == 23)
1899 *value2 = (uintptr_t)op2->ui64;
1900 else if(op2->kind == 22 && op2->type->isSigned)
1901 *value2 = (uintptr_t)op2->i64;
1902 else if(op2->kind == 22)
1903 *value2 = (uintptr_t)op2->ui64;
1904 else if(op2->kind == 2 && op2->type->isSigned)
1905 *value2 = (uintptr_t)op2->s;
1906 else if(op2->kind == 2)
1907 *value2 = (uintptr_t)op2->us;
1908 else if(op2->kind == 1 && op2->type->isSigned)
1909 *value2 = (uintptr_t)op2->c;
1910 else if(op2->kind == 24 || op2->kind == 1)
1911 *value2 = (uintptr_t)op2->uc;
1912 else if(op2->kind == 6)
1913 *value2 = (uintptr_t)op2->f;
1914 else if(op2->kind == 7)
1915 *value2 = (uintptr_t)op2->d;
1916 else if(op2->kind == 13)
1917 *value2 = (uintptr_t)op2->ui64;
1918 else
1919 return 0x0;
1920 return 0x1;
1921 }
1922
1923 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
1924 {
1925 struct Operand op2 = GetOperand(exp);
1926
1927 return GetOpUIntPtr(&op2, value2);
1928 }
1929
1930 unsigned int GetOpIntSize(struct Operand * op2, ssize_t * value2)
1931 {
1932 if(op2->kind == 3 && op2->type->isSigned)
1933 *value2 = (ssize_t)op2->i;
1934 else if(op2->kind == 3)
1935 *value2 = (ssize_t)op2->ui;
1936 else if(op2->kind == 4 && op2->type->isSigned)
1937 *value2 = (ssize_t)op2->i64;
1938 else if(op2->kind == 4)
1939 *value2 = (ssize_t)op2->ui64;
1940 else if(op2->kind == 23 && op2->type->isSigned)
1941 *value2 = (ssize_t)op2->i64;
1942 else if(op2->kind == 23)
1943 *value2 = (ssize_t)op2->ui64;
1944 else if(op2->kind == 22 && op2->type->isSigned)
1945 *value2 = (ssize_t)op2->i64;
1946 else if(op2->kind == 22)
1947 *value2 = (ssize_t)op2->ui64;
1948 else if(op2->kind == 2 && op2->type->isSigned)
1949 *value2 = (ssize_t)op2->s;
1950 else if(op2->kind == 2)
1951 *value2 = (ssize_t)op2->us;
1952 else if(op2->kind == 1 && op2->type->isSigned)
1953 *value2 = (ssize_t)op2->c;
1954 else if(op2->kind == 24 || op2->kind == 1)
1955 *value2 = (ssize_t)op2->uc;
1956 else if(op2->kind == 6)
1957 *value2 = (ssize_t)op2->f;
1958 else if(op2->kind == 7)
1959 *value2 = (ssize_t)op2->d;
1960 else if(op2->kind == 13)
1961 *value2 = (ssize_t)op2->ui64;
1962 else
1963 return 0x0;
1964 return 0x1;
1965 }
1966
1967 unsigned int GetIntSize(struct Expression * exp, ssize_t * value2)
1968 {
1969 struct Operand op2 = GetOperand(exp);
1970
1971 return GetOpIntSize(&op2, value2);
1972 }
1973
1974 unsigned int GetOpUIntSize(struct Operand * op2, size_t * value2)
1975 {
1976 if(op2->kind == 3 && op2->type->isSigned)
1977 *value2 = (size_t)op2->i;
1978 else if(op2->kind == 3)
1979 *value2 = (size_t)op2->ui;
1980 else if(op2->kind == 4 && op2->type->isSigned)
1981 *value2 = (size_t)op2->i64;
1982 else if(op2->kind == 4)
1983 *value2 = (size_t)op2->ui64;
1984 else if(op2->kind == 23 && op2->type->isSigned)
1985 *value2 = (size_t)op2->i64;
1986 else if(op2->kind == 23)
1987 *value2 = (size_t)op2->ui64;
1988 else if(op2->kind == 22 && op2->type->isSigned)
1989 *value2 = (size_t)op2->i64;
1990 else if(op2->kind == 22)
1991 *value2 = (size_t)op2->ui64;
1992 else if(op2->kind == 2 && op2->type->isSigned)
1993 *value2 = (size_t)op2->s;
1994 else if(op2->kind == 2)
1995 *value2 = (size_t)op2->us;
1996 else if(op2->kind == 1 && op2->type->isSigned)
1997 *value2 = (size_t)op2->c;
1998 else if(op2->kind == 24 || op2->kind == 1)
1999 *value2 = (size_t)op2->uc;
2000 else if(op2->kind == 6)
2001 *value2 = (size_t)op2->f;
2002 else if(op2->kind == 7)
2003 *value2 = (size_t)op2->d;
2004 else if(op2->kind == 13)
2005 *value2 = (size_t)op2->ui64;
2006 else
2007 return 0x0;
2008 return 0x1;
2009 }
2010
2011 unsigned int GetUIntSize(struct Expression * exp, size_t * value2)
2012 {
2013 struct Operand op2 = GetOperand(exp);
2014
2015 return GetOpUIntSize(&op2, value2);
2016 }
2017
2018 unsigned int GetOpShort(struct Operand * op2, short * value2)
2019 {
2020 if(op2->kind == 3 && op2->type->isSigned)
2021 *value2 = (short)op2->i;
2022 else if(op2->kind == 3)
2023 *value2 = (short)op2->ui;
2024 else if(op2->kind == 4 && op2->type->isSigned)
2025 *value2 = (short)op2->i64;
2026 else if(op2->kind == 4)
2027 *value2 = (short)op2->ui64;
2028 else if(op2->kind == 23 && op2->type->isSigned)
2029 *value2 = (short)op2->i64;
2030 else if(op2->kind == 23)
2031 *value2 = (short)op2->ui64;
2032 else if(op2->kind == 22 && op2->type->isSigned)
2033 *value2 = (short)op2->i64;
2034 else if(op2->kind == 22)
2035 *value2 = (short)op2->ui64;
2036 else if(op2->kind == 2 && op2->type->isSigned)
2037 *value2 = op2->s;
2038 else if(op2->kind == 2)
2039 *value2 = (short)op2->us;
2040 else if(op2->kind == 1 && op2->type->isSigned)
2041 *value2 = (short)op2->c;
2042 else if(op2->kind == 24 || op2->kind == 1)
2043 *value2 = (short)op2->uc;
2044 else if(op2->kind == 6)
2045 *value2 = (short)op2->f;
2046 else if(op2->kind == 7)
2047 *value2 = (short)op2->d;
2048 else if(op2->kind == 13)
2049 *value2 = (short)op2->ui64;
2050 else
2051 return 0x0;
2052 return 0x1;
2053 }
2054
2055 unsigned int GetShort(struct Expression * exp, short * value2)
2056 {
2057 struct Operand op2 = GetOperand(exp);
2058
2059 return GetOpShort(&op2, value2);
2060 }
2061
2062 unsigned int GetOpUShort(struct Operand * op2, unsigned short * value2)
2063 {
2064 if(op2->kind == 3 && op2->type->isSigned)
2065 *value2 = (unsigned short)op2->i;
2066 else if(op2->kind == 3)
2067 *value2 = (unsigned short)op2->ui;
2068 else if(op2->kind == 4 && op2->type->isSigned)
2069 *value2 = (unsigned short)op2->i64;
2070 else if(op2->kind == 4)
2071 *value2 = (unsigned short)op2->ui64;
2072 else if(op2->kind == 23 && op2->type->isSigned)
2073 *value2 = (unsigned short)op2->i64;
2074 else if(op2->kind == 23)
2075 *value2 = (unsigned short)op2->ui64;
2076 else if(op2->kind == 22 && op2->type->isSigned)
2077 *value2 = (unsigned short)op2->i64;
2078 else if(op2->kind == 22)
2079 *value2 = (unsigned short)op2->ui64;
2080 else if(op2->kind == 2 && op2->type->isSigned)
2081 *value2 = (unsigned short)op2->s;
2082 else if(op2->kind == 2)
2083 *value2 = op2->us;
2084 else if(op2->kind == 1 && op2->type->isSigned)
2085 *value2 = (unsigned short)op2->c;
2086 else if(op2->kind == 24 || op2->kind == 1)
2087 *value2 = (unsigned short)op2->uc;
2088 else if(op2->kind == 6)
2089 *value2 = (unsigned short)op2->f;
2090 else if(op2->kind == 7)
2091 *value2 = (unsigned short)op2->d;
2092 else if(op2->kind == 13)
2093 *value2 = (unsigned short)op2->ui64;
2094 else
2095 return 0x0;
2096 return 0x1;
2097 }
2098
2099 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
2100 {
2101 struct Operand op2 = GetOperand(exp);
2102
2103 return GetOpUShort(&op2, value2);
2104 }
2105
2106 unsigned int GetOpChar(struct Operand * op2, char * value2)
2107 {
2108 if(op2->kind == 3 && op2->type->isSigned)
2109 *value2 = (char)op2->i;
2110 else if(op2->kind == 3)
2111 *value2 = (char)op2->ui;
2112 else if(op2->kind == 4 && op2->type->isSigned)
2113 *value2 = (char)op2->i64;
2114 else if(op2->kind == 4)
2115 *value2 = (char)op2->ui64;
2116 else if(op2->kind == 23 && op2->type->isSigned)
2117 *value2 = (char)op2->i64;
2118 else if(op2->kind == 23)
2119 *value2 = (char)op2->ui64;
2120 else if(op2->kind == 22 && op2->type->isSigned)
2121 *value2 = (char)op2->i64;
2122 else if(op2->kind == 22)
2123 *value2 = (char)op2->ui64;
2124 else if(op2->kind == 2 && op2->type->isSigned)
2125 *value2 = (char)op2->s;
2126 else if(op2->kind == 2)
2127 *value2 = (char)op2->us;
2128 else if(op2->kind == 1 && op2->type->isSigned)
2129 *value2 = op2->c;
2130 else if(op2->kind == 24 || op2->kind == 1)
2131 *value2 = (char)op2->uc;
2132 else if(op2->kind == 6)
2133 *value2 = (char)op2->f;
2134 else if(op2->kind == 7)
2135 *value2 = (char)op2->d;
2136 else if(op2->kind == 13)
2137 *value2 = (char)op2->ui64;
2138 else
2139 return 0x0;
2140 return 0x1;
2141 }
2142
2143 unsigned int GetChar(struct Expression * exp, char * value2)
2144 {
2145 struct Operand op2 = GetOperand(exp);
2146
2147 return GetOpChar(&op2, value2);
2148 }
2149
2150 unsigned int GetOpUChar(struct Operand * op2, unsigned char * value2)
2151 {
2152 if(op2->kind == 3 && op2->type->isSigned)
2153 *value2 = (unsigned char)op2->i;
2154 else if(op2->kind == 3)
2155 *value2 = (unsigned char)op2->ui;
2156 else if(op2->kind == 4 && op2->type->isSigned)
2157 *value2 = (unsigned char)op2->i64;
2158 else if(op2->kind == 4)
2159 *value2 = (unsigned char)op2->ui64;
2160 else if(op2->kind == 23 && op2->type->isSigned)
2161 *value2 = (unsigned char)op2->i64;
2162 else if(op2->kind == 23)
2163 *value2 = (unsigned char)op2->ui64;
2164 else if(op2->kind == 22 && op2->type->isSigned)
2165 *value2 = (unsigned char)op2->i64;
2166 else if(op2->kind == 22)
2167 *value2 = (unsigned char)op2->ui64;
2168 else if(op2->kind == 2 && op2->type->isSigned)
2169 *value2 = (unsigned char)op2->s;
2170 else if(op2->kind == 2)
2171 *value2 = (unsigned char)op2->us;
2172 else if(op2->kind == 1 && op2->type->isSigned)
2173 *value2 = (unsigned char)op2->c;
2174 else if(op2->kind == 24 || op2->kind == 1)
2175 *value2 = op2->uc;
2176 else if(op2->kind == 6)
2177 *value2 = (unsigned char)op2->f;
2178 else if(op2->kind == 7)
2179 *value2 = (unsigned char)op2->d;
2180 else if(op2->kind == 13)
2181 *value2 = (unsigned char)op2->ui64;
2182 else
2183 return 0x0;
2184 return 0x1;
2185 }
2186
2187 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
2188 {
2189 struct Operand op2 = GetOperand(exp);
2190
2191 return GetOpUChar(&op2, value2);
2192 }
2193
2194 unsigned int GetOpFloat(struct Operand * op2, float * value2)
2195 {
2196 if(op2->kind == 3 && op2->type->isSigned)
2197 *value2 = (float)(float)op2->i;
2198 else if(op2->kind == 3)
2199 *value2 = (float)(float)op2->ui;
2200 else if(op2->kind == 4 && op2->type->isSigned)
2201 *value2 = (float)(float)op2->i64;
2202 else if(op2->kind == 4)
2203 *value2 = (float)(float)op2->ui64;
2204 else if(op2->kind == 23 && op2->type->isSigned)
2205 *value2 = (float)(float)op2->i64;
2206 else if(op2->kind == 23)
2207 *value2 = (float)(float)op2->ui64;
2208 else if(op2->kind == 22 && op2->type->isSigned)
2209 *value2 = (float)(float)op2->i64;
2210 else if(op2->kind == 22)
2211 *value2 = (float)(float)op2->ui64;
2212 else if(op2->kind == 2 && op2->type->isSigned)
2213 *value2 = (float)(float)op2->s;
2214 else if(op2->kind == 2)
2215 *value2 = (float)(float)op2->us;
2216 else if(op2->kind == 1 && op2->type->isSigned)
2217 *value2 = (float)(float)op2->c;
2218 else if(op2->kind == 24 || op2->kind == 1)
2219 *value2 = (float)(float)op2->uc;
2220 else if(op2->kind == 6)
2221 *value2 = (float)op2->f;
2222 else if(op2->kind == 7)
2223 *value2 = (float)op2->d;
2224 else if(op2->kind == 13)
2225 *value2 = (float)(float)op2->ui64;
2226 else
2227 return 0x0;
2228 return 0x1;
2229 }
2230
2231 unsigned int GetFloat(struct Expression * exp, float * value2)
2232 {
2233 struct Operand op2 = GetOperand(exp);
2234
2235 return GetOpFloat(&op2, value2);
2236 }
2237
2238 unsigned int GetOpDouble(struct Operand * op2, double * value2)
2239 {
2240 if(op2->kind == 3 && op2->type->isSigned)
2241 *value2 = (double)(double)op2->i;
2242 else if(op2->kind == 3)
2243 *value2 = (double)(double)op2->ui;
2244 else if(op2->kind == 4 && op2->type->isSigned)
2245 *value2 = (double)(double)op2->i64;
2246 else if(op2->kind == 4)
2247 *value2 = (double)(double)op2->ui64;
2248 else if(op2->kind == 23 && op2->type->isSigned)
2249 *value2 = (double)(double)op2->i64;
2250 else if(op2->kind == 23)
2251 *value2 = (double)(double)op2->ui64;
2252 else if(op2->kind == 22 && op2->type->isSigned)
2253 *value2 = (double)(double)op2->i64;
2254 else if(op2->kind == 22)
2255 *value2 = (double)(double)op2->ui64;
2256 else if(op2->kind == 2 && op2->type->isSigned)
2257 *value2 = (double)(double)op2->s;
2258 else if(op2->kind == 2)
2259 *value2 = (double)(double)op2->us;
2260 else if(op2->kind == 1 && op2->type->isSigned)
2261 *value2 = (double)(double)op2->c;
2262 else if(op2->kind == 24 || op2->kind == 1)
2263 *value2 = (double)(double)op2->uc;
2264 else if(op2->kind == 6)
2265 *value2 = (double)op2->f;
2266 else if(op2->kind == 7)
2267 *value2 = (double)op2->d;
2268 else if(op2->kind == 13)
2269 *value2 = (double)(double)op2->ui64;
2270 else
2271 return 0x0;
2272 return 0x1;
2273 }
2274
2275 unsigned int GetDouble(struct Expression * exp, double * value2)
2276 {
2277 struct Operand op2 = GetOperand(exp);
2278
2279 return GetOpDouble(&op2, value2);
2280 }
2281
2282 void ComputeExpression(struct Expression * exp);
2283
2284 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2285
2286 extern int targetBits;
2287
2288 int ComputeTypeSize(struct Type * type);
2289
2290 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2291
2292 struct __ecereNameSpace__ecere__com__BitMember
2293 {
2294 struct __ecereNameSpace__ecere__com__BitMember * prev;
2295 struct __ecereNameSpace__ecere__com__BitMember * next;
2296 char *  name;
2297 unsigned int isProperty;
2298 int memberAccess;
2299 int id;
2300 struct __ecereNameSpace__ecere__com__Class * _class;
2301 char *  dataTypeString;
2302 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2303 struct Type * dataType;
2304 int type;
2305 int size;
2306 int pos;
2307 uint64 mask;
2308 } __attribute__ ((gcc_struct));
2309
2310 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2311
2312 struct __ecereNameSpace__ecere__sys__OldLink
2313 {
2314 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2315 struct __ecereNameSpace__ecere__sys__OldLink * next;
2316 void *  data;
2317 } __attribute__ ((gcc_struct));
2318
2319 void FinishTemplatesContext(struct Context * context);
2320
2321 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2322 {
2323 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2324 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2325
2326 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))
2327 {
2328 int c;
2329 int unionMemberOffset = 0;
2330 int bitFields = 0;
2331
2332 if(member)
2333 {
2334 member->memberOffset = 0;
2335 if(targetBits < sizeof(void *) * 8)
2336 member->structAlignment = 0;
2337 }
2338 else if(targetBits < sizeof(void *) * 8)
2339 _class->structAlignment = 0;
2340 if(!member && ((_class->type == 0 || _class->type == 5) || (_class->type == 1 && _class->memberOffset && _class->memberOffset > _class->base->structSize)))
2341 _class->memberOffset = (_class->base && _class->type == 1) ? _class->base->structSize : 0;
2342 if(!member && _class->destructionWatchOffset)
2343 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2344 {
2345 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2346
2347 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2348 {
2349 if(!dataMember->isProperty)
2350 {
2351 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2352 {
2353 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
2354 }
2355 }
2356 }
2357 }
2358 {
2359 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2360
2361 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2362 {
2363 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2364 {
2365 if(!isMember && _class->type == 2 && dataMember->dataType)
2366 {
2367 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2368 uint64 mask = 0;
2369 int d;
2370
2371 ComputeTypeSize(dataMember->dataType);
2372 if(bitMember->pos == -1)
2373 bitMember->pos = _class->memberOffset;
2374 if(!bitMember->size)
2375 bitMember->size = dataMember->dataType->size * 8;
2376 _class->memberOffset = bitMember->pos + bitMember->size;
2377 for(d = 0; d < bitMember->size; d++)
2378 {
2379 if(d)
2380 mask <<= 1;
2381 mask |= 1;
2382 }
2383 bitMember->mask = mask << bitMember->pos;
2384 }
2385 else if(dataMember->type == 0 && dataMember->dataType)
2386 {
2387 int size;
2388 int alignment = 0;
2389
2390 if(dataMember->dataType->kind != 8 || ((!dataMember->dataType->_class || !dataMember->dataType->_class->registered || dataMember->dataType->_class->registered != _class || _class->type != 1)))
2391 ComputeTypeSize(dataMember->dataType);
2392 if(dataMember->dataType->bitFieldCount)
2393 {
2394 bitFields += dataMember->dataType->bitFieldCount;
2395 size = 0;
2396 }
2397 else
2398 {
2399 if(bitFields)
2400 {
2401 int size = (bitFields + 7) / 8;
2402
2403 if(isMember)
2404 {
2405 int __simpleStruct0;
2406
2407 if(alignment)
2408 {
2409 int __simpleStruct0;
2410
2411 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2412 if(member->memberOffset % alignment)
2413 member->memberOffset += alignment - (member->memberOffset % alignment);
2414 }
2415 dataMember->offset = member->memberOffset;
2416 if(member->type == 1)
2417 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2418 else
2419 {
2420 member->memberOffset += size;
2421 }
2422 }
2423 else
2424 {
2425 if(alignment)
2426 {
2427 int __simpleStruct0;
2428
2429 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2430 if(_class->memberOffset % alignment)
2431 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2432 }
2433 dataMember->offset = _class->memberOffset;
2434 _class->memberOffset += size;
2435 }
2436 bitFields = 0;
2437 }
2438 size = dataMember->dataType->size;
2439 alignment = dataMember->dataType->alignment;
2440 }
2441 if(isMember)
2442 {
2443 int __simpleStruct0;
2444
2445 if(alignment)
2446 {
2447 int __simpleStruct0;
2448
2449 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2450 if(member->memberOffset % alignment)
2451 member->memberOffset += alignment - (member->memberOffset % alignment);
2452 }
2453 dataMember->offset = member->memberOffset;
2454 if(member->type == 1)
2455 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2456 else
2457 {
2458 member->memberOffset += size;
2459 }
2460 }
2461 else
2462 {
2463 if(alignment)
2464 {
2465 int __simpleStruct0;
2466
2467 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2468 if(_class->memberOffset % alignment)
2469 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2470 }
2471 dataMember->offset = _class->memberOffset;
2472 _class->memberOffset += size;
2473 }
2474 }
2475 else
2476 {
2477 int alignment;
2478
2479 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 0x1);
2480 alignment = dataMember->structAlignment;
2481 if(isMember)
2482 {
2483 int __simpleStruct0;
2484
2485 if(alignment)
2486 {
2487 int __simpleStruct0;
2488
2489 if(member->memberOffset % alignment)
2490 member->memberOffset += alignment - (member->memberOffset % alignment);
2491 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2492 }
2493 dataMember->offset = member->memberOffset;
2494 if(member->type == 1)
2495 unionMemberOffset = (__simpleStruct0 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2496 else
2497 member->memberOffset += dataMember->memberOffset;
2498 }
2499 else
2500 {
2501 if(alignment)
2502 {
2503 int __simpleStruct0;
2504
2505 if(_class->memberOffset % alignment)
2506 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2507 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2508 }
2509 dataMember->offset = _class->memberOffset;
2510 _class->memberOffset += dataMember->memberOffset;
2511 }
2512 }
2513 }
2514 }
2515 if(bitFields)
2516 {
2517 int alignment = 0;
2518 int size = (bitFields + 7) / 8;
2519
2520 if(isMember)
2521 {
2522 int __simpleStruct0;
2523
2524 if(alignment)
2525 {
2526 int __simpleStruct0;
2527
2528 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2529 if(member->memberOffset % alignment)
2530 member->memberOffset += alignment - (member->memberOffset % alignment);
2531 }
2532 if(member->type == 1)
2533 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2534 else
2535 {
2536 member->memberOffset += size;
2537 }
2538 }
2539 else
2540 {
2541 if(alignment)
2542 {
2543 int __simpleStruct0;
2544
2545 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2546 if(_class->memberOffset % alignment)
2547 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2548 }
2549 _class->memberOffset += size;
2550 }
2551 bitFields = 0;
2552 }
2553 }
2554 if(member && member->type == 1)
2555 {
2556 member->memberOffset = unionMemberOffset;
2557 }
2558 if(!isMember)
2559 {
2560 if(_class->type != 2)
2561 {
2562 int extra = 0;
2563
2564 if(_class->structAlignment)
2565 {
2566 if(_class->memberOffset % _class->structAlignment)
2567 extra += _class->structAlignment - (_class->memberOffset % _class->structAlignment);
2568 }
2569 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset + extra;
2570 if(!member)
2571 {
2572 struct __ecereNameSpace__ecere__com__Property * prop;
2573
2574 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2575 {
2576 if(prop->isProperty && prop->isWatchable)
2577 {
2578 prop->watcherOffset = _class->structSize;
2579 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2580 }
2581 }
2582 }
2583 {
2584 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2585
2586 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2587 {
2588 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2589
2590 if(deriv->computeSize)
2591 {
2592 deriv->offset = _class->structSize;
2593 deriv->memberOffset = 0;
2594 deriv->structSize = deriv->offset;
2595 ComputeClassMembers(deriv, 0x0);
2596 }
2597 }
2598 }
2599 }
2600 }
2601 }
2602 if(context)
2603 FinishTemplatesContext(context);
2604 }
2605
2606 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2607
2608 struct __ecereNameSpace__ecere__com__NameSpace
2609 {
2610 char *  name;
2611 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
2612 struct __ecereNameSpace__ecere__com__NameSpace *  left;
2613 struct __ecereNameSpace__ecere__com__NameSpace *  right;
2614 int depth;
2615 struct __ecereNameSpace__ecere__com__NameSpace *  parent;
2616 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2617 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2618 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2619 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2620 } __attribute__ ((gcc_struct));
2621
2622 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2623
2624 struct __ecereNameSpace__ecere__com__Module
2625 {
2626 struct __ecereNameSpace__ecere__com__Instance * application;
2627 struct __ecereNameSpace__ecere__sys__OldList classes;
2628 struct __ecereNameSpace__ecere__sys__OldList defines;
2629 struct __ecereNameSpace__ecere__sys__OldList functions;
2630 struct __ecereNameSpace__ecere__sys__OldList modules;
2631 struct __ecereNameSpace__ecere__com__Instance * prev;
2632 struct __ecereNameSpace__ecere__com__Instance * next;
2633 char *  name;
2634 void *  library;
2635 void *  Unload;
2636 int importType;
2637 int origImportType;
2638 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2639 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2640 } __attribute__ ((gcc_struct));
2641
2642 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2643 {
2644 struct __ecereNameSpace__ecere__com__Class * _class;
2645 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2646
2647 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
2648 ComputeModuleClasses(subModule->data);
2649 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->classes.first; _class; _class = _class->next)
2650 ComputeClassMembers(_class, 0x0);
2651 }
2652
2653 extern unsigned int inCompiler;
2654
2655 extern void Compiler_Error(char *  format, ...);
2656
2657 extern char *  __ecereNameSpace__ecere__GetTranslatedString(char * name, char *  string, char *  stringAndContext);
2658
2659 int ComputeTypeSize(struct Type * type)
2660 {
2661 unsigned int size = type ? type->size : 0;
2662
2663 if(!size && type && !type->computing)
2664 {
2665 type->computing = 0x1;
2666 switch(type->kind)
2667 {
2668 case 24:
2669 type->alignment = size = sizeof(char);
2670 break;
2671 case 1:
2672 type->alignment = size = sizeof(char);
2673 break;
2674 case 3:
2675 type->alignment = size = sizeof(int);
2676 break;
2677 case 4:
2678 type->alignment = size = sizeof(long long);
2679 break;
2680 case 22:
2681 type->alignment = size = targetBits / 8;
2682 break;
2683 case 23:
2684 type->alignment = size = targetBits / 8;
2685 break;
2686 case 5:
2687 type->alignment = size = sizeof(long);
2688 break;
2689 case 2:
2690 type->alignment = size = sizeof(short);
2691 break;
2692 case 6:
2693 type->alignment = size = sizeof(float);
2694 break;
2695 case 7:
2696 type->alignment = size = sizeof(double);
2697 break;
2698 case 8:
2699 {
2700 struct __ecereNameSpace__ecere__com__Class * _class = type->_class ? type->_class->registered : (((void *)0));
2701
2702 if(_class && _class->type == 1)
2703 {
2704 ComputeClassMembers(_class, 0x0);
2705 type->alignment = _class->structAlignment;
2706 size = _class->structSize;
2707 if(type->alignment && size % type->alignment)
2708 size += type->alignment - (size % type->alignment);
2709 }
2710 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2711 {
2712 if(!_class->dataType)
2713 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2714 size = type->alignment = ComputeTypeSize(_class->dataType);
2715 }
2716 else
2717 size = type->alignment = targetBits / 8;
2718 break;
2719 }
2720 case 13:
2721 case 19:
2722 size = type->alignment = targetBits / 8;
2723 break;
2724 case 12:
2725 if(type->arraySizeExp)
2726 {
2727 ProcessExpressionType(type->arraySizeExp);
2728 ComputeExpression(type->arraySizeExp);
2729 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)))
2730 {
2731 struct Location oldLoc = yylloc;
2732 char expression[10240];
2733
2734 expression[0] = '\0';
2735 type->arraySizeExp->expType = (((void *)0));
2736 yylloc = type->arraySizeExp->loc;
2737 if(inCompiler)
2738 PrintExpression(type->arraySizeExp, expression);
2739 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Array size not constant int (%s)\n", (((void *)0))), expression);
2740 yylloc = oldLoc;
2741 }
2742 GetInt(type->arraySizeExp, &type->arraySize);
2743 }
2744 else if(type->enumClass)
2745 {
2746 if(type->enumClass && type->enumClass->registered && type->enumClass->registered->type == 4)
2747 {
2748 type->arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->enumClass->registered, "enumSize");
2749 }
2750 else
2751 type->arraySize = 0;
2752 }
2753 else
2754 {
2755 type->arraySize = 0;
2756 }
2757 size = ComputeTypeSize(type->type) * type->arraySize;
2758 if(type->type)
2759 type->alignment = type->type->alignment;
2760 break;
2761 case 9:
2762 {
2763 struct Type * member;
2764
2765 for(member = type->members.first; member; member = member->next)
2766 {
2767 int __simpleStruct0, __simpleStruct1;
2768 unsigned int addSize = ComputeTypeSize(member);
2769
2770 member->offset = size;
2771 if(member->alignment && size % member->alignment)
2772 member->offset += member->alignment - (size % member->alignment);
2773 size = member->offset;
2774 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2775 size += addSize;
2776 }
2777 if(type->alignment && size % type->alignment)
2778 size += type->alignment - (size % type->alignment);
2779 break;
2780 }
2781 case 10:
2782 {
2783 struct Type * member;
2784
2785 for(member = type->members.first; member; member = member->next)
2786 {
2787 int __simpleStruct0, __simpleStruct1;
2788 unsigned int addSize = ComputeTypeSize(member);
2789
2790 member->offset = size;
2791 if(member->alignment && size % member->alignment)
2792 member->offset += member->alignment - (size % member->alignment);
2793 size = member->offset;
2794 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2795 size = ((size > addSize) ? size : addSize);
2796 }
2797 if(type->alignment && size % type->alignment)
2798 size += type->alignment - (size % type->alignment);
2799 break;
2800 }
2801 case 20:
2802 {
2803 struct TemplateParameter * param = type->templateParameter;
2804 struct Type * baseType = ProcessTemplateParameterType(param);
2805
2806 if(baseType)
2807 {
2808 size = ComputeTypeSize(baseType);
2809 type->alignment = baseType->alignment;
2810 }
2811 else
2812 type->alignment = size = sizeof(uint64);
2813 break;
2814 }
2815 case 15:
2816 {
2817 type->alignment = size = sizeof(enum
2818 {
2819 test
2820 });
2821 break;
2822 }
2823 case 21:
2824 {
2825 type->alignment = size = targetBits / 8;
2826 break;
2827 }
2828 }
2829 type->size = size;
2830 type->computing = 0x0;
2831 }
2832 return size;
2833 }
2834
2835 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2836
2837 extern struct Identifier * MkIdentifier(char *  string);
2838
2839 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void *  item);
2840
2841 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2842
2843 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2844
2845 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2846
2847 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2848
2849 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2850
2851 extern void FreeType(struct Type * type);
2852
2853 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2854
2855 extern struct Specifier * MkSpecifier(int specifier);
2856
2857 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2858
2859 extern struct Expression * MkExpConstant(char *  string);
2860
2861 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)
2862 {
2863 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2864 unsigned int totalSize = 0;
2865 unsigned int maxSize = 0;
2866 int alignment, size;
2867 struct __ecereNameSpace__ecere__com__DataMember * member;
2868 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2869
2870 if(addedPadding)
2871 *addedPadding = 0x0;
2872 if(!isMember && _class->base)
2873 {
2874 maxSize = _class->structSize;
2875 {
2876 if(_class->type == 1 || _class->type == 5)
2877 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass, (((void *)0)));
2878 else
2879 {
2880 unsigned int baseSize = _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2881
2882 if(maxSize > baseSize)
2883 maxSize -= baseSize;
2884 else
2885 maxSize = 0;
2886 }
2887 }
2888 }
2889 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2890 {
2891 if(!member->isProperty)
2892 {
2893 switch(member->type)
2894 {
2895 case 0:
2896 {
2897 if(member->dataTypeString)
2898 {
2899 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2900 struct Declarator * decl;
2901
2902 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2903 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2904 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2905 if(!member->dataType)
2906 member->dataType = ProcessType(specs, decl);
2907 ReplaceThisClassSpecifiers(specs, topClass);
2908 {
2909 struct Type * type = ProcessType(specs, decl);
2910
2911 DeclareType(member->dataType, 0x0, 0x0);
2912 FreeType(type);
2913 }
2914 ComputeTypeSize(member->dataType);
2915 size = member->dataType->size;
2916 alignment = member->dataType->alignment;
2917 if(alignment)
2918 {
2919 if(totalSize % alignment)
2920 totalSize += alignment - (totalSize % alignment);
2921 }
2922 totalSize += size;
2923 }
2924 break;
2925 }
2926 case 1:
2927 case 2:
2928 {
2929 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
2930
2931 size = 0;
2932 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass, (((void *)0)));
2933 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
2934 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, (((void *)0)), (((void *)0)))));
2935 alignment = member->structAlignment;
2936 if(alignment)
2937 {
2938 if(totalSize % alignment)
2939 totalSize += alignment - (totalSize % alignment);
2940 }
2941 totalSize += size;
2942 break;
2943 }
2944 }
2945 }
2946 }
2947 if(retSize)
2948 {
2949 unsigned int __simpleStruct0;
2950
2951 if(topMember && topMember->type == 1)
2952 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
2953 else
2954 *retSize += totalSize;
2955 }
2956 else if(totalSize < maxSize && _class->type != 1000)
2957 {
2958 int autoPadding = 0;
2959
2960 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
2961 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
2962 if(totalSize + autoPadding < maxSize)
2963 {
2964 char sizeString[50];
2965
2966 sprintf(sizeString, "%d", maxSize - totalSize);
2967 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
2968 if(addedPadding)
2969 *addedPadding = 0x1;
2970 }
2971 }
2972 if(context)
2973 FinishTemplatesContext(context);
2974 return topMember ? topMember->memberID : _class->memberID;
2975 }
2976
2977 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2978 {
2979 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2980 unsigned int totalSize = 0;
2981 struct __ecereNameSpace__ecere__com__DataMember * member;
2982 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2983
2984 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
2985 DeclareMembers(_class->base, 0x0);
2986 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2987 {
2988 if(!member->isProperty)
2989 {
2990 switch(member->type)
2991 {
2992 case 0:
2993 {
2994 if(!member->dataType && member->dataTypeString)
2995 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
2996 if(member->dataType)
2997 DeclareType(member->dataType, 0x0, 0x0);
2998 break;
2999 }
3000 case 1:
3001 case 2:
3002 {
3003 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
3004 break;
3005 }
3006 }
3007 }
3008 }
3009 if(context)
3010 FinishTemplatesContext(context);
3011 return topMember ? topMember->memberID : _class->memberID;
3012 }
3013
3014 extern struct Symbol * FindClass(char *  name);
3015
3016 extern char *  strchr(const char * , int);
3017
3018 extern void FullClassNameCat(char *  output, char *  className, unsigned int includeTemplateParams);
3019
3020 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (*  FreeFunction)(void * ));
3021
3022 extern void FreeClassDef(struct ClassDef * def);
3023
3024 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
3025
3026 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
3027
3028 extern char *  strcpy(char * , const char * );
3029
3030 extern void MangleClassName(char *  className);
3031
3032 extern void DeclareClass(struct Symbol * classSym, char *  className);
3033
3034 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item, void *  prevItem);
3035
3036 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void *  prevItem, void *  item);
3037
3038 void DeclareStruct(char * name, unsigned int skipNoHead)
3039 {
3040 struct External * external = (((void *)0));
3041 struct Symbol * classSym = FindClass(name);
3042
3043 if(!inCompiler || !classSym)
3044 return ;
3045 if(classSym->registered && (classSym->registered->type == 2 || classSym->registered->type == 3 || classSym->registered->type == 4))
3046 return ;
3047 if(classSym->registered && classSym->imported && !classSym->declaredStructSym)
3048 {
3049 struct Declaration * decl;
3050 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3051 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
3052 char structName[1024];
3053
3054 external = (classSym->registered && classSym->registered->type == 1) ? classSym->pointerExternal : classSym->structExternal;
3055 classSym->declaring++;
3056 if(strchr(classSym->string, '<'))
3057 {
3058 if(classSym->registered->templateClass)
3059 {
3060 DeclareStruct(classSym->registered->templateClass->fullName, skipNoHead);
3061 classSym->declaring--;
3062 }
3063 return ;
3064 }
3065 DeclareMembers(classSym->registered, 0x0);
3066 structName[0] = (char)0;
3067 FullClassNameCat(structName, name, 0x0);
3068 if(!skipNoHead)
3069 {
3070 unsigned int addedPadding = 0x0;
3071
3072 classSym->declaredStructSym = 0x1;
3073 declarations = MkList();
3074 AddMembers(declarations, classSym->registered, 0x0, (((void *)0)), classSym->registered, &addedPadding);
3075 if(!(*declarations).count || ((*declarations).count == 1 && addedPadding))
3076 {
3077 FreeList(declarations, FreeClassDef);
3078 declarations = (((void *)0));
3079 }
3080 }
3081 if(skipNoHead || declarations)
3082 {
3083 if(external && external->declaration)
3084 {
3085 ((struct Specifier *)(*external->declaration->specifiers).first)->definitions = declarations;
3086 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3087 {
3088 if(classSym->structExternal)
3089 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3090 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3091 classSym->id = curExternal->symbol->idCode;
3092 classSym->idCode = curExternal->symbol->idCode;
3093 }
3094 }
3095 else
3096 {
3097 if(!external)
3098 external = MkExternalDeclaration((((void *)0)));
3099 specifiers = MkList();
3100 declarators = MkList();
3101 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
3102 external->declaration = decl = MkDeclaration(specifiers, declarators);
3103 if(decl->symbol && !decl->symbol->pointerExternal)
3104 decl->symbol->pointerExternal = external;
3105 if(classSym->registered && classSym->registered->type == 1)
3106 {
3107 char className[1024];
3108
3109 strcpy(className, "__ecereClass_");
3110 FullClassNameCat(className, classSym->string, 0x1);
3111 MangleClassName(className);
3112 DeclareClass(classSym, className);
3113 external->symbol = classSym;
3114 classSym->pointerExternal = external;
3115 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3116 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3117 }
3118 else
3119 {
3120 char className[1024];
3121
3122 strcpy(className, "__ecereClass_");
3123 FullClassNameCat(className, classSym->string, 0x1);
3124 MangleClassName(className);
3125 classSym->structExternal = external;
3126 DeclareClass(classSym, className);
3127 external->symbol = classSym;
3128 }
3129 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
3130 }
3131 }
3132 classSym->declaring--;
3133 }
3134 else if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3135 {
3136 classSym->declaring++;
3137 {
3138 if(classSym->registered)
3139 DeclareMembers(classSym->registered, 0x0);
3140 }
3141 if(classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 5))
3142 {
3143 if(classSym->structExternal)
3144 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3145 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3146 classSym->id = curExternal->symbol->idCode;
3147 classSym->idCode = curExternal->symbol->idCode;
3148 }
3149 classSym->declaring--;
3150 }
3151 }
3152
3153 extern char *  strcat(char * , const char * );
3154
3155 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
3156
3157 extern struct ModuleImport * mainModule;
3158
3159 extern struct Specifier * MkSpecifierName(char *  name);
3160
3161 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
3162
3163 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
3164
3165 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
3166
3167 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
3168
3169 extern void FreeDeclarator(struct Declarator * decl);
3170
3171 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
3172
3173 struct PropertyImport
3174 {
3175 struct PropertyImport * prev;
3176 struct PropertyImport * next;
3177 char *  name;
3178 unsigned int isVirtual;
3179 unsigned int hasSet;
3180 unsigned int hasGet;
3181 } __attribute__ ((gcc_struct));
3182
3183 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
3184
3185 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
3186 {
3187 struct Symbol * symbol = prop->symbol;
3188 char propName[1024];
3189
3190 strcpy(setName, "__ecereProp_");
3191 FullClassNameCat(setName, prop->_class->fullName, 0x0);
3192 strcat(setName, "_Set_");
3193 FullClassNameCat(setName, prop->name, 0x1);
3194 strcpy(getName, "__ecereProp_");
3195 FullClassNameCat(getName, prop->_class->fullName, 0x0);
3196 strcat(getName, "_Get_");
3197 FullClassNameCat(getName, prop->name, 0x1);
3198 strcpy(propName, "__ecereProp_");
3199 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3200 strcat(propName, "_");
3201 FullClassNameCat(propName, prop->name, 0x1);
3202 MangleClassName(getName);
3203 MangleClassName(setName);
3204 MangleClassName(propName);
3205 if(prop->_class->type == 1)
3206 DeclareStruct(prop->_class->fullName, 0x0);
3207 if(!symbol || curExternal->symbol->idCode < symbol->id)
3208 {
3209 unsigned int imported = 0x0;
3210 unsigned int dllImport = 0x0;
3211
3212 if(!symbol || symbol->_import)
3213 {
3214 if(!symbol)
3215 {
3216 struct Symbol * classSym;
3217
3218 if(!prop->_class->symbol)
3219 prop->_class->symbol = FindClass(prop->_class->fullName);
3220 classSym = prop->_class->symbol;
3221 if(classSym && !classSym->_import)
3222 {
3223 struct ModuleImport * module;
3224
3225 if(prop->_class->module)
3226 module = FindModule(prop->_class->module);
3227 else
3228 module = mainModule;
3229 classSym->_import = __extension__ ({
3230 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
3231
3232 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
3233 });
3234 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3235 }
3236 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3237 symbol->_import = (struct ClassImport *)__extension__ ({
3238 struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
3239
3240 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0x0, __ecereInstance1->hasSet = prop->Set ? 0x1 : 0x0, __ecereInstance1->hasGet = prop->Get ? 0x1 : 0x0, __ecereInstance1;
3241 });
3242 if(classSym)
3243 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3244 }
3245 imported = 0x1;
3246 if(prop->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)prop->_class->module + structSize_Instance)))->importType != 1)
3247 dllImport = 0x1;
3248 }
3249 if(!symbol->type)
3250 {
3251 struct Context * context = SetupTemplatesContext(prop->_class);
3252
3253 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
3254 FinishTemplatesContext(context);
3255 }
3256 if(prop->Get)
3257 {
3258 if(!symbol->externalGet || symbol->externalGet->type == 0)
3259 {
3260 struct Declaration * decl;
3261 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3262 struct Declarator * d;
3263 struct __ecereNameSpace__ecere__sys__OldList * params;
3264 struct Specifier * spec;
3265 struct External * external;
3266 struct Declarator * typeDecl;
3267 unsigned int simple = 0x0;
3268
3269 specifiers = MkList();
3270 declarators = MkList();
3271 params = MkList();
3272 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3273 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3274 if(dllImport)
3275 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3276 {
3277 struct Context * context = SetupTemplatesContext(prop->_class);
3278
3279 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3280 FinishTemplatesContext(context);
3281 }
3282 for(spec = (*specifiers).first; spec; spec = spec->next)
3283 {
3284 if(spec->type == 1)
3285 {
3286 if((!typeDecl || typeDecl->type == 1))
3287 {
3288 struct Symbol * classSym = spec->symbol;
3289
3290 symbol->_class = classSym->registered;
3291 if(classSym->registered && classSym->registered->type == 1)
3292 {
3293 DeclareStruct(spec->name, 0x0);
3294 simple = 0x1;
3295 }
3296 }
3297 }
3298 }
3299 if(!simple)
3300 d = PlugDeclarator(typeDecl, d);
3301 else
3302 {
3303 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3304 specifiers = MkList();
3305 }
3306 d = MkDeclaratorFunction(d, params);
3307 if(dllImport)
3308 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3309 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3310 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3311 if(simple)
3312 ListAdd(specifiers, MkSpecifier(VOID));
3313 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3314 decl = MkDeclaration(specifiers, declarators);
3315 external = MkExternalDeclaration(decl);
3316 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3317 external->symbol = symbol;
3318 symbol->externalGet = external;
3319 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3320 if(typeDecl)
3321 FreeDeclarator(typeDecl);
3322 }
3323 else
3324 {
3325 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
3326 }
3327 }
3328 if(prop->Set)
3329 {
3330 if(!symbol->externalSet || symbol->externalSet->type == 0)
3331 {
3332 struct Declaration * decl;
3333 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3334 struct Declarator * d;
3335 struct __ecereNameSpace__ecere__sys__OldList * params;
3336 struct Specifier * spec;
3337 struct External * external;
3338 struct Declarator * typeDecl;
3339
3340 declarators = MkList();
3341 params = MkList();
3342 if(!prop->conversion || prop->_class->type == 1)
3343 {
3344 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3345 }
3346 specifiers = MkList();
3347 {
3348 struct Context * context = SetupTemplatesContext(prop->_class);
3349
3350 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3351 FinishTemplatesContext(context);
3352 }
3353 ListAdd(params, MkTypeName(specifiers, d));
3354 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3355 if(dllImport)
3356 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3357 d = MkDeclaratorFunction(d, params);
3358 for(spec = (*specifiers).first; spec; spec = spec->next)
3359 {
3360 if(spec->type == 1)
3361 {
3362 if((!typeDecl || typeDecl->type == 1))
3363 {
3364 struct Symbol * classSym = spec->symbol;
3365
3366 symbol->_class = classSym->registered;
3367 if(classSym->registered && classSym->registered->type == 1)
3368 DeclareStruct(spec->name, 0x0);
3369 }
3370 }
3371 }
3372 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3373 specifiers = MkList();
3374 if(dllImport)
3375 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3376 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3377 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3378 if(!prop->conversion || prop->_class->type == 1)
3379 ListAdd(specifiers, MkSpecifier(VOID));
3380 else
3381 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3382 decl = MkDeclaration(specifiers, declarators);
3383 external = MkExternalDeclaration(decl);
3384 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3385 external->symbol = symbol;
3386 symbol->externalSet = external;
3387 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3388 }
3389 else
3390 {
3391 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3392 }
3393 }
3394 if(!symbol->externalPtr)
3395 {
3396 struct Declaration * decl;
3397 struct External * external;
3398 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3399
3400 if(imported)
3401 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3402 else
3403 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3404 ListAdd(specifiers, MkSpecifierName("Property"));
3405 {
3406 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3407
3408 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3409 if(!imported)
3410 {
3411 strcpy(propName, "__ecerePropM_");
3412 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3413 strcat(propName, "_");
3414 FullClassNameCat(propName, prop->name, 0x1);
3415 MangleClassName(propName);
3416 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3417 }
3418 decl = MkDeclaration(specifiers, list);
3419 }
3420 external = MkExternalDeclaration(decl);
3421 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3422 external->symbol = symbol;
3423 symbol->externalPtr = external;
3424 }
3425 else
3426 {
3427 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3428 }
3429 symbol->id = curExternal->symbol->idCode;
3430 }
3431 }
3432
3433 struct Type * Dereference(struct Type * source)
3434 {
3435 struct Type * type = (((void *)0));
3436
3437 if(source)
3438 {
3439 if(source->kind == 13 || source->kind == 12)
3440 {
3441 type = source->type;
3442 source->type->refCount++;
3443 }
3444 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3445 {
3446 type = __extension__ ({
3447 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3448
3449 __ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
3450 });
3451 }
3452 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3453 {
3454 type = source;
3455 source->refCount++;
3456 }
3457 else
3458 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot dereference type\n", (((void *)0))));
3459 }
3460 return type;
3461 }
3462
3463 static struct Type * Reference(struct Type * source)
3464 {
3465 struct Type * type = (((void *)0));
3466
3467 if(source)
3468 {
3469 type = __extension__ ({
3470 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3471
3472 __ecereInstance1->kind = 13, __ecereInstance1->type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
3473 });
3474 source->refCount++;
3475 }
3476 return type;
3477 }
3478
3479 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);
3480
3481 extern void *  memcpy(void * , const void * , size_t size);
3482
3483 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3484
3485 extern void FreeExpression(struct Expression * exp);
3486
3487 extern void __ecereNameSpace__ecere__sys__ChangeCh(char *  string, char ch1, char ch2);
3488
3489 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);
3490
3491 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3492
3493 extern struct Type * MkClassType(char *  name);
3494
3495 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);
3496
3497 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)
3498 {
3499 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3500 unsigned int found = 0x0;
3501 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3502 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3503 unsigned int freeType = 0x0;
3504
3505 yylloc = member->loc;
3506 if(!ident)
3507 {
3508 if(curMember)
3509 {
3510 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3511 if(*curMember)
3512 {
3513 found = 0x1;
3514 dataMember = *curMember;
3515 }
3516 }
3517 }
3518 else
3519 {
3520 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3521 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3522 int _subMemberStackPos = 0;
3523
3524 if(!thisMember)
3525 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3526 if(thisMember)
3527 {
3528 dataMember = thisMember;
3529 if(curMember && thisMember->memberAccess == 1)
3530 {
3531 *curMember = thisMember;
3532 *curClass = thisMember->_class;
3533 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
3534 *subMemberStackPos = _subMemberStackPos;
3535 }
3536 found = 0x1;
3537 }
3538 else
3539 {
3540 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3541 if(method && method->type == 1)
3542 found = 0x1;
3543 else
3544 method = (((void *)0));
3545 }
3546 }
3547 if(found)
3548 {
3549 struct Type * type = (((void *)0));
3550
3551 if(dataMember)
3552 {
3553 if(!dataMember->dataType && dataMember->dataTypeString)
3554 {
3555 struct Context * context = SetupTemplatesContext(_class);
3556
3557 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3558 FinishTemplatesContext(context);
3559 }
3560 type = dataMember->dataType;
3561 }
3562 else if(method)
3563 {
3564 if(!method->dataType)
3565 ProcessMethodType(method);
3566 type = method->dataType;
3567 }
3568 if(ident && ident->next)
3569 {
3570 for(ident = ident->next; ident && type; ident = ident->next)
3571 {
3572 if(type->kind == 8)
3573 {
3574 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3575 if(!dataMember)
3576 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3577 if(dataMember)
3578 type = dataMember->dataType;
3579 }
3580 else if(type->kind == 9 || type->kind == 10)
3581 {
3582 struct Type * memberType;
3583
3584 for(memberType = type->members.first; memberType; memberType = memberType->next)
3585 {
3586 if(!strcmp(memberType->name, ident->string))
3587 {
3588 type = memberType;
3589 break;
3590 }
3591 }
3592 }
3593 }
3594 }
3595 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3596 {
3597 int id = 0;
3598 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3599 struct __ecereNameSpace__ecere__com__Class * sClass;
3600
3601 for(sClass = _class; sClass; sClass = sClass->base)
3602 {
3603 id = 0;
3604 if(sClass->templateClass)
3605 sClass = sClass->templateClass;
3606 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3607 {
3608 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3609 {
3610 for(sClass = sClass->base; sClass; sClass = sClass->base)
3611 {
3612 if(sClass->templateClass)
3613 sClass = sClass->templateClass;
3614 id += sClass->templateParams.count;
3615 }
3616 break;
3617 }
3618 id++;
3619 }
3620 if(curParam)
3621 break;
3622 }
3623 if(curParam)
3624 {
3625 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3626
3627 if(arg.dataTypeString)
3628 {
3629 type = ProcessTypeString(arg.dataTypeString, 0x0);
3630 freeType = 0x1;
3631 if(type && _class->templateClass)
3632 type->passAsTemplate = 0x1;
3633 if(type)
3634 {
3635 }
3636 }
3637 }
3638 }
3639 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3640 {
3641 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3642 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3643 int c;
3644 int paramCount = 0;
3645 int lastParam = -1;
3646 char templateString[1024];
3647 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3648
3649 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3650 for(cClass = expClass; cClass; cClass = cClass->base)
3651 {
3652 int p = 0;
3653
3654 if(cClass->templateClass)
3655 cClass = cClass->templateClass;
3656 for(param = cClass->templateParams.first; param; param = param->next)
3657 {
3658 int id = p;
3659 struct __ecereNameSpace__ecere__com__Class * sClass;
3660 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3661
3662 for(sClass = cClass->base; sClass; sClass = sClass->base)
3663 {
3664 if(sClass->templateClass)
3665 sClass = sClass->templateClass;
3666 id += sClass->templateParams.count;
3667 }
3668 arg = expClass->templateArgs[id];
3669 for(sClass = _class; sClass; sClass = sClass->base)
3670 {
3671 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3672 int p = 0;
3673 struct __ecereNameSpace__ecere__com__Class * nextClass;
3674
3675 if(sClass->templateClass)
3676 sClass = sClass->templateClass;
3677 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3678 {
3679 if(nextClass->templateClass)
3680 nextClass = nextClass->templateClass;
3681 p += nextClass->templateParams.count;
3682 }
3683 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3684 {
3685 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3686 {
3687 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3688 {
3689 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3690 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3691 break;
3692 }
3693 }
3694 }
3695 }
3696 {
3697 char argument[256];
3698
3699 argument[0] = '\0';
3700 switch(param->type)
3701 {
3702 case 2:
3703 {
3704 char expString[1024];
3705 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3706 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3707 struct Expression * exp;
3708 char * string = PrintHexUInt64(arg.expression.ui64);
3709
3710 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3711 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
3712 ProcessExpressionType(exp);
3713 ComputeExpression(exp);
3714 expString[0] = '\0';
3715 PrintExpression(exp, expString);
3716 strcat(argument, expString);
3717 FreeExpression(exp);
3718 break;
3719 }
3720 case 1:
3721 {
3722 strcat(argument, arg.member->name);
3723 break;
3724 }
3725 case 0:
3726 {
3727 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3728 strcat(argument, arg.dataTypeString);
3729 break;
3730 }
3731 }
3732 if(argument[0])
3733 {
3734 if(paramCount)
3735 strcat(templateString, ", ");
3736 if(lastParam != p - 1)
3737 {
3738 strcat(templateString, param->name);
3739 strcat(templateString, " = ");
3740 }
3741 strcat(templateString, argument);
3742 paramCount++;
3743 lastParam = p;
3744 }
3745 p++;
3746 }
3747 }
3748 }
3749 {
3750 int len = strlen(templateString);
3751
3752 if(templateString[len - 1] == '<')
3753 len--;
3754 else
3755 {
3756 if(templateString[len - 1] == '>')
3757 templateString[len++] = ' ';
3758 templateString[len++] = '>';
3759 }
3760 templateString[len++] = '\0';
3761 }
3762 {
3763 struct Context * context = SetupTemplatesContext(_class);
3764
3765 if(freeType)
3766 FreeType(type);
3767 type = ProcessTypeString(templateString, 0x0);
3768 freeType = 0x1;
3769 FinishTemplatesContext(context);
3770 }
3771 }
3772 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3773 {
3774 ProcessExpressionType(member->initializer->exp);
3775 if(!member->initializer->exp->expType)
3776 {
3777 if(inCompiler)
3778 {
3779 char expString[10240];
3780
3781 expString[0] = '\0';
3782 PrintExpression(member->initializer->exp, expString);
3783 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3784 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3785 }
3786 }
3787 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0))
3788 {
3789 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible instance method %s\n", (((void *)0))), ident->string);
3790 }
3791 }
3792 else if(member->initializer)
3793 {
3794 ProcessInitializer(member->initializer, type);
3795 }
3796 if(freeType)
3797 FreeType(type);
3798 }
3799 else
3800 {
3801 if(_class && _class->type == 3)
3802 {
3803 if(member->initializer)
3804 {
3805 struct Type * type = MkClassType(_class->fullName);
3806
3807 ProcessInitializer(member->initializer, type);
3808 FreeType(type);
3809 }
3810 }
3811 else
3812 {
3813 if(member->initializer)
3814 {
3815 ProcessInitializer(member->initializer, (((void *)0)));
3816 }
3817 if(ident)
3818 {
3819 if(method)
3820 {
3821 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3822 }
3823 else if(_class)
3824 {
3825 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3826 if(inCompiler)
3827 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3828 }
3829 }
3830 else if(_class)
3831 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3832 }
3833 }
3834 }
3835
3836 extern struct Identifier * GetDeclId(struct Declarator * decl);
3837
3838 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);
3839
3840 extern void FreeSpecifier(struct Specifier * spec);
3841
3842 static void ProcessFunction(struct FunctionDefinition * function);
3843
3844 extern struct __ecereNameSpace__ecere__sys__OldList *  CopyList(struct __ecereNameSpace__ecere__sys__OldList *  source, void *  (*  CopyFunction)(void * ));
3845
3846 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3847
3848 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3849
3850 extern void FreeClassFunction(struct ClassFunction * func);
3851
3852 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3853
3854 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3855
3856 void ProcessInstantiationType(struct Instantiation * inst)
3857 {
3858 yylloc = inst->loc;
3859 if(inst->_class)
3860 {
3861 struct MembersInit * members;
3862 struct Symbol * classSym;
3863 struct __ecereNameSpace__ecere__com__Class * _class;
3864
3865 classSym = inst->_class->symbol;
3866 _class = classSym ? classSym->registered : (((void *)0));
3867 if(!_class || _class->type != 5)
3868 DeclareStruct(inst->_class->name, 0x0);
3869 afterExternal = afterExternal ? afterExternal : curExternal;
3870 if(inst->exp)
3871 ProcessExpressionType(inst->exp);
3872 inst->isConstant = 0x1;
3873 if(inst->members)
3874 {
3875 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3876 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3877 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3878 int subMemberStackPos = 0;
3879
3880 for(members = (*inst->members).first; members; members = members->next)
3881 {
3882 switch(members->type)
3883 {
3884 case 1:
3885 {
3886 char name[1024];
3887 static unsigned int instMethodID = 0;
3888 struct External * external = curExternal;
3889 struct Context * context = curContext;
3890 struct Declarator * declarator = members->function->declarator;
3891 struct Identifier * nameID = GetDeclId(declarator);
3892 char * unmangled = nameID ? nameID->string : (((void *)0));
3893 struct Expression * exp;
3894 struct External * createdExternal = (((void *)0));
3895
3896 if(inCompiler)
3897 {
3898 char number[16];
3899
3900 strcpy(name, "__ecereInstMeth_");
3901 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
3902 strcat(name, "_");
3903 strcat(name, nameID->string);
3904 strcat(name, "_");
3905 sprintf(number, "_%08d", instMethodID++);
3906 strcat(name, number);
3907 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
3908 }
3909 if(declarator)
3910 {
3911 struct Symbol * symbol = declarator->symbol;
3912 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
3913
3914 if(method && method->type == 1)
3915 {
3916 symbol->method = method;
3917 ProcessMethodType(method);
3918 if(!symbol->type->thisClass)
3919 {
3920 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
3921 {
3922 if(!currentClass->symbol)
3923 currentClass->symbol = FindClass(currentClass->fullName);
3924 symbol->type->thisClass = currentClass->symbol;
3925 }
3926 else
3927 {
3928 if(!_class->symbol)
3929 _class->symbol = FindClass(_class->fullName);
3930 symbol->type->thisClass = _class->symbol;
3931 }
3932 }
3933 DeclareType(symbol->type, 0x1, 0x1);
3934 }
3935 else if(classSym)
3936 {
3937 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
3938 }
3939 }
3940 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
3941 if(nameID)
3942 {
3943 FreeSpecifier(nameID->_class);
3944 nameID->_class = (((void *)0));
3945 }
3946 if(inCompiler)
3947 {
3948 struct Type * type = declarator->symbol->type;
3949 struct External * oldExternal = curExternal;
3950
3951 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
3952 {
3953 struct External * externalDecl;
3954
3955 externalDecl = MkExternalDeclaration((((void *)0)));
3956 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
3957 if(createdExternal->function)
3958 {
3959 ProcessFunction(createdExternal->function);
3960 {
3961 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
3962
3963 externalDecl->declaration = decl;
3964 if(decl->symbol && !decl->symbol->pointerExternal)
3965 decl->symbol->pointerExternal = externalDecl;
3966 declarator->symbol->pointerExternal = externalDecl;
3967 }
3968 }
3969 }
3970 }
3971 else if(declarator)
3972 {
3973 curExternal = declarator->symbol->pointerExternal;
3974 ProcessFunction((struct FunctionDefinition *)members->function);
3975 }
3976 curExternal = external;
3977 curContext = context;
3978 if(inCompiler)
3979 {
3980 FreeClassFunction(members->function);
3981 exp = QMkExpId(name);
3982 members->type = 0;
3983 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
3984 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
3985 }
3986 break;
3987 }
3988 case 0:
3989 {
3990 if(members->dataMembers && classSym)
3991 {
3992 struct MemberInit * member;
3993 struct Location oldyyloc = yylloc;
3994
3995 for(member = (*members->dataMembers).first; member; member = member->next)
3996 {
3997 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
3998 if(member->initializer && !member->initializer->isConstant)
3999 inst->isConstant = 0x0;
4000 }
4001 yylloc = oldyyloc;
4002 }
4003 break;
4004 }
4005 }
4006 }
4007 }
4008 }
4009 }
4010
4011 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
4012 {
4013 if(inCompiler)
4014 {
4015 if(type->kind == 11)
4016 {
4017 struct Type * param;
4018
4019 if(declareParams)
4020 {
4021 for(param = type->params.first; param; param = param->next)
4022 DeclareType(param, declarePointers, 0x1);
4023 }
4024 DeclareType(type->returnType, declarePointers, 0x1);
4025 }
4026 else if(type->kind == 13 && declarePointers)
4027 DeclareType(type->type, declarePointers, 0x0);
4028 else if(type->kind == 8)
4029 {
4030 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
4031 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
4032 }
4033 else if(type->kind == 9 || type->kind == 10)
4034 {
4035 struct Type * member;
4036
4037 for(member = type->members.first; member; member = member->next)
4038 DeclareType(member, 0x0, 0x0);
4039 }
4040 else if(type->kind == 12)
4041 DeclareType(type->arrayType, declarePointers, 0x0);
4042 }
4043 }
4044
4045 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
4046
4047 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
4048 {
4049 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
4050 int id = 0;
4051 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4052 struct __ecereNameSpace__ecere__com__Class * sClass;
4053
4054 for(sClass = _class; sClass; sClass = sClass->base)
4055 {
4056 id = 0;
4057 if(sClass->templateClass)
4058 sClass = sClass->templateClass;
4059 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4060 {
4061 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
4062 {
4063 for(sClass = sClass->base; sClass; sClass = sClass->base)
4064 {
4065 if(sClass->templateClass)
4066 sClass = sClass->templateClass;
4067 id += sClass->templateParams.count;
4068 }
4069 break;
4070 }
4071 id++;
4072 }
4073 if(curParam)
4074 break;
4075 }
4076 if(curParam)
4077 {
4078 arg = &_class->templateArgs[id];
4079 if(arg && param->type == 0)
4080 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
4081 }
4082 return arg;
4083 }
4084
4085 extern struct Context * PushContext(void);
4086
4087 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
4088
4089 struct TemplatedType
4090 {
4091 uintptr_t key;
4092 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4093 struct __ecereNameSpace__ecere__sys__BTNode * left;
4094 struct __ecereNameSpace__ecere__sys__BTNode * right;
4095 int depth;
4096 struct TemplateParameter * param;
4097 } __attribute__ ((gcc_struct));
4098
4099 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
4100
4101 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
4102 {
4103 struct Context * context = PushContext();
4104
4105 context->templateTypesOnly = 0x1;
4106 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
4107 {
4108 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
4109
4110 for(; param; param = param->next)
4111 {
4112 if(param->type == 0 && param->identifier)
4113 {
4114 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
4115
4116 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4117 }
4118 }
4119 }
4120 else if(_class)
4121 {
4122 struct __ecereNameSpace__ecere__com__Class * sClass;
4123
4124 for(sClass = _class; sClass; sClass = sClass->base)
4125 {
4126 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
4127
4128 for(p = sClass->templateParams.first; p; p = p->next)
4129 {
4130 if(p->type == 0)
4131 {
4132 struct TemplateParameter * param = p->param;
4133 struct TemplatedType * type;
4134
4135 if(!param)
4136 {
4137 p->param = param = __extension__ ({
4138 struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
4139
4140 __ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->dataTypeString, __ecereInstance1;
4141 });
4142 }
4143 type = __extension__ ({
4144 struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
4145
4146 __ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
4147 });
4148 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4149 }
4150 }
4151 }
4152 }
4153 return context;
4154 }
4155
4156 extern void PopContext(struct Context * ctx);
4157
4158 extern void FreeContext(struct Context * context);
4159
4160 void FinishTemplatesContext(struct Context * context)
4161 {
4162 PopContext(context);
4163 FreeContext(context);
4164 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
4165 }
4166
4167 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
4168 {
4169 if(!method->dataType)
4170 {
4171 struct Context * context = SetupTemplatesContext(method->_class);
4172
4173 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4174 FinishTemplatesContext(context);
4175 if(method->type != 1 && method->dataType)
4176 {
4177 if(!method->dataType->thisClass && !method->dataType->staticMethod)
4178 {
4179 if(!method->_class->symbol)
4180 method->_class->symbol = FindClass(method->_class->fullName);
4181 method->dataType->thisClass = method->_class->symbol;
4182 }
4183 }
4184 }
4185 }
4186
4187 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
4188 {
4189 if(!prop->dataType)
4190 {
4191 struct Context * context = SetupTemplatesContext(prop->_class);
4192
4193 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
4194 FinishTemplatesContext(context);
4195 }
4196 }
4197
4198 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4199
4200 extern void FreeTypeName(struct TypeName * typeName);
4201
4202 static void ProcessDeclarator(struct Declarator * decl);
4203
4204 extern struct __ecereNameSpace__ecere__sys__OldList *  excludedSymbols;
4205
4206 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4207
4208 struct MethodImport
4209 {
4210 struct MethodImport * prev;
4211 struct MethodImport * next;
4212 char *  name;
4213 unsigned int isVirtual;
4214 } __attribute__ ((gcc_struct));
4215
4216 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
4217
4218 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
4219 {
4220 struct Symbol * symbol = method->symbol;
4221
4222 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4223 {
4224 unsigned int imported = 0x0;
4225 unsigned int dllImport = 0x0;
4226
4227 if(!method->dataType)
4228 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4229 if(!symbol || symbol->_import || method->type == 1)
4230 {
4231 if(!symbol || method->type == 1)
4232 {
4233 struct Symbol * classSym;
4234
4235 if(!method->_class->symbol)
4236 method->_class->symbol = FindClass(method->_class->fullName);
4237 classSym = method->_class->symbol;
4238 if(!classSym->_import)
4239 {
4240 struct ModuleImport * module;
4241
4242 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->name)
4243 module = FindModule(method->_class->module);
4244 else
4245 module = mainModule;
4246 classSym->_import = __extension__ ({
4247 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
4248
4249 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
4250 });
4251 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4252 }
4253 if(!symbol)
4254 {
4255 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4256 }
4257 if(!symbol->_import)
4258 {
4259 symbol->_import = (struct ClassImport *)__extension__ ({
4260 struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
4261
4262 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
4263 });
4264 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4265 }
4266 if(!symbol)
4267 {
4268 symbol->type = method->dataType;
4269 if(symbol->type)
4270 symbol->type->refCount++;
4271 }
4272 }
4273 if(!method->dataType->dllExport)
4274 {
4275 imported = 0x1;
4276 if(method->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->importType != 1)
4277 dllImport = 0x1;
4278 }
4279 }
4280 if(method->type != 1 && method->dataType)
4281 DeclareType(method->dataType, 0x1, 0x1);
4282 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4283 {
4284 struct Declaration * decl;
4285 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4286 struct Declarator * d;
4287 struct Declarator * funcDecl;
4288 struct External * external;
4289
4290 specifiers = MkList();
4291 declarators = MkList();
4292 if(dllImport)
4293 ListAdd(specifiers, MkSpecifier(EXTERN));
4294 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4295 ListAdd(specifiers, MkSpecifier(STATIC));
4296 if(method->type == 1)
4297 {
4298 ListAdd(specifiers, MkSpecifier(INT));
4299 d = MkDeclaratorIdentifier(MkIdentifier(name));
4300 }
4301 else
4302 {
4303 d = MkDeclaratorIdentifier(MkIdentifier(name));
4304 if(dllImport)
4305 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4306 {
4307 struct Context * context = SetupTemplatesContext(method->_class);
4308
4309 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4310 FinishTemplatesContext(context);
4311 }
4312 funcDecl = GetFuncDecl(d);
4313 if(dllImport)
4314 {
4315 struct Specifier * spec, * next;
4316
4317 for(spec = (*specifiers).first; spec; spec = next)
4318 {
4319 next = spec->next;
4320 if(spec->type == 5)
4321 {
4322 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4323 FreeSpecifier(spec);
4324 }
4325 }
4326 }
4327 if(method->dataType && !method->dataType->staticMethod)
4328 {
4329 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
4330 {
4331 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
4332 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")));
4333 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
4334 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4335
4336 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
4337 {
4338 struct TypeName * param = (*funcDecl->function.parameters).first;
4339
4340 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
4341 FreeTypeName(param);
4342 }
4343 if(!funcDecl->function.parameters)
4344 funcDecl->function.parameters = MkList();
4345 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
4346 }
4347 }
4348 }
4349 ProcessDeclarator(d);
4350 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4351 decl = MkDeclaration(specifiers, declarators);
4352 ReplaceThisClassSpecifiers(specifiers, method->_class);
4353 if(symbol->pointerExternal)
4354 {
4355 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4356
4357 {
4358 *functionSymbol = *symbol;
4359 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4360 if(functionSymbol->type)
4361 functionSymbol->type->refCount++;
4362 }
4363 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4364 symbol->pointerExternal->symbol = functionSymbol;
4365 }
4366 external = MkExternalDeclaration(decl);
4367 if(curExternal)
4368 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4369 external->symbol = symbol;
4370 symbol->pointerExternal = external;
4371 }
4372 else if(ast)
4373 {
4374 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4375 }
4376 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4377 }
4378 }
4379
4380 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4381 {
4382 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4383 {
4384 unsigned int first = 0x1;
4385 int p = 0;
4386 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4387 int lastParam = -1;
4388 char className[1024];
4389
4390 strcpy(className, _class->fullName);
4391 for(param = _class->templateParams.first; param; param = param->next)
4392 {
4393 {
4394 if(first)
4395 strcat(className, "<");
4396 if(!first)
4397 strcat(className, ", ");
4398 if(lastParam + 1 != p)
4399 {
4400 strcat(className, param->name);
4401 strcat(className, " = ");
4402 }
4403 strcat(className, param->name);
4404 first = 0x0;
4405 lastParam = p;
4406 }
4407 p++;
4408 }
4409 if(!first)
4410 {
4411 int len = strlen(className);
4412
4413 if(className[len - 1] == '>')
4414 className[len++] = ' ';
4415 className[len++] = '>';
4416 className[len++] = '\0';
4417 }
4418 return __ecereNameSpace__ecere__sys__CopyString(className);
4419 }
4420 else
4421 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4422 }
4423
4424 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4425 {
4426 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4427 {
4428 unsigned int first = 0x1;
4429 int p = 0;
4430 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4431 int lastParam = -1;
4432 char className[1024];
4433
4434 strcpy(className, _class->fullName);
4435 for(param = _class->templateParams.first; param; param = param->next)
4436 {
4437 {
4438 if(first)
4439 strcat(className, "<");
4440 if(!first)
4441 strcat(className, ", ");
4442 if(lastParam + 1 != p)
4443 {
4444 strcat(className, param->name);
4445 strcat(className, " = ");
4446 }
4447 strcat(className, param->name);
4448 first = 0x0;
4449 lastParam = p;
4450 }
4451 p++;
4452 }
4453 if(!first)
4454 {
4455 int len = strlen(className);
4456
4457 if(className[len - 1] == '>')
4458 className[len++] = ' ';
4459 className[len++] = '>';
4460 className[len++] = '\0';
4461 }
4462 return MkClassType(className);
4463 }
4464 else
4465 {
4466 return MkClassType(_class->fullName);
4467 }
4468 }
4469
4470 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4471 {
4472 if(specs != (((void *)0)) && _class)
4473 {
4474 struct Specifier * spec;
4475
4476 for(spec = specs->first; spec; spec = spec->next)
4477 {
4478 if(spec->type == 0 && spec->specifier == THISCLASS)
4479 {
4480 spec->type = 1;
4481 spec->name = ReplaceThisClass(_class);
4482 spec->symbol = FindClass(spec->name);
4483 }
4484 }
4485 }
4486 }
4487
4488 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4489
4490 struct __ecereNameSpace__ecere__com__GlobalFunction
4491 {
4492 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4493 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4494 char *  name;
4495 int (*  function)();
4496 struct __ecereNameSpace__ecere__com__Instance * module;
4497 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
4498 char *  dataTypeString;
4499 struct Type * dataType;
4500 void *  symbol;
4501 } __attribute__ ((gcc_struct));
4502
4503 extern struct Context * globalContext;
4504
4505 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4506
4507 struct FunctionImport
4508 {
4509 struct FunctionImport * prev;
4510 struct FunctionImport * next;
4511 char *  name;
4512 } __attribute__ ((gcc_struct));
4513
4514 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4515 {
4516 struct Symbol * symbol = function->symbol;
4517
4518 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4519 {
4520 unsigned int imported = 0x0;
4521 unsigned int dllImport = 0x0;
4522
4523 if(!function->dataType)
4524 {
4525 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4526 if(!function->dataType->thisClass)
4527 function->dataType->staticMethod = 0x1;
4528 }
4529 if(inCompiler)
4530 {
4531 if(!symbol)
4532 {
4533 struct ModuleImport * module = FindModule(function->module);
4534
4535 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4536 if(module->name)
4537 {
4538 if(!function->dataType->dllExport)
4539 {
4540 symbol->_import = (struct ClassImport *)__extension__ ({
4541 struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
4542
4543 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
4544 });
4545 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4546 }
4547 }
4548 {
4549 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4550 if(!symbol->type->thisClass)
4551 symbol->type->staticMethod = 0x1;
4552 }
4553 }
4554 imported = symbol->_import ? 0x1 : 0x0;
4555 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1)
4556 dllImport = 0x1;
4557 }
4558 DeclareType(function->dataType, 0x1, 0x1);
4559 if(inCompiler)
4560 {
4561 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4562 {
4563 struct Declaration * decl;
4564 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4565 struct Declarator * d;
4566 struct Declarator * funcDecl;
4567 struct External * external;
4568
4569 specifiers = MkList();
4570 declarators = MkList();
4571 ListAdd(specifiers, MkSpecifier(EXTERN));
4572 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4573 if(dllImport)
4574 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4575 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4576 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType == 1)
4577 {
4578 struct Specifier * spec;
4579
4580 for(spec = (*specifiers).first; spec; spec = spec->next)
4581 if(spec->type == 5 && spec->extDecl && spec->extDecl->type == 0 && !strcmp(spec->extDecl->s, "dllexport"))
4582 {
4583 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4584 FreeSpecifier(spec);
4585 break;
4586 }
4587 }
4588 funcDecl = GetFuncDecl(d);
4589 if(funcDecl && !funcDecl->function.parameters)
4590 {
4591 funcDecl->function.parameters = MkList();
4592 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4593 }
4594 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4595 {
4596 struct Context * oldCtx = curContext;
4597
4598 curContext = globalContext;
4599 decl = MkDeclaration(specifiers, declarators);
4600 curContext = oldCtx;
4601 }
4602 if(symbol->pointerExternal)
4603 {
4604 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4605
4606 {
4607 *functionSymbol = *symbol;
4608 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4609 if(functionSymbol->type)
4610 functionSymbol->type->refCount++;
4611 }
4612 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4613 symbol->pointerExternal->symbol = functionSymbol;
4614 }
4615 external = MkExternalDeclaration(decl);
4616 if(curExternal)
4617 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4618 external->symbol = symbol;
4619 symbol->pointerExternal = external;
4620 }
4621 else
4622 {
4623 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4624 }
4625 if(curExternal)
4626 symbol->id = curExternal->symbol->idCode;
4627 }
4628 }
4629 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1) ? 0x1 : 0x0;
4630 }
4631
4632 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4633
4634 struct GlobalData
4635 {
4636 uintptr_t key;
4637 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4638 struct __ecereNameSpace__ecere__sys__BTNode * left;
4639 struct __ecereNameSpace__ecere__sys__BTNode * right;
4640 int depth;
4641 struct __ecereNameSpace__ecere__com__Instance * module;
4642 char *  dataTypeString;
4643 struct Type * dataType;
4644 void *  symbol;
4645 char *  fullName;
4646 } __attribute__ ((gcc_struct));
4647
4648 void DeclareGlobalData(struct GlobalData * data)
4649 {
4650 struct Symbol * symbol = data->symbol;
4651
4652 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4653 {
4654 if(inCompiler)
4655 {
4656 if(!symbol)
4657 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4658 }
4659 if(!data->dataType)
4660 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4661 DeclareType(data->dataType, 0x1, 0x1);
4662 if(inCompiler)
4663 {
4664 if(!symbol->pointerExternal)
4665 {
4666 struct Declaration * decl;
4667 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4668 struct Declarator * d;
4669 struct External * external;
4670
4671 specifiers = MkList();
4672 declarators = MkList();
4673 ListAdd(specifiers, MkSpecifier(EXTERN));
4674 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4675 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4676 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4677 decl = MkDeclaration(specifiers, declarators);
4678 external = MkExternalDeclaration(decl);
4679 if(curExternal)
4680 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4681 external->symbol = symbol;
4682 symbol->pointerExternal = external;
4683 }
4684 else
4685 {
4686 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4687 }
4688 if(curExternal)
4689 symbol->id = curExternal->symbol->idCode;
4690 }
4691 }
4692 }
4693
4694 struct Conversion
4695 {
4696 struct Conversion * prev, * next;
4697 struct __ecereNameSpace__ecere__com__Property * convert;
4698 unsigned int isGet;
4699 struct Type * resultType;
4700 } __attribute__ ((gcc_struct));
4701
4702 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4703
4704 extern void Compiler_Warning(char *  format, ...);
4705
4706 void PrintType(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
4707
4708 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)
4709 {
4710 if(source && dest)
4711 {
4712 if(source->kind == 20 && dest->kind != 20)
4713 {
4714 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4715
4716 if(type)
4717 source = type;
4718 }
4719 if(dest->kind == 20 && source->kind != 20)
4720 {
4721 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4722
4723 if(type)
4724 dest = type;
4725 }
4726 if(dest->classObjectType == 2)
4727 {
4728 if(source->classObjectType != 3)
4729 return 0x1;
4730 else
4731 {
4732 if((dest->_class && strcmp(dest->_class->string, "class")) || (source->_class && strcmp(source->_class->string, "class")))
4733 {
4734 return 0x1;
4735 }
4736 }
4737 }
4738 else
4739 {
4740 if(source->classObjectType == 3)
4741 return 0x1;
4742 if(dest->classObjectType == 3 && source->classObjectType != 2)
4743 return 0x1;
4744 }
4745 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4746 {
4747 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4748 return 0x1;
4749 }
4750 if(dest->kind == 14 && source->kind != 0)
4751 return 0x1;
4752 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))
4753 return 0x1;
4754 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))
4755 return 0x1;
4756 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4757 {
4758 if(source->_class->registered && source->_class->registered->type == 3)
4759 {
4760 if(conversions != (((void *)0)))
4761 {
4762 if(source->_class->registered == dest->_class->registered)
4763 return 0x1;
4764 }
4765 else
4766 {
4767 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4768
4769 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4770 ;
4771 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4772 ;
4773 if(sourceBase == destBase)
4774 return 0x1;
4775 }
4776 }
4777 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))
4778 return 0x1;
4779 else
4780 {
4781 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))
4782 {
4783 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4784 {
4785 return 0x1;
4786 }
4787 }
4788 }
4789 }
4790 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
4791 return 0x1;
4792 if(doConversion)
4793 {
4794 if(source->kind == 8)
4795 {
4796 struct __ecereNameSpace__ecere__com__Class * _class;
4797
4798 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4799 {
4800 struct __ecereNameSpace__ecere__com__Property * convert;
4801
4802 for(convert = _class->conversions.first; convert; convert = convert->next)
4803 {
4804 if(convert->memberAccess == 1 || _class->module == privateModule)
4805 {
4806 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4807
4808 if(!convert->dataType)
4809 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4810 if(MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x0, 0x1, 0x0, 0x1))
4811 {
4812 if(!conversions && !convert->Get)
4813 return 0x1;
4814 else if(conversions != (((void *)0)))
4815 {
4816 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))
4817 return 0x1;
4818 else
4819 {
4820 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4821
4822 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4823 return 0x1;
4824 }
4825 }
4826 }
4827 }
4828 }
4829 }
4830 }
4831 if(dest->kind == 8)
4832 {
4833 struct __ecereNameSpace__ecere__com__Class * _class;
4834
4835 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4836 {
4837 struct __ecereNameSpace__ecere__com__Property * convert;
4838
4839 for(convert = _class->conversions.first; convert; convert = convert->next)
4840 {
4841 if(convert->memberAccess == 1 || _class->module == privateModule)
4842 {
4843 if(!convert->dataType)
4844 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4845 if(convert->dataType != dest && MatchTypes(source, convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1))
4846 {
4847 if(!conversions && !convert->Set)
4848 return 0x1;
4849 else if(conversions != (((void *)0)))
4850 {
4851 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))
4852 return 0x1;
4853 else
4854 {
4855 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4856
4857 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4858 return 0x1;
4859 }
4860 }
4861 }
4862 }
4863 }
4864 }
4865 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
4866 {
4867 if(!dest->_class->registered->dataType)
4868 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
4869 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
4870 {
4871 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4872 {
4873 return 0x1;
4874 }
4875 }
4876 }
4877 }
4878 if(source->kind == 8)
4879 {
4880 struct __ecereNameSpace__ecere__com__Class * _class;
4881
4882 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4883 {
4884 struct __ecereNameSpace__ecere__com__Property * convert;
4885
4886 for(convert = _class->conversions.first; convert; convert = convert->next)
4887 {
4888 if(convert->memberAccess == 1 || _class->module == privateModule)
4889 {
4890 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4891
4892 if(!convert->dataType)
4893 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4894 if(convert->dataType != source && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x1))
4895 {
4896 if(!conversions && !convert->Get)
4897 return 0x1;
4898 else if(conversions != (((void *)0)))
4899 {
4900 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))
4901 return 0x1;
4902 else
4903 {
4904 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4905
4906 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4907 return 0x1;
4908 }
4909 }
4910 }
4911 }
4912 }
4913 }
4914 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
4915 {
4916 if(!source->_class->registered->dataType)
4917 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
4918 if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4919 {
4920 return 0x1;
4921 }
4922 }
4923 }
4924 }
4925 if(source->kind == 8 || source->kind == 19)
4926 ;
4927 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
4928 return 0x1;
4929 else if(dest->kind == 7 && source->kind == 6)
4930 return 0x1;
4931 else if(dest->kind == 2 && (source->kind == 1 || source->kind == 24))
4932 return 0x1;
4933 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 23))
4934 return 0x1;
4935 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 22 || source->kind == 23))
4936 return 0x1;
4937 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 23 || source->kind == 4))
4938 return 0x1;
4939 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 4 || source->kind == 22))
4940 return 0x1;
4941 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))
4942 return 0x1;
4943 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))
4944 return 0x1;
4945 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)))
4946 {
4947 struct Type * paramSource, * paramDest;
4948
4949 if(dest->kind == 16)
4950 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
4951 if(source->kind == 16)
4952 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
4953 if(dest->kind == 13 && dest->type->kind == 11)
4954 dest = dest->type;
4955 if(source->kind == 13 && source->type->kind == 11)
4956 source = source->type;
4957 if(dest->kind == 16)
4958 dest = dest->method->dataType;
4959 if(source->kind == 16)
4960 source = source->method->dataType;
4961 paramSource = source->params.first;
4962 if(paramSource && paramSource->kind == 0)
4963 paramSource = (((void *)0));
4964 paramDest = dest->params.first;
4965 if(paramDest && paramDest->kind == 0)
4966 paramDest = (((void *)0));
4967 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
4968 {
4969 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))))
4970 {
4971 if(paramDest && paramDest->kind == 8)
4972 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), paramDest->_class->string);
4973 else
4974 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class should not take an object\n", (((void *)0))));
4975 return 0x0;
4976 }
4977 paramDest = paramDest->next;
4978 }
4979 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
4980 {
4981 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
4982 {
4983 if(dest->thisClass)
4984 {
4985 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
4986 {
4987 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4988 return 0x0;
4989 }
4990 }
4991 else
4992 {
4993 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
4994 {
4995 if(owningClassDest)
4996 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
4997 else
4998 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "overriding class expected to be derived from method class\n", (((void *)0))));
4999 return 0x0;
5000 }
5001 }
5002 paramSource = paramSource->next;
5003 }
5004 else
5005 {
5006 if(dest->thisClass)
5007 {
5008 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
5009 {
5010 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
5011 return 0x0;
5012 }
5013 }
5014 else
5015 {
5016 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
5017 {
5018 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), source->thisClass->registered->fullName);
5019 return 0x0;
5020 }
5021 }
5022 }
5023 }
5024 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5025 {
5026 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible return type for function\n", (((void *)0))));
5027 return 0x0;
5028 }
5029 for(; paramDest; paramDest = paramDest->next)
5030 {
5031 if(!paramSource)
5032 {
5033 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "not enough parameters\n", (((void *)0))));
5034 return 0x0;
5035 }
5036 {
5037 struct Type * paramDestType = paramDest;
5038 struct Type * paramSourceType = paramSource;
5039 struct Type * type = paramDestType;
5040
5041 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
5042 {
5043 int id = 0;
5044 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
5045 struct __ecereNameSpace__ecere__com__Class * sClass;
5046
5047 for(sClass = owningClassSource; sClass; sClass = sClass->base)
5048 {
5049 id = 0;
5050 if(sClass->templateClass)
5051 sClass = sClass->templateClass;
5052 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
5053 {
5054 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
5055 {
5056 for(sClass = sClass->base; sClass; sClass = sClass->base)
5057 {
5058 if(sClass->templateClass)
5059 sClass = sClass->templateClass;
5060 id += sClass->templateParams.count;
5061 }
5062 break;
5063 }
5064 id++;
5065 }
5066 if(curParam)
5067 break;
5068 }
5069 if(curParam)
5070 {
5071 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
5072
5073 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
5074 }
5075 }
5076 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)))
5077 {
5078 char type[1024];
5079
5080 type[0] = (char)0;
5081 PrintType(paramDest, type, 0x0, 0x1);
5082 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
5083 if(paramDestType != paramDest)
5084 FreeType(paramDestType);
5085 return 0x0;
5086 }
5087 if(paramDestType != paramDest)
5088 FreeType(paramDestType);
5089 }
5090 paramSource = paramSource->next;
5091 }
5092 if(paramSource)
5093 {
5094 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many parameters\n", (((void *)0))));
5095 return 0x0;
5096 }
5097 return 0x1;
5098 }
5099 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
5100 {
5101 return 0x1;
5102 }
5103 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
5104 {
5105 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5106 return 0x1;
5107 }
5108 }
5109 return 0x0;
5110 }
5111
5112 static void FreeConvert(struct Conversion * convert)
5113 {
5114 if(convert->resultType)
5115 FreeType(convert->resultType);
5116 }
5117
5118 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
5119
5120 struct __ecereNameSpace__ecere__com__BTNamedLink
5121 {
5122 char *  name;
5123 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
5124 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
5125 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
5126 int depth;
5127 void *  data;
5128 } __attribute__ ((gcc_struct));
5129
5130 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
5131
5132 struct __ecereNameSpace__ecere__com__EnumClassData
5133 {
5134 struct __ecereNameSpace__ecere__sys__OldList values;
5135 int largest;
5136 } __attribute__ ((gcc_struct));
5137
5138 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
5139
5140 struct __ecereNameSpace__ecere__sys__NamedLink
5141 {
5142 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
5143 struct __ecereNameSpace__ecere__sys__NamedLink * next;
5144 char *  name;
5145 void *  data;
5146 } __attribute__ ((gcc_struct));
5147
5148 extern void FreeExpContents(struct Expression * exp);
5149
5150 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
5151
5152 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
5153
5154 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
5155
5156 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
5157
5158 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (*  freeFn)(void * ));
5159
5160 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5161 {
5162 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
5163
5164 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)))
5165 {
5166 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
5167
5168 if(_class->type == 4)
5169 {
5170 struct __ecereNameSpace__ecere__sys__OldList converts = 
5171 {
5172 0, 0, 0, 0, 0
5173 };
5174 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5175
5176 type->kind = 8;
5177 if(!_class->symbol)
5178 _class->symbol = FindClass(_class->fullName);
5179 type->_class = _class->symbol;
5180 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0))
5181 {
5182 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5183 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5184
5185 if(enumClass)
5186 {
5187 struct __ecereNameSpace__ecere__com__Class * baseClass;
5188
5189 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
5190 {
5191 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
5192
5193 for(value = e->values.first; value; value = value->next)
5194 {
5195 if(!strcmp(value->name, string))
5196 break;
5197 }
5198 if(value)
5199 {
5200 FreeExpContents(sourceExp);
5201 FreeType(sourceExp->expType);
5202 sourceExp->isConstant = 0x1;
5203 sourceExp->expType = MkClassType(baseClass->fullName);
5204 {
5205 char constant[256];
5206
5207 sourceExp->type = 2;
5208 if(!strcmp(baseClass->dataTypeString, "int"))
5209 sprintf(constant, "%d", (int)value->data);
5210 else
5211 sprintf(constant, "0x%X", (int)value->data);
5212 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5213 }
5214 while(converts.first)
5215 {
5216 struct Conversion * convert = converts.first;
5217
5218 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
5219 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5220 }
5221 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5222 return 0x1;
5223 }
5224 }
5225 }
5226 }
5227 if(converts.first)
5228 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
5229 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5230 }
5231 }
5232 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)))
5233 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5234 return 0x1;
5235 return 0x0;
5236 }
5237
5238 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5239
5240 struct __ecereNameSpace__ecere__com__SubModule
5241 {
5242 struct __ecereNameSpace__ecere__com__SubModule * prev;
5243 struct __ecereNameSpace__ecere__com__SubModule * next;
5244 struct __ecereNameSpace__ecere__com__Instance * module;
5245 int importMode;
5246 } __attribute__ ((gcc_struct));
5247
5248 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5249 {
5250 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5251
5252 if(searchFor == searchIn)
5253 return 0x1;
5254 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
5255 {
5256 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->application)
5257 {
5258 if(ModuleVisibility(subModule->module, searchFor))
5259 return 0x1;
5260 }
5261 }
5262 return 0x0;
5263 }
5264
5265 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5266
5267 struct __ecereNameSpace__ecere__com__Application
5268 {
5269 int argc;
5270 char * *  argv;
5271 int exitCode;
5272 unsigned int isGUIApp;
5273 struct __ecereNameSpace__ecere__sys__OldList allModules;
5274 char *  parsedCommand;
5275 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5276 } __attribute__ ((gcc_struct));
5277
5278 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5279 {
5280 struct __ecereNameSpace__ecere__com__Instance * module;
5281
5282 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))
5283 return 0x1;
5284 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))
5285 return 0x1;
5286 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))
5287 return 0x1;
5288 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)
5289 {
5290 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5291 return 0x1;
5292 }
5293 return 0x0;
5294 }
5295
5296 extern unsigned long strtoul(const char *  nptr, char * *  endptr, int base);
5297
5298 void ReadString(char *  output, char *  string);
5299
5300 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5301
5302 extern struct TypeName * QMkClass(char *  spec, struct Declarator * decl);
5303
5304 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5305
5306 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
5307 {
5308 struct Type * source = sourceExp->expType;
5309 struct Type * realDest = dest;
5310 struct Type * backupSourceExpType = (((void *)0));
5311
5312 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
5313 return 0x1;
5314 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5315 {
5316 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
5317 {
5318 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5319
5320 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5321 ;
5322 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5323 ;
5324 if(sourceBase == destBase)
5325 return 0x1;
5326 }
5327 }
5328 if(source)
5329 {
5330 struct __ecereNameSpace__ecere__sys__OldList * specs;
5331 unsigned int flag = 0x0;
5332 long long value = (((int)0x7fffffff));
5333
5334 source->refCount++;
5335 dest->refCount++;
5336 if(sourceExp->type == 2)
5337 {
5338 if(source->isSigned)
5339 value = strtoll(sourceExp->constant, (((void *)0)), 0);
5340 else
5341 value = strtoull(sourceExp->constant, (((void *)0)), 0);
5342 }
5343 else if(sourceExp->type == 4 && sourceExp->op.op == '-' && !sourceExp->op.exp1 && sourceExp->op.exp2 && sourceExp->op.exp2->type == 2)
5344 {
5345 if(source->isSigned)
5346 value = -strtoll(sourceExp->op.exp2->constant, (((void *)0)), 0);
5347 else
5348 value = -strtoull(sourceExp->op.exp2->constant, (((void *)0)), 0);
5349 }
5350 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
5351 {
5352 FreeType(source);
5353 source = __extension__ ({
5354 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5355
5356 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0x0, __ecereInstance1->refCount = 1, __ecereInstance1;
5357 });
5358 }
5359 if(dest->kind == 8)
5360 {
5361 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5362
5363 if(_class && _class->type == 3)
5364 {
5365 if(source->kind != 8)
5366 {
5367 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5368 struct Type * tempDest, * tempSource;
5369
5370 for(; _class->base->type != 1000; _class = _class->base)
5371 ;
5372 tempSource = dest;
5373 tempDest = tempType;
5374 tempType->kind = 8;
5375 if(!_class->symbol)
5376 _class->symbol = FindClass(_class->fullName);
5377 tempType->_class = _class->symbol;
5378 tempType->truth = dest->truth;
5379 if(tempType->_class)
5380 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5381 backupSourceExpType = sourceExp->expType;
5382 sourceExp->expType = dest;
5383 dest->refCount++;
5384 flag = 0x1;
5385 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5386 }
5387 }
5388 if(_class && _class->type == 2 && source->kind != 8)
5389 {
5390 if(!dest->_class->registered->dataType)
5391 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5392 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5393 {
5394 FreeType(source);
5395 FreeType(sourceExp->expType);
5396 source = sourceExp->expType = MkClassType(dest->_class->string);
5397 source->refCount++;
5398 }
5399 }
5400 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5401 {
5402 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5403 struct Declarator * decl;
5404 char string[1024];
5405
5406 ReadString(string, sourceExp->string);
5407 decl = SpecDeclFromString(string, specs, (((void *)0)));
5408 FreeExpContents(sourceExp);
5409 FreeType(sourceExp->expType);
5410 sourceExp->type = 24;
5411 sourceExp->_classExp.specifiers = specs;
5412 sourceExp->_classExp.decl = decl;
5413 sourceExp->expType = dest;
5414 dest->refCount++;
5415 FreeType(source);
5416 FreeType(dest);
5417 if(backupSourceExpType)
5418 FreeType(backupSourceExpType);
5419 return 0x1;
5420 }
5421 }
5422 else if(source->kind == 8)
5423 {
5424 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5425
5426 if(_class && (_class->type == 3 || !strcmp(_class->fullName, "bool") || _class->type == 2))
5427 {
5428 if(dest->kind != 8)
5429 {
5430 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5431 struct Type * tempDest, * tempSource;
5432
5433 if(!source->_class->registered->dataType)
5434 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5435 for(; _class->base->type != 1000; _class = _class->base)
5436 ;
5437 tempDest = source;
5438 tempSource = tempType;
5439 tempType->kind = 8;
5440 tempType->_class = FindClass(_class->fullName);
5441 tempType->truth = source->truth;
5442 tempType->classObjectType = source->classObjectType;
5443 if(tempType->_class)
5444 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5445 if(conversions->last)
5446 {
5447 ((struct Conversion *)conversions->last)->resultType = dest;
5448 dest->refCount++;
5449 }
5450 FreeType(sourceExp->expType);
5451 sourceExp->expType = MkClassType(_class->fullName);
5452 sourceExp->expType->truth = source->truth;
5453 sourceExp->expType->classObjectType = source->classObjectType;
5454 if(!sourceExp->destType)
5455 {
5456 FreeType(sourceExp->destType);
5457 sourceExp->destType = sourceExp->expType;
5458 if(sourceExp->expType)
5459 sourceExp->expType->refCount++;
5460 }
5461 if(!_class->dataType)
5462 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5463 FreeType(dest);
5464 dest = MkClassType(source->_class->string);
5465 dest->truth = source->truth;
5466 dest->classObjectType = source->classObjectType;
5467 FreeType(source);
5468 source = _class->dataType;
5469 source->refCount++;
5470 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5471 }
5472 }
5473 }
5474 if(!flag)
5475 {
5476 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5477 {
5478 FreeType(source);
5479 FreeType(dest);
5480 return 0x1;
5481 }
5482 }
5483 if(dest->kind == 8)
5484 {
5485 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5486
5487 if(_class && !dest->truth && (_class->type == 3 || !strcmp(_class->fullName, "bool") || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5488 {
5489 if(_class->type == 0 || _class->type == 5)
5490 {
5491 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5492
5493 *newExp = *sourceExp;
5494 if(sourceExp->destType)
5495 sourceExp->destType->refCount++;
5496 if(sourceExp->expType)
5497 sourceExp->expType->refCount++;
5498 sourceExp->type = 11;
5499 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5500 sourceExp->cast.exp = newExp;
5501 FreeType(sourceExp->expType);
5502 sourceExp->expType = (((void *)0));
5503 ProcessExpressionType(sourceExp);
5504 if(!inCompiler)
5505 {
5506 FreeType(sourceExp->expType);
5507 sourceExp->expType = dest;
5508 }
5509 FreeType(source);
5510 if(inCompiler)
5511 FreeType(dest);
5512 if(backupSourceExpType)
5513 FreeType(backupSourceExpType);
5514 return 0x1;
5515 }
5516 if(!_class->dataType)
5517 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5518 FreeType(dest);
5519 dest = _class->dataType;
5520 dest->refCount++;
5521 }
5522 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))
5523 {
5524 specs = MkListOne(MkSpecifier(DOUBLE));
5525 }
5526 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))
5527 {
5528 specs = MkListOne(MkSpecifier(FLOAT));
5529 }
5530 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))
5531 {
5532 specs = MkList();
5533 if(!dest->isSigned)
5534 ListAdd(specs, MkSpecifier(UNSIGNED));
5535 ListAdd(specs, MkSpecifier(INT64));
5536 }
5537 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
5538 {
5539 specs = MkList();
5540 if(!dest->isSigned)
5541 ListAdd(specs, MkSpecifier(UNSIGNED));
5542 ListAdd(specs, MkSpecifier(INT));
5543 }
5544 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5545 {
5546 specs = MkList();
5547 if(!dest->isSigned)
5548 ListAdd(specs, MkSpecifier(UNSIGNED));
5549 ListAdd(specs, MkSpecifier(SHORT));
5550 }
5551 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 24 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5552 {
5553 specs = MkList();
5554 if(!dest->isSigned)
5555 ListAdd(specs, MkSpecifier(UNSIGNED));
5556 ListAdd(specs, MkSpecifier(CHAR));
5557 }
5558 else
5559 {
5560 FreeType(source);
5561 FreeType(dest);
5562 if(backupSourceExpType)
5563 {
5564 if(sourceExp->expType)
5565 FreeType(sourceExp->expType);
5566 sourceExp->expType = backupSourceExpType;
5567 }
5568 return 0x0;
5569 }
5570 }
5571 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))
5572 {
5573 specs = MkListOne(MkSpecifier(DOUBLE));
5574 }
5575 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))
5576 {
5577 specs = MkListOne(MkSpecifier(FLOAT));
5578 }
5579 else if(dest->kind == 24 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (value == 1 || value == 0))
5580 {
5581 specs = MkList();
5582 ListAdd(specs, MkSpecifier(BOOL));
5583 }
5584 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)))
5585 {
5586 specs = MkList();
5587 if(!dest->isSigned)
5588 ListAdd(specs, MkSpecifier(UNSIGNED));
5589 ListAdd(specs, MkSpecifier(CHAR));
5590 }
5591 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)))))
5592 {
5593 specs = MkList();
5594 if(!dest->isSigned)
5595 ListAdd(specs, MkSpecifier(UNSIGNED));
5596 ListAdd(specs, MkSpecifier(SHORT));
5597 }
5598 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3))
5599 {
5600 specs = MkList();
5601 if(!dest->isSigned)
5602 ListAdd(specs, MkSpecifier(UNSIGNED));
5603 ListAdd(specs, MkSpecifier(INT));
5604 }
5605 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5606 {
5607 specs = MkList();
5608 if(!dest->isSigned)
5609 ListAdd(specs, MkSpecifier(UNSIGNED));
5610 ListAdd(specs, MkSpecifier(INT64));
5611 }
5612 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
5613 {
5614 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
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 if(!flag)
5629 {
5630 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5631
5632 *newExp = *sourceExp;
5633 newExp->prev = (((void *)0));
5634 newExp->next = (((void *)0));
5635 if(sourceExp->destType)
5636 sourceExp->destType->refCount++;
5637 if(sourceExp->expType)
5638 sourceExp->expType->refCount++;
5639 sourceExp->type = 11;
5640 if(realDest->kind == 8)
5641 {
5642 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5643 FreeList(specs, FreeSpecifier);
5644 }
5645 else
5646 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5647 if(newExp->type == 4)
5648 {
5649 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5650 }
5651 else
5652 sourceExp->cast.exp = newExp;
5653 FreeType(sourceExp->expType);
5654 sourceExp->expType = (((void *)0));
5655 ProcessExpressionType(sourceExp);
5656 }
5657 else
5658 FreeList(specs, FreeSpecifier);
5659 FreeType(dest);
5660 FreeType(source);
5661 if(backupSourceExpType)
5662 FreeType(backupSourceExpType);
5663 return 0x1;
5664 }
5665 else
5666 {
5667 while((sourceExp->type == 5 || sourceExp->type == 32) && sourceExp->list)
5668 sourceExp = (*sourceExp->list).last;
5669 if(sourceExp->type == 0)
5670 {
5671 struct Identifier * id = sourceExp->identifier;
5672
5673 if(dest->kind == 8)
5674 {
5675 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5676 {
5677 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5678 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5679
5680 if(enumClass)
5681 {
5682 for(; _class && _class->type == 4; _class = _class->base)
5683 {
5684 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5685 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5686
5687 for(value = e->values.first; value; value = value->next)
5688 {
5689 if(!strcmp(value->name, id->string))
5690 break;
5691 }
5692 if(value)
5693 {
5694 FreeExpContents(sourceExp);
5695 FreeType(sourceExp->expType);
5696 sourceExp->isConstant = 0x1;
5697 sourceExp->expType = MkClassType(_class->fullName);
5698 {
5699 char constant[256];
5700
5701 sourceExp->type = 2;
5702 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5703 sprintf(constant, "%d", (int)value->data);
5704 else
5705 sprintf(constant, "0x%X", (int)value->data);
5706 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5707 }
5708 return 0x1;
5709 }
5710 }
5711 }
5712 }
5713 }
5714 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5715 return 0x1;
5716 }
5717 }
5718 return 0x0;
5719 }
5720
5721 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5722 {
5723 int value2 = op2->i;
5724
5725 exp->type = 2;
5726 exp->string = PrintInt(op1->i + value2);
5727 if(!exp->expType)
5728 {
5729 exp->expType = op1->type;
5730 if(op1->type)
5731 op1->type->refCount++;
5732 }
5733 return 0x1;
5734 }
5735
5736 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5737 {
5738 unsigned int value2 = op2->ui;
5739
5740 exp->type = 2;
5741 exp->string = PrintUInt(op1->ui + value2);
5742 if(!exp->expType)
5743 {
5744 exp->expType = op1->type;
5745 if(op1->type)
5746 op1->type->refCount++;
5747 }
5748 return 0x1;
5749 }
5750
5751 static unsigned int Int64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5752 {
5753 long long value2 = op2->i64;
5754
5755 exp->type = 2;
5756 exp->string = PrintInt64(op1->i64 + value2);
5757 if(!exp->expType)
5758 {
5759 exp->expType = op1->type;
5760 if(op1->type)
5761 op1->type->refCount++;
5762 }
5763 return 0x1;
5764 }
5765
5766 static unsigned int UInt64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5767 {
5768 uint64 value2 = op2->ui64;
5769
5770 exp->type = 2;
5771 exp->string = PrintUInt64(op1->ui64 + value2);
5772 if(!exp->expType)
5773 {
5774 exp->expType = op1->type;
5775 if(op1->type)
5776 op1->type->refCount++;
5777 }
5778 return 0x1;
5779 }
5780
5781 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5782 {
5783 short value2 = op2->s;
5784
5785 exp->type = 2;
5786 exp->string = PrintShort(op1->s + value2);
5787 if(!exp->expType)
5788 {
5789 exp->expType = op1->type;
5790 if(op1->type)
5791 op1->type->refCount++;
5792 }
5793 return 0x1;
5794 }
5795
5796 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5797 {
5798 unsigned short value2 = op2->us;
5799
5800 exp->type = 2;
5801 exp->string = PrintUShort(op1->us + value2);
5802 if(!exp->expType)
5803 {
5804 exp->expType = op1->type;
5805 if(op1->type)
5806 op1->type->refCount++;
5807 }
5808 return 0x1;
5809 }
5810
5811 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5812 {
5813 char value2 = op2->c;
5814
5815 exp->type = 2;
5816 exp->string = PrintChar(op1->c + value2);
5817 if(!exp->expType)
5818 {
5819 exp->expType = op1->type;
5820 if(op1->type)
5821 op1->type->refCount++;
5822 }
5823 return 0x1;
5824 }
5825
5826 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5827 {
5828 unsigned char value2 = op2->uc;
5829
5830 exp->type = 2;
5831 exp->string = PrintUChar(op1->uc + value2);
5832 if(!exp->expType)
5833 {
5834 exp->expType = op1->type;
5835 if(op1->type)
5836 op1->type->refCount++;
5837 }
5838 return 0x1;
5839 }
5840
5841 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5842 {
5843 float value2 = op2->f;
5844
5845 exp->type = 2;
5846 exp->string = PrintFloat(op1->f + value2);
5847 if(!exp->expType)
5848 {
5849 exp->expType = op1->type;
5850 if(op1->type)
5851 op1->type->refCount++;
5852 }
5853 return 0x1;
5854 }
5855
5856 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5857 {
5858 double value2 = op2->d;
5859
5860 exp->type = 2;
5861 exp->string = PrintDouble(op1->d + value2);
5862 if(!exp->expType)
5863 {
5864 exp->expType = op1->type;
5865 if(op1->type)
5866 op1->type->refCount++;
5867 }
5868 return 0x1;
5869 }
5870
5871 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5872 {
5873 int value2 = op2->i;
5874
5875 exp->type = 2;
5876 exp->string = PrintInt(op1->i - value2);
5877 if(!exp->expType)
5878 {
5879 exp->expType = op1->type;
5880 if(op1->type)
5881 op1->type->refCount++;
5882 }
5883 return 0x1;
5884 }
5885
5886 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5887 {
5888 unsigned int value2 = op2->ui;
5889
5890 exp->type = 2;
5891 exp->string = PrintUInt(op1->ui - value2);
5892 if(!exp->expType)
5893 {
5894 exp->expType = op1->type;
5895 if(op1->type)
5896 op1->type->refCount++;
5897 }
5898 return 0x1;
5899 }
5900
5901 static unsigned int Int64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5902 {
5903 long long value2 = op2->i64;
5904
5905 exp->type = 2;
5906 exp->string = PrintInt64(op1->i64 - value2);
5907 if(!exp->expType)
5908 {
5909 exp->expType = op1->type;
5910 if(op1->type)
5911 op1->type->refCount++;
5912 }
5913 return 0x1;
5914 }
5915
5916 static unsigned int UInt64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5917 {
5918 uint64 value2 = op2->ui64;
5919
5920 exp->type = 2;
5921 exp->string = PrintUInt64(op1->ui64 - value2);
5922 if(!exp->expType)
5923 {
5924 exp->expType = op1->type;
5925 if(op1->type)
5926 op1->type->refCount++;
5927 }
5928 return 0x1;
5929 }
5930
5931 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5932 {
5933 short value2 = op2->s;
5934
5935 exp->type = 2;
5936 exp->string = PrintShort(op1->s - value2);
5937 if(!exp->expType)
5938 {
5939 exp->expType = op1->type;
5940 if(op1->type)
5941 op1->type->refCount++;
5942 }
5943 return 0x1;
5944 }
5945
5946 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5947 {
5948 unsigned short value2 = op2->us;
5949
5950 exp->type = 2;
5951 exp->string = PrintUShort(op1->us - value2);
5952 if(!exp->expType)
5953 {
5954 exp->expType = op1->type;
5955 if(op1->type)
5956 op1->type->refCount++;
5957 }
5958 return 0x1;
5959 }
5960
5961 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5962 {
5963 char value2 = op2->c;
5964
5965 exp->type = 2;
5966 exp->string = PrintChar(op1->c - value2);
5967 if(!exp->expType)
5968 {
5969 exp->expType = op1->type;
5970 if(op1->type)
5971 op1->type->refCount++;
5972 }
5973 return 0x1;
5974 }
5975
5976 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5977 {
5978 unsigned char value2 = op2->uc;
5979
5980 exp->type = 2;
5981 exp->string = PrintUChar(op1->uc - value2);
5982 if(!exp->expType)
5983 {
5984 exp->expType = op1->type;
5985 if(op1->type)
5986 op1->type->refCount++;
5987 }
5988 return 0x1;
5989 }
5990
5991 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5992 {
5993 float value2 = op2->f;
5994
5995 exp->type = 2;
5996 exp->string = PrintFloat(op1->f - value2);
5997 if(!exp->expType)
5998 {
5999 exp->expType = op1->type;
6000 if(op1->type)
6001 op1->type->refCount++;
6002 }
6003 return 0x1;
6004 }
6005
6006 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6007 {
6008 double value2 = op2->d;
6009
6010 exp->type = 2;
6011 exp->string = PrintDouble(op1->d - value2);
6012 if(!exp->expType)
6013 {
6014 exp->expType = op1->type;
6015 if(op1->type)
6016 op1->type->refCount++;
6017 }
6018 return 0x1;
6019 }
6020
6021 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6022 {
6023 int value2 = op2->i;
6024
6025 exp->type = 2;
6026 exp->string = PrintInt(op1->i * value2);
6027 if(!exp->expType)
6028 {
6029 exp->expType = op1->type;
6030 if(op1->type)
6031 op1->type->refCount++;
6032 }
6033 return 0x1;
6034 }
6035
6036 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6037 {
6038 unsigned int value2 = op2->ui;
6039
6040 exp->type = 2;
6041 exp->string = PrintUInt(op1->ui * value2);
6042 if(!exp->expType)
6043 {
6044 exp->expType = op1->type;
6045 if(op1->type)
6046 op1->type->refCount++;
6047 }
6048 return 0x1;
6049 }
6050
6051 static unsigned int Int64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6052 {
6053 long long value2 = op2->i64;
6054
6055 exp->type = 2;
6056 exp->string = PrintInt64(op1->i64 * value2);
6057 if(!exp->expType)
6058 {
6059 exp->expType = op1->type;
6060 if(op1->type)
6061 op1->type->refCount++;
6062 }
6063 return 0x1;
6064 }
6065
6066 static unsigned int UInt64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6067 {
6068 uint64 value2 = op2->ui64;
6069
6070 exp->type = 2;
6071 exp->string = PrintUInt64(op1->ui64 * value2);
6072 if(!exp->expType)
6073 {
6074 exp->expType = op1->type;
6075 if(op1->type)
6076 op1->type->refCount++;
6077 }
6078 return 0x1;
6079 }
6080
6081 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6082 {
6083 short value2 = op2->s;
6084
6085 exp->type = 2;
6086 exp->string = PrintShort(op1->s * value2);
6087 if(!exp->expType)
6088 {
6089 exp->expType = op1->type;
6090 if(op1->type)
6091 op1->type->refCount++;
6092 }
6093 return 0x1;
6094 }
6095
6096 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6097 {
6098 unsigned short value2 = op2->us;
6099
6100 exp->type = 2;
6101 exp->string = PrintUShort(op1->us * value2);
6102 if(!exp->expType)
6103 {
6104 exp->expType = op1->type;
6105 if(op1->type)
6106 op1->type->refCount++;
6107 }
6108 return 0x1;
6109 }
6110
6111 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6112 {
6113 char value2 = op2->c;
6114
6115 exp->type = 2;
6116 exp->string = PrintChar(op1->c * value2);
6117 if(!exp->expType)
6118 {
6119 exp->expType = op1->type;
6120 if(op1->type)
6121 op1->type->refCount++;
6122 }
6123 return 0x1;
6124 }
6125
6126 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6127 {
6128 unsigned char value2 = op2->uc;
6129
6130 exp->type = 2;
6131 exp->string = PrintUChar(op1->uc * value2);
6132 if(!exp->expType)
6133 {
6134 exp->expType = op1->type;
6135 if(op1->type)
6136 op1->type->refCount++;
6137 }
6138 return 0x1;
6139 }
6140
6141 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6142 {
6143 float value2 = op2->f;
6144
6145 exp->type = 2;
6146 exp->string = PrintFloat(op1->f * value2);
6147 if(!exp->expType)
6148 {
6149 exp->expType = op1->type;
6150 if(op1->type)
6151 op1->type->refCount++;
6152 }
6153 return 0x1;
6154 }
6155
6156 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6157 {
6158 double value2 = op2->d;
6159
6160 exp->type = 2;
6161 exp->string = PrintDouble(op1->d * value2);
6162 if(!exp->expType)
6163 {
6164 exp->expType = op1->type;
6165 if(op1->type)
6166 op1->type->refCount++;
6167 }
6168 return 0x1;
6169 }
6170
6171 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6172 {
6173 int value2 = op2->i;
6174
6175 exp->type = 2;
6176 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
6177 if(!exp->expType)
6178 {
6179 exp->expType = op1->type;
6180 if(op1->type)
6181 op1->type->refCount++;
6182 }
6183 return 0x1;
6184 }
6185
6186 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6187 {
6188 unsigned int value2 = op2->ui;
6189
6190 exp->type = 2;
6191 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
6192 if(!exp->expType)
6193 {
6194 exp->expType = op1->type;
6195 if(op1->type)
6196 op1->type->refCount++;
6197 }
6198 return 0x1;
6199 }
6200
6201 static unsigned int Int64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6202 {
6203 long long value2 = op2->i64;
6204
6205 exp->type = 2;
6206 exp->string = PrintInt64(value2 ? (op1->i64 / value2) : 0);
6207 if(!exp->expType)
6208 {
6209 exp->expType = op1->type;
6210 if(op1->type)
6211 op1->type->refCount++;
6212 }
6213 return 0x1;
6214 }
6215
6216 static unsigned int UInt64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6217 {
6218 uint64 value2 = op2->ui64;
6219
6220 exp->type = 2;
6221 exp->string = PrintUInt64(value2 ? (op1->ui64 / value2) : 0);
6222 if(!exp->expType)
6223 {
6224 exp->expType = op1->type;
6225 if(op1->type)
6226 op1->type->refCount++;
6227 }
6228 return 0x1;
6229 }
6230
6231 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6232 {
6233 short value2 = op2->s;
6234
6235 exp->type = 2;
6236 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
6237 if(!exp->expType)
6238 {
6239 exp->expType = op1->type;
6240 if(op1->type)
6241 op1->type->refCount++;
6242 }
6243 return 0x1;
6244 }
6245
6246 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6247 {
6248 unsigned short value2 = op2->us;
6249
6250 exp->type = 2;
6251 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
6252 if(!exp->expType)
6253 {
6254 exp->expType = op1->type;
6255 if(op1->type)
6256 op1->type->refCount++;
6257 }
6258 return 0x1;
6259 }
6260
6261 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6262 {
6263 char value2 = op2->c;
6264
6265 exp->type = 2;
6266 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
6267 if(!exp->expType)
6268 {
6269 exp->expType = op1->type;
6270 if(op1->type)
6271 op1->type->refCount++;
6272 }
6273 return 0x1;
6274 }
6275
6276 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6277 {
6278 unsigned char value2 = op2->uc;
6279
6280 exp->type = 2;
6281 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
6282 if(!exp->expType)
6283 {
6284 exp->expType = op1->type;
6285 if(op1->type)
6286 op1->type->refCount++;
6287 }
6288 return 0x1;
6289 }
6290
6291 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6292 {
6293 float value2 = op2->f;
6294
6295 exp->type = 2;
6296 exp->string = PrintFloat(value2 ? (op1->f / value2) : 0);
6297 if(!exp->expType)
6298 {
6299 exp->expType = op1->type;
6300 if(op1->type)
6301 op1->type->refCount++;
6302 }
6303 return 0x1;
6304 }
6305
6306 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6307 {
6308 double value2 = op2->d;
6309
6310 exp->type = 2;
6311 exp->string = PrintDouble(value2 ? (op1->d / value2) : 0);
6312 if(!exp->expType)
6313 {
6314 exp->expType = op1->type;
6315 if(op1->type)
6316 op1->type->refCount++;
6317 }
6318 return 0x1;
6319 }
6320
6321 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6322 {
6323 int value2 = op2->i;
6324
6325 exp->type = 2;
6326 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
6327 if(!exp->expType)
6328 {
6329 exp->expType = op1->type;
6330 if(op1->type)
6331 op1->type->refCount++;
6332 }
6333 return 0x1;
6334 }
6335
6336 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6337 {
6338 unsigned int value2 = op2->ui;
6339
6340 exp->type = 2;
6341 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
6342 if(!exp->expType)
6343 {
6344 exp->expType = op1->type;
6345 if(op1->type)
6346 op1->type->refCount++;
6347 }
6348 return 0x1;
6349 }
6350
6351 static unsigned int Int64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6352 {
6353 long long value2 = op2->i64;
6354
6355 exp->type = 2;
6356 exp->string = PrintInt64(value2 ? (op1->i64 % value2) : 0);
6357 if(!exp->expType)
6358 {
6359 exp->expType = op1->type;
6360 if(op1->type)
6361 op1->type->refCount++;
6362 }
6363 return 0x1;
6364 }
6365
6366 static unsigned int UInt64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6367 {
6368 uint64 value2 = op2->ui64;
6369
6370 exp->type = 2;
6371 exp->string = PrintUInt64(value2 ? (op1->ui64 % value2) : 0);
6372 if(!exp->expType)
6373 {
6374 exp->expType = op1->type;
6375 if(op1->type)
6376 op1->type->refCount++;
6377 }
6378 return 0x1;
6379 }
6380
6381 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6382 {
6383 short value2 = op2->s;
6384
6385 exp->type = 2;
6386 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
6387 if(!exp->expType)
6388 {
6389 exp->expType = op1->type;
6390 if(op1->type)
6391 op1->type->refCount++;
6392 }
6393 return 0x1;
6394 }
6395
6396 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6397 {
6398 unsigned short value2 = op2->us;
6399
6400 exp->type = 2;
6401 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
6402 if(!exp->expType)
6403 {
6404 exp->expType = op1->type;
6405 if(op1->type)
6406 op1->type->refCount++;
6407 }
6408 return 0x1;
6409 }
6410
6411 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6412 {
6413 char value2 = op2->c;
6414
6415 exp->type = 2;
6416 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
6417 if(!exp->expType)
6418 {
6419 exp->expType = op1->type;
6420 if(op1->type)
6421 op1->type->refCount++;
6422 }
6423 return 0x1;
6424 }
6425
6426 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6427 {
6428 unsigned char value2 = op2->uc;
6429
6430 exp->type = 2;
6431 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
6432 if(!exp->expType)
6433 {
6434 exp->expType = op1->type;
6435 if(op1->type)
6436 op1->type->refCount++;
6437 }
6438 return 0x1;
6439 }
6440
6441 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6442 {
6443 exp->type = 2;
6444 exp->string = PrintInt((-op1->i));
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 UIntNeg(struct Expression * exp, struct Operand * op1)
6455 {
6456 exp->type = 2;
6457 exp->string = PrintUInt((unsigned int)(-op1->ui));
6458 if(!exp->expType)
6459 {
6460 exp->expType = op1->type;
6461 if(op1->type)
6462 op1->type->refCount++;
6463 }
6464 return 0x1;
6465 }
6466
6467 static unsigned int Int64Neg(struct Expression * exp, struct Operand * op1)
6468 {
6469 exp->type = 2;
6470 exp->string = PrintInt64((-op1->i64));
6471 if(!exp->expType)
6472 {
6473 exp->expType = op1->type;
6474 if(op1->type)
6475 op1->type->refCount++;
6476 }
6477 return 0x1;
6478 }
6479
6480 static unsigned int UInt64Neg(struct Expression * exp, struct Operand * op1)
6481 {
6482 exp->type = 2;
6483 exp->string = PrintUInt64((uint64)(-op1->ui64));
6484 if(!exp->expType)
6485 {
6486 exp->expType = op1->type;
6487 if(op1->type)
6488 op1->type->refCount++;
6489 }
6490 return 0x1;
6491 }
6492
6493 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6494 {
6495 exp->type = 2;
6496 exp->string = PrintShort((-op1->s));
6497 if(!exp->expType)
6498 {
6499 exp->expType = op1->type;
6500 if(op1->type)
6501 op1->type->refCount++;
6502 }
6503 return 0x1;
6504 }
6505
6506 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6507 {
6508 exp->type = 2;
6509 exp->string = PrintUShort((unsigned short)(-op1->us));
6510 if(!exp->expType)
6511 {
6512 exp->expType = op1->type;
6513 if(op1->type)
6514 op1->type->refCount++;
6515 }
6516 return 0x1;
6517 }
6518
6519 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6520 {
6521 exp->type = 2;
6522 exp->string = PrintChar((-op1->c));
6523 if(!exp->expType)
6524 {
6525 exp->expType = op1->type;
6526 if(op1->type)
6527 op1->type->refCount++;
6528 }
6529 return 0x1;
6530 }
6531
6532 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6533 {
6534 exp->type = 2;
6535 exp->string = PrintUChar((unsigned char)(-op1->uc));
6536 if(!exp->expType)
6537 {
6538 exp->expType = op1->type;
6539 if(op1->type)
6540 op1->type->refCount++;
6541 }
6542 return 0x1;
6543 }
6544
6545 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6546 {
6547 exp->type = 2;
6548 exp->string = PrintFloat((float)(-op1->f));
6549 if(!exp->expType)
6550 {
6551 exp->expType = op1->type;
6552 if(op1->type)
6553 op1->type->refCount++;
6554 }
6555 return 0x1;
6556 }
6557
6558 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6559 {
6560 exp->type = 2;
6561 exp->string = PrintDouble((double)(-op1->d));
6562 if(!exp->expType)
6563 {
6564 exp->expType = op1->type;
6565 if(op1->type)
6566 op1->type->refCount++;
6567 }
6568 return 0x1;
6569 }
6570
6571 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6572 {
6573 exp->type = 2;
6574 exp->string = PrintInt((++op1->i));
6575 if(!exp->expType)
6576 {
6577 exp->expType = op1->type;
6578 if(op1->type)
6579 op1->type->refCount++;
6580 }
6581 return 0x1;
6582 }
6583
6584 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6585 {
6586 exp->type = 2;
6587 exp->string = PrintUInt((++op1->ui));
6588 if(!exp->expType)
6589 {
6590 exp->expType = op1->type;
6591 if(op1->type)
6592 op1->type->refCount++;
6593 }
6594 return 0x1;
6595 }
6596
6597 static unsigned int Int64Inc(struct Expression * exp, struct Operand * op1)
6598 {
6599 exp->type = 2;
6600 exp->string = PrintInt64((++op1->i64));
6601 if(!exp->expType)
6602 {
6603 exp->expType = op1->type;
6604 if(op1->type)
6605 op1->type->refCount++;
6606 }
6607 return 0x1;
6608 }
6609
6610 static unsigned int UInt64Inc(struct Expression * exp, struct Operand * op1)
6611 {
6612 exp->type = 2;
6613 exp->string = PrintUInt64((++op1->ui64));
6614 if(!exp->expType)
6615 {
6616 exp->expType = op1->type;
6617 if(op1->type)
6618 op1->type->refCount++;
6619 }
6620 return 0x1;
6621 }
6622
6623 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6624 {
6625 exp->type = 2;
6626 exp->string = PrintShort((++op1->s));
6627 if(!exp->expType)
6628 {
6629 exp->expType = op1->type;
6630 if(op1->type)
6631 op1->type->refCount++;
6632 }
6633 return 0x1;
6634 }
6635
6636 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6637 {
6638 exp->type = 2;
6639 exp->string = PrintUShort((++op1->us));
6640 if(!exp->expType)
6641 {
6642 exp->expType = op1->type;
6643 if(op1->type)
6644 op1->type->refCount++;
6645 }
6646 return 0x1;
6647 }
6648
6649 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6650 {
6651 exp->type = 2;
6652 exp->string = PrintChar((++op1->c));
6653 if(!exp->expType)
6654 {
6655 exp->expType = op1->type;
6656 if(op1->type)
6657 op1->type->refCount++;
6658 }
6659 return 0x1;
6660 }
6661
6662 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6663 {
6664 exp->type = 2;
6665 exp->string = PrintUChar((++op1->uc));
6666 if(!exp->expType)
6667 {
6668 exp->expType = op1->type;
6669 if(op1->type)
6670 op1->type->refCount++;
6671 }
6672 return 0x1;
6673 }
6674
6675 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6676 {
6677 exp->type = 2;
6678 exp->string = PrintFloat((float)(++op1->f));
6679 if(!exp->expType)
6680 {
6681 exp->expType = op1->type;
6682 if(op1->type)
6683 op1->type->refCount++;
6684 }
6685 return 0x1;
6686 }
6687
6688 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6689 {
6690 exp->type = 2;
6691 exp->string = PrintDouble((double)(++op1->d));
6692 if(!exp->expType)
6693 {
6694 exp->expType = op1->type;
6695 if(op1->type)
6696 op1->type->refCount++;
6697 }
6698 return 0x1;
6699 }
6700
6701 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6702 {
6703 exp->type = 2;
6704 exp->string = PrintInt((--op1->i));
6705 if(!exp->expType)
6706 {
6707 exp->expType = op1->type;
6708 if(op1->type)
6709 op1->type->refCount++;
6710 }
6711 return 0x1;
6712 }
6713
6714 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6715 {
6716 exp->type = 2;
6717 exp->string = PrintUInt((--op1->ui));
6718 if(!exp->expType)
6719 {
6720 exp->expType = op1->type;
6721 if(op1->type)
6722 op1->type->refCount++;
6723 }
6724 return 0x1;
6725 }
6726
6727 static unsigned int Int64Dec(struct Expression * exp, struct Operand * op1)
6728 {
6729 exp->type = 2;
6730 exp->string = PrintInt64((--op1->i64));
6731 if(!exp->expType)
6732 {
6733 exp->expType = op1->type;
6734 if(op1->type)
6735 op1->type->refCount++;
6736 }
6737 return 0x1;
6738 }
6739
6740 static unsigned int UInt64Dec(struct Expression * exp, struct Operand * op1)
6741 {
6742 exp->type = 2;
6743 exp->string = PrintUInt64((--op1->ui64));
6744 if(!exp->expType)
6745 {
6746 exp->expType = op1->type;
6747 if(op1->type)
6748 op1->type->refCount++;
6749 }
6750 return 0x1;
6751 }
6752
6753 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6754 {
6755 exp->type = 2;
6756 exp->string = PrintShort((--op1->s));
6757 if(!exp->expType)
6758 {
6759 exp->expType = op1->type;
6760 if(op1->type)
6761 op1->type->refCount++;
6762 }
6763 return 0x1;
6764 }
6765
6766 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6767 {
6768 exp->type = 2;
6769 exp->string = PrintUShort((--op1->us));
6770 if(!exp->expType)
6771 {
6772 exp->expType = op1->type;
6773 if(op1->type)
6774 op1->type->refCount++;
6775 }
6776 return 0x1;
6777 }
6778
6779 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6780 {
6781 exp->type = 2;
6782 exp->string = PrintChar((--op1->c));
6783 if(!exp->expType)
6784 {
6785 exp->expType = op1->type;
6786 if(op1->type)
6787 op1->type->refCount++;
6788 }
6789 return 0x1;
6790 }
6791
6792 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6793 {
6794 exp->type = 2;
6795 exp->string = PrintUChar((--op1->uc));
6796 if(!exp->expType)
6797 {
6798 exp->expType = op1->type;
6799 if(op1->type)
6800 op1->type->refCount++;
6801 }
6802 return 0x1;
6803 }
6804
6805 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6806 {
6807 exp->type = 2;
6808 exp->string = PrintFloat((float)(--op1->f));
6809 if(!exp->expType)
6810 {
6811 exp->expType = op1->type;
6812 if(op1->type)
6813 op1->type->refCount++;
6814 }
6815 return 0x1;
6816 }
6817
6818 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6819 {
6820 exp->type = 2;
6821 exp->string = PrintDouble((double)(--op1->d));
6822 if(!exp->expType)
6823 {
6824 exp->expType = op1->type;
6825 if(op1->type)
6826 op1->type->refCount++;
6827 }
6828 return 0x1;
6829 }
6830
6831 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6832 {
6833 int value2 = op2->i;
6834
6835 exp->type = 2;
6836 exp->string = PrintInt(op1->i = value2);
6837 if(!exp->expType)
6838 {
6839 exp->expType = op1->type;
6840 if(op1->type)
6841 op1->type->refCount++;
6842 }
6843 return 0x1;
6844 }
6845
6846 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6847 {
6848 unsigned int value2 = op2->ui;
6849
6850 exp->type = 2;
6851 exp->string = PrintUInt(op1->ui = value2);
6852 if(!exp->expType)
6853 {
6854 exp->expType = op1->type;
6855 if(op1->type)
6856 op1->type->refCount++;
6857 }
6858 return 0x1;
6859 }
6860
6861 static unsigned int Int64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6862 {
6863 long long value2 = op2->i64;
6864
6865 exp->type = 2;
6866 exp->string = PrintInt64(op1->i64 = value2);
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 UInt64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6877 {
6878 uint64 value2 = op2->ui64;
6879
6880 exp->type = 2;
6881 exp->string = PrintUInt64(op1->ui64 = value2);
6882 if(!exp->expType)
6883 {
6884 exp->expType = op1->type;
6885 if(op1->type)
6886 op1->type->refCount++;
6887 }
6888 return 0x1;
6889 }
6890
6891 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6892 {
6893 short value2 = op2->s;
6894
6895 exp->type = 2;
6896 exp->string = PrintShort(op1->s = value2);
6897 if(!exp->expType)
6898 {
6899 exp->expType = op1->type;
6900 if(op1->type)
6901 op1->type->refCount++;
6902 }
6903 return 0x1;
6904 }
6905
6906 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6907 {
6908 unsigned short value2 = op2->us;
6909
6910 exp->type = 2;
6911 exp->string = PrintUShort(op1->us = value2);
6912 if(!exp->expType)
6913 {
6914 exp->expType = op1->type;
6915 if(op1->type)
6916 op1->type->refCount++;
6917 }
6918 return 0x1;
6919 }
6920
6921 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6922 {
6923 char value2 = op2->c;
6924
6925 exp->type = 2;
6926 exp->string = PrintChar(op1->c = value2);
6927 if(!exp->expType)
6928 {
6929 exp->expType = op1->type;
6930 if(op1->type)
6931 op1->type->refCount++;
6932 }
6933 return 0x1;
6934 }
6935
6936 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6937 {
6938 unsigned char value2 = op2->uc;
6939
6940 exp->type = 2;
6941 exp->string = PrintUChar(op1->uc = value2);
6942 if(!exp->expType)
6943 {
6944 exp->expType = op1->type;
6945 if(op1->type)
6946 op1->type->refCount++;
6947 }
6948 return 0x1;
6949 }
6950
6951 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6952 {
6953 float value2 = op2->f;
6954
6955 exp->type = 2;
6956 exp->string = PrintFloat(op1->f = value2);
6957 if(!exp->expType)
6958 {
6959 exp->expType = op1->type;
6960 if(op1->type)
6961 op1->type->refCount++;
6962 }
6963 return 0x1;
6964 }
6965
6966 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6967 {
6968 double value2 = op2->d;
6969
6970 exp->type = 2;
6971 exp->string = PrintDouble(op1->d = value2);
6972 if(!exp->expType)
6973 {
6974 exp->expType = op1->type;
6975 if(op1->type)
6976 op1->type->refCount++;
6977 }
6978 return 0x1;
6979 }
6980
6981 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6982 {
6983 int value2 = op2->i;
6984
6985 exp->type = 2;
6986 exp->string = PrintInt(op1->i += value2);
6987 if(!exp->expType)
6988 {
6989 exp->expType = op1->type;
6990 if(op1->type)
6991 op1->type->refCount++;
6992 }
6993 return 0x1;
6994 }
6995
6996 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6997 {
6998 unsigned int value2 = op2->ui;
6999
7000 exp->type = 2;
7001 exp->string = PrintUInt(op1->ui += value2);
7002 if(!exp->expType)
7003 {
7004 exp->expType = op1->type;
7005 if(op1->type)
7006 op1->type->refCount++;
7007 }
7008 return 0x1;
7009 }
7010
7011 static unsigned int Int64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7012 {
7013 long long value2 = op2->i64;
7014
7015 exp->type = 2;
7016 exp->string = PrintInt64(op1->i64 += value2);
7017 if(!exp->expType)
7018 {
7019 exp->expType = op1->type;
7020 if(op1->type)
7021 op1->type->refCount++;
7022 }
7023 return 0x1;
7024 }
7025
7026 static unsigned int UInt64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7027 {
7028 uint64 value2 = op2->ui64;
7029
7030 exp->type = 2;
7031 exp->string = PrintUInt64(op1->ui64 += value2);
7032 if(!exp->expType)
7033 {
7034 exp->expType = op1->type;
7035 if(op1->type)
7036 op1->type->refCount++;
7037 }
7038 return 0x1;
7039 }
7040
7041 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7042 {
7043 short value2 = op2->s;
7044
7045 exp->type = 2;
7046 exp->string = PrintShort(op1->s += value2);
7047 if(!exp->expType)
7048 {
7049 exp->expType = op1->type;
7050 if(op1->type)
7051 op1->type->refCount++;
7052 }
7053 return 0x1;
7054 }
7055
7056 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7057 {
7058 unsigned short value2 = op2->us;
7059
7060 exp->type = 2;
7061 exp->string = PrintUShort(op1->us += value2);
7062 if(!exp->expType)
7063 {
7064 exp->expType = op1->type;
7065 if(op1->type)
7066 op1->type->refCount++;
7067 }
7068 return 0x1;
7069 }
7070
7071 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7072 {
7073 char value2 = op2->c;
7074
7075 exp->type = 2;
7076 exp->string = PrintChar(op1->c += value2);
7077 if(!exp->expType)
7078 {
7079 exp->expType = op1->type;
7080 if(op1->type)
7081 op1->type->refCount++;
7082 }
7083 return 0x1;
7084 }
7085
7086 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7087 {
7088 unsigned char value2 = op2->uc;
7089
7090 exp->type = 2;
7091 exp->string = PrintUChar(op1->uc += value2);
7092 if(!exp->expType)
7093 {
7094 exp->expType = op1->type;
7095 if(op1->type)
7096 op1->type->refCount++;
7097 }
7098 return 0x1;
7099 }
7100
7101 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7102 {
7103 float value2 = op2->f;
7104
7105 exp->type = 2;
7106 exp->string = PrintFloat(op1->f += value2);
7107 if(!exp->expType)
7108 {
7109 exp->expType = op1->type;
7110 if(op1->type)
7111 op1->type->refCount++;
7112 }
7113 return 0x1;
7114 }
7115
7116 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7117 {
7118 double value2 = op2->d;
7119
7120 exp->type = 2;
7121 exp->string = PrintDouble(op1->d += value2);
7122 if(!exp->expType)
7123 {
7124 exp->expType = op1->type;
7125 if(op1->type)
7126 op1->type->refCount++;
7127 }
7128 return 0x1;
7129 }
7130
7131 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7132 {
7133 int value2 = op2->i;
7134
7135 exp->type = 2;
7136 exp->string = PrintInt(op1->i -= value2);
7137 if(!exp->expType)
7138 {
7139 exp->expType = op1->type;
7140 if(op1->type)
7141 op1->type->refCount++;
7142 }
7143 return 0x1;
7144 }
7145
7146 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7147 {
7148 unsigned int value2 = op2->ui;
7149
7150 exp->type = 2;
7151 exp->string = PrintUInt(op1->ui -= value2);
7152 if(!exp->expType)
7153 {
7154 exp->expType = op1->type;
7155 if(op1->type)
7156 op1->type->refCount++;
7157 }
7158 return 0x1;
7159 }
7160
7161 static unsigned int Int64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7162 {
7163 long long value2 = op2->i64;
7164
7165 exp->type = 2;
7166 exp->string = PrintInt64(op1->i64 -= value2);
7167 if(!exp->expType)
7168 {
7169 exp->expType = op1->type;
7170 if(op1->type)
7171 op1->type->refCount++;
7172 }
7173 return 0x1;
7174 }
7175
7176 static unsigned int UInt64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7177 {
7178 uint64 value2 = op2->ui64;
7179
7180 exp->type = 2;
7181 exp->string = PrintUInt64(op1->ui64 -= value2);
7182 if(!exp->expType)
7183 {
7184 exp->expType = op1->type;
7185 if(op1->type)
7186 op1->type->refCount++;
7187 }
7188 return 0x1;
7189 }
7190
7191 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7192 {
7193 short value2 = op2->s;
7194
7195 exp->type = 2;
7196 exp->string = PrintShort(op1->s -= value2);
7197 if(!exp->expType)
7198 {
7199 exp->expType = op1->type;
7200 if(op1->type)
7201 op1->type->refCount++;
7202 }
7203 return 0x1;
7204 }
7205
7206 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7207 {
7208 unsigned short value2 = op2->us;
7209
7210 exp->type = 2;
7211 exp->string = PrintUShort(op1->us -= value2);
7212 if(!exp->expType)
7213 {
7214 exp->expType = op1->type;
7215 if(op1->type)
7216 op1->type->refCount++;
7217 }
7218 return 0x1;
7219 }
7220
7221 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7222 {
7223 char value2 = op2->c;
7224
7225 exp->type = 2;
7226 exp->string = PrintChar(op1->c -= value2);
7227 if(!exp->expType)
7228 {
7229 exp->expType = op1->type;
7230 if(op1->type)
7231 op1->type->refCount++;
7232 }
7233 return 0x1;
7234 }
7235
7236 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7237 {
7238 unsigned char value2 = op2->uc;
7239
7240 exp->type = 2;
7241 exp->string = PrintUChar(op1->uc -= value2);
7242 if(!exp->expType)
7243 {
7244 exp->expType = op1->type;
7245 if(op1->type)
7246 op1->type->refCount++;
7247 }
7248 return 0x1;
7249 }
7250
7251 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7252 {
7253 float value2 = op2->f;
7254
7255 exp->type = 2;
7256 exp->string = PrintFloat(op1->f -= value2);
7257 if(!exp->expType)
7258 {
7259 exp->expType = op1->type;
7260 if(op1->type)
7261 op1->type->refCount++;
7262 }
7263 return 0x1;
7264 }
7265
7266 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7267 {
7268 double value2 = op2->d;
7269
7270 exp->type = 2;
7271 exp->string = PrintDouble(op1->d -= value2);
7272 if(!exp->expType)
7273 {
7274 exp->expType = op1->type;
7275 if(op1->type)
7276 op1->type->refCount++;
7277 }
7278 return 0x1;
7279 }
7280
7281 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7282 {
7283 int value2 = op2->i;
7284
7285 exp->type = 2;
7286 exp->string = PrintInt(op1->i *= value2);
7287 if(!exp->expType)
7288 {
7289 exp->expType = op1->type;
7290 if(op1->type)
7291 op1->type->refCount++;
7292 }
7293 return 0x1;
7294 }
7295
7296 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7297 {
7298 unsigned int value2 = op2->ui;
7299
7300 exp->type = 2;
7301 exp->string = PrintUInt(op1->ui *= value2);
7302 if(!exp->expType)
7303 {
7304 exp->expType = op1->type;
7305 if(op1->type)
7306 op1->type->refCount++;
7307 }
7308 return 0x1;
7309 }
7310
7311 static unsigned int Int64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7312 {
7313 long long value2 = op2->i64;
7314
7315 exp->type = 2;
7316 exp->string = PrintInt64(op1->i64 *= value2);
7317 if(!exp->expType)
7318 {
7319 exp->expType = op1->type;
7320 if(op1->type)
7321 op1->type->refCount++;
7322 }
7323 return 0x1;
7324 }
7325
7326 static unsigned int UInt64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7327 {
7328 uint64 value2 = op2->ui64;
7329
7330 exp->type = 2;
7331 exp->string = PrintUInt64(op1->ui64 *= value2);
7332 if(!exp->expType)
7333 {
7334 exp->expType = op1->type;
7335 if(op1->type)
7336 op1->type->refCount++;
7337 }
7338 return 0x1;
7339 }
7340
7341 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7342 {
7343 short value2 = op2->s;
7344
7345 exp->type = 2;
7346 exp->string = PrintShort(op1->s *= value2);
7347 if(!exp->expType)
7348 {
7349 exp->expType = op1->type;
7350 if(op1->type)
7351 op1->type->refCount++;
7352 }
7353 return 0x1;
7354 }
7355
7356 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7357 {
7358 unsigned short value2 = op2->us;
7359
7360 exp->type = 2;
7361 exp->string = PrintUShort(op1->us *= value2);
7362 if(!exp->expType)
7363 {
7364 exp->expType = op1->type;
7365 if(op1->type)
7366 op1->type->refCount++;
7367 }
7368 return 0x1;
7369 }
7370
7371 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7372 {
7373 char value2 = op2->c;
7374
7375 exp->type = 2;
7376 exp->string = PrintChar(op1->c *= value2);
7377 if(!exp->expType)
7378 {
7379 exp->expType = op1->type;
7380 if(op1->type)
7381 op1->type->refCount++;
7382 }
7383 return 0x1;
7384 }
7385
7386 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7387 {
7388 unsigned char value2 = op2->uc;
7389
7390 exp->type = 2;
7391 exp->string = PrintUChar(op1->uc *= value2);
7392 if(!exp->expType)
7393 {
7394 exp->expType = op1->type;
7395 if(op1->type)
7396 op1->type->refCount++;
7397 }
7398 return 0x1;
7399 }
7400
7401 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7402 {
7403 float value2 = op2->f;
7404
7405 exp->type = 2;
7406 exp->string = PrintFloat(op1->f *= value2);
7407 if(!exp->expType)
7408 {
7409 exp->expType = op1->type;
7410 if(op1->type)
7411 op1->type->refCount++;
7412 }
7413 return 0x1;
7414 }
7415
7416 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7417 {
7418 double value2 = op2->d;
7419
7420 exp->type = 2;
7421 exp->string = PrintDouble(op1->d *= value2);
7422 if(!exp->expType)
7423 {
7424 exp->expType = op1->type;
7425 if(op1->type)
7426 op1->type->refCount++;
7427 }
7428 return 0x1;
7429 }
7430
7431 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7432 {
7433 int value2 = op2->i;
7434
7435 exp->type = 2;
7436 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
7437 if(!exp->expType)
7438 {
7439 exp->expType = op1->type;
7440 if(op1->type)
7441 op1->type->refCount++;
7442 }
7443 return 0x1;
7444 }
7445
7446 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7447 {
7448 unsigned int value2 = op2->ui;
7449
7450 exp->type = 2;
7451 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
7452 if(!exp->expType)
7453 {
7454 exp->expType = op1->type;
7455 if(op1->type)
7456 op1->type->refCount++;
7457 }
7458 return 0x1;
7459 }
7460
7461 static unsigned int Int64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7462 {
7463 long long value2 = op2->i64;
7464
7465 exp->type = 2;
7466 exp->string = PrintInt64(value2 ? (op1->i64 /= value2) : 0);
7467 if(!exp->expType)
7468 {
7469 exp->expType = op1->type;
7470 if(op1->type)
7471 op1->type->refCount++;
7472 }
7473 return 0x1;
7474 }
7475
7476 static unsigned int UInt64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7477 {
7478 uint64 value2 = op2->ui64;
7479
7480 exp->type = 2;
7481 exp->string = PrintUInt64(value2 ? (op1->ui64 /= value2) : 0);
7482 if(!exp->expType)
7483 {
7484 exp->expType = op1->type;
7485 if(op1->type)
7486 op1->type->refCount++;
7487 }
7488 return 0x1;
7489 }
7490
7491 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7492 {
7493 short value2 = op2->s;
7494
7495 exp->type = 2;
7496 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
7497 if(!exp->expType)
7498 {
7499 exp->expType = op1->type;
7500 if(op1->type)
7501 op1->type->refCount++;
7502 }
7503 return 0x1;
7504 }
7505
7506 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7507 {
7508 unsigned short value2 = op2->us;
7509
7510 exp->type = 2;
7511 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
7512 if(!exp->expType)
7513 {
7514 exp->expType = op1->type;
7515 if(op1->type)
7516 op1->type->refCount++;
7517 }
7518 return 0x1;
7519 }
7520
7521 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7522 {
7523 char value2 = op2->c;
7524
7525 exp->type = 2;
7526 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
7527 if(!exp->expType)
7528 {
7529 exp->expType = op1->type;
7530 if(op1->type)
7531 op1->type->refCount++;
7532 }
7533 return 0x1;
7534 }
7535
7536 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7537 {
7538 unsigned char value2 = op2->uc;
7539
7540 exp->type = 2;
7541 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
7542 if(!exp->expType)
7543 {
7544 exp->expType = op1->type;
7545 if(op1->type)
7546 op1->type->refCount++;
7547 }
7548 return 0x1;
7549 }
7550
7551 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7552 {
7553 float value2 = op2->f;
7554
7555 exp->type = 2;
7556 exp->string = PrintFloat(value2 ? (op1->f /= value2) : 0);
7557 if(!exp->expType)
7558 {
7559 exp->expType = op1->type;
7560 if(op1->type)
7561 op1->type->refCount++;
7562 }
7563 return 0x1;
7564 }
7565
7566 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7567 {
7568 double value2 = op2->d;
7569
7570 exp->type = 2;
7571 exp->string = PrintDouble(value2 ? (op1->d /= value2) : 0);
7572 if(!exp->expType)
7573 {
7574 exp->expType = op1->type;
7575 if(op1->type)
7576 op1->type->refCount++;
7577 }
7578 return 0x1;
7579 }
7580
7581 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7582 {
7583 int value2 = op2->i;
7584
7585 exp->type = 2;
7586 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
7587 if(!exp->expType)
7588 {
7589 exp->expType = op1->type;
7590 if(op1->type)
7591 op1->type->refCount++;
7592 }
7593 return 0x1;
7594 }
7595
7596 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7597 {
7598 unsigned int value2 = op2->ui;
7599
7600 exp->type = 2;
7601 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
7602 if(!exp->expType)
7603 {
7604 exp->expType = op1->type;
7605 if(op1->type)
7606 op1->type->refCount++;
7607 }
7608 return 0x1;
7609 }
7610
7611 static unsigned int Int64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7612 {
7613 long long value2 = op2->i64;
7614
7615 exp->type = 2;
7616 exp->string = PrintInt64(value2 ? (op1->i64 %= value2) : 0);
7617 if(!exp->expType)
7618 {
7619 exp->expType = op1->type;
7620 if(op1->type)
7621 op1->type->refCount++;
7622 }
7623 return 0x1;
7624 }
7625
7626 static unsigned int UInt64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7627 {
7628 uint64 value2 = op2->ui64;
7629
7630 exp->type = 2;
7631 exp->string = PrintUInt64(value2 ? (op1->ui64 %= value2) : 0);
7632 if(!exp->expType)
7633 {
7634 exp->expType = op1->type;
7635 if(op1->type)
7636 op1->type->refCount++;
7637 }
7638 return 0x1;
7639 }
7640
7641 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7642 {
7643 short value2 = op2->s;
7644
7645 exp->type = 2;
7646 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
7647 if(!exp->expType)
7648 {
7649 exp->expType = op1->type;
7650 if(op1->type)
7651 op1->type->refCount++;
7652 }
7653 return 0x1;
7654 }
7655
7656 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7657 {
7658 unsigned short value2 = op2->us;
7659
7660 exp->type = 2;
7661 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
7662 if(!exp->expType)
7663 {
7664 exp->expType = op1->type;
7665 if(op1->type)
7666 op1->type->refCount++;
7667 }
7668 return 0x1;
7669 }
7670
7671 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7672 {
7673 char value2 = op2->c;
7674
7675 exp->type = 2;
7676 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
7677 if(!exp->expType)
7678 {
7679 exp->expType = op1->type;
7680 if(op1->type)
7681 op1->type->refCount++;
7682 }
7683 return 0x1;
7684 }
7685
7686 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7687 {
7688 unsigned char value2 = op2->uc;
7689
7690 exp->type = 2;
7691 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
7692 if(!exp->expType)
7693 {
7694 exp->expType = op1->type;
7695 if(op1->type)
7696 op1->type->refCount++;
7697 }
7698 return 0x1;
7699 }
7700
7701 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7702 {
7703 int value2 = op2->i;
7704
7705 exp->type = 2;
7706 exp->string = PrintInt(op1->i & value2);
7707 if(!exp->expType)
7708 {
7709 exp->expType = op1->type;
7710 if(op1->type)
7711 op1->type->refCount++;
7712 }
7713 return 0x1;
7714 }
7715
7716 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7717 {
7718 unsigned int value2 = op2->ui;
7719
7720 exp->type = 2;
7721 exp->string = PrintUInt(op1->ui & value2);
7722 if(!exp->expType)
7723 {
7724 exp->expType = op1->type;
7725 if(op1->type)
7726 op1->type->refCount++;
7727 }
7728 return 0x1;
7729 }
7730
7731 static unsigned int Int64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7732 {
7733 long long value2 = op2->i64;
7734
7735 exp->type = 2;
7736 exp->string = PrintInt64(op1->i64 & value2);
7737 if(!exp->expType)
7738 {
7739 exp->expType = op1->type;
7740 if(op1->type)
7741 op1->type->refCount++;
7742 }
7743 return 0x1;
7744 }
7745
7746 static unsigned int UInt64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7747 {
7748 uint64 value2 = op2->ui64;
7749
7750 exp->type = 2;
7751 exp->string = PrintUInt64(op1->ui64 & value2);
7752 if(!exp->expType)
7753 {
7754 exp->expType = op1->type;
7755 if(op1->type)
7756 op1->type->refCount++;
7757 }
7758 return 0x1;
7759 }
7760
7761 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7762 {
7763 short value2 = op2->s;
7764
7765 exp->type = 2;
7766 exp->string = PrintShort(op1->s & value2);
7767 if(!exp->expType)
7768 {
7769 exp->expType = op1->type;
7770 if(op1->type)
7771 op1->type->refCount++;
7772 }
7773 return 0x1;
7774 }
7775
7776 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7777 {
7778 unsigned short value2 = op2->us;
7779
7780 exp->type = 2;
7781 exp->string = PrintUShort(op1->us & value2);
7782 if(!exp->expType)
7783 {
7784 exp->expType = op1->type;
7785 if(op1->type)
7786 op1->type->refCount++;
7787 }
7788 return 0x1;
7789 }
7790
7791 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7792 {
7793 char value2 = op2->c;
7794
7795 exp->type = 2;
7796 exp->string = PrintChar(op1->c & value2);
7797 if(!exp->expType)
7798 {
7799 exp->expType = op1->type;
7800 if(op1->type)
7801 op1->type->refCount++;
7802 }
7803 return 0x1;
7804 }
7805
7806 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7807 {
7808 unsigned char value2 = op2->uc;
7809
7810 exp->type = 2;
7811 exp->string = PrintUChar(op1->uc & value2);
7812 if(!exp->expType)
7813 {
7814 exp->expType = op1->type;
7815 if(op1->type)
7816 op1->type->refCount++;
7817 }
7818 return 0x1;
7819 }
7820
7821 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7822 {
7823 int value2 = op2->i;
7824
7825 exp->type = 2;
7826 exp->string = PrintInt(op1->i | value2);
7827 if(!exp->expType)
7828 {
7829 exp->expType = op1->type;
7830 if(op1->type)
7831 op1->type->refCount++;
7832 }
7833 return 0x1;
7834 }
7835
7836 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7837 {
7838 unsigned int value2 = op2->ui;
7839
7840 exp->type = 2;
7841 exp->string = PrintUInt(op1->ui | value2);
7842 if(!exp->expType)
7843 {
7844 exp->expType = op1->type;
7845 if(op1->type)
7846 op1->type->refCount++;
7847 }
7848 return 0x1;
7849 }
7850
7851 static unsigned int Int64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7852 {
7853 long long value2 = op2->i64;
7854
7855 exp->type = 2;
7856 exp->string = PrintInt64(op1->i64 | value2);
7857 if(!exp->expType)
7858 {
7859 exp->expType = op1->type;
7860 if(op1->type)
7861 op1->type->refCount++;
7862 }
7863 return 0x1;
7864 }
7865
7866 static unsigned int UInt64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7867 {
7868 uint64 value2 = op2->ui64;
7869
7870 exp->type = 2;
7871 exp->string = PrintUInt64(op1->ui64 | value2);
7872 if(!exp->expType)
7873 {
7874 exp->expType = op1->type;
7875 if(op1->type)
7876 op1->type->refCount++;
7877 }
7878 return 0x1;
7879 }
7880
7881 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7882 {
7883 short value2 = op2->s;
7884
7885 exp->type = 2;
7886 exp->string = PrintShort(op1->s | value2);
7887 if(!exp->expType)
7888 {
7889 exp->expType = op1->type;
7890 if(op1->type)
7891 op1->type->refCount++;
7892 }
7893 return 0x1;
7894 }
7895
7896 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7897 {
7898 unsigned short value2 = op2->us;
7899
7900 exp->type = 2;
7901 exp->string = PrintUShort(op1->us | value2);
7902 if(!exp->expType)
7903 {
7904 exp->expType = op1->type;
7905 if(op1->type)
7906 op1->type->refCount++;
7907 }
7908 return 0x1;
7909 }
7910
7911 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7912 {
7913 char value2 = op2->c;
7914
7915 exp->type = 2;
7916 exp->string = PrintChar(op1->c | value2);
7917 if(!exp->expType)
7918 {
7919 exp->expType = op1->type;
7920 if(op1->type)
7921 op1->type->refCount++;
7922 }
7923 return 0x1;
7924 }
7925
7926 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7927 {
7928 unsigned char value2 = op2->uc;
7929
7930 exp->type = 2;
7931 exp->string = PrintUChar(op1->uc | value2);
7932 if(!exp->expType)
7933 {
7934 exp->expType = op1->type;
7935 if(op1->type)
7936 op1->type->refCount++;
7937 }
7938 return 0x1;
7939 }
7940
7941 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7942 {
7943 int value2 = op2->i;
7944
7945 exp->type = 2;
7946 exp->string = PrintInt(op1->i ^ value2);
7947 if(!exp->expType)
7948 {
7949 exp->expType = op1->type;
7950 if(op1->type)
7951 op1->type->refCount++;
7952 }
7953 return 0x1;
7954 }
7955
7956 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7957 {
7958 unsigned int value2 = op2->ui;
7959
7960 exp->type = 2;
7961 exp->string = PrintUInt(op1->ui ^ value2);
7962 if(!exp->expType)
7963 {
7964 exp->expType = op1->type;
7965 if(op1->type)
7966 op1->type->refCount++;
7967 }
7968 return 0x1;
7969 }
7970
7971 static unsigned int Int64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7972 {
7973 long long value2 = op2->i64;
7974
7975 exp->type = 2;
7976 exp->string = PrintInt64(op1->i64 ^ value2);
7977 if(!exp->expType)
7978 {
7979 exp->expType = op1->type;
7980 if(op1->type)
7981 op1->type->refCount++;
7982 }
7983 return 0x1;
7984 }
7985
7986 static unsigned int UInt64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7987 {
7988 uint64 value2 = op2->ui64;
7989
7990 exp->type = 2;
7991 exp->string = PrintUInt64(op1->ui64 ^ value2);
7992 if(!exp->expType)
7993 {
7994 exp->expType = op1->type;
7995 if(op1->type)
7996 op1->type->refCount++;
7997 }
7998 return 0x1;
7999 }
8000
8001 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8002 {
8003 short value2 = op2->s;
8004
8005 exp->type = 2;
8006 exp->string = PrintShort(op1->s ^ value2);
8007 if(!exp->expType)
8008 {
8009 exp->expType = op1->type;
8010 if(op1->type)
8011 op1->type->refCount++;
8012 }
8013 return 0x1;
8014 }
8015
8016 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8017 {
8018 unsigned short value2 = op2->us;
8019
8020 exp->type = 2;
8021 exp->string = PrintUShort(op1->us ^ value2);
8022 if(!exp->expType)
8023 {
8024 exp->expType = op1->type;
8025 if(op1->type)
8026 op1->type->refCount++;
8027 }
8028 return 0x1;
8029 }
8030
8031 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8032 {
8033 char value2 = op2->c;
8034
8035 exp->type = 2;
8036 exp->string = PrintChar(op1->c ^ value2);
8037 if(!exp->expType)
8038 {
8039 exp->expType = op1->type;
8040 if(op1->type)
8041 op1->type->refCount++;
8042 }
8043 return 0x1;
8044 }
8045
8046 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8047 {
8048 unsigned char value2 = op2->uc;
8049
8050 exp->type = 2;
8051 exp->string = PrintUChar(op1->uc ^ value2);
8052 if(!exp->expType)
8053 {
8054 exp->expType = op1->type;
8055 if(op1->type)
8056 op1->type->refCount++;
8057 }
8058 return 0x1;
8059 }
8060
8061 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8062 {
8063 int value2 = op2->i;
8064
8065 exp->type = 2;
8066 exp->string = PrintInt(op1->i << value2);
8067 if(!exp->expType)
8068 {
8069 exp->expType = op1->type;
8070 if(op1->type)
8071 op1->type->refCount++;
8072 }
8073 return 0x1;
8074 }
8075
8076 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8077 {
8078 unsigned int value2 = op2->ui;
8079
8080 exp->type = 2;
8081 exp->string = PrintUInt(op1->ui << value2);
8082 if(!exp->expType)
8083 {
8084 exp->expType = op1->type;
8085 if(op1->type)
8086 op1->type->refCount++;
8087 }
8088 return 0x1;
8089 }
8090
8091 static unsigned int Int64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8092 {
8093 long long value2 = op2->i64;
8094
8095 exp->type = 2;
8096 exp->string = PrintInt64(op1->i64 << value2);
8097 if(!exp->expType)
8098 {
8099 exp->expType = op1->type;
8100 if(op1->type)
8101 op1->type->refCount++;
8102 }
8103 return 0x1;
8104 }
8105
8106 static unsigned int UInt64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8107 {
8108 uint64 value2 = op2->ui64;
8109
8110 exp->type = 2;
8111 exp->string = PrintUInt64(op1->ui64 << value2);
8112 if(!exp->expType)
8113 {
8114 exp->expType = op1->type;
8115 if(op1->type)
8116 op1->type->refCount++;
8117 }
8118 return 0x1;
8119 }
8120
8121 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8122 {
8123 short value2 = op2->s;
8124
8125 exp->type = 2;
8126 exp->string = PrintShort(op1->s << value2);
8127 if(!exp->expType)
8128 {
8129 exp->expType = op1->type;
8130 if(op1->type)
8131 op1->type->refCount++;
8132 }
8133 return 0x1;
8134 }
8135
8136 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8137 {
8138 unsigned short value2 = op2->us;
8139
8140 exp->type = 2;
8141 exp->string = PrintUShort(op1->us << value2);
8142 if(!exp->expType)
8143 {
8144 exp->expType = op1->type;
8145 if(op1->type)
8146 op1->type->refCount++;
8147 }
8148 return 0x1;
8149 }
8150
8151 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8152 {
8153 char value2 = op2->c;
8154
8155 exp->type = 2;
8156 exp->string = PrintChar(op1->c << value2);
8157 if(!exp->expType)
8158 {
8159 exp->expType = op1->type;
8160 if(op1->type)
8161 op1->type->refCount++;
8162 }
8163 return 0x1;
8164 }
8165
8166 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8167 {
8168 unsigned char value2 = op2->uc;
8169
8170 exp->type = 2;
8171 exp->string = PrintUChar(op1->uc << value2);
8172 if(!exp->expType)
8173 {
8174 exp->expType = op1->type;
8175 if(op1->type)
8176 op1->type->refCount++;
8177 }
8178 return 0x1;
8179 }
8180
8181 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8182 {
8183 int value2 = op2->i;
8184
8185 exp->type = 2;
8186 exp->string = PrintInt(op1->i >> value2);
8187 if(!exp->expType)
8188 {
8189 exp->expType = op1->type;
8190 if(op1->type)
8191 op1->type->refCount++;
8192 }
8193 return 0x1;
8194 }
8195
8196 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8197 {
8198 unsigned int value2 = op2->ui;
8199
8200 exp->type = 2;
8201 exp->string = PrintUInt(op1->ui >> value2);
8202 if(!exp->expType)
8203 {
8204 exp->expType = op1->type;
8205 if(op1->type)
8206 op1->type->refCount++;
8207 }
8208 return 0x1;
8209 }
8210
8211 static unsigned int Int64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8212 {
8213 long long value2 = op2->i64;
8214
8215 exp->type = 2;
8216 exp->string = PrintInt64(op1->i64 >> value2);
8217 if(!exp->expType)
8218 {
8219 exp->expType = op1->type;
8220 if(op1->type)
8221 op1->type->refCount++;
8222 }
8223 return 0x1;
8224 }
8225
8226 static unsigned int UInt64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8227 {
8228 uint64 value2 = op2->ui64;
8229
8230 exp->type = 2;
8231 exp->string = PrintUInt64(op1->ui64 >> value2);
8232 if(!exp->expType)
8233 {
8234 exp->expType = op1->type;
8235 if(op1->type)
8236 op1->type->refCount++;
8237 }
8238 return 0x1;
8239 }
8240
8241 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8242 {
8243 short value2 = op2->s;
8244
8245 exp->type = 2;
8246 exp->string = PrintShort(op1->s >> value2);
8247 if(!exp->expType)
8248 {
8249 exp->expType = op1->type;
8250 if(op1->type)
8251 op1->type->refCount++;
8252 }
8253 return 0x1;
8254 }
8255
8256 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8257 {
8258 unsigned short value2 = op2->us;
8259
8260 exp->type = 2;
8261 exp->string = PrintUShort(op1->us >> value2);
8262 if(!exp->expType)
8263 {
8264 exp->expType = op1->type;
8265 if(op1->type)
8266 op1->type->refCount++;
8267 }
8268 return 0x1;
8269 }
8270
8271 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8272 {
8273 char value2 = op2->c;
8274
8275 exp->type = 2;
8276 exp->string = PrintChar(op1->c >> value2);
8277 if(!exp->expType)
8278 {
8279 exp->expType = op1->type;
8280 if(op1->type)
8281 op1->type->refCount++;
8282 }
8283 return 0x1;
8284 }
8285
8286 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8287 {
8288 unsigned char value2 = op2->uc;
8289
8290 exp->type = 2;
8291 exp->string = PrintUChar(op1->uc >> value2);
8292 if(!exp->expType)
8293 {
8294 exp->expType = op1->type;
8295 if(op1->type)
8296 op1->type->refCount++;
8297 }
8298 return 0x1;
8299 }
8300
8301 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
8302 {
8303 exp->type = 2;
8304 exp->string = PrintInt((~op1->i));
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 UIntBitNot(struct Expression * exp, struct Operand * op1)
8315 {
8316 exp->type = 2;
8317 exp->string = PrintUInt((unsigned int)(~op1->ui));
8318 if(!exp->expType)
8319 {
8320 exp->expType = op1->type;
8321 if(op1->type)
8322 op1->type->refCount++;
8323 }
8324 return 0x1;
8325 }
8326
8327 static unsigned int Int64BitNot(struct Expression * exp, struct Operand * op1)
8328 {
8329 exp->type = 2;
8330 exp->string = PrintInt64((long long)(~op1->i64));
8331 if(!exp->expType)
8332 {
8333 exp->expType = op1->type;
8334 if(op1->type)
8335 op1->type->refCount++;
8336 }
8337 return 0x1;
8338 }
8339
8340 static unsigned int UInt64BitNot(struct Expression * exp, struct Operand * op1)
8341 {
8342 exp->type = 2;
8343 exp->string = PrintUInt64((uint64)(~op1->ui64));
8344 if(!exp->expType)
8345 {
8346 exp->expType = op1->type;
8347 if(op1->type)
8348 op1->type->refCount++;
8349 }
8350 return 0x1;
8351 }
8352
8353 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
8354 {
8355 exp->type = 2;
8356 exp->string = PrintShort((short)(~op1->s));
8357 if(!exp->expType)
8358 {
8359 exp->expType = op1->type;
8360 if(op1->type)
8361 op1->type->refCount++;
8362 }
8363 return 0x1;
8364 }
8365
8366 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
8367 {
8368 exp->type = 2;
8369 exp->string = PrintUShort((unsigned short)(~op1->us));
8370 if(!exp->expType)
8371 {
8372 exp->expType = op1->type;
8373 if(op1->type)
8374 op1->type->refCount++;
8375 }
8376 return 0x1;
8377 }
8378
8379 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
8380 {
8381 exp->type = 2;
8382 exp->string = PrintChar((char)(~op1->c));
8383 if(!exp->expType)
8384 {
8385 exp->expType = op1->type;
8386 if(op1->type)
8387 op1->type->refCount++;
8388 }
8389 return 0x1;
8390 }
8391
8392 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
8393 {
8394 exp->type = 2;
8395 exp->string = PrintUChar((unsigned char)(~op1->uc));
8396 if(!exp->expType)
8397 {
8398 exp->expType = op1->type;
8399 if(op1->type)
8400 op1->type->refCount++;
8401 }
8402 return 0x1;
8403 }
8404
8405 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8406 {
8407 int value2 = op2->i;
8408
8409 exp->type = 2;
8410 exp->string = PrintInt(op1->i &= value2);
8411 if(!exp->expType)
8412 {
8413 exp->expType = op1->type;
8414 if(op1->type)
8415 op1->type->refCount++;
8416 }
8417 return 0x1;
8418 }
8419
8420 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8421 {
8422 unsigned int value2 = op2->ui;
8423
8424 exp->type = 2;
8425 exp->string = PrintUInt(op1->ui &= value2);
8426 if(!exp->expType)
8427 {
8428 exp->expType = op1->type;
8429 if(op1->type)
8430 op1->type->refCount++;
8431 }
8432 return 0x1;
8433 }
8434
8435 static unsigned int Int64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8436 {
8437 long long value2 = op2->i64;
8438
8439 exp->type = 2;
8440 exp->string = PrintInt64(op1->i64 &= value2);
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 UInt64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8451 {
8452 uint64 value2 = op2->ui64;
8453
8454 exp->type = 2;
8455 exp->string = PrintUInt64(op1->ui64 &= value2);
8456 if(!exp->expType)
8457 {
8458 exp->expType = op1->type;
8459 if(op1->type)
8460 op1->type->refCount++;
8461 }
8462 return 0x1;
8463 }
8464
8465 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8466 {
8467 short value2 = op2->s;
8468
8469 exp->type = 2;
8470 exp->string = PrintShort(op1->s &= value2);
8471 if(!exp->expType)
8472 {
8473 exp->expType = op1->type;
8474 if(op1->type)
8475 op1->type->refCount++;
8476 }
8477 return 0x1;
8478 }
8479
8480 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8481 {
8482 unsigned short value2 = op2->us;
8483
8484 exp->type = 2;
8485 exp->string = PrintUShort(op1->us &= value2);
8486 if(!exp->expType)
8487 {
8488 exp->expType = op1->type;
8489 if(op1->type)
8490 op1->type->refCount++;
8491 }
8492 return 0x1;
8493 }
8494
8495 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8496 {
8497 char value2 = op2->c;
8498
8499 exp->type = 2;
8500 exp->string = PrintChar(op1->c &= value2);
8501 if(!exp->expType)
8502 {
8503 exp->expType = op1->type;
8504 if(op1->type)
8505 op1->type->refCount++;
8506 }
8507 return 0x1;
8508 }
8509
8510 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8511 {
8512 unsigned char value2 = op2->uc;
8513
8514 exp->type = 2;
8515 exp->string = PrintUChar(op1->uc &= value2);
8516 if(!exp->expType)
8517 {
8518 exp->expType = op1->type;
8519 if(op1->type)
8520 op1->type->refCount++;
8521 }
8522 return 0x1;
8523 }
8524
8525 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8526 {
8527 int value2 = op2->i;
8528
8529 exp->type = 2;
8530 exp->string = PrintInt(op1->i |= value2);
8531 if(!exp->expType)
8532 {
8533 exp->expType = op1->type;
8534 if(op1->type)
8535 op1->type->refCount++;
8536 }
8537 return 0x1;
8538 }
8539
8540 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8541 {
8542 unsigned int value2 = op2->ui;
8543
8544 exp->type = 2;
8545 exp->string = PrintUInt(op1->ui |= value2);
8546 if(!exp->expType)
8547 {
8548 exp->expType = op1->type;
8549 if(op1->type)
8550 op1->type->refCount++;
8551 }
8552 return 0x1;
8553 }
8554
8555 static unsigned int Int64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8556 {
8557 long long value2 = op2->i64;
8558
8559 exp->type = 2;
8560 exp->string = PrintInt64(op1->i64 |= value2);
8561 if(!exp->expType)
8562 {
8563 exp->expType = op1->type;
8564 if(op1->type)
8565 op1->type->refCount++;
8566 }
8567 return 0x1;
8568 }
8569
8570 static unsigned int UInt64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8571 {
8572 uint64 value2 = op2->ui64;
8573
8574 exp->type = 2;
8575 exp->string = PrintUInt64(op1->ui64 |= value2);
8576 if(!exp->expType)
8577 {
8578 exp->expType = op1->type;
8579 if(op1->type)
8580 op1->type->refCount++;
8581 }
8582 return 0x1;
8583 }
8584
8585 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8586 {
8587 short value2 = op2->s;
8588
8589 exp->type = 2;
8590 exp->string = PrintShort(op1->s |= value2);
8591 if(!exp->expType)
8592 {
8593 exp->expType = op1->type;
8594 if(op1->type)
8595 op1->type->refCount++;
8596 }
8597 return 0x1;
8598 }
8599
8600 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8601 {
8602 unsigned short value2 = op2->us;
8603
8604 exp->type = 2;
8605 exp->string = PrintUShort(op1->us |= value2);
8606 if(!exp->expType)
8607 {
8608 exp->expType = op1->type;
8609 if(op1->type)
8610 op1->type->refCount++;
8611 }
8612 return 0x1;
8613 }
8614
8615 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8616 {
8617 char value2 = op2->c;
8618
8619 exp->type = 2;
8620 exp->string = PrintChar(op1->c |= value2);
8621 if(!exp->expType)
8622 {
8623 exp->expType = op1->type;
8624 if(op1->type)
8625 op1->type->refCount++;
8626 }
8627 return 0x1;
8628 }
8629
8630 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8631 {
8632 unsigned char value2 = op2->uc;
8633
8634 exp->type = 2;
8635 exp->string = PrintUChar(op1->uc |= value2);
8636 if(!exp->expType)
8637 {
8638 exp->expType = op1->type;
8639 if(op1->type)
8640 op1->type->refCount++;
8641 }
8642 return 0x1;
8643 }
8644
8645 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8646 {
8647 int value2 = op2->i;
8648
8649 exp->type = 2;
8650 exp->string = PrintInt(op1->i ^= value2);
8651 if(!exp->expType)
8652 {
8653 exp->expType = op1->type;
8654 if(op1->type)
8655 op1->type->refCount++;
8656 }
8657 return 0x1;
8658 }
8659
8660 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8661 {
8662 unsigned int value2 = op2->ui;
8663
8664 exp->type = 2;
8665 exp->string = PrintUInt(op1->ui ^= value2);
8666 if(!exp->expType)
8667 {
8668 exp->expType = op1->type;
8669 if(op1->type)
8670 op1->type->refCount++;
8671 }
8672 return 0x1;
8673 }
8674
8675 static unsigned int Int64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8676 {
8677 long long value2 = op2->i64;
8678
8679 exp->type = 2;
8680 exp->string = PrintInt64(op1->i64 ^= value2);
8681 if(!exp->expType)
8682 {
8683 exp->expType = op1->type;
8684 if(op1->type)
8685 op1->type->refCount++;
8686 }
8687 return 0x1;
8688 }
8689
8690 static unsigned int UInt64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8691 {
8692 uint64 value2 = op2->ui64;
8693
8694 exp->type = 2;
8695 exp->string = PrintUInt64(op1->ui64 ^= value2);
8696 if(!exp->expType)
8697 {
8698 exp->expType = op1->type;
8699 if(op1->type)
8700 op1->type->refCount++;
8701 }
8702 return 0x1;
8703 }
8704
8705 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8706 {
8707 short value2 = op2->s;
8708
8709 exp->type = 2;
8710 exp->string = PrintShort(op1->s ^= value2);
8711 if(!exp->expType)
8712 {
8713 exp->expType = op1->type;
8714 if(op1->type)
8715 op1->type->refCount++;
8716 }
8717 return 0x1;
8718 }
8719
8720 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8721 {
8722 unsigned short value2 = op2->us;
8723
8724 exp->type = 2;
8725 exp->string = PrintUShort(op1->us ^= value2);
8726 if(!exp->expType)
8727 {
8728 exp->expType = op1->type;
8729 if(op1->type)
8730 op1->type->refCount++;
8731 }
8732 return 0x1;
8733 }
8734
8735 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8736 {
8737 char value2 = op2->c;
8738
8739 exp->type = 2;
8740 exp->string = PrintChar(op1->c ^= value2);
8741 if(!exp->expType)
8742 {
8743 exp->expType = op1->type;
8744 if(op1->type)
8745 op1->type->refCount++;
8746 }
8747 return 0x1;
8748 }
8749
8750 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8751 {
8752 unsigned char value2 = op2->uc;
8753
8754 exp->type = 2;
8755 exp->string = PrintUChar(op1->uc ^= value2);
8756 if(!exp->expType)
8757 {
8758 exp->expType = op1->type;
8759 if(op1->type)
8760 op1->type->refCount++;
8761 }
8762 return 0x1;
8763 }
8764
8765 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8766 {
8767 int value2 = op2->i;
8768
8769 exp->type = 2;
8770 exp->string = PrintInt(op1->i <<= value2);
8771 if(!exp->expType)
8772 {
8773 exp->expType = op1->type;
8774 if(op1->type)
8775 op1->type->refCount++;
8776 }
8777 return 0x1;
8778 }
8779
8780 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8781 {
8782 unsigned int value2 = op2->ui;
8783
8784 exp->type = 2;
8785 exp->string = PrintUInt(op1->ui <<= value2);
8786 if(!exp->expType)
8787 {
8788 exp->expType = op1->type;
8789 if(op1->type)
8790 op1->type->refCount++;
8791 }
8792 return 0x1;
8793 }
8794
8795 static unsigned int Int64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8796 {
8797 long long value2 = op2->i64;
8798
8799 exp->type = 2;
8800 exp->string = PrintInt64(op1->i64 <<= value2);
8801 if(!exp->expType)
8802 {
8803 exp->expType = op1->type;
8804 if(op1->type)
8805 op1->type->refCount++;
8806 }
8807 return 0x1;
8808 }
8809
8810 static unsigned int UInt64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8811 {
8812 uint64 value2 = op2->ui64;
8813
8814 exp->type = 2;
8815 exp->string = PrintUInt64(op1->ui64 <<= value2);
8816 if(!exp->expType)
8817 {
8818 exp->expType = op1->type;
8819 if(op1->type)
8820 op1->type->refCount++;
8821 }
8822 return 0x1;
8823 }
8824
8825 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8826 {
8827 short value2 = op2->s;
8828
8829 exp->type = 2;
8830 exp->string = PrintShort(op1->s <<= value2);
8831 if(!exp->expType)
8832 {
8833 exp->expType = op1->type;
8834 if(op1->type)
8835 op1->type->refCount++;
8836 }
8837 return 0x1;
8838 }
8839
8840 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8841 {
8842 unsigned short value2 = op2->us;
8843
8844 exp->type = 2;
8845 exp->string = PrintUShort(op1->us <<= value2);
8846 if(!exp->expType)
8847 {
8848 exp->expType = op1->type;
8849 if(op1->type)
8850 op1->type->refCount++;
8851 }
8852 return 0x1;
8853 }
8854
8855 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8856 {
8857 char value2 = op2->c;
8858
8859 exp->type = 2;
8860 exp->string = PrintChar(op1->c <<= value2);
8861 if(!exp->expType)
8862 {
8863 exp->expType = op1->type;
8864 if(op1->type)
8865 op1->type->refCount++;
8866 }
8867 return 0x1;
8868 }
8869
8870 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8871 {
8872 unsigned char value2 = op2->uc;
8873
8874 exp->type = 2;
8875 exp->string = PrintUChar(op1->uc <<= value2);
8876 if(!exp->expType)
8877 {
8878 exp->expType = op1->type;
8879 if(op1->type)
8880 op1->type->refCount++;
8881 }
8882 return 0x1;
8883 }
8884
8885 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8886 {
8887 int value2 = op2->i;
8888
8889 exp->type = 2;
8890 exp->string = PrintInt(op1->i >>= value2);
8891 if(!exp->expType)
8892 {
8893 exp->expType = op1->type;
8894 if(op1->type)
8895 op1->type->refCount++;
8896 }
8897 return 0x1;
8898 }
8899
8900 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8901 {
8902 unsigned int value2 = op2->ui;
8903
8904 exp->type = 2;
8905 exp->string = PrintUInt(op1->ui >>= value2);
8906 if(!exp->expType)
8907 {
8908 exp->expType = op1->type;
8909 if(op1->type)
8910 op1->type->refCount++;
8911 }
8912 return 0x1;
8913 }
8914
8915 static unsigned int Int64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8916 {
8917 long long value2 = op2->i64;
8918
8919 exp->type = 2;
8920 exp->string = PrintInt64(op1->i64 >>= value2);
8921 if(!exp->expType)
8922 {
8923 exp->expType = op1->type;
8924 if(op1->type)
8925 op1->type->refCount++;
8926 }
8927 return 0x1;
8928 }
8929
8930 static unsigned int UInt64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8931 {
8932 uint64 value2 = op2->ui64;
8933
8934 exp->type = 2;
8935 exp->string = PrintUInt64(op1->ui64 >>= value2);
8936 if(!exp->expType)
8937 {
8938 exp->expType = op1->type;
8939 if(op1->type)
8940 op1->type->refCount++;
8941 }
8942 return 0x1;
8943 }
8944
8945 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8946 {
8947 short value2 = op2->s;
8948
8949 exp->type = 2;
8950 exp->string = PrintShort(op1->s >>= value2);
8951 if(!exp->expType)
8952 {
8953 exp->expType = op1->type;
8954 if(op1->type)
8955 op1->type->refCount++;
8956 }
8957 return 0x1;
8958 }
8959
8960 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8961 {
8962 unsigned short value2 = op2->us;
8963
8964 exp->type = 2;
8965 exp->string = PrintUShort(op1->us >>= value2);
8966 if(!exp->expType)
8967 {
8968 exp->expType = op1->type;
8969 if(op1->type)
8970 op1->type->refCount++;
8971 }
8972 return 0x1;
8973 }
8974
8975 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8976 {
8977 char value2 = op2->c;
8978
8979 exp->type = 2;
8980 exp->string = PrintChar(op1->c >>= value2);
8981 if(!exp->expType)
8982 {
8983 exp->expType = op1->type;
8984 if(op1->type)
8985 op1->type->refCount++;
8986 }
8987 return 0x1;
8988 }
8989
8990 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8991 {
8992 unsigned char value2 = op2->uc;
8993
8994 exp->type = 2;
8995 exp->string = PrintUChar(op1->uc >>= value2);
8996 if(!exp->expType)
8997 {
8998 exp->expType = op1->type;
8999 if(op1->type)
9000 op1->type->refCount++;
9001 }
9002 return 0x1;
9003 }
9004
9005 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
9006 {
9007 exp->type = 2;
9008 exp->string = PrintInt((int)(!op1->i));
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 UIntNot(struct Expression * exp, struct Operand * op1)
9019 {
9020 exp->type = 2;
9021 exp->string = PrintUInt((unsigned int)(!op1->ui));
9022 if(!exp->expType)
9023 {
9024 exp->expType = op1->type;
9025 if(op1->type)
9026 op1->type->refCount++;
9027 }
9028 return 0x1;
9029 }
9030
9031 static unsigned int Int64Not(struct Expression * exp, struct Operand * op1)
9032 {
9033 exp->type = 2;
9034 exp->string = PrintInt64((long long)(!op1->i64));
9035 if(!exp->expType)
9036 {
9037 exp->expType = op1->type;
9038 if(op1->type)
9039 op1->type->refCount++;
9040 }
9041 return 0x1;
9042 }
9043
9044 static unsigned int UInt64Not(struct Expression * exp, struct Operand * op1)
9045 {
9046 exp->type = 2;
9047 exp->string = PrintUInt64((uint64)(!op1->ui64));
9048 if(!exp->expType)
9049 {
9050 exp->expType = op1->type;
9051 if(op1->type)
9052 op1->type->refCount++;
9053 }
9054 return 0x1;
9055 }
9056
9057 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
9058 {
9059 exp->type = 2;
9060 exp->string = PrintShort((short)(!op1->s));
9061 if(!exp->expType)
9062 {
9063 exp->expType = op1->type;
9064 if(op1->type)
9065 op1->type->refCount++;
9066 }
9067 return 0x1;
9068 }
9069
9070 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
9071 {
9072 exp->type = 2;
9073 exp->string = PrintUShort((unsigned short)(!op1->us));
9074 if(!exp->expType)
9075 {
9076 exp->expType = op1->type;
9077 if(op1->type)
9078 op1->type->refCount++;
9079 }
9080 return 0x1;
9081 }
9082
9083 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
9084 {
9085 exp->type = 2;
9086 exp->string = PrintChar((char)(!op1->c));
9087 if(!exp->expType)
9088 {
9089 exp->expType = op1->type;
9090 if(op1->type)
9091 op1->type->refCount++;
9092 }
9093 return 0x1;
9094 }
9095
9096 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
9097 {
9098 exp->type = 2;
9099 exp->string = PrintUChar((unsigned char)(!op1->uc));
9100 if(!exp->expType)
9101 {
9102 exp->expType = op1->type;
9103 if(op1->type)
9104 op1->type->refCount++;
9105 }
9106 return 0x1;
9107 }
9108
9109 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9110 {
9111 int value2 = op2->i;
9112
9113 exp->type = 2;
9114 exp->string = PrintInt(op1->i == value2);
9115 if(!exp->expType)
9116 {
9117 exp->expType = op1->type;
9118 if(op1->type)
9119 op1->type->refCount++;
9120 }
9121 return 0x1;
9122 }
9123
9124 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9125 {
9126 unsigned int value2 = op2->ui;
9127
9128 exp->type = 2;
9129 exp->string = PrintUInt(op1->ui == value2);
9130 if(!exp->expType)
9131 {
9132 exp->expType = op1->type;
9133 if(op1->type)
9134 op1->type->refCount++;
9135 }
9136 return 0x1;
9137 }
9138
9139 static unsigned int Int64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9140 {
9141 long long value2 = op2->i64;
9142
9143 exp->type = 2;
9144 exp->string = PrintInt64(op1->i64 == value2);
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 UInt64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9155 {
9156 uint64 value2 = op2->ui64;
9157
9158 exp->type = 2;
9159 exp->string = PrintUInt64(op1->ui64 == value2);
9160 if(!exp->expType)
9161 {
9162 exp->expType = op1->type;
9163 if(op1->type)
9164 op1->type->refCount++;
9165 }
9166 return 0x1;
9167 }
9168
9169 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9170 {
9171 short value2 = op2->s;
9172
9173 exp->type = 2;
9174 exp->string = PrintShort(op1->s == value2);
9175 if(!exp->expType)
9176 {
9177 exp->expType = op1->type;
9178 if(op1->type)
9179 op1->type->refCount++;
9180 }
9181 return 0x1;
9182 }
9183
9184 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9185 {
9186 unsigned short value2 = op2->us;
9187
9188 exp->type = 2;
9189 exp->string = PrintUShort(op1->us == value2);
9190 if(!exp->expType)
9191 {
9192 exp->expType = op1->type;
9193 if(op1->type)
9194 op1->type->refCount++;
9195 }
9196 return 0x1;
9197 }
9198
9199 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9200 {
9201 char value2 = op2->c;
9202
9203 exp->type = 2;
9204 exp->string = PrintChar(op1->c == value2);
9205 if(!exp->expType)
9206 {
9207 exp->expType = op1->type;
9208 if(op1->type)
9209 op1->type->refCount++;
9210 }
9211 return 0x1;
9212 }
9213
9214 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9215 {
9216 unsigned char value2 = op2->uc;
9217
9218 exp->type = 2;
9219 exp->string = PrintUChar(op1->uc == value2);
9220 if(!exp->expType)
9221 {
9222 exp->expType = op1->type;
9223 if(op1->type)
9224 op1->type->refCount++;
9225 }
9226 return 0x1;
9227 }
9228
9229 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9230 {
9231 float value2 = op2->f;
9232
9233 exp->type = 2;
9234 exp->string = PrintFloat(op1->f == value2);
9235 if(!exp->expType)
9236 {
9237 exp->expType = op1->type;
9238 if(op1->type)
9239 op1->type->refCount++;
9240 }
9241 return 0x1;
9242 }
9243
9244 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9245 {
9246 double value2 = op2->d;
9247
9248 exp->type = 2;
9249 exp->string = PrintDouble(op1->d == value2);
9250 if(!exp->expType)
9251 {
9252 exp->expType = op1->type;
9253 if(op1->type)
9254 op1->type->refCount++;
9255 }
9256 return 0x1;
9257 }
9258
9259 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9260 {
9261 int value2 = op2->i;
9262
9263 exp->type = 2;
9264 exp->string = PrintInt(op1->i != value2);
9265 if(!exp->expType)
9266 {
9267 exp->expType = op1->type;
9268 if(op1->type)
9269 op1->type->refCount++;
9270 }
9271 return 0x1;
9272 }
9273
9274 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9275 {
9276 unsigned int value2 = op2->ui;
9277
9278 exp->type = 2;
9279 exp->string = PrintUInt(op1->ui != value2);
9280 if(!exp->expType)
9281 {
9282 exp->expType = op1->type;
9283 if(op1->type)
9284 op1->type->refCount++;
9285 }
9286 return 0x1;
9287 }
9288
9289 static unsigned int Int64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9290 {
9291 long long value2 = op2->i64;
9292
9293 exp->type = 2;
9294 exp->string = PrintInt64(op1->i64 != value2);
9295 if(!exp->expType)
9296 {
9297 exp->expType = op1->type;
9298 if(op1->type)
9299 op1->type->refCount++;
9300 }
9301 return 0x1;
9302 }
9303
9304 static unsigned int UInt64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9305 {
9306 uint64 value2 = op2->ui64;
9307
9308 exp->type = 2;
9309 exp->string = PrintUInt64(op1->ui64 != value2);
9310 if(!exp->expType)
9311 {
9312 exp->expType = op1->type;
9313 if(op1->type)
9314 op1->type->refCount++;
9315 }
9316 return 0x1;
9317 }
9318
9319 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9320 {
9321 short value2 = op2->s;
9322
9323 exp->type = 2;
9324 exp->string = PrintShort(op1->s != value2);
9325 if(!exp->expType)
9326 {
9327 exp->expType = op1->type;
9328 if(op1->type)
9329 op1->type->refCount++;
9330 }
9331 return 0x1;
9332 }
9333
9334 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9335 {
9336 unsigned short value2 = op2->us;
9337
9338 exp->type = 2;
9339 exp->string = PrintUShort(op1->us != value2);
9340 if(!exp->expType)
9341 {
9342 exp->expType = op1->type;
9343 if(op1->type)
9344 op1->type->refCount++;
9345 }
9346 return 0x1;
9347 }
9348
9349 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9350 {
9351 char value2 = op2->c;
9352
9353 exp->type = 2;
9354 exp->string = PrintChar(op1->c != value2);
9355 if(!exp->expType)
9356 {
9357 exp->expType = op1->type;
9358 if(op1->type)
9359 op1->type->refCount++;
9360 }
9361 return 0x1;
9362 }
9363
9364 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9365 {
9366 unsigned char value2 = op2->uc;
9367
9368 exp->type = 2;
9369 exp->string = PrintUChar(op1->uc != value2);
9370 if(!exp->expType)
9371 {
9372 exp->expType = op1->type;
9373 if(op1->type)
9374 op1->type->refCount++;
9375 }
9376 return 0x1;
9377 }
9378
9379 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9380 {
9381 float value2 = op2->f;
9382
9383 exp->type = 2;
9384 exp->string = PrintFloat(op1->f != value2);
9385 if(!exp->expType)
9386 {
9387 exp->expType = op1->type;
9388 if(op1->type)
9389 op1->type->refCount++;
9390 }
9391 return 0x1;
9392 }
9393
9394 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9395 {
9396 double value2 = op2->d;
9397
9398 exp->type = 2;
9399 exp->string = PrintDouble(op1->d != value2);
9400 if(!exp->expType)
9401 {
9402 exp->expType = op1->type;
9403 if(op1->type)
9404 op1->type->refCount++;
9405 }
9406 return 0x1;
9407 }
9408
9409 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9410 {
9411 int value2 = op2->i;
9412
9413 exp->type = 2;
9414 exp->string = PrintInt(op1->i && value2);
9415 if(!exp->expType)
9416 {
9417 exp->expType = op1->type;
9418 if(op1->type)
9419 op1->type->refCount++;
9420 }
9421 return 0x1;
9422 }
9423
9424 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9425 {
9426 unsigned int value2 = op2->ui;
9427
9428 exp->type = 2;
9429 exp->string = PrintUInt(op1->ui && value2);
9430 if(!exp->expType)
9431 {
9432 exp->expType = op1->type;
9433 if(op1->type)
9434 op1->type->refCount++;
9435 }
9436 return 0x1;
9437 }
9438
9439 static unsigned int Int64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9440 {
9441 long long value2 = op2->i64;
9442
9443 exp->type = 2;
9444 exp->string = PrintInt64(op1->i64 && value2);
9445 if(!exp->expType)
9446 {
9447 exp->expType = op1->type;
9448 if(op1->type)
9449 op1->type->refCount++;
9450 }
9451 return 0x1;
9452 }
9453
9454 static unsigned int UInt64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9455 {
9456 uint64 value2 = op2->ui64;
9457
9458 exp->type = 2;
9459 exp->string = PrintUInt64(op1->ui64 && value2);
9460 if(!exp->expType)
9461 {
9462 exp->expType = op1->type;
9463 if(op1->type)
9464 op1->type->refCount++;
9465 }
9466 return 0x1;
9467 }
9468
9469 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9470 {
9471 short value2 = op2->s;
9472
9473 exp->type = 2;
9474 exp->string = PrintShort(op1->s && value2);
9475 if(!exp->expType)
9476 {
9477 exp->expType = op1->type;
9478 if(op1->type)
9479 op1->type->refCount++;
9480 }
9481 return 0x1;
9482 }
9483
9484 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9485 {
9486 unsigned short value2 = op2->us;
9487
9488 exp->type = 2;
9489 exp->string = PrintUShort(op1->us && value2);
9490 if(!exp->expType)
9491 {
9492 exp->expType = op1->type;
9493 if(op1->type)
9494 op1->type->refCount++;
9495 }
9496 return 0x1;
9497 }
9498
9499 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9500 {
9501 char value2 = op2->c;
9502
9503 exp->type = 2;
9504 exp->string = PrintChar(op1->c && value2);
9505 if(!exp->expType)
9506 {
9507 exp->expType = op1->type;
9508 if(op1->type)
9509 op1->type->refCount++;
9510 }
9511 return 0x1;
9512 }
9513
9514 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9515 {
9516 unsigned char value2 = op2->uc;
9517
9518 exp->type = 2;
9519 exp->string = PrintUChar(op1->uc && value2);
9520 if(!exp->expType)
9521 {
9522 exp->expType = op1->type;
9523 if(op1->type)
9524 op1->type->refCount++;
9525 }
9526 return 0x1;
9527 }
9528
9529 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9530 {
9531 float value2 = op2->f;
9532
9533 exp->type = 2;
9534 exp->string = PrintFloat(op1->f && value2);
9535 if(!exp->expType)
9536 {
9537 exp->expType = op1->type;
9538 if(op1->type)
9539 op1->type->refCount++;
9540 }
9541 return 0x1;
9542 }
9543
9544 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9545 {
9546 double value2 = op2->d;
9547
9548 exp->type = 2;
9549 exp->string = PrintDouble(op1->d && value2);
9550 if(!exp->expType)
9551 {
9552 exp->expType = op1->type;
9553 if(op1->type)
9554 op1->type->refCount++;
9555 }
9556 return 0x1;
9557 }
9558
9559 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9560 {
9561 int value2 = op2->i;
9562
9563 exp->type = 2;
9564 exp->string = PrintInt(op1->i || value2);
9565 if(!exp->expType)
9566 {
9567 exp->expType = op1->type;
9568 if(op1->type)
9569 op1->type->refCount++;
9570 }
9571 return 0x1;
9572 }
9573
9574 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9575 {
9576 unsigned int value2 = op2->ui;
9577
9578 exp->type = 2;
9579 exp->string = PrintUInt(op1->ui || value2);
9580 if(!exp->expType)
9581 {
9582 exp->expType = op1->type;
9583 if(op1->type)
9584 op1->type->refCount++;
9585 }
9586 return 0x1;
9587 }
9588
9589 static unsigned int Int64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9590 {
9591 long long value2 = op2->i64;
9592
9593 exp->type = 2;
9594 exp->string = PrintInt64(op1->i64 || value2);
9595 if(!exp->expType)
9596 {
9597 exp->expType = op1->type;
9598 if(op1->type)
9599 op1->type->refCount++;
9600 }
9601 return 0x1;
9602 }
9603
9604 static unsigned int UInt64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9605 {
9606 uint64 value2 = op2->ui64;
9607
9608 exp->type = 2;
9609 exp->string = PrintUInt64(op1->ui64 || value2);
9610 if(!exp->expType)
9611 {
9612 exp->expType = op1->type;
9613 if(op1->type)
9614 op1->type->refCount++;
9615 }
9616 return 0x1;
9617 }
9618
9619 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9620 {
9621 short value2 = op2->s;
9622
9623 exp->type = 2;
9624 exp->string = PrintShort(op1->s || value2);
9625 if(!exp->expType)
9626 {
9627 exp->expType = op1->type;
9628 if(op1->type)
9629 op1->type->refCount++;
9630 }
9631 return 0x1;
9632 }
9633
9634 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9635 {
9636 unsigned short value2 = op2->us;
9637
9638 exp->type = 2;
9639 exp->string = PrintUShort(op1->us || value2);
9640 if(!exp->expType)
9641 {
9642 exp->expType = op1->type;
9643 if(op1->type)
9644 op1->type->refCount++;
9645 }
9646 return 0x1;
9647 }
9648
9649 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9650 {
9651 char value2 = op2->c;
9652
9653 exp->type = 2;
9654 exp->string = PrintChar(op1->c || value2);
9655 if(!exp->expType)
9656 {
9657 exp->expType = op1->type;
9658 if(op1->type)
9659 op1->type->refCount++;
9660 }
9661 return 0x1;
9662 }
9663
9664 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9665 {
9666 unsigned char value2 = op2->uc;
9667
9668 exp->type = 2;
9669 exp->string = PrintUChar(op1->uc || value2);
9670 if(!exp->expType)
9671 {
9672 exp->expType = op1->type;
9673 if(op1->type)
9674 op1->type->refCount++;
9675 }
9676 return 0x1;
9677 }
9678
9679 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9680 {
9681 float value2 = op2->f;
9682
9683 exp->type = 2;
9684 exp->string = PrintFloat(op1->f || value2);
9685 if(!exp->expType)
9686 {
9687 exp->expType = op1->type;
9688 if(op1->type)
9689 op1->type->refCount++;
9690 }
9691 return 0x1;
9692 }
9693
9694 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9695 {
9696 double value2 = op2->d;
9697
9698 exp->type = 2;
9699 exp->string = PrintDouble(op1->d || value2);
9700 if(!exp->expType)
9701 {
9702 exp->expType = op1->type;
9703 if(op1->type)
9704 op1->type->refCount++;
9705 }
9706 return 0x1;
9707 }
9708
9709 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9710 {
9711 int value2 = op2->i;
9712
9713 exp->type = 2;
9714 exp->string = PrintInt(op1->i > value2);
9715 if(!exp->expType)
9716 {
9717 exp->expType = op1->type;
9718 if(op1->type)
9719 op1->type->refCount++;
9720 }
9721 return 0x1;
9722 }
9723
9724 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9725 {
9726 unsigned int value2 = op2->ui;
9727
9728 exp->type = 2;
9729 exp->string = PrintUInt(op1->ui > value2);
9730 if(!exp->expType)
9731 {
9732 exp->expType = op1->type;
9733 if(op1->type)
9734 op1->type->refCount++;
9735 }
9736 return 0x1;
9737 }
9738
9739 static unsigned int Int64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9740 {
9741 long long value2 = op2->i64;
9742
9743 exp->type = 2;
9744 exp->string = PrintInt64(op1->i64 > value2);
9745 if(!exp->expType)
9746 {
9747 exp->expType = op1->type;
9748 if(op1->type)
9749 op1->type->refCount++;
9750 }
9751 return 0x1;
9752 }
9753
9754 static unsigned int UInt64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9755 {
9756 uint64 value2 = op2->ui64;
9757
9758 exp->type = 2;
9759 exp->string = PrintUInt64(op1->ui64 > value2);
9760 if(!exp->expType)
9761 {
9762 exp->expType = op1->type;
9763 if(op1->type)
9764 op1->type->refCount++;
9765 }
9766 return 0x1;
9767 }
9768
9769 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9770 {
9771 short value2 = op2->s;
9772
9773 exp->type = 2;
9774 exp->string = PrintShort(op1->s > value2);
9775 if(!exp->expType)
9776 {
9777 exp->expType = op1->type;
9778 if(op1->type)
9779 op1->type->refCount++;
9780 }
9781 return 0x1;
9782 }
9783
9784 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9785 {
9786 unsigned short value2 = op2->us;
9787
9788 exp->type = 2;
9789 exp->string = PrintUShort(op1->us > value2);
9790 if(!exp->expType)
9791 {
9792 exp->expType = op1->type;
9793 if(op1->type)
9794 op1->type->refCount++;
9795 }
9796 return 0x1;
9797 }
9798
9799 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9800 {
9801 char value2 = op2->c;
9802
9803 exp->type = 2;
9804 exp->string = PrintChar(op1->c > value2);
9805 if(!exp->expType)
9806 {
9807 exp->expType = op1->type;
9808 if(op1->type)
9809 op1->type->refCount++;
9810 }
9811 return 0x1;
9812 }
9813
9814 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9815 {
9816 unsigned char value2 = op2->uc;
9817
9818 exp->type = 2;
9819 exp->string = PrintUChar(op1->uc > value2);
9820 if(!exp->expType)
9821 {
9822 exp->expType = op1->type;
9823 if(op1->type)
9824 op1->type->refCount++;
9825 }
9826 return 0x1;
9827 }
9828
9829 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9830 {
9831 float value2 = op2->f;
9832
9833 exp->type = 2;
9834 exp->string = PrintFloat(op1->f > value2);
9835 if(!exp->expType)
9836 {
9837 exp->expType = op1->type;
9838 if(op1->type)
9839 op1->type->refCount++;
9840 }
9841 return 0x1;
9842 }
9843
9844 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9845 {
9846 double value2 = op2->d;
9847
9848 exp->type = 2;
9849 exp->string = PrintDouble(op1->d > value2);
9850 if(!exp->expType)
9851 {
9852 exp->expType = op1->type;
9853 if(op1->type)
9854 op1->type->refCount++;
9855 }
9856 return 0x1;
9857 }
9858
9859 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9860 {
9861 int value2 = op2->i;
9862
9863 exp->type = 2;
9864 exp->string = PrintInt(op1->i < value2);
9865 if(!exp->expType)
9866 {
9867 exp->expType = op1->type;
9868 if(op1->type)
9869 op1->type->refCount++;
9870 }
9871 return 0x1;
9872 }
9873
9874 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9875 {
9876 unsigned int value2 = op2->ui;
9877
9878 exp->type = 2;
9879 exp->string = PrintUInt(op1->ui < value2);
9880 if(!exp->expType)
9881 {
9882 exp->expType = op1->type;
9883 if(op1->type)
9884 op1->type->refCount++;
9885 }
9886 return 0x1;
9887 }
9888
9889 static unsigned int Int64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9890 {
9891 long long value2 = op2->i64;
9892
9893 exp->type = 2;
9894 exp->string = PrintInt64(op1->i64 < value2);
9895 if(!exp->expType)
9896 {
9897 exp->expType = op1->type;
9898 if(op1->type)
9899 op1->type->refCount++;
9900 }
9901 return 0x1;
9902 }
9903
9904 static unsigned int UInt64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9905 {
9906 uint64 value2 = op2->ui64;
9907
9908 exp->type = 2;
9909 exp->string = PrintUInt64(op1->ui64 < value2);
9910 if(!exp->expType)
9911 {
9912 exp->expType = op1->type;
9913 if(op1->type)
9914 op1->type->refCount++;
9915 }
9916 return 0x1;
9917 }
9918
9919 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9920 {
9921 short value2 = op2->s;
9922
9923 exp->type = 2;
9924 exp->string = PrintShort(op1->s < value2);
9925 if(!exp->expType)
9926 {
9927 exp->expType = op1->type;
9928 if(op1->type)
9929 op1->type->refCount++;
9930 }
9931 return 0x1;
9932 }
9933
9934 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9935 {
9936 unsigned short value2 = op2->us;
9937
9938 exp->type = 2;
9939 exp->string = PrintUShort(op1->us < value2);
9940 if(!exp->expType)
9941 {
9942 exp->expType = op1->type;
9943 if(op1->type)
9944 op1->type->refCount++;
9945 }
9946 return 0x1;
9947 }
9948
9949 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9950 {
9951 char value2 = op2->c;
9952
9953 exp->type = 2;
9954 exp->string = PrintChar(op1->c < value2);
9955 if(!exp->expType)
9956 {
9957 exp->expType = op1->type;
9958 if(op1->type)
9959 op1->type->refCount++;
9960 }
9961 return 0x1;
9962 }
9963
9964 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9965 {
9966 unsigned char value2 = op2->uc;
9967
9968 exp->type = 2;
9969 exp->string = PrintUChar(op1->uc < value2);
9970 if(!exp->expType)
9971 {
9972 exp->expType = op1->type;
9973 if(op1->type)
9974 op1->type->refCount++;
9975 }
9976 return 0x1;
9977 }
9978
9979 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9980 {
9981 float value2 = op2->f;
9982
9983 exp->type = 2;
9984 exp->string = PrintFloat(op1->f < value2);
9985 if(!exp->expType)
9986 {
9987 exp->expType = op1->type;
9988 if(op1->type)
9989 op1->type->refCount++;
9990 }
9991 return 0x1;
9992 }
9993
9994 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9995 {
9996 double value2 = op2->d;
9997
9998 exp->type = 2;
9999 exp->string = PrintDouble(op1->d < value2);
10000 if(!exp->expType)
10001 {
10002 exp->expType = op1->type;
10003 if(op1->type)
10004 op1->type->refCount++;
10005 }
10006 return 0x1;
10007 }
10008
10009 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10010 {
10011 int value2 = op2->i;
10012
10013 exp->type = 2;
10014 exp->string = PrintInt(op1->i >= value2);
10015 if(!exp->expType)
10016 {
10017 exp->expType = op1->type;
10018 if(op1->type)
10019 op1->type->refCount++;
10020 }
10021 return 0x1;
10022 }
10023
10024 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10025 {
10026 unsigned int value2 = op2->ui;
10027
10028 exp->type = 2;
10029 exp->string = PrintUInt(op1->ui >= value2);
10030 if(!exp->expType)
10031 {
10032 exp->expType = op1->type;
10033 if(op1->type)
10034 op1->type->refCount++;
10035 }
10036 return 0x1;
10037 }
10038
10039 static unsigned int Int64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10040 {
10041 long long value2 = op2->i64;
10042
10043 exp->type = 2;
10044 exp->string = PrintInt64(op1->i64 >= value2);
10045 if(!exp->expType)
10046 {
10047 exp->expType = op1->type;
10048 if(op1->type)
10049 op1->type->refCount++;
10050 }
10051 return 0x1;
10052 }
10053
10054 static unsigned int UInt64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10055 {
10056 uint64 value2 = op2->ui64;
10057
10058 exp->type = 2;
10059 exp->string = PrintUInt64(op1->ui64 >= value2);
10060 if(!exp->expType)
10061 {
10062 exp->expType = op1->type;
10063 if(op1->type)
10064 op1->type->refCount++;
10065 }
10066 return 0x1;
10067 }
10068
10069 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10070 {
10071 short value2 = op2->s;
10072
10073 exp->type = 2;
10074 exp->string = PrintShort(op1->s >= value2);
10075 if(!exp->expType)
10076 {
10077 exp->expType = op1->type;
10078 if(op1->type)
10079 op1->type->refCount++;
10080 }
10081 return 0x1;
10082 }
10083
10084 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10085 {
10086 unsigned short value2 = op2->us;
10087
10088 exp->type = 2;
10089 exp->string = PrintUShort(op1->us >= value2);
10090 if(!exp->expType)
10091 {
10092 exp->expType = op1->type;
10093 if(op1->type)
10094 op1->type->refCount++;
10095 }
10096 return 0x1;
10097 }
10098
10099 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10100 {
10101 char value2 = op2->c;
10102
10103 exp->type = 2;
10104 exp->string = PrintChar(op1->c >= value2);
10105 if(!exp->expType)
10106 {
10107 exp->expType = op1->type;
10108 if(op1->type)
10109 op1->type->refCount++;
10110 }
10111 return 0x1;
10112 }
10113
10114 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10115 {
10116 unsigned char value2 = op2->uc;
10117
10118 exp->type = 2;
10119 exp->string = PrintUChar(op1->uc >= value2);
10120 if(!exp->expType)
10121 {
10122 exp->expType = op1->type;
10123 if(op1->type)
10124 op1->type->refCount++;
10125 }
10126 return 0x1;
10127 }
10128
10129 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10130 {
10131 float value2 = op2->f;
10132
10133 exp->type = 2;
10134 exp->string = PrintFloat(op1->f >= value2);
10135 if(!exp->expType)
10136 {
10137 exp->expType = op1->type;
10138 if(op1->type)
10139 op1->type->refCount++;
10140 }
10141 return 0x1;
10142 }
10143
10144 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10145 {
10146 double value2 = op2->d;
10147
10148 exp->type = 2;
10149 exp->string = PrintDouble(op1->d >= value2);
10150 if(!exp->expType)
10151 {
10152 exp->expType = op1->type;
10153 if(op1->type)
10154 op1->type->refCount++;
10155 }
10156 return 0x1;
10157 }
10158
10159 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10160 {
10161 int value2 = op2->i;
10162
10163 exp->type = 2;
10164 exp->string = PrintInt(op1->i <= value2);
10165 if(!exp->expType)
10166 {
10167 exp->expType = op1->type;
10168 if(op1->type)
10169 op1->type->refCount++;
10170 }
10171 return 0x1;
10172 }
10173
10174 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10175 {
10176 unsigned int value2 = op2->ui;
10177
10178 exp->type = 2;
10179 exp->string = PrintUInt(op1->ui <= value2);
10180 if(!exp->expType)
10181 {
10182 exp->expType = op1->type;
10183 if(op1->type)
10184 op1->type->refCount++;
10185 }
10186 return 0x1;
10187 }
10188
10189 static unsigned int Int64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10190 {
10191 long long value2 = op2->i64;
10192
10193 exp->type = 2;
10194 exp->string = PrintInt64(op1->i64 <= value2);
10195 if(!exp->expType)
10196 {
10197 exp->expType = op1->type;
10198 if(op1->type)
10199 op1->type->refCount++;
10200 }
10201 return 0x1;
10202 }
10203
10204 static unsigned int UInt64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10205 {
10206 uint64 value2 = op2->ui64;
10207
10208 exp->type = 2;
10209 exp->string = PrintUInt64(op1->ui64 <= value2);
10210 if(!exp->expType)
10211 {
10212 exp->expType = op1->type;
10213 if(op1->type)
10214 op1->type->refCount++;
10215 }
10216 return 0x1;
10217 }
10218
10219 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10220 {
10221 short value2 = op2->s;
10222
10223 exp->type = 2;
10224 exp->string = PrintShort(op1->s <= value2);
10225 if(!exp->expType)
10226 {
10227 exp->expType = op1->type;
10228 if(op1->type)
10229 op1->type->refCount++;
10230 }
10231 return 0x1;
10232 }
10233
10234 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10235 {
10236 unsigned short value2 = op2->us;
10237
10238 exp->type = 2;
10239 exp->string = PrintUShort(op1->us <= value2);
10240 if(!exp->expType)
10241 {
10242 exp->expType = op1->type;
10243 if(op1->type)
10244 op1->type->refCount++;
10245 }
10246 return 0x1;
10247 }
10248
10249 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10250 {
10251 char value2 = op2->c;
10252
10253 exp->type = 2;
10254 exp->string = PrintChar(op1->c <= value2);
10255 if(!exp->expType)
10256 {
10257 exp->expType = op1->type;
10258 if(op1->type)
10259 op1->type->refCount++;
10260 }
10261 return 0x1;
10262 }
10263
10264 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10265 {
10266 unsigned char value2 = op2->uc;
10267
10268 exp->type = 2;
10269 exp->string = PrintUChar(op1->uc <= value2);
10270 if(!exp->expType)
10271 {
10272 exp->expType = op1->type;
10273 if(op1->type)
10274 op1->type->refCount++;
10275 }
10276 return 0x1;
10277 }
10278
10279 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10280 {
10281 float value2 = op2->f;
10282
10283 exp->type = 2;
10284 exp->string = PrintFloat(op1->f <= value2);
10285 if(!exp->expType)
10286 {
10287 exp->expType = op1->type;
10288 if(op1->type)
10289 op1->type->refCount++;
10290 }
10291 return 0x1;
10292 }
10293
10294 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10295 {
10296 double value2 = op2->d;
10297
10298 exp->type = 2;
10299 exp->string = PrintDouble(op1->d <= value2);
10300 if(!exp->expType)
10301 {
10302 exp->expType = op1->type;
10303 if(op1->type)
10304 op1->type->refCount++;
10305 }
10306 return 0x1;
10307 }
10308
10309 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10310 {
10311 exp->type = 2;
10312 exp->string = PrintInt(op1->i ? op2->i : op3->i);
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 UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10323 {
10324 exp->type = 2;
10325 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
10326 if(!exp->expType)
10327 {
10328 exp->expType = op1->type;
10329 if(op1->type)
10330 op1->type->refCount++;
10331 }
10332 return 0x1;
10333 }
10334
10335 static unsigned int Int64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10336 {
10337 exp->type = 2;
10338 exp->string = PrintInt64(op1->i64 ? op2->i64 : op3->i64);
10339 if(!exp->expType)
10340 {
10341 exp->expType = op1->type;
10342 if(op1->type)
10343 op1->type->refCount++;
10344 }
10345 return 0x1;
10346 }
10347
10348 static unsigned int UInt64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10349 {
10350 exp->type = 2;
10351 exp->string = PrintUInt64(op1->ui64 ? op2->ui64 : op3->ui64);
10352 if(!exp->expType)
10353 {
10354 exp->expType = op1->type;
10355 if(op1->type)
10356 op1->type->refCount++;
10357 }
10358 return 0x1;
10359 }
10360
10361 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10362 {
10363 exp->type = 2;
10364 exp->string = PrintShort(op1->s ? op2->s : op3->s);
10365 if(!exp->expType)
10366 {
10367 exp->expType = op1->type;
10368 if(op1->type)
10369 op1->type->refCount++;
10370 }
10371 return 0x1;
10372 }
10373
10374 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10375 {
10376 exp->type = 2;
10377 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
10378 if(!exp->expType)
10379 {
10380 exp->expType = op1->type;
10381 if(op1->type)
10382 op1->type->refCount++;
10383 }
10384 return 0x1;
10385 }
10386
10387 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10388 {
10389 exp->type = 2;
10390 exp->string = PrintChar(op1->c ? op2->c : op3->c);
10391 if(!exp->expType)
10392 {
10393 exp->expType = op1->type;
10394 if(op1->type)
10395 op1->type->refCount++;
10396 }
10397 return 0x1;
10398 }
10399
10400 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10401 {
10402 exp->type = 2;
10403 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
10404 if(!exp->expType)
10405 {
10406 exp->expType = op1->type;
10407 if(op1->type)
10408 op1->type->refCount++;
10409 }
10410 return 0x1;
10411 }
10412
10413 static unsigned int FloatCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10414 {
10415 exp->type = 2;
10416 exp->string = PrintFloat(op1->f ? op2->f : op3->f);
10417 if(!exp->expType)
10418 {
10419 exp->expType = op1->type;
10420 if(op1->type)
10421 op1->type->refCount++;
10422 }
10423 return 0x1;
10424 }
10425
10426 static unsigned int DoubleCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10427 {
10428 exp->type = 2;
10429 exp->string = PrintDouble(op1->d ? op2->d : op3->d);
10430 if(!exp->expType)
10431 {
10432 exp->expType = op1->type;
10433 if(op1->type)
10434 op1->type->refCount++;
10435 }
10436 return 0x1;
10437 }
10438
10439 struct OpTable intOps = 
10440 {
10441 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
10442 };
10443
10444 struct OpTable uintOps = 
10445 {
10446 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
10447 };
10448
10449 struct OpTable int64Ops = 
10450 {
10451 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
10452 };
10453
10454 struct OpTable uint64Ops = 
10455 {
10456 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
10457 };
10458
10459 struct OpTable shortOps = 
10460 {
10461 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
10462 };
10463
10464 struct OpTable ushortOps = 
10465 {
10466 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
10467 };
10468
10469 struct OpTable floatOps = 
10470 {
10471 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
10472 };
10473
10474 struct OpTable doubleOps = 
10475 {
10476 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
10477 };
10478
10479 struct OpTable charOps = 
10480 {
10481 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
10482 };
10483
10484 struct OpTable ucharOps = 
10485 {
10486 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
10487 };
10488
10489 void ReadString(char * output, char * string)
10490 {
10491 int len = strlen(string);
10492 int c, d = 0;
10493 unsigned int quoted = 0x0, escaped = 0x0;
10494
10495 for(c = 0; c < len; c++)
10496 {
10497 char ch = string[c];
10498
10499 if(escaped)
10500 {
10501 switch(ch)
10502 {
10503 case 'n':
10504 output[d] = '\n';
10505 break;
10506 case 't':
10507 output[d] = '\t';
10508 break;
10509 case 'a':
10510 output[d] = '\a';
10511 break;
10512 case 'b':
10513 output[d] = '\b';
10514 break;
10515 case 'f':
10516 output[d] = '\f';
10517 break;
10518 case 'r':
10519 output[d] = '\r';
10520 break;
10521 case 'v':
10522 output[d] = '\v';
10523 break;
10524 case '\\':
10525 output[d] = '\\';
10526 break;
10527 case '\"':
10528 output[d] = '\"';
10529 break;
10530 case '\'':
10531 output[d] = '\'';
10532 break;
10533 default:
10534 output[d] = ch;
10535 }
10536 d++;
10537 escaped = 0x0;
10538 }
10539 else
10540 {
10541 if(ch == '\"')
10542 quoted ^= 0x1;
10543 else if(quoted)
10544 {
10545 if(ch == '\\')
10546 escaped = 0x1;
10547 else
10548 output[d++] = ch;
10549 }
10550 }
10551 }
10552 output[d] = '\0';
10553 }
10554
10555 int UnescapeString(char * d, char * s, int len)
10556 {
10557 int j = 0, k = 0;
10558 char ch;
10559
10560 while(j < len && (ch = s[j]))
10561 {
10562 switch(ch)
10563 {
10564 case '\\':
10565 switch((ch = s[++j]))
10566 {
10567 case 'n':
10568 d[k] = '\n';
10569 break;
10570 case 't':
10571 d[k] = '\t';
10572 break;
10573 case 'a':
10574 d[k] = '\a';
10575 break;
10576 case 'b':
10577 d[k] = '\b';
10578 break;
10579 case 'f':
10580 d[k] = '\f';
10581 break;
10582 case 'r':
10583 d[k] = '\r';
10584 break;
10585 case 'v':
10586 d[k] = '\v';
10587 break;
10588 case '\\':
10589 d[k] = '\\';
10590 break;
10591 case '\"':
10592 d[k] = '\"';
10593 break;
10594 case '\'':
10595 d[k] = '\'';
10596 break;
10597 default:
10598 d[k] = '\\';
10599 d[k] = ch;
10600 }
10601 break;
10602 default:
10603 d[k] = ch;
10604 }
10605 j++, k++;
10606 }
10607 d[k] = '\0';
10608 return k;
10609 }
10610
10611 char * OffsetEscapedString(char * s, int len, int offset)
10612 {
10613 char ch;
10614 int j = 0, k = 0;
10615
10616 while(j < len && k < offset && (ch = s[j]))
10617 {
10618 if(ch == '\\')
10619 ++j;
10620 j++, k++;
10621 }
10622 return (k == offset) ? s + j : (((void *)0));
10623 }
10624
10625 extern long long __ecereNameSpace__ecere__com___strtoi64(char *  string, char * *  endString, int base);
10626
10627 extern uint64 __ecereNameSpace__ecere__com___strtoui64(char *  string, char * *  endString, int base);
10628
10629 extern double strtod(char * , char * * );
10630
10631 struct Operand GetOperand(struct Expression * exp)
10632 {
10633 struct Operand op = 
10634 {
10635 0, 0, 0, 0, 
10636 {
10637 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10638 }
10639 };
10640 struct Type * type = exp->expType;
10641
10642 if(type)
10643 {
10644 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
10645 {
10646 if(!type->_class->registered->dataType)
10647 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
10648 type = type->_class->registered->dataType;
10649 }
10650 op.kind = type->kind;
10651 op.type = exp->expType;
10652 if(exp->type == 3 && op.kind == 13)
10653 {
10654 op.ui64 = (uint64)exp->string;
10655 op.kind = 13;
10656 op.ops = uint64Ops;
10657 }
10658 else if(exp->isConstant && exp->type == 2)
10659 {
10660 switch(op.kind)
10661 {
10662 case 24:
10663 case 1:
10664 {
10665 if(exp->constant[0] == '\'')
10666 {
10667 op.c = exp->constant[1];
10668 op.ops = charOps;
10669 }
10670 else if(type->isSigned)
10671 {
10672 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
10673 op.ops = charOps;
10674 }
10675 else
10676 {
10677 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
10678 op.ops = ucharOps;
10679 }
10680 break;
10681 }
10682 case 2:
10683 if(type->isSigned)
10684 {
10685 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
10686 op.ops = shortOps;
10687 }
10688 else
10689 {
10690 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
10691 op.ops = ushortOps;
10692 }
10693 break;
10694 case 3:
10695 case 5:
10696 if(type->isSigned)
10697 {
10698 op.i = strtol(exp->constant, (((void *)0)), 0);
10699 op.ops = intOps;
10700 }
10701 else
10702 {
10703 op.ui = strtoul(exp->constant, (((void *)0)), 0);
10704 op.ops = uintOps;
10705 }
10706 op.kind = 3;
10707 break;
10708 case 4:
10709 if(type->isSigned)
10710 {
10711 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10712 op.ops = intOps;
10713 }
10714 else
10715 {
10716 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10717 op.ops = uintOps;
10718 }
10719 op.kind = 4;
10720 break;
10721 case 22:
10722 if(type->isSigned)
10723 {
10724 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10725 op.ops = int64Ops;
10726 }
10727 else
10728 {
10729 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10730 op.ops = uint64Ops;
10731 }
10732 op.kind = 4;
10733 break;
10734 case 23:
10735 if(type->isSigned)
10736 {
10737 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10738 op.ops = int64Ops;
10739 }
10740 else
10741 {
10742 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10743 op.ops = uint64Ops;
10744 }
10745 op.kind = 4;
10746 break;
10747 case 6:
10748 op.f = (float)strtod(exp->constant, (((void *)0)));
10749 op.ops = floatOps;
10750 break;
10751 case 7:
10752 op.d = (double)strtod(exp->constant, (((void *)0)));
10753 op.ops = doubleOps;
10754 break;
10755 case 12:
10756 case 13:
10757 case 8:
10758 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10759 op.kind = 13;
10760 op.ops = uint64Ops;
10761 break;
10762 }
10763 }
10764 }
10765 return op;
10766 }
10767
10768 int __ecereVMethodID_class_OnGetString;
10769
10770 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
10771
10772 static void UnusedFunction()
10773 {
10774 int a;
10775
10776 ((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);
10777 }
10778
10779 extern int __ecereVMethodID_class_OnGetString;
10780
10781 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
10782 {
10783 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10784
10785 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
10786 {
10787 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
10788 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
10789 else
10790 {
10791 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10792 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
10793 struct Type * type;
10794 void * ptr = inst->data + dataMember->offset + offset;
10795 char * result = (((void *)0));
10796
10797 exp->loc = member->loc = inst->loc;
10798 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
10799 if(!dataMember->dataType)
10800 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
10801 type = dataMember->dataType;
10802 if(type->kind == 8)
10803 {
10804 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10805
10806 if(_class->type == 4)
10807 {
10808 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
10809
10810 if(enumClass)
10811 {
10812 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
10813 struct __ecereNameSpace__ecere__sys__NamedLink * item;
10814
10815 for(item = e->values.first; item; item = item->next)
10816 {
10817 if((int)item->data == *(int *)ptr)
10818 {
10819 result = item->name;
10820 break;
10821 }
10822 }
10823 if(result)
10824 {
10825 exp->identifier = MkIdentifier(result);
10826 exp->type = 0;
10827 exp->destType = MkClassType(_class->fullName);
10828 ProcessExpressionType(exp);
10829 }
10830 }
10831 }
10832 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
10833 {
10834 if(!_class->dataType)
10835 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10836 type = _class->dataType;
10837 }
10838 }
10839 if(!result)
10840 {
10841 switch(type->kind)
10842 {
10843 case 6:
10844 {
10845 FreeExpContents(exp);
10846 exp->constant = PrintFloat(*(float *)ptr);
10847 exp->type = 2;
10848 break;
10849 }
10850 case 7:
10851 {
10852 FreeExpContents(exp);
10853 exp->constant = PrintDouble(*(double *)ptr);
10854 exp->type = 2;
10855 break;
10856 }
10857 case 3:
10858 {
10859 FreeExpContents(exp);
10860 exp->constant = PrintInt(*(int *)ptr);
10861 exp->type = 2;
10862 break;
10863 }
10864 case 4:
10865 {
10866 FreeExpContents(exp);
10867 exp->constant = PrintInt64(*(long long *)ptr);
10868 exp->type = 2;
10869 break;
10870 }
10871 case 22:
10872 {
10873 FreeExpContents(exp);
10874 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
10875 exp->type = 2;
10876 break;
10877 }
10878 case 23:
10879 {
10880 FreeExpContents(exp);
10881 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
10882 exp->type = 2;
10883 break;
10884 }
10885 default:
10886 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
10887 }
10888 }
10889 ListAdd(memberList, member);
10890 }
10891 if(parentDataMember->type == 1)
10892 break;
10893 }
10894 }
10895
10896 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
10897
10898 void PopulateInstance(struct Instantiation * inst)
10899 {
10900 struct Symbol * classSym = inst->_class->symbol;
10901 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
10902 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10903 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
10904
10905 if(!inst->members)
10906 inst->members = MkListOne(MkMembersInitList(memberList));
10907 else
10908 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
10909 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
10910 {
10911 if(!dataMember->isProperty)
10912 {
10913 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
10914 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
10915 else
10916 {
10917 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10918 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
10919 struct Type * type;
10920 void * ptr = inst->data + dataMember->offset;
10921 char * result = (((void *)0));
10922
10923 exp->loc = member->loc = inst->loc;
10924 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
10925 if(!dataMember->dataType)
10926 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
10927 type = dataMember->dataType;
10928 if(type->kind == 8)
10929 {
10930 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10931
10932 if(_class->type == 4)
10933 {
10934 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
10935
10936 if(enumClass)
10937 {
10938 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
10939 struct __ecereNameSpace__ecere__sys__NamedLink * item;
10940
10941 for(item = e->values.first; item; item = item->next)
10942 {
10943 if((int)item->data == *(int *)ptr)
10944 {
10945 result = item->name;
10946 break;
10947 }
10948 }
10949 }
10950 if(result)
10951 {
10952 exp->identifier = MkIdentifier(result);
10953 exp->type = 0;
10954 exp->destType = MkClassType(_class->fullName);
10955 ProcessExpressionType(exp);
10956 }
10957 }
10958 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
10959 {
10960 if(!_class->dataType)
10961 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10962 type = _class->dataType;
10963 }
10964 }
10965 if(!result)
10966 {
10967 switch(type->kind)
10968 {
10969 case 6:
10970 {
10971 exp->constant = PrintFloat(*(float *)ptr);
10972 exp->type = 2;
10973 break;
10974 }
10975 case 7:
10976 {
10977 exp->constant = PrintDouble(*(double *)ptr);
10978 exp->type = 2;
10979 break;
10980 }
10981 case 3:
10982 {
10983 exp->constant = PrintInt(*(int *)ptr);
10984 exp->type = 2;
10985 break;
10986 }
10987 case 4:
10988 {
10989 exp->constant = PrintInt64(*(long long *)ptr);
10990 exp->type = 2;
10991 break;
10992 }
10993 case 22:
10994 {
10995 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
10996 exp->type = 2;
10997 break;
10998 }
10999 default:
11000 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
11001 }
11002 }
11003 ListAdd(memberList, member);
11004 }
11005 }
11006 }
11007 }
11008
11009 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);
11010
11011 extern void FreeInstance(struct Instantiation * inst);
11012
11013 void ComputeInstantiation(struct Expression * exp)
11014 {
11015 struct Instantiation * inst = exp->instance;
11016 struct MembersInit * members;
11017 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
11018 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
11019 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
11020 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
11021 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
11022 int subMemberStackPos = 0;
11023 uint64 bits = 0;
11024
11025 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11026 {
11027 if(inst->data)
11028 return ;
11029 if(_class->type == 0 || _class->type == 5)
11030 {
11031 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
11032 if(_class->type == 0)
11033 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)inst->data))->_refCount++;
11034 }
11035 else
11036 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11037 }
11038 if(inst->members)
11039 {
11040 for(members = (*inst->members).first; members; members = members->next)
11041 {
11042 switch(members->type)
11043 {
11044 case 0:
11045 {
11046 if(members->dataMembers)
11047 {
11048 struct MemberInit * member;
11049
11050 for(member = (*members->dataMembers).first; member; member = member->next)
11051 {
11052 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
11053 unsigned int found = 0x0;
11054 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11055 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
11056 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
11057 unsigned int dataMemberOffset;
11058
11059 if(!ident)
11060 {
11061 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
11062 if(curMember)
11063 {
11064 if(curMember->isProperty)
11065 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
11066 else
11067 {
11068 dataMember = curMember;
11069 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11070 if(_class->type == 0)
11071 dataMemberOffset += _class->base->structSize;
11072 }
11073 found = 0x1;
11074 }
11075 }
11076 else
11077 {
11078 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
11079 if(prop)
11080 {
11081 found = 0x1;
11082 if(prop->memberAccess == 1)
11083 {
11084 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
11085 curClass = prop->_class;
11086 }
11087 }
11088 else
11089 {
11090 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
11091 int _subMemberStackPos = 0;
11092
11093 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
11094 if(dataMember)
11095 {
11096 found = 0x1;
11097 if(dataMember->memberAccess == 1)
11098 {
11099 curMember = dataMember;
11100 curClass = dataMember->_class;
11101 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
11102 subMemberStackPos = _subMemberStackPos;
11103 }
11104 }
11105 }
11106 }
11107 if(found && member->initializer && member->initializer->type == 0)
11108 {
11109 struct Expression * value = member->initializer->exp;
11110 struct Type * type = (((void *)0));
11111 unsigned int deepMember = 0x0;
11112
11113 if(prop)
11114 {
11115 type = prop->dataType;
11116 }
11117 else if(dataMember)
11118 {
11119 if(!dataMember->dataType)
11120 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
11121 type = dataMember->dataType;
11122 }
11123 if(ident && ident->next)
11124 {
11125 deepMember = 0x1;
11126 for(ident = ident->next; ident && type; ident = ident->next)
11127 {
11128 if(type->kind == 8)
11129 {
11130 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
11131 if(prop)
11132 type = prop->dataType;
11133 else
11134 {
11135 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11136 if(dataMember)
11137 type = dataMember->dataType;
11138 }
11139 }
11140 else if(type->kind == 9 || type->kind == 10)
11141 {
11142 struct Type * memberType;
11143
11144 for(memberType = type->members.first; memberType; memberType = memberType->next)
11145 {
11146 if(!strcmp(memberType->name, ident->string))
11147 {
11148 type = memberType;
11149 break;
11150 }
11151 }
11152 }
11153 }
11154 }
11155 if(value)
11156 {
11157 FreeType(value->destType);
11158 value->destType = type;
11159 if(type)
11160 type->refCount++;
11161 ComputeExpression(value);
11162 }
11163 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11164 {
11165 if(type->kind == 8)
11166 {
11167 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11168
11169 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
11170 {
11171 if(!_class->dataType)
11172 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11173 type = _class->dataType;
11174 }
11175 }
11176 if(dataMember)
11177 {
11178 void * ptr = inst->data + dataMemberOffset;
11179
11180 if(value->type == 2)
11181 {
11182 switch(type->kind)
11183 {
11184 case 3:
11185 {
11186 GetInt(value, (int *)ptr);
11187 break;
11188 }
11189 case 4:
11190 {
11191 GetInt64(value, (long long *)ptr);
11192 break;
11193 }
11194 case 22:
11195 {
11196 GetIntPtr(value, (intptr_t *)ptr);
11197 break;
11198 }
11199 case 23:
11200 {
11201 GetIntSize(value, (ssize_t *)ptr);
11202 break;
11203 }
11204 case 6:
11205 {
11206 GetFloat(value, (float *)ptr);
11207 break;
11208 }
11209 case 7:
11210 {
11211 GetDouble(value, (double *)ptr);
11212 break;
11213 }
11214 }
11215 }
11216 else if(value->type == 1)
11217 {
11218 if(type->kind == 8)
11219 {
11220 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11221
11222 if(_class->type == 1)
11223 {
11224 ComputeTypeSize(type);
11225 if(value->instance->data)
11226 memcpy(ptr, value->instance->data, type->size);
11227 }
11228 }
11229 }
11230 }
11231 else if(prop)
11232 {
11233 if(value->type == 1 && value->instance->data)
11234 {
11235 if(type->kind == 8)
11236 {
11237 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11238
11239 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)))
11240 {
11241 void (* Set)(void *, void *) = (void *)prop->Set;
11242
11243 Set(inst->data, value->instance->data);
11244 PopulateInstance(inst);
11245 }
11246 }
11247 }
11248 else if(value->type == 2)
11249 {
11250 switch(type->kind)
11251 {
11252 case 7:
11253 {
11254 void (* Set)(void *, double) = (void *)prop->Set;
11255
11256 Set(inst->data, strtod(value->constant, (((void *)0))));
11257 break;
11258 }
11259 case 6:
11260 {
11261 void (* Set)(void *, float) = (void *)prop->Set;
11262
11263 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
11264 break;
11265 }
11266 case 3:
11267 {
11268 void (* Set)(void *, int) = (void *)prop->Set;
11269
11270 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
11271 break;
11272 }
11273 case 4:
11274 {
11275 void (* Set)(void *, long long) = (void *)prop->Set;
11276
11277 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11278 break;
11279 }
11280 case 22:
11281 {
11282 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11283
11284 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11285 break;
11286 }
11287 case 23:
11288 {
11289 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11290
11291 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11292 break;
11293 }
11294 }
11295 }
11296 else if(value->type == 3)
11297 {
11298 char temp[1024];
11299
11300 ReadString(temp, value->string);
11301 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
11302 }
11303 }
11304 }
11305 else if(!deepMember && type && _class->type == 3)
11306 {
11307 if(prop)
11308 {
11309 if(value->type == 2)
11310 {
11311 if(type->kind == 8)
11312 {
11313 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11314
11315 if(_class->type == 3)
11316 {
11317 if(!_class->dataType)
11318 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11319 type = _class->dataType;
11320 }
11321 }
11322 switch(type->kind)
11323 {
11324 case 6:
11325 {
11326 float fValue;
11327 float (* Set)(float) = (void *)prop->Set;
11328
11329 GetFloat(member->initializer->exp, &fValue);
11330 exp->constant = PrintFloat(Set(fValue));
11331 exp->type = 2;
11332 break;
11333 }
11334 case 7:
11335 {
11336 double dValue;
11337 double (* Set)(double) = (void *)prop->Set;
11338
11339 GetDouble(member->initializer->exp, &dValue);
11340 exp->constant = PrintDouble(Set(dValue));
11341 exp->type = 2;
11342 break;
11343 }
11344 }
11345 }
11346 }
11347 }
11348 else if(!deepMember && type && _class->type == 2)
11349 {
11350 if(prop)
11351 {
11352 if(value->type == 1 && value->instance->data)
11353 {
11354 unsigned int (* Set)(void *) = (void *)prop->Set;
11355
11356 bits = Set(value->instance->data);
11357 }
11358 else if(value->type == 2)
11359 {
11360 }
11361 }
11362 else if(dataMember)
11363 {
11364 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
11365 struct Type * type;
11366 int part = 0;
11367
11368 GetInt(value, &part);
11369 bits = (bits & ~bitMember->mask);
11370 if(!bitMember->dataType)
11371 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
11372 type = bitMember->dataType;
11373 if(type->kind == 8 && type->_class && type->_class->registered)
11374 {
11375 if(!type->_class->registered->dataType)
11376 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
11377 type = type->_class->registered->dataType;
11378 }
11379 switch(type->kind)
11380 {
11381 case 24:
11382 case 1:
11383 if(type->isSigned)
11384 bits |= ((char)part << bitMember->pos);
11385 else
11386 bits |= ((unsigned char)part << bitMember->pos);
11387 break;
11388 case 2:
11389 if(type->isSigned)
11390 bits |= ((short)part << bitMember->pos);
11391 else
11392 bits |= ((unsigned short)part << bitMember->pos);
11393 break;
11394 case 3:
11395 case 5:
11396 if(type->isSigned)
11397 bits |= (part << bitMember->pos);
11398 else
11399 bits |= ((unsigned int)part << bitMember->pos);
11400 break;
11401 case 4:
11402 if(type->isSigned)
11403 bits |= ((long long)part << bitMember->pos);
11404 else
11405 bits |= ((uint64)part << bitMember->pos);
11406 break;
11407 case 22:
11408 if(type->isSigned)
11409 {
11410 bits |= ((intptr_t)part << bitMember->pos);
11411 }
11412 else
11413 {
11414 bits |= ((uintptr_t)part << bitMember->pos);
11415 }
11416 break;
11417 case 23:
11418 if(type->isSigned)
11419 {
11420 bits |= ((ssize_t)part << bitMember->pos);
11421 }
11422 else
11423 {
11424 bits |= ((size_t)part << bitMember->pos);
11425 }
11426 break;
11427 }
11428 }
11429 }
11430 }
11431 else
11432 {
11433 if(_class && _class->type == 3)
11434 {
11435 ComputeExpression(member->initializer->exp);
11436 exp->constant = member->initializer->exp->constant;
11437 exp->type = 2;
11438 member->initializer->exp->constant = (((void *)0));
11439 }
11440 }
11441 }
11442 }
11443 break;
11444 }
11445 }
11446 }
11447 }
11448 if(_class && _class->type == 2)
11449 {
11450 exp->constant = PrintHexUInt(bits);
11451 exp->type = 2;
11452 }
11453 if(exp->type != 1)
11454 {
11455 FreeInstance(inst);
11456 }
11457 }
11458
11459 static unsigned int Promote(struct Operand * op, int kind, unsigned int isSigned)
11460 {
11461 unsigned int result = 0x0;
11462
11463 switch(kind)
11464 {
11465 case 2:
11466 if(op->kind == 1 || op->kind == 15 || op->kind == 24)
11467 result = isSigned ? GetOpShort(op, &op->s) : GetOpUShort(op, &op->us);
11468 break;
11469 case 3:
11470 case 5:
11471 if(op->kind == 1 || op->kind == 2 || op->kind == 15 || op->kind == 24)
11472 result = isSigned ? GetOpInt(op, &op->i) : GetOpUInt(op, &op->ui);
11473 break;
11474 case 4:
11475 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)
11476 result = isSigned ? GetOpInt64(op, &op->i64) : GetOpUInt64(op, &op->ui64);
11477 break;
11478 case 6:
11479 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)
11480 result = GetOpFloat(op, &op->f);
11481 break;
11482 case 7:
11483 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)
11484 result = GetOpDouble(op, &op->d);
11485 break;
11486 case 13:
11487 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)
11488 result = GetOpUIntPtr(op, &op->ui64);
11489 break;
11490 case 15:
11491 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)
11492 result = isSigned ? GetOpInt(op, &op->i) : GetOpUInt(op, &op->ui);
11493 break;
11494 case 22:
11495 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11496 result = isSigned ? GetOpIntPtr(op, &op->i64) : GetOpUIntPtr(op, &op->i64);
11497 break;
11498 case 23:
11499 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11500 result = isSigned ? GetOpIntSize(op, &op->ui64) : GetOpUIntSize(op, &op->ui64);
11501 break;
11502 }
11503 return result;
11504 }
11505
11506 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
11507 {
11508 if(exp->op.op == SIZEOF)
11509 {
11510 FreeExpContents(exp);
11511 exp->type = 2;
11512 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
11513 }
11514 else
11515 {
11516 if(!exp->op.exp1)
11517 {
11518 switch(exp->op.op)
11519 {
11520 case '+':
11521 {
11522 struct Expression * exp2 = exp->op.exp2;
11523
11524 exp->op.exp2 = (((void *)0));
11525 FreeExpContents(exp);
11526 FreeType(exp->expType);
11527 FreeType(exp->destType);
11528 *exp = *exp2;
11529 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
11530 break;
11531 }
11532 case '-':
11533 if(op1->ops.Neg)
11534 {
11535 FreeExpContents(exp);
11536 op1->ops.Neg(exp, op1);
11537 }
11538 break;
11539 case '~':
11540 if(op1->ops.BitNot)
11541 {
11542 FreeExpContents(exp);
11543 op1->ops.BitNot(exp, op1);
11544 }
11545 break;
11546 case '!':
11547 if(op1->ops.Not)
11548 {
11549 FreeExpContents(exp);
11550 op1->ops.Not(exp, op1);
11551 }
11552 break;
11553 }
11554 }
11555 else
11556 {
11557 if(op1 && op2 && op1->kind != op2->kind)
11558 {
11559 if(Promote(op2, op1->kind, op1->type->isSigned))
11560 op2->kind = op1->kind, op2->ops = op1->ops;
11561 else if(Promote(op1, op2->kind, op2->type->isSigned))
11562 op1->kind = op2->kind, op1->ops = op2->ops;
11563 }
11564 switch(exp->op.op)
11565 {
11566 case '+':
11567 if(op1->ops.Add)
11568 {
11569 FreeExpContents(exp);
11570 op1->ops.Add(exp, op1, op2);
11571 }
11572 break;
11573 case '-':
11574 if(op1->ops.Sub)
11575 {
11576 FreeExpContents(exp);
11577 op1->ops.Sub(exp, op1, op2);
11578 }
11579 break;
11580 case '*':
11581 if(op1->ops.Mul)
11582 {
11583 FreeExpContents(exp);
11584 op1->ops.Mul(exp, op1, op2);
11585 }
11586 break;
11587 case '/':
11588 if(op1->ops.Div)
11589 {
11590 FreeExpContents(exp);
11591 op1->ops.Div(exp, op1, op2);
11592 }
11593 break;
11594 case '%':
11595 if(op1->ops.Mod)
11596 {
11597 FreeExpContents(exp);
11598 op1->ops.Mod(exp, op1, op2);
11599 }
11600 break;
11601 case '&':
11602 if(exp->op.exp2)
11603 {
11604 if(op1->ops.BitAnd)
11605 {
11606 FreeExpContents(exp);
11607 op1->ops.BitAnd(exp, op1, op2);
11608 }
11609 }
11610 break;
11611 case '|':
11612 if(op1->ops.BitOr)
11613 {
11614 FreeExpContents(exp);
11615 op1->ops.BitOr(exp, op1, op2);
11616 }
11617 break;
11618 case '^':
11619 if(op1->ops.BitXor)
11620 {
11621 FreeExpContents(exp);
11622 op1->ops.BitXor(exp, op1, op2);
11623 }
11624 break;
11625 case LEFT_OP:
11626 if(op1->ops.LShift)
11627 {
11628 FreeExpContents(exp);
11629 op1->ops.LShift(exp, op1, op2);
11630 }
11631 break;
11632 case RIGHT_OP:
11633 if(op1->ops.RShift)
11634 {
11635 FreeExpContents(exp);
11636 op1->ops.RShift(exp, op1, op2);
11637 }
11638 break;
11639 case EQ_OP:
11640 if(op1->ops.Equ)
11641 {
11642 FreeExpContents(exp);
11643 op1->ops.Equ(exp, op1, op2);
11644 }
11645 break;
11646 case NE_OP:
11647 if(op1->ops.Nqu)
11648 {
11649 FreeExpContents(exp);
11650 op1->ops.Nqu(exp, op1, op2);
11651 }
11652 break;
11653 case AND_OP:
11654 if(op1->ops.And)
11655 {
11656 FreeExpContents(exp);
11657 op1->ops.And(exp, op1, op2);
11658 }
11659 break;
11660 case OR_OP:
11661 if(op1->ops.Or)
11662 {
11663 FreeExpContents(exp);
11664 op1->ops.Or(exp, op1, op2);
11665 }
11666 break;
11667 case '>':
11668 if(op1->ops.Grt)
11669 {
11670 FreeExpContents(exp);
11671 op1->ops.Grt(exp, op1, op2);
11672 }
11673 break;
11674 case '<':
11675 if(op1->ops.Sma)
11676 {
11677 FreeExpContents(exp);
11678 op1->ops.Sma(exp, op1, op2);
11679 }
11680 break;
11681 case GE_OP:
11682 if(op1->ops.GrtEqu)
11683 {
11684 FreeExpContents(exp);
11685 op1->ops.GrtEqu(exp, op1, op2);
11686 }
11687 break;
11688 case LE_OP:
11689 if(op1->ops.SmaEqu)
11690 {
11691 FreeExpContents(exp);
11692 op1->ops.SmaEqu(exp, op1, op2);
11693 }
11694 break;
11695 }
11696 }
11697 }
11698 }
11699
11700 void PrintTypeNoConst(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
11701
11702 extern struct Expression * MkExpIdentifier(struct Identifier * id);
11703
11704 void ComputeExpression(struct Expression * exp)
11705 {
11706 char expString[10240];
11707
11708 expString[0] = '\0';
11709 switch(exp->type)
11710 {
11711 case 1:
11712 {
11713 ComputeInstantiation(exp);
11714 break;
11715 }
11716 case 4:
11717 {
11718 struct Expression * exp1, * exp2 = (((void *)0));
11719 struct Operand op1 = 
11720 {
11721 0, 0, 0, 0, 
11722 {
11723 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11724 }
11725 };
11726 struct Operand op2 = 
11727 {
11728 0, 0, 0, 0, 
11729 {
11730 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11731 }
11732 };
11733
11734 if(exp->op.exp2)
11735 {
11736 struct Expression * e = exp->op.exp2;
11737
11738 while((e->type == 5 || e->type == 32 || e->type == 23) && e->list)
11739 {
11740 if(e->type == 5 || e->type == 32 || e->type == 23)
11741 {
11742 if(e->type == 23)
11743 e = (*((struct Statement *)(*e->compound->compound.statements).last)->expressions).last;
11744 else
11745 e = (*e->list).last;
11746 }
11747 }
11748 if(exp->op.op == 261 && e && e->expType)
11749 {
11750 if(e->type == 3 && e->string)
11751 {
11752 char * string = e->string;
11753 int len = strlen(string);
11754 char * tmp = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (len - 2 + 1));
11755
11756 len = UnescapeString(tmp, string + 1, len - 2);
11757 (__ecereNameSpace__ecere__com__eSystem_Delete(tmp), tmp = 0);
11758 FreeExpContents(exp);
11759 exp->type = 2;
11760 exp->constant = PrintUInt(len + 1);
11761 }
11762 else
11763 {
11764 struct Type * type = e->expType;
11765
11766 type->refCount++;
11767 FreeExpContents(exp);
11768 exp->type = 2;
11769 exp->constant = PrintUInt(ComputeTypeSize(type));
11770 FreeType(type);
11771 }
11772 break;
11773 }
11774 else
11775 ComputeExpression(exp->op.exp2);
11776 }
11777 if(exp->op.exp1)
11778 {
11779 ComputeExpression(exp->op.exp1);
11780 exp1 = exp->op.exp1;
11781 exp2 = exp->op.exp2;
11782 op1 = GetOperand(exp1);
11783 if(op1.type)
11784 op1.type->refCount++;
11785 if(exp2)
11786 {
11787 op2 = GetOperand(exp2);
11788 if(op2.type)
11789 op2.type->refCount++;
11790 }
11791 }
11792 else
11793 {
11794 exp1 = exp->op.exp2;
11795 op1 = GetOperand(exp1);
11796 if(op1.type)
11797 op1.type->refCount++;
11798 }
11799 CallOperator(exp, exp1, exp2, &op1, &op2);
11800 if(op1.type)
11801 FreeType(op1.type);
11802 if(op2.type)
11803 FreeType(op2.type);
11804 break;
11805 }
11806 case 5:
11807 case 32:
11808 {
11809 struct Expression * e, * n;
11810
11811 for(e = (*exp->list).first; e; e = n)
11812 {
11813 n = e->next;
11814 if(!n)
11815 {
11816 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
11817
11818 ComputeExpression(e);
11819 FreeType(exp->expType);
11820 FreeType(exp->destType);
11821 *exp = *e;
11822 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
11823 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
11824 }
11825 else
11826 {
11827 FreeExpression(e);
11828 }
11829 }
11830 break;
11831 }
11832 case 8:
11833 {
11834 struct Expression * memberExp = exp->member.exp;
11835 struct Identifier * memberID = exp->member.member;
11836 struct Type * type;
11837
11838 ComputeExpression(exp->member.exp);
11839 type = exp->member.exp->expType;
11840 if(type)
11841 {
11842 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)));
11843 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11844 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11845 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
11846
11847 if(type->kind == 19 && exp->member.exp->type == 24)
11848 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
11849 if(!_class)
11850 {
11851 char string[256];
11852 struct Symbol * classSym;
11853
11854 string[0] = '\0';
11855 PrintTypeNoConst(type, string, 0x0, 0x1);
11856 classSym = FindClass(string);
11857 _class = classSym ? classSym->registered : (((void *)0));
11858 }
11859 if(exp->member.member)
11860 {
11861 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
11862 if(!prop)
11863 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
11864 }
11865 if(!prop && !member && _class && exp->member.member)
11866 {
11867 struct Symbol * classSym = FindClass(exp->member.member->string);
11868
11869 convertTo = _class;
11870 _class = classSym ? classSym->registered : (((void *)0));
11871 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
11872 }
11873 if(prop)
11874 {
11875 if(prop->compiled)
11876 {
11877 struct Type * type = prop->dataType;
11878
11879 if(_class->type == 3)
11880 {
11881 if(type->kind == 8)
11882 {
11883 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11884
11885 if(_class->type == 3)
11886 {
11887 if(!_class->dataType)
11888 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11889 type = _class->dataType;
11890 }
11891 }
11892 switch(type->kind)
11893 {
11894 case 6:
11895 {
11896 float value;
11897 float (* Get)(float) = (void *)prop->Get;
11898
11899 GetFloat(exp->member.exp, &value);
11900 exp->constant = PrintFloat(Get ? Get(value) : value);
11901 exp->type = 2;
11902 break;
11903 }
11904 case 7:
11905 {
11906 double value;
11907 double (* Get)(double);
11908
11909 GetDouble(exp->member.exp, &value);
11910 if(convertTo)
11911 Get = (void *)prop->Set;
11912 else
11913 Get = (void *)prop->Get;
11914 exp->constant = PrintDouble(Get ? Get(value) : value);
11915 exp->type = 2;
11916 break;
11917 }
11918 }
11919 }
11920 else
11921 {
11922 if(convertTo)
11923 {
11924 struct Expression * value = exp->member.exp;
11925 struct Type * type;
11926
11927 if(!prop->dataType)
11928 ProcessPropertyType(prop);
11929 type = prop->dataType;
11930 if(!type)
11931 {
11932 }
11933 else if(_class->type == 1)
11934 {
11935 switch(type->kind)
11936 {
11937 case 8:
11938 {
11939 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
11940
11941 if(propertyClass->type == 1 && value->type == 1)
11942 {
11943 void (* Set)(void *, void *) = (void *)prop->Set;
11944
11945 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11946 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11947 exp->instance->_class = MkSpecifierName(_class->fullName);
11948 exp->instance->loc = exp->loc;
11949 exp->type = 1;
11950 Set(exp->instance->data, value->instance->data);
11951 PopulateInstance(exp->instance);
11952 }
11953 break;
11954 }
11955 case 3:
11956 {
11957 int intValue;
11958 void (* Set)(void *, int) = (void *)prop->Set;
11959
11960 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11961 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11962 exp->instance->_class = MkSpecifierName(_class->fullName);
11963 exp->instance->loc = exp->loc;
11964 exp->type = 1;
11965 GetInt(value, &intValue);
11966 Set(exp->instance->data, intValue);
11967 PopulateInstance(exp->instance);
11968 break;
11969 }
11970 case 4:
11971 {
11972 long long intValue;
11973 void (* Set)(void *, long long) = (void *)prop->Set;
11974
11975 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11976 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11977 exp->instance->_class = MkSpecifierName(_class->fullName);
11978 exp->instance->loc = exp->loc;
11979 exp->type = 1;
11980 GetInt64(value, &intValue);
11981 Set(exp->instance->data, intValue);
11982 PopulateInstance(exp->instance);
11983 break;
11984 }
11985 case 22:
11986 {
11987 intptr_t intValue;
11988 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11989
11990 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11991 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11992 exp->instance->_class = MkSpecifierName(_class->fullName);
11993 exp->instance->loc = exp->loc;
11994 exp->type = 1;
11995 GetIntPtr(value, &intValue);
11996 Set(exp->instance->data, intValue);
11997 PopulateInstance(exp->instance);
11998 break;
11999 }
12000 case 23:
12001 {
12002 ssize_t intValue;
12003 void (* Set)(void *, ssize_t) = (void *)prop->Set;
12004
12005 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12006 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12007 exp->instance->_class = MkSpecifierName(_class->fullName);
12008 exp->instance->loc = exp->loc;
12009 exp->type = 1;
12010 GetIntSize(value, &intValue);
12011 Set(exp->instance->data, intValue);
12012 PopulateInstance(exp->instance);
12013 break;
12014 }
12015 case 7:
12016 {
12017 double doubleValue;
12018 void (* Set)(void *, double) = (void *)prop->Set;
12019
12020 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12021 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12022 exp->instance->_class = MkSpecifierName(_class->fullName);
12023 exp->instance->loc = exp->loc;
12024 exp->type = 1;
12025 GetDouble(value, &doubleValue);
12026 Set(exp->instance->data, doubleValue);
12027 PopulateInstance(exp->instance);
12028 break;
12029 }
12030 }
12031 }
12032 else if(_class->type == 2)
12033 {
12034 switch(type->kind)
12035 {
12036 case 8:
12037 {
12038 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
12039
12040 if(propertyClass->type == 1 && value->instance->data)
12041 {
12042 unsigned int (* Set)(void *) = (void *)prop->Set;
12043 unsigned int bits = Set(value->instance->data);
12044
12045 exp->constant = PrintHexUInt(bits);
12046 exp->type = 2;
12047 break;
12048 }
12049 else if(_class->type == 2)
12050 {
12051 unsigned int value;
12052 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
12053 unsigned int bits;
12054
12055 GetUInt(exp->member.exp, &value);
12056 bits = Set(value);
12057 exp->constant = PrintHexUInt(bits);
12058 exp->type = 2;
12059 }
12060 }
12061 }
12062 }
12063 }
12064 else
12065 {
12066 if(_class->type == 2)
12067 {
12068 unsigned int value;
12069
12070 GetUInt(exp->member.exp, &value);
12071 switch(type->kind)
12072 {
12073 case 8:
12074 {
12075 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12076
12077 if(_class->type == 1)
12078 {
12079 void (* Get)(unsigned int, void *) = (void *)prop->Get;
12080
12081 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12082 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12083 exp->instance->_class = MkSpecifierName(_class->fullName);
12084 exp->instance->loc = exp->loc;
12085 exp->type = 1;
12086 Get(value, exp->instance->data);
12087 PopulateInstance(exp->instance);
12088 }
12089 else if(_class->type == 2)
12090 {
12091 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
12092 uint64 bits = Get(value);
12093
12094 exp->constant = PrintHexUInt64(bits);
12095 exp->type = 2;
12096 }
12097 break;
12098 }
12099 }
12100 }
12101 else if(_class->type == 1)
12102 {
12103 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
12104
12105 switch(type->kind)
12106 {
12107 case 8:
12108 {
12109 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12110
12111 if(_class->type == 1 && value)
12112 {
12113 void (* Get)(void *, void *) = (void *)prop->Get;
12114
12115 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12116 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12117 exp->instance->_class = MkSpecifierName(_class->fullName);
12118 exp->instance->loc = exp->loc;
12119 exp->type = 1;
12120 Get(value, exp->instance->data);
12121 PopulateInstance(exp->instance);
12122 }
12123 break;
12124 }
12125 }
12126 }
12127 }
12128 }
12129 }
12130 else
12131 {
12132 exp->isConstant = 0x0;
12133 }
12134 }
12135 else if(member)
12136 {
12137 }
12138 }
12139 if(exp->type != 8)
12140 {
12141 FreeExpression(memberExp);
12142 FreeIdentifier(memberID);
12143 }
12144 break;
12145 }
12146 case 10:
12147 {
12148 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
12149
12150 FreeExpContents(exp);
12151 exp->constant = PrintUInt(ComputeTypeSize(type));
12152 exp->type = 2;
12153 FreeType(type);
12154 break;
12155 }
12156 case 15:
12157 {
12158 struct Symbol * classSym = exp->_class->symbol;
12159
12160 if(classSym && classSym->registered)
12161 {
12162 if(classSym->registered->fixed)
12163 {
12164 FreeSpecifier(exp->_class);
12165 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
12166 exp->type = 2;
12167 }
12168 else
12169 {
12170 char className[1024];
12171
12172 strcpy(className, "__ecereClass_");
12173 FullClassNameCat(className, classSym->string, 0x1);
12174 MangleClassName(className);
12175 DeclareClass(classSym, className);
12176 FreeExpContents(exp);
12177 exp->type = 9;
12178 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
12179 exp->member.member = MkIdentifier("structSize");
12180 }
12181 }
12182 break;
12183 }
12184 case 11:
12185 {
12186 struct Type * type;
12187 struct Expression * e = exp;
12188
12189 if(exp->type == 11)
12190 {
12191 if(exp->cast.exp)
12192 ComputeExpression(exp->cast.exp);
12193 e = exp->cast.exp;
12194 }
12195 if(e && exp->expType)
12196 {
12197 type = exp->expType;
12198 if(type->kind == 8)
12199 {
12200 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12201
12202 if(_class && (_class->type == 3 || _class->type == 2))
12203 {
12204 if(!_class->dataType)
12205 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
12206 type = _class->dataType;
12207 }
12208 }
12209 switch(type->kind)
12210 {
12211 case 24:
12212 case 1:
12213 if(type->isSigned)
12214 {
12215 char value;
12216
12217 GetChar(e, &value);
12218 FreeExpContents(exp);
12219 exp->constant = PrintChar(value);
12220 exp->type = 2;
12221 }
12222 else
12223 {
12224 unsigned char value;
12225
12226 GetUChar(e, &value);
12227 FreeExpContents(exp);
12228 exp->constant = PrintUChar(value);
12229 exp->type = 2;
12230 }
12231 break;
12232 case 2:
12233 if(type->isSigned)
12234 {
12235 short value;
12236
12237 GetShort(e, &value);
12238 FreeExpContents(exp);
12239 exp->constant = PrintShort(value);
12240 exp->type = 2;
12241 }
12242 else
12243 {
12244 unsigned short value;
12245
12246 GetUShort(e, &value);
12247 FreeExpContents(exp);
12248 exp->constant = PrintUShort(value);
12249 exp->type = 2;
12250 }
12251 break;
12252 case 3:
12253 if(type->isSigned)
12254 {
12255 int value;
12256
12257 GetInt(e, &value);
12258 FreeExpContents(exp);
12259 exp->constant = PrintInt(value);
12260 exp->type = 2;
12261 }
12262 else
12263 {
12264 unsigned int value;
12265
12266 GetUInt(e, &value);
12267 FreeExpContents(exp);
12268 exp->constant = PrintUInt(value);
12269 exp->type = 2;
12270 }
12271 break;
12272 case 4:
12273 if(type->isSigned)
12274 {
12275 long long value;
12276
12277 GetInt64(e, &value);
12278 FreeExpContents(exp);
12279 exp->constant = PrintInt64(value);
12280 exp->type = 2;
12281 }
12282 else
12283 {
12284 uint64 value;
12285
12286 GetUInt64(e, &value);
12287 FreeExpContents(exp);
12288 exp->constant = PrintUInt64(value);
12289 exp->type = 2;
12290 }
12291 break;
12292 case 22:
12293 if(type->isSigned)
12294 {
12295 intptr_t value;
12296
12297 GetIntPtr(e, &value);
12298 FreeExpContents(exp);
12299 exp->constant = PrintInt64((long long)value);
12300 exp->type = 2;
12301 }
12302 else
12303 {
12304 uintptr_t value;
12305
12306 GetUIntPtr(e, &value);
12307 FreeExpContents(exp);
12308 exp->constant = PrintUInt64((uint64)value);
12309 exp->type = 2;
12310 }
12311 break;
12312 case 23:
12313 if(type->isSigned)
12314 {
12315 ssize_t value;
12316
12317 GetIntSize(e, &value);
12318 FreeExpContents(exp);
12319 exp->constant = PrintInt64((long long)value);
12320 exp->type = 2;
12321 }
12322 else
12323 {
12324 size_t value;
12325
12326 GetUIntSize(e, &value);
12327 FreeExpContents(exp);
12328 exp->constant = PrintUInt64((uint64)value);
12329 exp->type = 2;
12330 }
12331 break;
12332 case 6:
12333 {
12334 float value;
12335
12336 GetFloat(e, &value);
12337 FreeExpContents(exp);
12338 exp->constant = PrintFloat(value);
12339 exp->type = 2;
12340 break;
12341 }
12342 case 7:
12343 {
12344 double value;
12345
12346 GetDouble(e, &value);
12347 FreeExpContents(exp);
12348 exp->constant = PrintDouble(value);
12349 exp->type = 2;
12350 break;
12351 }
12352 }
12353 }
12354 break;
12355 }
12356 case 12:
12357 {
12358 struct Operand op1 = 
12359 {
12360 0, 0, 0, 0, 
12361 {
12362 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12363 }
12364 };
12365 struct Operand op2 = 
12366 {
12367 0, 0, 0, 0, 
12368 {
12369 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12370 }
12371 };
12372 struct Operand op3 = 
12373 {
12374 0, 0, 0, 0, 
12375 {
12376 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12377 }
12378 };
12379
12380 if(exp->cond.exp)
12381 ComputeExpression((*exp->cond.exp).last);
12382 if(exp->cond.elseExp)
12383 ComputeExpression(exp->cond.elseExp);
12384 if(exp->cond.cond)
12385 ComputeExpression(exp->cond.cond);
12386 op1 = GetOperand(exp->cond.cond);
12387 if(op1.type)
12388 op1.type->refCount++;
12389 op2 = GetOperand((*exp->cond.exp).last);
12390 if(op2.type)
12391 op2.type->refCount++;
12392 op3 = GetOperand(exp->cond.elseExp);
12393 if(op3.type)
12394 op3.type->refCount++;
12395 if(op1.ops.Cond)
12396 {
12397 FreeExpContents(exp);
12398 op1.ops.Cond(exp, &op1, &op2, &op3);
12399 }
12400 if(op1.type)
12401 FreeType(op1.type);
12402 if(op2.type)
12403 FreeType(op2.type);
12404 if(op3.type)
12405 FreeType(op3.type);
12406 break;
12407 }
12408 }
12409 }
12410
12411 void ApplyAnyObjectLogic(struct Expression * e);
12412
12413 extern void CopyTypeInto(struct Type * type, struct Type * src);
12414
12415 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
12416 {
12417 unsigned int result = 0x1;
12418
12419 if(destType)
12420 {
12421 struct __ecereNameSpace__ecere__sys__OldList converts = 
12422 {
12423 0, 0, 0, 0, 0
12424 };
12425 struct Conversion * convert;
12426
12427 if(destType->kind == 0)
12428 return 0x0;
12429 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
12430 result = 0x0;
12431 if(converts.count)
12432 {
12433 for(convert = converts.first; convert; convert = convert->next)
12434 {
12435 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
12436
12437 if(!empty)
12438 {
12439 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12440 int objectType = exp->expType ? exp->expType->classObjectType : 0;
12441
12442 *newExp = *exp;
12443 newExp->destType = (((void *)0));
12444 if(convert->isGet)
12445 {
12446 exp->type = 8;
12447 exp->addedThis = 0x1;
12448 exp->member.exp = newExp;
12449 FreeType(exp->member.exp->expType);
12450 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
12451 exp->member.exp->expType->classObjectType = objectType;
12452 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
12453 exp->member.memberType = 1;
12454 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12455 exp->needCast = 0x1;
12456 if(exp->expType)
12457 exp->expType->refCount++;
12458 ApplyAnyObjectLogic(exp->member.exp);
12459 }
12460 else
12461 {
12462 {
12463 exp->type = 8;
12464 exp->addedThis = 0x1;
12465 exp->member.exp = newExp;
12466 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
12467 {
12468 newExp->byReference = 0x1;
12469 }
12470 FreeType(exp->member.exp->expType);
12471 exp->member.exp->expType = (((void *)0));
12472 if(convert->convert->dataType)
12473 {
12474 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12475 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
12476 exp->member.exp->expType->refCount = 1;
12477 exp->member.exp->expType->classObjectType = objectType;
12478 ApplyAnyObjectLogic(exp->member.exp);
12479 }
12480 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
12481 exp->member.memberType = 4;
12482 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12483 exp->needCast = 0x1;
12484 if(convert->resultType)
12485 convert->resultType->refCount++;
12486 }
12487 }
12488 }
12489 else
12490 {
12491 FreeType(exp->expType);
12492 if(convert->isGet)
12493 {
12494 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12495 exp->needCast = 0x1;
12496 if(exp->expType)
12497 exp->expType->refCount++;
12498 }
12499 else
12500 {
12501 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12502 exp->needCast = 0x1;
12503 if(convert->resultType)
12504 convert->resultType->refCount++;
12505 }
12506 }
12507 }
12508 if(exp->isConstant && inCompiler)
12509 ComputeExpression(exp);
12510 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
12511 }
12512 if(!result && exp->expType && converts.count)
12513 {
12514 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
12515 }
12516 if(!result && exp->expType && exp->destType)
12517 {
12518 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))
12519 result = 0x1;
12520 }
12521 }
12522 return result;
12523 }
12524
12525 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
12526
12527 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
12528
12529 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
12530
12531 void CheckTemplateTypes(struct Expression * exp)
12532 {
12533 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
12534 {
12535 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12536 struct Statement * compound;
12537 struct Context * context;
12538
12539 *newExp = *exp;
12540 if(exp->destType)
12541 exp->destType->refCount++;
12542 if(exp->expType)
12543 exp->expType->refCount++;
12544 newExp->prev = (((void *)0));
12545 newExp->next = (((void *)0));
12546 switch(exp->expType->kind)
12547 {
12548 case 7:
12549 if(exp->destType->classObjectType)
12550 {
12551 if(exp->destType)
12552 exp->destType->refCount--;
12553 if(exp->expType)
12554 exp->expType->refCount--;
12555 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12556 }
12557 else
12558 {
12559 struct __ecereNameSpace__ecere__sys__OldList * specs;
12560 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12561 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12562
12563 context = PushContext();
12564 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12565 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12566 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12567 exp->type = 23;
12568 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12569 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
12570 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
12571 exp->compound->compound.context = context;
12572 PopContext(context);
12573 }
12574 break;
12575 default:
12576 exp->type = 11;
12577 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
12578 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12579 break;
12580 }
12581 }
12582 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
12583 {
12584 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12585 struct Statement * compound;
12586 struct Context * context;
12587
12588 *newExp = *exp;
12589 if(exp->destType)
12590 exp->destType->refCount++;
12591 if(exp->expType)
12592 exp->expType->refCount++;
12593 newExp->prev = (((void *)0));
12594 newExp->next = (((void *)0));
12595 switch(exp->expType->kind)
12596 {
12597 case 7:
12598 if(exp->destType->classObjectType)
12599 {
12600 if(exp->destType)
12601 exp->destType->refCount--;
12602 if(exp->expType)
12603 exp->expType->refCount--;
12604 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12605 }
12606 else
12607 {
12608 struct __ecereNameSpace__ecere__sys__OldList * specs;
12609 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12610 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12611
12612 context = PushContext();
12613 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12614 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12615 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12616 exp->type = 23;
12617 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12618 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
12619 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
12620 exp->compound->compound.context = context;
12621 PopContext(context);
12622 }
12623 break;
12624 case 8:
12625 {
12626 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
12627 {
12628 exp->type = 5;
12629 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
12630 ProcessExpressionType((*exp->list).first);
12631 break;
12632 }
12633 else
12634 {
12635 exp->type = 5;
12636 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
12637 newExp->needCast = 0x1;
12638 ProcessExpressionType((*exp->list).first);
12639 break;
12640 }
12641 }
12642 default:
12643 {
12644 if(exp->expType->kind == 20)
12645 {
12646 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
12647
12648 if(type)
12649 {
12650 FreeType(exp->destType);
12651 FreeType(exp->expType);
12652 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12653 break;
12654 }
12655 }
12656 if(newExp->type == 8 && newExp->member.memberType == 3)
12657 {
12658 exp->type = 4;
12659 exp->op.op = '*';
12660 exp->op.exp1 = (((void *)0));
12661 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
12662 }
12663 else
12664 {
12665 char typeString[1024];
12666 struct Declarator * decl;
12667 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12668
12669 typeString[0] = '\0';
12670 PrintType(exp->expType, typeString, 0x0, 0x0);
12671 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12672 exp->type = 11;
12673 exp->cast.typeName = MkTypeName(specs, decl);
12674 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12675 exp->cast.exp->needCast = 0x1;
12676 }
12677 break;
12678 }
12679 }
12680 }
12681 }
12682
12683 extern int strncmp(const char * , const char * , size_t n);
12684
12685 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char *  key);
12686
12687 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
12688 {
12689 int nsLen = strlen(nameSpace);
12690 struct Symbol * symbol;
12691
12692 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)))
12693 {
12694 char * s = symbol->string;
12695
12696 if(!strncmp(s, nameSpace, nsLen))
12697 {
12698 int c;
12699 char * namePart;
12700
12701 for(c = strlen(s) - 1; c >= 0; c--)
12702 if(s[c] == ':')
12703 break;
12704 namePart = s + c + 1;
12705 if(!strcmp(namePart, name))
12706 {
12707 return symbol;
12708 }
12709 }
12710 else
12711 break;
12712 }
12713 return (((void *)0));
12714 }
12715
12716 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
12717 {
12718 int c;
12719 char nameSpace[1024];
12720 char * namePart;
12721 unsigned int gotColon = 0x0;
12722
12723 nameSpace[0] = '\0';
12724 for(c = strlen(name) - 1; c >= 0; c--)
12725 if(name[c] == ':')
12726 {
12727 gotColon = 0x1;
12728 break;
12729 }
12730 namePart = name + c + 1;
12731 while(c >= 0 && name[c] == ':')
12732 c--;
12733 if(c >= 0)
12734 {
12735 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
12736
12737 if(symbol)
12738 return symbol;
12739 memcpy(nameSpace, name, c + 1);
12740 nameSpace[c + 1] = (char)0;
12741 return ScanWithNameSpace(tree, nameSpace, namePart);
12742 }
12743 else if(gotColon)
12744 {
12745 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12746
12747 return symbol;
12748 }
12749 else
12750 {
12751 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12752
12753 if(symbol)
12754 return symbol;
12755 return ScanWithNameSpace(tree, "", namePart);
12756 }
12757 return (((void *)0));
12758 }
12759
12760 static void ProcessDeclaration(struct Declaration * decl);
12761
12762 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
12763 {
12764 struct Context * ctx;
12765 struct Symbol * symbol = (((void *)0));
12766
12767 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
12768 {
12769 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
12770 {
12771 symbol = (((void *)0));
12772 if(thisNameSpace)
12773 {
12774 char curName[1024];
12775
12776 strcpy(curName, thisNameSpace);
12777 strcat(curName, "::");
12778 strcat(curName, name);
12779 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
12780 }
12781 if(!symbol)
12782 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
12783 }
12784 else
12785 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
12786 if(symbol || ctx == endContext)
12787 break;
12788 }
12789 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
12790 {
12791 if(symbol->pointerExternal->type == 0)
12792 {
12793 struct FunctionDefinition * function = symbol->pointerExternal->function;
12794 struct Context * tmpContext = curContext;
12795
12796 curContext = (((void *)0));
12797 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
12798 curContext = tmpContext;
12799 symbol->pointerExternal->symbol = symbol;
12800 DeclareType(symbol->type, 0x1, 0x1);
12801 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
12802 symbol->id = curExternal->symbol->idCode;
12803 }
12804 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
12805 {
12806 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
12807 symbol->id = curExternal->symbol->idCode;
12808 }
12809 }
12810 return symbol;
12811 }
12812
12813 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
12814 {
12815 if(!type->isSigned && type->kind != 22 && type->kind != 23)
12816 ListAdd(specs, MkSpecifier(UNSIGNED));
12817 switch(type->kind)
12818 {
12819 case 8:
12820 {
12821 if(type->_class->registered)
12822 {
12823 if(!type->_class->registered->dataType)
12824 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
12825 GetTypeSpecs(type->_class->registered->dataType, specs);
12826 }
12827 break;
12828 }
12829 case 7:
12830 ListAdd(specs, MkSpecifier(DOUBLE));
12831 break;
12832 case 6:
12833 ListAdd(specs, MkSpecifier(FLOAT));
12834 break;
12835 case 1:
12836 ListAdd(specs, MkSpecifier(CHAR));
12837 break;
12838 case 24:
12839 ListAdd(specs, MkSpecifier(_BOOL));
12840 break;
12841 case 2:
12842 ListAdd(specs, MkSpecifier(SHORT));
12843 break;
12844 case 4:
12845 ListAdd(specs, MkSpecifier(INT64));
12846 break;
12847 case 22:
12848 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
12849 break;
12850 case 23:
12851 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
12852 break;
12853 case 3:
12854 default:
12855 ListAdd(specs, MkSpecifier(INT));
12856 break;
12857 }
12858 }
12859
12860 static void PrintArraySize(struct Type * arrayType, char * string)
12861 {
12862 char size[256];
12863
12864 size[0] = '\0';
12865 strcat(size, "[");
12866 if(arrayType->enumClass)
12867 strcat(size, arrayType->enumClass->string);
12868 else if(arrayType->arraySizeExp)
12869 PrintExpression(arrayType->arraySizeExp, size);
12870 strcat(size, "]");
12871 strcat(string, size);
12872 }
12873
12874 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
12875 {
12876 if(type)
12877 {
12878 if(printConst && type->constant)
12879 strcat(string, "const ");
12880 switch(type->kind)
12881 {
12882 case 8:
12883 {
12884 struct Symbol * c = type->_class;
12885
12886 if(type->classObjectType == 2)
12887 strcat(string, "typed_object");
12888 else if(type->classObjectType == 3)
12889 strcat(string, "any_object");
12890 else
12891 {
12892 if(c && c->string)
12893 strcat(string, (fullName || !c->registered) ? c->string : c->registered->name);
12894 }
12895 if(type->byReference)
12896 strcat(string, " &");
12897 break;
12898 }
12899 case 0:
12900 strcat(string, "void");
12901 break;
12902 case 3:
12903 strcat(string, type->isSigned ? "int" : "uint");
12904 break;
12905 case 4:
12906 strcat(string, type->isSigned ? "int64" : "uint64");
12907 break;
12908 case 22:
12909 strcat(string, type->isSigned ? "intptr" : "uintptr");
12910 break;
12911 case 23:
12912 strcat(string, type->isSigned ? "intsize" : "uintsize");
12913 break;
12914 case 1:
12915 strcat(string, type->isSigned ? "char" : "byte");
12916 break;
12917 case 24:
12918 strcat(string, "_Bool");
12919 break;
12920 case 2:
12921 strcat(string, type->isSigned ? "short" : "uint16");
12922 break;
12923 case 6:
12924 strcat(string, "float");
12925 break;
12926 case 7:
12927 strcat(string, "double");
12928 break;
12929 case 9:
12930 if(type->enumName)
12931 {
12932 strcat(string, "struct ");
12933 strcat(string, type->enumName);
12934 }
12935 else if(type->typeName)
12936 strcat(string, type->typeName);
12937 else
12938 {
12939 struct Type * member;
12940
12941 strcat(string, "struct { ");
12942 for(member = type->members.first; member; member = member->next)
12943 {
12944 PrintType(member, string, 0x1, fullName);
12945 strcat(string, "; ");
12946 }
12947 strcat(string, "}");
12948 }
12949 break;
12950 case 10:
12951 if(type->enumName)
12952 {
12953 strcat(string, "union ");
12954 strcat(string, type->enumName);
12955 }
12956 else if(type->typeName)
12957 strcat(string, type->typeName);
12958 else
12959 {
12960 strcat(string, "union ");
12961 strcat(string, "(unnamed)");
12962 }
12963 break;
12964 case 15:
12965 if(type->enumName)
12966 {
12967 strcat(string, "enum ");
12968 strcat(string, type->enumName);
12969 }
12970 else if(type->typeName)
12971 strcat(string, type->typeName);
12972 else
12973 strcat(string, "int");
12974 break;
12975 case 14:
12976 strcat(string, "...");
12977 break;
12978 case 19:
12979 strcat(string, "subclass(");
12980 strcat(string, type->_class ? type->_class->string : "int");
12981 strcat(string, ")");
12982 break;
12983 case 20:
12984 strcat(string, type->templateParameter->identifier->string);
12985 break;
12986 case 21:
12987 strcat(string, "thisclass");
12988 break;
12989 case 17:
12990 strcat(string, "__builtin_va_list");
12991 break;
12992 }
12993 }
12994 }
12995
12996 extern char *  __ecereNameSpace__ecere__sys__RSearchString(char *  buffer, char *  subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
12997
12998 static void PrintName(struct Type * type, char * string, unsigned int fullName)
12999 {
13000 if(type->name && type->name[0])
13001 {
13002 if(fullName)
13003 strcat(string, type->name);
13004 else
13005 {
13006 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
13007
13008 if(name)
13009 name += 2;
13010 else
13011 name = type->name;
13012 strcat(string, name);
13013 }
13014 }
13015 }
13016
13017 static void PrintAttribs(struct Type * type, char * string)
13018 {
13019 if(type)
13020 {
13021 if(type->dllExport)
13022 strcat(string, "dllexport ");
13023 if(type->attrStdcall)
13024 strcat(string, "stdcall ");
13025 }
13026 }
13027
13028 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
13029 {
13030 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13031 {
13032 struct Type * attrType = (((void *)0));
13033
13034 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
13035 PrintAttribs(type, string);
13036 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
13037 strcat(string, " const");
13038 PrePrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName, type, printConst);
13039 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
13040 strcat(string, " (");
13041 if(type->kind == 13)
13042 {
13043 if(type->type->kind == 11 || type->type->kind == 16)
13044 PrintAttribs(type->type, string);
13045 }
13046 if(type->kind == 13)
13047 {
13048 if(type->type->kind == 11 || type->type->kind == 16 || type->type->kind == 12)
13049 strcat(string, "*");
13050 else
13051 strcat(string, " *");
13052 }
13053 if(printConst && type->constant && type->kind == 13)
13054 strcat(string, " const");
13055 }
13056 else
13057 PrintTypeSpecs(type, string, fullName, printConst);
13058 }
13059
13060 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
13061 {
13062 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
13063 strcat(string, ")");
13064 if(type->kind == 12)
13065 PrintArraySize(type, string);
13066 else if(type->kind == 11)
13067 {
13068 struct Type * param;
13069
13070 strcat(string, "(");
13071 for(param = type->params.first; param; param = param->next)
13072 {
13073 PrintType(param, string, 0x1, fullName);
13074 if(param->next)
13075 strcat(string, ", ");
13076 }
13077 strcat(string, ")");
13078 }
13079 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13080 PostPrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName);
13081 }
13082
13083 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
13084 {
13085 PrePrintType(type, string, fullName, (((void *)0)), printConst);
13086 if(type->thisClass || (printName && type->name && type->name[0]))
13087 strcat(string, " ");
13088 if((type->thisClass || type->staticMethod))
13089 {
13090 struct Symbol * _class = type->thisClass;
13091
13092 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
13093 {
13094 if(type->classObjectType == 1)
13095 strcat(string, "class");
13096 else
13097 strcat(string, type->byReference ? "typed_object&" : "typed_object");
13098 }
13099 else if(_class && _class->string)
13100 {
13101 char * s = _class->string;
13102
13103 if(fullName)
13104 strcat(string, s);
13105 else
13106 {
13107 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 0x1, 0x0);
13108
13109 if(name)
13110 name += 2;
13111 else
13112 name = s;
13113 strcat(string, name);
13114 }
13115 }
13116 strcat(string, "::");
13117 }
13118 if(printName && type->name)
13119 PrintName(type, string, fullName);
13120 PostPrintType(type, string, fullName);
13121 if(type->bitFieldCount)
13122 {
13123 char count[100];
13124
13125 sprintf(count, ":%d", type->bitFieldCount);
13126 strcat(string, count);
13127 }
13128 }
13129
13130 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13131 {
13132 _PrintType(type, string, printName, fullName, 0x1);
13133 }
13134
13135 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13136 {
13137 _PrintType(type, string, printName, fullName, 0x0);
13138 }
13139
13140 static struct Type * FindMember(struct Type * type, char * string)
13141 {
13142 struct Type * memberType;
13143
13144 for(memberType = type->members.first; memberType; memberType = memberType->next)
13145 {
13146 if(!memberType->name)
13147 {
13148 struct Type * subType = FindMember(memberType, string);
13149
13150 if(subType)
13151 return subType;
13152 }
13153 else if(!strcmp(memberType->name, string))
13154 return memberType;
13155 }
13156 return (((void *)0));
13157 }
13158
13159 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
13160 {
13161 struct Type * memberType;
13162
13163 for(memberType = type->members.first; memberType; memberType = memberType->next)
13164 {
13165 if(!memberType->name)
13166 {
13167 struct Type * subType = FindMember(memberType, string);
13168
13169 if(subType)
13170 {
13171 *offset += memberType->offset;
13172 return subType;
13173 }
13174 }
13175 else if(!strcmp(memberType->name, string))
13176 {
13177 *offset += memberType->offset;
13178 return memberType;
13179 }
13180 }
13181 return (((void *)0));
13182 }
13183
13184 extern unsigned int parseError;
13185
13186 unsigned int GetParseError()
13187 {
13188 return parseError;
13189 }
13190
13191 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
13192
13193 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
13194
13195 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
13196
13197 struct Expression * ParseExpressionString(char * expression)
13198 {
13199 parseError = 0x0;
13200 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13201 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__extension__ ({
13202 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13203
13204 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13205 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
13206 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13207 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13208
13209 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13210 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13211 echoOn = 0x0;
13212 parsedExpression = (((void *)0));
13213 resetScanner();
13214 expression_yyparse();
13215 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13216 return parsedExpression;
13217 }
13218
13219 extern char *  QMkString(char *  source);
13220
13221 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
13222 {
13223 struct Identifier * id = exp->identifier;
13224 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13225 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13226 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13227 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13228
13229 if(_class && _class->type == 4)
13230 {
13231 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
13232 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
13233
13234 if(enumClass)
13235 {
13236 struct __ecereNameSpace__ecere__com__Class * baseClass;
13237
13238 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
13239 {
13240 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
13241
13242 for(value = e->values.first; value; value = value->next)
13243 {
13244 if(!strcmp(value->name, id->string))
13245 break;
13246 }
13247 if(value)
13248 {
13249 char constant[256];
13250
13251 FreeExpContents(exp);
13252 exp->type = 2;
13253 exp->isConstant = 0x1;
13254 if(!strcmp(baseClass->dataTypeString, "int"))
13255 sprintf(constant, "%d", (int)value->data);
13256 else
13257 sprintf(constant, "0x%X", (int)value->data);
13258 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13259 exp->expType = MkClassType(baseClass->fullName);
13260 break;
13261 }
13262 }
13263 }
13264 if(value)
13265 return 0x1;
13266 }
13267 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
13268 {
13269 ProcessMethodType(method);
13270 exp->expType = __extension__ ({
13271 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13272
13273 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1->methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
13274 });
13275 return 0x1;
13276 }
13277 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
13278 {
13279 if(!prop->dataType)
13280 ProcessPropertyType(prop);
13281 exp->expType = prop->dataType;
13282 if(prop->dataType)
13283 prop->dataType->refCount++;
13284 return 0x1;
13285 }
13286 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
13287 {
13288 if(!member->dataType)
13289 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13290 exp->expType = member->dataType;
13291 if(member->dataType)
13292 member->dataType->refCount++;
13293 return 0x1;
13294 }
13295 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
13296 {
13297 if(!classProp->dataType)
13298 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
13299 if(classProp->constant)
13300 {
13301 FreeExpContents(exp);
13302 exp->isConstant = 0x1;
13303 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
13304 {
13305 exp->type = 3;
13306 exp->constant = QMkString((char *)classProp->Get(_class));
13307 }
13308 else
13309 {
13310 char constant[256];
13311
13312 exp->type = 2;
13313 sprintf(constant, "%d", (int)classProp->Get(_class));
13314 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13315 }
13316 }
13317 else
13318 {
13319 }
13320 exp->expType = classProp->dataType;
13321 if(classProp->dataType)
13322 classProp->dataType->refCount++;
13323 return 0x1;
13324 }
13325 return 0x0;
13326 }
13327
13328 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
13329 {
13330 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
13331 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
13332 struct __ecereNameSpace__ecere__com__NameSpace * child;
13333
13334 if(!data)
13335 {
13336 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)))
13337 {
13338 data = ScanGlobalData(child, name);
13339 if(data)
13340 break;
13341 }
13342 }
13343 return data;
13344 }
13345
13346 extern struct __ecereNameSpace__ecere__com__NameSpace *  globalData;
13347
13348 extern char *  strncpy(char * , const char * , size_t n);
13349
13350 static struct GlobalData * FindGlobalData(char * name)
13351 {
13352 int start = 0, c;
13353 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13354
13355 nameSpace = globalData;
13356 for(c = 0; name[c]; c++)
13357 {
13358 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
13359 {
13360 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
13361 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
13362
13363 strncpy(spaceName, name + start, c - start);
13364 spaceName[c - start] = '\0';
13365 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
13366 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
13367 if(!newSpace)
13368 return (((void *)0));
13369 nameSpace = newSpace;
13370 if(name[c] == ':')
13371 c++;
13372 start = c + 1;
13373 }
13374 }
13375 if(c - start)
13376 {
13377 return ScanGlobalData(nameSpace, name + start);
13378 }
13379 return (((void *)0));
13380 }
13381
13382 static int definedExpStackPos;
13383
13384 static void * definedExpStack[512];
13385
13386 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
13387 {
13388 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
13389
13390 FreeExpContents(checkedExp);
13391 FreeType(checkedExp->expType);
13392 FreeType(checkedExp->destType);
13393 *checkedExp = *newExp;
13394 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13395 checkedExp->prev = prev;
13396 checkedExp->next = next;
13397 }
13398
13399 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
13400
13401 extern int printf(char * , ...);
13402
13403 void __ecereMethod_Expression_Clear();
13404
13405 void ApplyAnyObjectLogic(struct Expression * e)
13406 {
13407 struct Type * destType = e->destType;
13408
13409 if(destType && (destType->classObjectType == 3))
13410 {
13411 if(e && e->expType)
13412 {
13413 struct Type * type = e->expType;
13414 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
13415
13416 if(type->kind == 8 && type->_class && type->_class->registered)
13417 {
13418 _class = type->_class->registered;
13419 }
13420 else if(type->kind == 19)
13421 {
13422 _class = FindClass("ecere::com::Class")->registered;
13423 }
13424 else
13425 {
13426 char string[1024] = "";
13427 struct Symbol * classSym;
13428
13429 PrintTypeNoConst(type, string, 0x0, 0x1);
13430 classSym = FindClass(string);
13431 if(classSym)
13432 _class = classSym->registered;
13433 }
13434 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)))
13435 {
13436 if(!_class || strcmp(_class->fullName, "char *"))
13437 {
13438 struct Expression * checkedExp = e, * newExp;
13439
13440 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->list) || checkedExp->type == 11)
13441 {
13442 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13443 {
13444 if(checkedExp->type == 23)
13445 {
13446 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13447 }
13448 else
13449 checkedExp = (*checkedExp->list).last;
13450 }
13451 else if(checkedExp->type == 11)
13452 checkedExp = checkedExp->cast.exp;
13453 }
13454 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
13455 {
13456 newExp = checkedExp->op.exp2;
13457 checkedExp->op.exp2 = (((void *)0));
13458 FreeExpContents(checkedExp);
13459 if(e->expType && e->expType->passAsTemplate)
13460 {
13461 char size[100];
13462
13463 ComputeTypeSize(e->expType);
13464 sprintf(size, "%d", e->expType->size);
13465 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))))));
13466 }
13467 ReplaceExpContents(checkedExp, newExp);
13468 e->byReference = 0x1;
13469 }
13470 else if(!e->byReference || (_class && _class->type == 5))
13471 {
13472 struct Expression * checkedExp, * newExp;
13473
13474 {
13475 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;
13476
13477 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
13478 {
13479 struct Context * context = PushContext();
13480 struct Declarator * decl;
13481 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13482 char typeString[1024];
13483 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13484
13485 typeString[0] = '\0';
13486 *newExp = *e;
13487 newExp->prev = (((void *)0));
13488 newExp->next = (((void *)0));
13489 newExp->expType = (((void *)0));
13490 PrintTypeNoConst(e->expType, typeString, 0x0, 0x1);
13491 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13492 newExp->destType = ProcessType(specs, decl);
13493 curContext = context;
13494 if(curCompound)
13495 {
13496 char name[100];
13497 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
13498
13499 e->type = 23;
13500 sprintf(name, "__internalValue%03X", internalValueCounter++);
13501 if(!curCompound->compound.declarations)
13502 curCompound->compound.declarations = MkList();
13503 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
13504 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
13505 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
13506 e->compound = MkCompoundStmt((((void *)0)), stmts);
13507 }
13508 else
13509 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
13510 {
13511 struct Type * type = e->destType;
13512
13513 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13514 CopyTypeInto(e->destType, type);
13515 e->destType->refCount = 1;
13516 e->destType->classObjectType = 0;
13517 FreeType(type);
13518 }
13519 e->compound->compound.context = context;
13520 PopContext(context);
13521 curContext = context->parent;
13522 }
13523 }
13524 checkedExp = e;
13525 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->list) || checkedExp->type == 11)
13526 {
13527 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13528 {
13529 if(checkedExp->type == 23)
13530 {
13531 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13532 }
13533 else
13534 checkedExp = (*checkedExp->list).last;
13535 }
13536 else if(checkedExp->type == 11)
13537 checkedExp = checkedExp->cast.exp;
13538 }
13539 {
13540 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13541
13542 *operand = *checkedExp;
13543 checkedExp->destType = (((void *)0));
13544 checkedExp->expType = (((void *)0));
13545 __ecereMethod_Expression_Clear(checkedExp);
13546 checkedExp->type = 4;
13547 checkedExp->op.op = '&';
13548 checkedExp->op.exp1 = (((void *)0));
13549 checkedExp->op.exp2 = operand;
13550 }
13551 }
13552 }
13553 }
13554 }
13555 }
13556 {
13557 }
13558 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))))
13559 {
13560 if(e->expType->classObjectType && destType && destType->classObjectType)
13561 {
13562 return ;
13563 }
13564 else
13565 {
13566 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13567
13568 *thisExp = *e;
13569 thisExp->prev = (((void *)0));
13570 thisExp->next = (((void *)0));
13571 __ecereMethod_Expression_Clear(e);
13572 e->type = 5;
13573 e->list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
13574 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
13575 ((struct Expression *)(*e->list).first)->byReference = 0x1;
13576 {
13577 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13578 CopyTypeInto(e->expType, thisExp->expType);
13579 e->expType->byReference = 0x0;
13580 e->expType->refCount = 1;
13581 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))
13582 {
13583 e->expType->classObjectType = 0;
13584 }
13585 }
13586 }
13587 }
13588 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
13589 {
13590 if(destType->kind == 14)
13591 {
13592 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unspecified type\n", (((void *)0))));
13593 }
13594 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
13595 {
13596 unsigned int byReference = e->expType->byReference;
13597 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13598 struct Declarator * decl;
13599 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13600 char typeString[1024];
13601 struct Type * type;
13602 int backupClassObjectType;
13603 unsigned int backupByReference;
13604
13605 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
13606 type = e->expType;
13607 else
13608 type = destType;
13609 backupClassObjectType = type->classObjectType;
13610 backupByReference = type->byReference;
13611 type->classObjectType = 0;
13612 type->byReference = 0x0;
13613 typeString[0] = '\0';
13614 PrintType(type, typeString, 0x0, 0x1);
13615 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13616 type->classObjectType = backupClassObjectType;
13617 type->byReference = backupByReference;
13618 *thisExp = *e;
13619 thisExp->prev = (((void *)0));
13620 thisExp->next = (((void *)0));
13621 __ecereMethod_Expression_Clear(e);
13622 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)))
13623 {
13624 e->type = 4;
13625 e->op.op = '*';
13626 e->op.exp1 = (((void *)0));
13627 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
13628 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13629 CopyTypeInto(e->expType, type);
13630 e->expType->byReference = 0x0;
13631 e->expType->refCount = 1;
13632 }
13633 else
13634 {
13635 e->type = 11;
13636 e->cast.typeName = MkTypeName(specs, decl);
13637 e->cast.exp = thisExp;
13638 e->byReference = 0x1;
13639 e->expType = type;
13640 type->refCount++;
13641 }
13642 e->destType = destType;
13643 destType->refCount++;
13644 }
13645 }
13646 }
13647
13648 extern char *  strstr(const char * , const char * );
13649
13650 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
13651
13652 struct __ecereNameSpace__ecere__com__DefinedExpression
13653 {
13654 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
13655 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
13656 char *  name;
13657 char *  value;
13658 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
13659 } __attribute__ ((gcc_struct));
13660
13661 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
13662
13663 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
13664
13665 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char *  string, int *  numBytes);
13666
13667 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
13668
13669 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
13670
13671 extern struct Expression * CopyExpression(struct Expression * exp);
13672
13673 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
13674
13675 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList *  specifiers, struct Declarator * decl);
13676
13677 static void ProcessStatement(struct Statement * stmt);
13678
13679 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
13680
13681 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
13682
13683 extern char *  __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, void * object, ...);
13684
13685 extern char *  sourceFile;
13686
13687 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
13688
13689 void ProcessExpressionType(struct Expression * exp)
13690 {
13691 unsigned int unresolved = 0x0;
13692 struct Location oldyylloc = yylloc;
13693 unsigned int notByReference = 0x0;
13694
13695 if(!exp || exp->expType)
13696 return ;
13697 yylloc = exp->loc;
13698 switch(exp->type)
13699 {
13700 case 0:
13701 {
13702 struct Identifier * id = exp->identifier;
13703
13704 if(!id || !topContext)
13705 return ;
13706 if(id->_class && id->_class->name)
13707 {
13708 id->classSym = id->_class->symbol;
13709 }
13710 if(strstr(id->string, "__ecereClass") == id->string)
13711 {
13712 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
13713 break;
13714 }
13715 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
13716 {
13717 ReplaceClassMembers(exp, thisClass);
13718 if(exp->type != 0)
13719 {
13720 ProcessExpressionType(exp);
13721 break;
13722 }
13723 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
13724 break;
13725 }
13726 else
13727 {
13728 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13729
13730 if(!symbol)
13731 {
13732 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
13733 break;
13734 else
13735 {
13736 if(thisClass)
13737 {
13738 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
13739 if(exp->type != 0)
13740 {
13741 ProcessExpressionType(exp);
13742 break;
13743 }
13744 }
13745 else if(currentClass && !id->_class)
13746 {
13747 if(ResolveIdWithClass(exp, currentClass, 0x1))
13748 break;
13749 }
13750 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13751 }
13752 }
13753 if(symbol)
13754 {
13755 struct Type * type = symbol->type;
13756 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
13757
13758 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
13759 {
13760 struct Context * context = SetupTemplatesContext(_class);
13761
13762 type = ReplaceThisClassType(_class);
13763 FinishTemplatesContext(context);
13764 if(type)
13765 type->refCount = 0;
13766 }
13767 FreeSpecifier(id->_class);
13768 id->_class = (((void *)0));
13769 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13770 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
13771 id->classSym = (((void *)0));
13772 exp->expType = type;
13773 if(type)
13774 type->refCount++;
13775 if(type && (type->kind == 15 || (_class && _class->type == 4)))
13776 exp->isConstant = 0x1;
13777 if(symbol->isParam || !strcmp(id->string, "this"))
13778 {
13779 if(_class && _class->type == 1 && !type->declaredWithStruct)
13780 exp->byReference = 0x1;
13781 }
13782 if(symbol->isIterator)
13783 {
13784 if(symbol->isIterator == 3)
13785 {
13786 exp->type = 5;
13787 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
13788 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
13789 exp->expType = (((void *)0));
13790 ProcessExpressionType(exp);
13791 }
13792 else if(symbol->isIterator != 4)
13793 {
13794 exp->type = 8;
13795 exp->member.exp = MkExpIdentifier(exp->identifier);
13796 exp->member.exp->expType = exp->expType;
13797 exp->member.member = MkIdentifier("data");
13798 exp->expType = (((void *)0));
13799 ProcessExpressionType(exp);
13800 }
13801 }
13802 break;
13803 }
13804 else
13805 {
13806 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
13807
13808 if(thisNameSpace && !(id->_class && !id->_class->name))
13809 {
13810 char name[1024];
13811
13812 strcpy(name, thisNameSpace);
13813 strcat(name, "::");
13814 strcat(name, id->string);
13815 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
13816 }
13817 if(!definedExp)
13818 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
13819 if(definedExp)
13820 {
13821 int c;
13822
13823 for(c = 0; c < definedExpStackPos; c++)
13824 if(definedExpStack[c] == definedExp)
13825 break;
13826 if(c == definedExpStackPos && c < sizeof (definedExpStack) / sizeof(void *))
13827 {
13828 struct Location backupYylloc = yylloc;
13829 struct __ecereNameSpace__ecere__com__Instance * backInput = fileInput;
13830
13831 definedExpStack[definedExpStackPos++] = definedExp;
13832 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13833 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__extension__ ({
13834 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13835
13836 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13837 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
13838 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13839 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13840
13841 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13842 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13843 echoOn = 0x0;
13844 parsedExpression = (((void *)0));
13845 resetScanner();
13846 expression_yyparse();
13847 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13848 if(backInput)
13849 fileInput = backInput;
13850 yylloc = backupYylloc;
13851 if(parsedExpression)
13852 {
13853 FreeIdentifier(id);
13854 exp->type = 5;
13855 exp->list = MkListOne(parsedExpression);
13856 parsedExpression->loc = yylloc;
13857 ProcessExpressionType(exp);
13858 definedExpStackPos--;
13859 return ;
13860 }
13861 definedExpStackPos--;
13862 }
13863 else
13864 {
13865 if(inCompiler)
13866 {
13867 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Recursion in defined expression %s\n", (((void *)0))), id->string);
13868 }
13869 }
13870 }
13871 else
13872 {
13873 struct GlobalData * data = (((void *)0));
13874
13875 if(thisNameSpace && !(id->_class && !id->_class->name))
13876 {
13877 char name[1024];
13878
13879 strcpy(name, thisNameSpace);
13880 strcat(name, "::");
13881 strcat(name, id->string);
13882 data = FindGlobalData(name);
13883 }
13884 if(!data)
13885 data = FindGlobalData(id->string);
13886 if(data)
13887 {
13888 DeclareGlobalData(data);
13889 exp->expType = data->dataType;
13890 if(data->dataType)
13891 data->dataType->refCount++;
13892 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13893 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
13894 FreeSpecifier(id->_class);
13895 id->_class = (((void *)0));
13896 break;
13897 }
13898 else
13899 {
13900 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
13901
13902 if(thisNameSpace && !(id->_class && !id->_class->name))
13903 {
13904 char name[1024];
13905
13906 strcpy(name, thisNameSpace);
13907 strcat(name, "::");
13908 strcat(name, id->string);
13909 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
13910 }
13911 if(!function)
13912 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
13913 if(function)
13914 {
13915 char name[1024];
13916
13917 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13918 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
13919 name[0] = (char)0;
13920 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
13921 strcpy(name, "__ecereFunction_");
13922 FullClassNameCat(name, id->string, 0x0);
13923 if(DeclareFunction(function, name))
13924 {
13925 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13926 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
13927 }
13928 exp->expType = function->dataType;
13929 if(function->dataType)
13930 function->dataType->refCount++;
13931 FreeSpecifier(id->_class);
13932 id->_class = (((void *)0));
13933 break;
13934 }
13935 }
13936 }
13937 }
13938 }
13939 unresolved = 0x1;
13940 break;
13941 }
13942 case 1:
13943 {
13944 struct __ecereNameSpace__ecere__com__Class * _class;
13945
13946 if(!exp->instance->_class)
13947 {
13948 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
13949 {
13950 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
13951 }
13952 }
13953 ProcessInstantiationType(exp->instance);
13954 exp->isConstant = exp->instance->isConstant;
13955 if(exp->instance->_class)
13956 {
13957 exp->expType = MkClassType(exp->instance->_class->name);
13958 }
13959 break;
13960 }
13961 case 2:
13962 {
13963 if(!exp->expType)
13964 {
13965 char * constant = exp->constant;
13966 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
13967
13968 exp->expType = type;
13969 if(constant[0] == '\'')
13970 {
13971 if((int)((unsigned char *)constant)[1] > 127)
13972 {
13973 int nb;
13974 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
13975
13976 if(nb < 2)
13977 ch = constant[1];
13978 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
13979 exp->constant = PrintUInt(ch);
13980 type->kind = 8;
13981 type->_class = FindClass("unichar");
13982 type->isSigned = 0x0;
13983 }
13984 else
13985 {
13986 type->kind = 1;
13987 type->isSigned = 0x1;
13988 }
13989 }
13990 else
13991 {
13992 char * dot = strchr(constant, '.');
13993 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
13994 char * exponent;
13995
13996 if(isHex)
13997 {
13998 exponent = strchr(constant, 'p');
13999 if(!exponent)
14000 exponent = strchr(constant, 'P');
14001 }
14002 else
14003 {
14004 exponent = strchr(constant, 'e');
14005 if(!exponent)
14006 exponent = strchr(constant, 'E');
14007 }
14008 if(dot || exponent)
14009 {
14010 if(strchr(constant, 'f') || strchr(constant, 'F'))
14011 type->kind = 6;
14012 else
14013 type->kind = 7;
14014 type->isSigned = 0x1;
14015 }
14016 else
14017 {
14018 unsigned int isSigned = constant[0] == '-';
14019 long long i64 = strtoll(constant, (((void *)0)), 0);
14020 uint64 ui64 = strtoull(constant, (((void *)0)), 0);
14021 unsigned int is64Bit = 0x0;
14022
14023 if(isSigned)
14024 {
14025 if(i64 < (((int)0x80000000)))
14026 is64Bit = 0x1;
14027 }
14028 else
14029 {
14030 if(ui64 > (((int)0x7fffffff)))
14031 {
14032 if(ui64 > (0xffffffff))
14033 {
14034 is64Bit = 0x1;
14035 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
14036 isSigned = 0x1;
14037 }
14038 }
14039 else if(constant[0] != '0' || !constant[1])
14040 isSigned = 0x1;
14041 }
14042 type->kind = is64Bit ? 4 : 3;
14043 type->isSigned = isSigned;
14044 }
14045 }
14046 exp->isConstant = 0x1;
14047 if(exp->destType && exp->destType->kind == 7)
14048 type->kind = 7;
14049 else if(exp->destType && exp->destType->kind == 6)
14050 type->kind = 6;
14051 else if(exp->destType && exp->destType->kind == 4)
14052 type->kind = 4;
14053 }
14054 break;
14055 }
14056 case 3:
14057 {
14058 exp->isConstant = 0x1;
14059 exp->expType = __extension__ ({
14060 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14061
14062 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
14063 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14064
14065 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 1, __ecereInstance1->constant = 0x1, __ecereInstance1->isSigned = 0x1, __ecereInstance1;
14066 }), __ecereInstance2;
14067 });
14068 break;
14069 }
14070 case 13:
14071 case 26:
14072 ProcessExpressionType(exp->_new.size);
14073 exp->expType = __extension__ ({
14074 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14075
14076 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_new.typeName->qualifiers, exp->_new.typeName->declarator), __ecereInstance1;
14077 });
14078 DeclareType(exp->expType->type, 0x0, 0x0);
14079 break;
14080 case 14:
14081 case 27:
14082 ProcessExpressionType(exp->_renew.size);
14083 ProcessExpressionType(exp->_renew.exp);
14084 exp->expType = __extension__ ({
14085 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14086
14087 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_renew.typeName->qualifiers, exp->_renew.typeName->declarator), __ecereInstance1;
14088 });
14089 DeclareType(exp->expType->type, 0x0, 0x0);
14090 break;
14091 case 4:
14092 {
14093 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
14094 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
14095 unsigned int useDestType = 0x0, useSideType = 0x0;
14096 struct Location oldyylloc = yylloc;
14097 unsigned int useSideUnit = 0x0;
14098 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
14099
14100 switch(exp->op.op)
14101 {
14102 case '=':
14103 case MUL_ASSIGN:
14104 case DIV_ASSIGN:
14105 case MOD_ASSIGN:
14106 case ADD_ASSIGN:
14107 case SUB_ASSIGN:
14108 case LEFT_ASSIGN:
14109 case RIGHT_ASSIGN:
14110 case AND_ASSIGN:
14111 case XOR_ASSIGN:
14112 case OR_ASSIGN:
14113 assign = 0x1;
14114 break;
14115 case '!':
14116 break;
14117 case AND_OP:
14118 case OR_OP:
14119 boolOps = 0x1;
14120 boolResult = 0x1;
14121 break;
14122 case EQ_OP:
14123 case '<':
14124 case '>':
14125 case LE_OP:
14126 case GE_OP:
14127 case NE_OP:
14128 boolResult = 0x1;
14129 useSideType = 0x1;
14130 break;
14131 case '+':
14132 case '-':
14133 useSideUnit = 0x1;
14134 case '|':
14135 case '&':
14136 case '^':
14137 case '/':
14138 case '%':
14139 case '*':
14140 if(exp->op.op != '*' || exp->op.exp1)
14141 {
14142 useSideType = 0x1;
14143 useDestType = 0x1;
14144 }
14145 break;
14146 }
14147 if(exp->op.op == '&')
14148 {
14149 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
14150 {
14151 struct Identifier * id = exp->op.exp2->identifier;
14152 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
14153
14154 if(symbol && symbol->isIterator == 2)
14155 {
14156 exp->type = 8;
14157 exp->member.exp = exp->op.exp2;
14158 exp->member.member = MkIdentifier("key");
14159 exp->expType = (((void *)0));
14160 exp->op.exp2->expType = symbol->type;
14161 symbol->type->refCount++;
14162 ProcessExpressionType(exp);
14163 FreeType(dummy);
14164 break;
14165 }
14166 }
14167 }
14168 if(exp->op.exp1)
14169 {
14170 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))
14171 {
14172 if(exp->op.exp1->destType)
14173 FreeType(exp->op.exp1->destType);
14174 exp->op.exp1->destType = exp->destType;
14175 if(exp->destType)
14176 exp->destType->refCount++;
14177 }
14178 else if(!assign)
14179 {
14180 if(exp->op.exp1->destType)
14181 FreeType(exp->op.exp1->destType);
14182 exp->op.exp1->destType = dummy;
14183 dummy->refCount++;
14184 }
14185 if(exp->op.exp1->destType && exp->op.op != '=')
14186 exp->op.exp1->destType->count++;
14187 ProcessExpressionType(exp->op.exp1);
14188 if(exp->op.exp1->destType && exp->op.op != '=')
14189 exp->op.exp1->destType->count--;
14190 if(exp->op.exp1->destType == dummy)
14191 {
14192 FreeType(dummy);
14193 exp->op.exp1->destType = (((void *)0));
14194 }
14195 type1 = exp->op.exp1->expType;
14196 }
14197 if(exp->op.exp2)
14198 {
14199 char expString[10240];
14200
14201 expString[0] = '\0';
14202 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
14203 {
14204 if(exp->op.exp1)
14205 {
14206 exp->op.exp2->destType = exp->op.exp1->expType;
14207 if(exp->op.exp1->expType)
14208 exp->op.exp1->expType->refCount++;
14209 }
14210 else
14211 {
14212 exp->op.exp2->destType = exp->destType;
14213 if(exp->destType)
14214 exp->destType->refCount++;
14215 }
14216 if(type1)
14217 type1->refCount++;
14218 exp->expType = type1;
14219 }
14220 else if(assign)
14221 {
14222 if(inCompiler)
14223 PrintExpression(exp->op.exp2, expString);
14224 if(type1 && type1->kind == 13)
14225 {
14226 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)
14227 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
14228 else if(exp->op.op == '=')
14229 {
14230 if(exp->op.exp2->destType)
14231 FreeType(exp->op.exp2->destType);
14232 exp->op.exp2->destType = type1;
14233 if(type1)
14234 type1->refCount++;
14235 }
14236 }
14237 else
14238 {
14239 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)
14240 ;
14241 else
14242 {
14243 if(exp->op.exp2->destType)
14244 FreeType(exp->op.exp2->destType);
14245 exp->op.exp2->destType = type1;
14246 if(type1)
14247 type1->refCount++;
14248 }
14249 }
14250 if(type1)
14251 type1->refCount++;
14252 exp->expType = type1;
14253 }
14254 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)))
14255 {
14256 if(exp->op.exp2->destType)
14257 FreeType(exp->op.exp2->destType);
14258 exp->op.exp2->destType = exp->destType;
14259 if(exp->destType)
14260 exp->destType->refCount++;
14261 }
14262 else
14263 {
14264 if(exp->op.exp2->destType)
14265 FreeType(exp->op.exp2->destType);
14266 exp->op.exp2->destType = dummy;
14267 dummy->refCount++;
14268 }
14269 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
14270 {
14271 FreeType(exp->op.exp2->destType);
14272 exp->op.exp2->destType = type1;
14273 type1->refCount++;
14274 }
14275 if(exp->op.exp2->destType && exp->op.op != '=')
14276 exp->op.exp2->destType->count++;
14277 if(exp->op.op == SIZEOF)
14278 {
14279 struct Expression * e = exp->op.exp2;
14280
14281 while((e->type == 5 || e->type == 32 || e->type == 23) && e->list)
14282 {
14283 if(e->type == 5 || e->type == 32 || e->type == 23)
14284 {
14285 if(e->type == 23)
14286 e = (*((struct Statement *)(*e->compound->compound.statements).last)->expressions).last;
14287 else
14288 e = (*e->list).last;
14289 }
14290 }
14291 if(e->type == 11 && e->cast.exp)
14292 e->cast.exp->needCast = 0x1;
14293 }
14294 ProcessExpressionType(exp->op.exp2);
14295 if(exp->op.exp2->destType && exp->op.op != '=')
14296 exp->op.exp2->destType->count--;
14297 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
14298 {
14299 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)
14300 {
14301 if(exp->op.op != '=' && type1->type->kind == 0)
14302 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14303 }
14304 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)))
14305 {
14306 if(exp->op.op == ADD_ASSIGN)
14307 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14308 }
14309 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))
14310 {
14311 if(exp->op.op == ADD_ASSIGN)
14312 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14313 }
14314 else if(inCompiler)
14315 {
14316 char type1String[1024];
14317 char type2String[1024];
14318
14319 type1String[0] = '\0';
14320 type2String[0] = '\0';
14321 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
14322 PrintType(type1, type2String, 0x0, 0x1);
14323 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14324 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
14325 }
14326 }
14327 if(exp->op.exp2->destType == dummy)
14328 {
14329 FreeType(dummy);
14330 exp->op.exp2->destType = (((void *)0));
14331 }
14332 if(exp->op.op == '-' && !exp->op.exp1 && exp->op.exp2->expType && !exp->op.exp2->expType->isSigned)
14333 {
14334 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14335 type2->refCount = 1;
14336 CopyTypeInto(type2, exp->op.exp2->expType);
14337 type2->isSigned = 0x1;
14338 }
14339 else if(exp->op.op == '~' && !exp->op.exp1 && exp->op.exp2->expType && (!exp->op.exp2->expType->isSigned || exp->op.exp2->expType->kind != 3))
14340 {
14341 type2 = __extension__ ({
14342 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14343
14344 __ecereInstance1->kind = 3, __ecereInstance1;
14345 });
14346 type2->refCount = 1;
14347 type2->isSigned = 0x1;
14348 }
14349 else
14350 {
14351 type2 = exp->op.exp2->expType;
14352 if(type2)
14353 type2->refCount++;
14354 }
14355 }
14356 dummy->kind = 0;
14357 if(exp->op.op == SIZEOF)
14358 {
14359 exp->expType = __extension__ ({
14360 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14361
14362 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
14363 });
14364 exp->isConstant = 0x1;
14365 }
14366 else if(exp->op.op == '*' && !exp->op.exp1)
14367 {
14368 exp->expType = Dereference(type2);
14369 if(type2 && type2->kind == 8)
14370 notByReference = 0x1;
14371 }
14372 else if(exp->op.op == '&' && !exp->op.exp1)
14373 exp->expType = Reference(type2);
14374 else if(!assign)
14375 {
14376 if(boolOps)
14377 {
14378 if(exp->op.exp1)
14379 {
14380 if(exp->op.exp1->destType)
14381 FreeType(exp->op.exp1->destType);
14382 exp->op.exp1->destType = MkClassType("bool");
14383 exp->op.exp1->destType->truth = 0x1;
14384 if(!exp->op.exp1->expType)
14385 ProcessExpressionType(exp->op.exp1);
14386 else
14387 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14388 FreeType(exp->op.exp1->expType);
14389 exp->op.exp1->expType = MkClassType("bool");
14390 exp->op.exp1->expType->truth = 0x1;
14391 }
14392 if(exp->op.exp2)
14393 {
14394 if(exp->op.exp2->destType)
14395 FreeType(exp->op.exp2->destType);
14396 exp->op.exp2->destType = MkClassType("bool");
14397 exp->op.exp2->destType->truth = 0x1;
14398 if(!exp->op.exp2->expType)
14399 ProcessExpressionType(exp->op.exp2);
14400 else
14401 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14402 FreeType(exp->op.exp2->expType);
14403 exp->op.exp2->expType = MkClassType("bool");
14404 exp->op.exp2->expType->truth = 0x1;
14405 }
14406 }
14407 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")))))
14408 {
14409 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
14410 {
14411 if(exp->op.exp2->destType)
14412 FreeType(exp->op.exp2->destType);
14413 exp->op.exp2->destType = type1;
14414 type1->refCount++;
14415 if(exp->op.exp1->destType)
14416 FreeType(exp->op.exp1->destType);
14417 exp->op.exp1->destType = type2;
14418 type2->refCount++;
14419 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)
14420 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);
14421 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
14422 {
14423 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14424
14425 if(argExp)
14426 {
14427 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14428
14429 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
14430 ProcessExpressionType(exp->op.exp1);
14431 if(type2->kind != 13)
14432 {
14433 ProcessExpressionType(classExp);
14434 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"))))))));
14435 if(!exp->op.exp2->expType)
14436 {
14437 if(type2)
14438 FreeType(type2);
14439 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
14440 type2->refCount++;
14441 }
14442 ProcessExpressionType(exp->op.exp2);
14443 }
14444 }
14445 }
14446 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)))
14447 {
14448 if(type1->kind != 8 && type1->type->kind == 0)
14449 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14450 exp->expType = type1;
14451 if(type1)
14452 type1->refCount++;
14453 }
14454 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)))
14455 {
14456 if(type2->kind != 8 && type2->type->kind == 0)
14457 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14458 exp->expType = type2;
14459 if(type2)
14460 type2->refCount++;
14461 }
14462 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))
14463 {
14464 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "different levels of indirection\n", (((void *)0))));
14465 }
14466 else
14467 {
14468 unsigned int success = 0x0;
14469
14470 if(type1->kind == 13 && type2->kind == 13)
14471 {
14472 if(exp->op.op == '+')
14473 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14474 else if(exp->op.op == '-')
14475 {
14476 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
14477 {
14478 exp->expType = __extension__ ({
14479 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14480
14481 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
14482 });
14483 success = 0x1;
14484 if(type1->type->kind == 20)
14485 {
14486 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14487
14488 if(argExp)
14489 {
14490 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14491
14492 ProcessExpressionType(classExp);
14493 exp->type = 5;
14494 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")))))));
14495 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
14496 FreeType(dummy);
14497 return ;
14498 }
14499 }
14500 }
14501 }
14502 }
14503 if(!success && exp->op.exp1->type == 2)
14504 {
14505 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14506 {
14507 if(exp->expType)
14508 FreeType(exp->expType);
14509 exp->expType = exp->op.exp1->destType;
14510 if(exp->op.exp1->destType)
14511 exp->op.exp1->destType->refCount++;
14512 success = 0x1;
14513 }
14514 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14515 {
14516 if(exp->expType)
14517 FreeType(exp->expType);
14518 exp->expType = exp->op.exp2->destType;
14519 if(exp->op.exp2->destType)
14520 exp->op.exp2->destType->refCount++;
14521 success = 0x1;
14522 }
14523 }
14524 else if(!success)
14525 {
14526 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14527 {
14528 if(exp->expType)
14529 FreeType(exp->expType);
14530 exp->expType = exp->op.exp2->destType;
14531 if(exp->op.exp2->destType)
14532 exp->op.exp2->destType->refCount++;
14533 success = 0x1;
14534 }
14535 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14536 {
14537 if(exp->expType)
14538 FreeType(exp->expType);
14539 exp->expType = exp->op.exp1->destType;
14540 if(exp->op.exp1->destType)
14541 exp->op.exp1->destType->refCount++;
14542 success = 0x1;
14543 }
14544 }
14545 if(!success)
14546 {
14547 char expString1[10240];
14548 char expString2[10240];
14549 char type1[1024];
14550 char type2[1024];
14551
14552 expString1[0] = '\0';
14553 expString2[0] = '\0';
14554 type1[0] = '\0';
14555 type2[0] = '\0';
14556 if(inCompiler)
14557 {
14558 PrintExpression(exp->op.exp1, expString1);
14559 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
14560 PrintExpression(exp->op.exp2, expString2);
14561 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
14562 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
14563 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
14564 }
14565 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
14566 }
14567 }
14568 }
14569 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
14570 {
14571 if(exp->op.exp1->destType)
14572 FreeType(exp->op.exp1->destType);
14573 exp->op.exp1->destType = type2->_class->registered->dataType;
14574 if(type2->_class->registered->dataType)
14575 type2->_class->registered->dataType->refCount++;
14576 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14577 exp->expType = type2;
14578 if(type2)
14579 type2->refCount++;
14580 }
14581 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
14582 {
14583 if(exp->op.exp2->destType)
14584 FreeType(exp->op.exp2->destType);
14585 exp->op.exp2->destType = type1->_class->registered->dataType;
14586 if(type1->_class->registered->dataType)
14587 type1->_class->registered->dataType->refCount++;
14588 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14589 exp->expType = type1;
14590 if(type1)
14591 type1->refCount++;
14592 }
14593 else if(type1)
14594 {
14595 unsigned int valid = 0x0;
14596
14597 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
14598 {
14599 if(exp->op.exp2->destType)
14600 FreeType(exp->op.exp2->destType);
14601 if(!type1->_class->registered->dataType)
14602 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
14603 exp->op.exp2->destType = type1->_class->registered->dataType;
14604 exp->op.exp2->destType->refCount++;
14605 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14606 if(type2)
14607 FreeType(type2);
14608 type2 = exp->op.exp2->destType;
14609 if(type2)
14610 type2->refCount++;
14611 exp->expType = type2;
14612 type2->refCount++;
14613 }
14614 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
14615 {
14616 if(exp->op.exp1->destType)
14617 FreeType(exp->op.exp1->destType);
14618 if(!type2->_class->registered->dataType)
14619 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
14620 exp->op.exp1->destType = type2->_class->registered->dataType;
14621 exp->op.exp1->destType->refCount++;
14622 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14623 type1 = exp->op.exp1->destType;
14624 exp->expType = type1;
14625 type1->refCount++;
14626 }
14627 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
14628 {
14629 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
14630 {
14631 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
14632 {
14633 if(exp->expType)
14634 FreeType(exp->expType);
14635 exp->expType = exp->op.exp1->expType;
14636 if(exp->op.exp2->expType)
14637 exp->op.exp1->expType->refCount++;
14638 valid = 0x1;
14639 }
14640 }
14641 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
14642 {
14643 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
14644 {
14645 if(exp->expType)
14646 FreeType(exp->expType);
14647 exp->expType = exp->op.exp2->expType;
14648 if(exp->op.exp2->expType)
14649 exp->op.exp2->expType->refCount++;
14650 valid = 0x1;
14651 }
14652 }
14653 }
14654 if(!valid)
14655 {
14656 if(exp->op.exp2->destType)
14657 FreeType(exp->op.exp2->destType);
14658 exp->op.exp2->destType = type1;
14659 type1->refCount++;
14660 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14661 {
14662 if(exp->expType)
14663 FreeType(exp->expType);
14664 exp->expType = exp->op.exp2->destType;
14665 if(exp->op.exp2->destType)
14666 exp->op.exp2->destType->refCount++;
14667 }
14668 else if(type1 && type2)
14669 {
14670 char expString1[10240];
14671 char expString2[10240];
14672 char type1String[1024];
14673 char type2String[1024];
14674
14675 expString1[0] = '\0';
14676 expString2[0] = '\0';
14677 type1String[0] = '\0';
14678 type2String[0] = '\0';
14679 if(inCompiler)
14680 {
14681 PrintExpression(exp->op.exp1, expString1);
14682 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
14683 PrintExpression(exp->op.exp2, expString2);
14684 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
14685 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
14686 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
14687 }
14688 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
14689 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
14690 {
14691 exp->expType = exp->op.exp1->expType;
14692 if(exp->op.exp1->expType)
14693 exp->op.exp1->expType->refCount++;
14694 }
14695 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
14696 {
14697 exp->expType = exp->op.exp2->expType;
14698 if(exp->op.exp2->expType)
14699 exp->op.exp2->expType->refCount++;
14700 }
14701 }
14702 }
14703 }
14704 else if(type2)
14705 {
14706 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
14707 {
14708 struct Type * oldType = exp->op.exp1->expType;
14709
14710 exp->op.exp1->expType = (((void *)0));
14711 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14712 FreeType(oldType);
14713 else
14714 exp->op.exp1->expType = oldType;
14715 }
14716 if(exp->op.exp1->destType)
14717 FreeType(exp->op.exp1->destType);
14718 exp->op.exp1->destType = type2;
14719 type2->refCount++;
14720 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14721 {
14722 if(exp->expType)
14723 FreeType(exp->expType);
14724 exp->expType = exp->op.exp1->destType;
14725 if(exp->op.exp1->destType)
14726 exp->op.exp1->destType->refCount++;
14727 }
14728 }
14729 }
14730 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
14731 {
14732 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
14733 {
14734 if(exp->op.exp1->destType)
14735 FreeType(exp->op.exp1->destType);
14736 exp->op.exp1->destType = type2->_class->registered->dataType;
14737 if(type2->_class->registered->dataType)
14738 type2->_class->registered->dataType->refCount++;
14739 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14740 }
14741 if(exp->op.op == '!')
14742 {
14743 exp->expType = MkClassType("bool");
14744 exp->expType->truth = 0x1;
14745 }
14746 else
14747 {
14748 exp->expType = type2;
14749 if(type2)
14750 type2->refCount++;
14751 }
14752 }
14753 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
14754 {
14755 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
14756 {
14757 if(exp->op.exp2->destType)
14758 FreeType(exp->op.exp2->destType);
14759 exp->op.exp2->destType = type1->_class->registered->dataType;
14760 if(type1->_class->registered->dataType)
14761 type1->_class->registered->dataType->refCount++;
14762 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14763 }
14764 exp->expType = type1;
14765 if(type1)
14766 type1->refCount++;
14767 }
14768 }
14769 yylloc = exp->loc;
14770 if(exp->op.exp1 && !exp->op.exp1->expType)
14771 {
14772 char expString[10000];
14773
14774 expString[0] = '\0';
14775 if(inCompiler)
14776 {
14777 PrintExpression(exp->op.exp1, expString);
14778 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14779 }
14780 if(expString[0])
14781 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
14782 }
14783 if(exp->op.exp2 && !exp->op.exp2->expType)
14784 {
14785 char expString[10240];
14786
14787 expString[0] = '\0';
14788 if(inCompiler)
14789 {
14790 PrintExpression(exp->op.exp2, expString);
14791 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14792 }
14793 if(expString[0])
14794 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
14795 }
14796 if(boolResult)
14797 {
14798 FreeType(exp->expType);
14799 exp->expType = MkClassType("bool");
14800 exp->expType->truth = 0x1;
14801 }
14802 if(exp->op.op != SIZEOF)
14803 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
14804 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
14805 {
14806 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
14807 }
14808 yylloc = oldyylloc;
14809 FreeType(dummy);
14810 if(type2)
14811 FreeType(type2);
14812 break;
14813 }
14814 case 5:
14815 case 32:
14816 {
14817 struct Expression * e;
14818
14819 exp->isConstant = 0x1;
14820 for(e = (*exp->list).first; e; e = e->next)
14821 {
14822 unsigned int inced = 0x0;
14823
14824 if(!e->next)
14825 {
14826 FreeType(e->destType);
14827 e->destType = exp->destType;
14828 if(e->destType)
14829 {
14830 exp->destType->refCount++;
14831 e->destType->count++;
14832 inced = 0x1;
14833 }
14834 }
14835 ProcessExpressionType(e);
14836 if(inced)
14837 exp->destType->count--;
14838 if(!exp->expType && !e->next)
14839 {
14840 exp->expType = e->expType;
14841 if(e->expType)
14842 e->expType->refCount++;
14843 }
14844 if(!e->isConstant)
14845 exp->isConstant = 0x0;
14846 }
14847 e = (*exp->list).first;
14848 if(!e->next && e->type == 8)
14849 {
14850 struct Expression * next = exp->next, * prev = exp->prev;
14851
14852 FreeType(exp->expType);
14853 FreeType(exp->destType);
14854 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14855 *exp = *e;
14856 exp->prev = prev;
14857 exp->next = next;
14858 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
14859 ProcessExpressionType(exp);
14860 }
14861 break;
14862 }
14863 case 6:
14864 {
14865 struct Expression * e;
14866
14867 exp->isConstant = 0x1;
14868 ProcessExpressionType(exp->index.exp);
14869 if(!exp->index.exp->isConstant)
14870 exp->isConstant = 0x0;
14871 if(exp->index.exp->expType)
14872 {
14873 struct Type * source = exp->index.exp->expType;
14874
14875 if(source->kind == 8 && source->_class && source->_class->registered)
14876 {
14877 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
14878 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
14879
14880 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
14881 {
14882 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
14883 if(exp->index.index && (*exp->index.index).last)
14884 {
14885 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
14886 }
14887 }
14888 }
14889 }
14890 for(e = (*exp->index.index).first; e; e = e->next)
14891 {
14892 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
14893 {
14894 if(e->destType)
14895 FreeType(e->destType);
14896 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
14897 }
14898 ProcessExpressionType(e);
14899 if(!e->next)
14900 {
14901 }
14902 if(!e->isConstant)
14903 exp->isConstant = 0x0;
14904 }
14905 if(!exp->expType)
14906 exp->expType = Dereference(exp->index.exp->expType);
14907 if(exp->expType)
14908 DeclareType(exp->expType, 0x0, 0x0);
14909 break;
14910 }
14911 case 7:
14912 {
14913 struct Expression * e;
14914 struct Type * functionType;
14915 struct Type * methodType = (((void *)0));
14916 char name[1024];
14917
14918 name[0] = '\0';
14919 if(inCompiler)
14920 {
14921 PrintExpression(exp->call.exp, name);
14922 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
14923 {
14924 PrintExpression(exp->call.exp, name);
14925 }
14926 }
14927 if(exp->call.exp->type == 0)
14928 {
14929 struct Expression * idExp = exp->call.exp;
14930 struct Identifier * id = idExp->identifier;
14931
14932 if(!strcmp(id->string, "__builtin_frame_address"))
14933 {
14934 exp->expType = ProcessTypeString("void *", 0x1);
14935 if(exp->call.arguments && (*exp->call.arguments).first)
14936 ProcessExpressionType((*exp->call.arguments).first);
14937 break;
14938 }
14939 else if(!strcmp(id->string, "__ENDIAN_PAD"))
14940 {
14941 exp->expType = ProcessTypeString("int", 0x1);
14942 if(exp->call.arguments && (*exp->call.arguments).first)
14943 ProcessExpressionType((*exp->call.arguments).first);
14944 break;
14945 }
14946 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
14947 {
14948 struct Expression * a = (((void *)0));
14949 struct Expression * b = (((void *)0));
14950 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
14951
14952 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
14953 {
14954 a = (*exp->call.arguments).first;
14955 b = (*exp->call.arguments).last;
14956 tempExp1 = a;
14957 tempExp2 = b;
14958 }
14959 else if((*exp->call.arguments).count == 1)
14960 {
14961 a = (*exp->call.arguments).first;
14962 tempExp1 = a;
14963 }
14964 if(a)
14965 {
14966 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
14967 idExp->identifier = (((void *)0));
14968 FreeExpContents(exp);
14969 ProcessExpressionType(a);
14970 if(b)
14971 ProcessExpressionType(b);
14972 exp->type = 5;
14973 exp->list = MkList();
14974 if(a->expType && (!b || b->expType))
14975 {
14976 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
14977 {
14978 if(inCompiler)
14979 {
14980 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14981 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
14982 struct Declaration * decl;
14983 char temp1[1024], temp2[1024];
14984
14985 GetTypeSpecs(a->expType, specs);
14986 if(a && !a->isConstant && a->type != 0)
14987 {
14988 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
14989 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
14990 tempExp1 = QMkExpId(temp1);
14991 tempExp1->expType = a->expType;
14992 if(a->expType)
14993 a->expType->refCount++;
14994 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
14995 }
14996 if(b && !b->isConstant && b->type != 0)
14997 {
14998 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
14999 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
15000 tempExp2 = QMkExpId(temp2);
15001 tempExp2->expType = b->expType;
15002 if(b->expType)
15003 b->expType->refCount++;
15004 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
15005 }
15006 decl = MkDeclaration(specs, decls);
15007 if(!curCompound->compound.declarations)
15008 curCompound->compound.declarations = MkList();
15009 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
15010 }
15011 }
15012 }
15013 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
15014 {
15015 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
15016
15017 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
15018 exp->expType = a->expType;
15019 if(a->expType)
15020 a->expType->refCount++;
15021 }
15022 else if(!strcmp(id->string, "Abs"))
15023 {
15024 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
15025 exp->expType = a->expType;
15026 if(a->expType)
15027 a->expType->refCount++;
15028 }
15029 else if(!strcmp(id->string, "Sgn"))
15030 {
15031 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"))))));
15032 exp->expType = ProcessTypeString("int", 0x0);
15033 }
15034 FreeExpression(tempExp1);
15035 if(tempExp2)
15036 FreeExpression(tempExp2);
15037 FreeIdentifier(id);
15038 break;
15039 }
15040 }
15041 }
15042 {
15043 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
15044
15045 if(!exp->call.exp->destType)
15046 {
15047 exp->call.exp->destType = dummy;
15048 dummy->refCount++;
15049 }
15050 ProcessExpressionType(exp->call.exp);
15051 if(exp->call.exp->destType == dummy)
15052 {
15053 FreeType(dummy);
15054 exp->call.exp->destType = (((void *)0));
15055 }
15056 FreeType(dummy);
15057 }
15058 functionType = exp->call.exp->expType;
15059 if(functionType && functionType->kind == 16)
15060 {
15061 methodType = functionType;
15062 functionType = methodType->method->dataType;
15063 if(exp->call.exp->expType->usedClass)
15064 {
15065 char typeString[1024];
15066
15067 typeString[0] = '\0';
15068 {
15069 struct Symbol * back = functionType->thisClass;
15070
15071 functionType->thisClass = (((void *)0));
15072 PrintType(functionType, typeString, 0x1, 0x1);
15073 functionType->thisClass = back;
15074 }
15075 if(strstr(typeString, "thisclass"))
15076 {
15077 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15078 struct Declarator * decl;
15079
15080 {
15081 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
15082
15083 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
15084 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
15085 thisClassParams = 0x0;
15086 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
15087 {
15088 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
15089
15090 thisClass = exp->call.exp->expType->usedClass;
15091 ProcessDeclarator(decl);
15092 thisClass = backupThisClass;
15093 }
15094 thisClassParams = 0x1;
15095 functionType = ProcessType(specs, decl);
15096 functionType->refCount = 0;
15097 FinishTemplatesContext(context);
15098 }
15099 FreeList(specs, FreeSpecifier);
15100 FreeDeclarator(decl);
15101 }
15102 }
15103 }
15104 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
15105 {
15106 struct Type * type = functionType->type;
15107
15108 if(!functionType->refCount)
15109 {
15110 functionType->type = (((void *)0));
15111 FreeType(functionType);
15112 }
15113 functionType = type;
15114 }
15115 if(functionType && functionType->kind != 11)
15116 {
15117 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "called object %s is not a function\n", (((void *)0))), name);
15118 }
15119 else if(functionType)
15120 {
15121 unsigned int emptyParams = 0x0, noParams = 0x0;
15122 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
15123 struct Type * type = functionType->params.first;
15124 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
15125 int extra = 0;
15126 struct Location oldyylloc = yylloc;
15127
15128 if(!type)
15129 emptyParams = 0x1;
15130 if(functionType->extraParam && e && functionType->thisClass)
15131 {
15132 e->destType = MkClassType(functionType->thisClass->string);
15133 e = e->next;
15134 }
15135 if(!functionType->staticMethod && !functionType->extraParam)
15136 {
15137 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
15138 {
15139 type = MkClassType(memberExp->member.exp->expType->_class->string);
15140 if(e)
15141 {
15142 e->destType = type;
15143 e = e->next;
15144 type = functionType->params.first;
15145 }
15146 else
15147 type->refCount = 0;
15148 }
15149 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
15150 {
15151 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
15152 type->byReference = functionType->byReference;
15153 type->typedByReference = functionType->typedByReference;
15154 if(e)
15155 {
15156 if(e->next && type->kind == 8 && (functionType && functionType->thisClass) && functionType->classObjectType == 2)
15157 e = e->next;
15158 e->destType = type;
15159 e = e->next;
15160 type = functionType->params.first;
15161 }
15162 else
15163 type->refCount = 0;
15164 }
15165 }
15166 if(type && type->kind == 0)
15167 {
15168 noParams = 0x1;
15169 if(!type->refCount)
15170 FreeType(type);
15171 type = (((void *)0));
15172 }
15173 for(; e; e = e->next)
15174 {
15175 if(!type && !emptyParams)
15176 {
15177 yylloc = e->loc;
15178 if(methodType && methodType->methodClass)
15179 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);
15180 else
15181 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);
15182 break;
15183 }
15184 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
15185 {
15186 struct Type * templatedType = (((void *)0));
15187 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
15188 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15189 int id = 0;
15190
15191 if(_class && _class->templateArgs)
15192 {
15193 struct __ecereNameSpace__ecere__com__Class * sClass;
15194
15195 for(sClass = _class; sClass; sClass = sClass->base)
15196 {
15197 if(sClass->templateClass)
15198 sClass = sClass->templateClass;
15199 id = 0;
15200 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15201 {
15202 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
15203 {
15204 struct __ecereNameSpace__ecere__com__Class * nextClass;
15205
15206 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15207 {
15208 if(nextClass->templateClass)
15209 nextClass = nextClass->templateClass;
15210 id += nextClass->templateParams.count;
15211 }
15212 break;
15213 }
15214 id++;
15215 }
15216 if(curParam)
15217 break;
15218 }
15219 }
15220 if(curParam && _class->templateArgs[id].dataTypeString)
15221 {
15222 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
15223
15224 {
15225 struct Context * context = SetupTemplatesContext(_class);
15226
15227 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
15228 FinishTemplatesContext(context);
15229 }
15230 e->destType = templatedType;
15231 if(templatedType)
15232 {
15233 templatedType->passAsTemplate = 0x1;
15234 }
15235 }
15236 else
15237 {
15238 e->destType = type;
15239 if(type)
15240 type->refCount++;
15241 }
15242 }
15243 else
15244 {
15245 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
15246 {
15247 e->destType = type->prev;
15248 e->destType->refCount++;
15249 }
15250 else
15251 {
15252 e->destType = type;
15253 if(type)
15254 type->refCount++;
15255 }
15256 }
15257 if(type && type->kind != 14)
15258 {
15259 struct Type * next = type->next;
15260
15261 if(!type->refCount)
15262 FreeType(type);
15263 type = next;
15264 }
15265 }
15266 if(type && type->kind != 14)
15267 {
15268 if(methodType && methodType->methodClass)
15269 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);
15270 else
15271 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);
15272 }
15273 yylloc = oldyylloc;
15274 if(type && !type->refCount)
15275 FreeType(type);
15276 }
15277 else
15278 {
15279 functionType = __extension__ ({
15280 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15281
15282 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
15283 });
15284 if(exp->call.exp->type == 0)
15285 {
15286 char * string = exp->call.exp->identifier->string;
15287
15288 if(inCompiler)
15289 {
15290 struct Symbol * symbol;
15291 struct Location oldyylloc = yylloc;
15292
15293 yylloc = exp->call.exp->identifier->loc;
15294 if(strstr(string, "__builtin_") == string)
15295 {
15296 if(exp->destType)
15297 {
15298 functionType->returnType = exp->destType;
15299 exp->destType->refCount++;
15300 }
15301 }
15302 else
15303 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s undefined; assuming extern returning int\n", (((void *)0))), string);
15304 symbol = __extension__ ({
15305 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
15306
15307 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 0x1), __ecereInstance1;
15308 });
15309 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
15310 if(strstr(symbol->string, "::"))
15311 globalContext->hasNameSpace = 0x1;
15312 yylloc = oldyylloc;
15313 }
15314 }
15315 else if(exp->call.exp->type == 8)
15316 {
15317 }
15318 else
15319 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "callable object undefined; extern assuming returning int\n", (((void *)0))));
15320 if(!functionType->returnType)
15321 {
15322 functionType->returnType = __extension__ ({
15323 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15324
15325 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15326 });
15327 }
15328 }
15329 if(functionType && functionType->kind == 11)
15330 {
15331 exp->expType = functionType->returnType;
15332 if(functionType->returnType)
15333 functionType->returnType->refCount++;
15334 if(!functionType->refCount)
15335 FreeType(functionType);
15336 }
15337 if(exp->call.arguments)
15338 {
15339 for(e = (*exp->call.arguments).first; e; e = e->next)
15340 {
15341 struct Type * destType = e->destType;
15342
15343 ProcessExpressionType(e);
15344 }
15345 }
15346 break;
15347 }
15348 case 8:
15349 {
15350 struct Type * type;
15351 struct Location oldyylloc = yylloc;
15352 unsigned int thisPtr;
15353 struct Expression * checkExp = exp->member.exp;
15354
15355 while(checkExp)
15356 {
15357 if(checkExp->type == 11)
15358 checkExp = checkExp->cast.exp;
15359 else if(checkExp->type == 5)
15360 checkExp = checkExp->list ? (*checkExp->list).first : (((void *)0));
15361 else
15362 break;
15363 }
15364 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->identifier->string, "this"));
15365 exp->thisPtr = thisPtr;
15366 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
15367 {
15368 exp->member.member->classSym = exp->member.member->_class->symbol;
15369 }
15370 ProcessExpressionType(exp->member.exp);
15371 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)
15372 {
15373 exp->isConstant = 0x0;
15374 }
15375 else
15376 exp->isConstant = exp->member.exp->isConstant;
15377 type = exp->member.exp->expType;
15378 yylloc = exp->loc;
15379 if(type && (type->kind == 20))
15380 {
15381 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
15382 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
15383
15384 if(_class)
15385 {
15386 for(param = _class->templateParams.first; param; param = param->next)
15387 {
15388 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
15389 break;
15390 }
15391 }
15392 if(param && param->defaultArg.member)
15393 {
15394 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
15395
15396 if(argExp)
15397 {
15398 struct Expression * expMember = exp->member.exp;
15399 struct Declarator * decl;
15400 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15401 char thisClassTypeString[1024];
15402
15403 FreeIdentifier(exp->member.member);
15404 ProcessExpressionType(argExp);
15405 {
15406 char * colon = strstr(param->defaultArg.memberString, "::");
15407
15408 if(colon)
15409 {
15410 char className[1024];
15411 struct __ecereNameSpace__ecere__com__Class * sClass;
15412
15413 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
15414 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
15415 }
15416 else
15417 strcpy(thisClassTypeString, _class->fullName);
15418 }
15419 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
15420 exp->expType = ProcessType(specs, decl);
15421 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
15422 {
15423 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
15424 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
15425 int c;
15426 int paramCount = 0;
15427 int lastParam = -1;
15428 char templateString[1024];
15429 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
15430
15431 sprintf(templateString, "%s<", expClass->templateClass->fullName);
15432 for(cClass = expClass; cClass; cClass = cClass->base)
15433 {
15434 int p = 0;
15435
15436 for(param = cClass->templateParams.first; param; param = param->next)
15437 {
15438 int id = p;
15439 struct __ecereNameSpace__ecere__com__Class * sClass;
15440 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
15441
15442 for(sClass = cClass->base; sClass; sClass = sClass->base)
15443 id += sClass->templateParams.count;
15444 arg = expClass->templateArgs[id];
15445 for(sClass = _class; sClass; sClass = sClass->base)
15446 {
15447 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
15448 int p = 0;
15449 struct __ecereNameSpace__ecere__com__Class * nextClass;
15450
15451 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15452 p += nextClass->templateParams.count;
15453 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
15454 {
15455 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
15456 {
15457 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15458 {
15459 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
15460 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
15461 break;
15462 }
15463 }
15464 }
15465 }
15466 {
15467 char argument[256];
15468
15469 argument[0] = '\0';
15470 switch(param->type)
15471 {
15472 case 2:
15473 {
15474 char expString[1024];
15475 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15476 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
15477 struct Expression * exp;
15478 char * string = PrintHexUInt64(arg.expression.ui64);
15479
15480 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
15481 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
15482 ProcessExpressionType(exp);
15483 ComputeExpression(exp);
15484 expString[0] = '\0';
15485 PrintExpression(exp, expString);
15486 strcat(argument, expString);
15487 FreeExpression(exp);
15488 break;
15489 }
15490 case 1:
15491 {
15492 strcat(argument, arg.member->name);
15493 break;
15494 }
15495 case 0:
15496 {
15497 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15498 {
15499 if(!strcmp(arg.dataTypeString, "thisclass"))
15500 strcat(argument, thisClassTypeString);
15501 else
15502 strcat(argument, arg.dataTypeString);
15503 }
15504 break;
15505 }
15506 }
15507 if(argument[0])
15508 {
15509 if(paramCount)
15510 strcat(templateString, ", ");
15511 if(lastParam != p - 1)
15512 {
15513 strcat(templateString, param->name);
15514 strcat(templateString, " = ");
15515 }
15516 strcat(templateString, argument);
15517 paramCount++;
15518 lastParam = p;
15519 }
15520 p++;
15521 }
15522 }
15523 }
15524 {
15525 int len = strlen(templateString);
15526
15527 if(templateString[len - 1] == '>')
15528 templateString[len++] = ' ';
15529 templateString[len++] = '>';
15530 templateString[len++] = '\0';
15531 }
15532 {
15533 struct Context * context = SetupTemplatesContext(_class);
15534
15535 FreeType(exp->expType);
15536 exp->expType = ProcessTypeString(templateString, 0x0);
15537 FinishTemplatesContext(context);
15538 }
15539 }
15540 exp->type = 5;
15541 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")))))))));
15542 }
15543 }
15544 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
15545 {
15546 type = ProcessTemplateParameterType(type->templateParameter);
15547 }
15548 }
15549 if(type && (type->kind == 20))
15550 ;
15551 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)))
15552 {
15553 struct Identifier * id = exp->member.member;
15554 int typeKind = type->kind;
15555 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));
15556
15557 if(typeKind == 19 && exp->member.exp->type == 24)
15558 {
15559 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
15560 typeKind = 8;
15561 }
15562 if(id)
15563 {
15564 if(typeKind == 3 || typeKind == 15)
15565 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
15566 else if(!_class)
15567 {
15568 if(type->kind == 8 && type->_class && type->_class->registered)
15569 {
15570 _class = type->_class->registered;
15571 }
15572 else if((type->kind == 12 || type->kind == 13) && type->type && type->type->kind == 1)
15573 {
15574 _class = FindClass("char *")->registered;
15575 }
15576 else if(type->kind == 13)
15577 {
15578 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
15579 FreeType(exp->expType);
15580 exp->expType = ProcessTypeString("uintptr", 0x0);
15581 exp->byReference = 0x1;
15582 }
15583 else
15584 {
15585 char string[1024] = "";
15586 struct Symbol * classSym;
15587
15588 PrintTypeNoConst(type, string, 0x0, 0x1);
15589 classSym = FindClass(string);
15590 if(classSym)
15591 _class = classSym->registered;
15592 }
15593 }
15594 }
15595 if(_class && id)
15596 {
15597 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
15598 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
15599 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
15600 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
15601 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
15602
15603 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
15604 exp->member.memberType = 1;
15605 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
15606 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
15607 if(typeKind != 19)
15608 {
15609 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
15610 {
15611 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
15612 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
15613 {
15614 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15615 if(prop)
15616 member = (((void *)0));
15617 }
15618 if(!member && !prop)
15619 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15620 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
15621 exp->member.thisPtr = 0x1;
15622 }
15623 else
15624 {
15625 if(!id->classSym)
15626 {
15627 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
15628 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
15629 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
15630 }
15631 if(!prop && !member)
15632 {
15633 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
15634 if(!method)
15635 {
15636 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15637 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
15638 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
15639 }
15640 }
15641 if(member && prop)
15642 {
15643 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
15644 prop = (((void *)0));
15645 else
15646 member = (((void *)0));
15647 }
15648 }
15649 }
15650 if(!prop && !member && !method)
15651 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
15652 if(!prop && !member && !method)
15653 {
15654 if(typeKind == 19)
15655 {
15656 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
15657 if(classProp)
15658 {
15659 exp->member.memberType = 5;
15660 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
15661 }
15662 else
15663 {
15664 char structName[1024];
15665 struct Identifier * id = exp->member.member;
15666 struct Expression * classExp = exp->member.exp;
15667
15668 type->refCount++;
15669 FreeType(classExp->expType);
15670 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
15671 strcpy(structName, "__ecereClassData_");
15672 FullClassNameCat(structName, type->_class->string, 0x0);
15673 exp->type = 9;
15674 exp->member.member = id;
15675 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"))))))));
15676 FreeType(type);
15677 ProcessExpressionType(exp);
15678 return ;
15679 }
15680 }
15681 else
15682 {
15683 struct Symbol * classSym = FindClass(id->string);
15684
15685 if(classSym)
15686 {
15687 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
15688
15689 if(convertClass)
15690 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
15691 }
15692 }
15693 }
15694 if(prop)
15695 {
15696 exp->member.memberType = 1;
15697 if(!prop->dataType)
15698 ProcessPropertyType(prop);
15699 exp->expType = prop->dataType;
15700 if(prop->dataType)
15701 prop->dataType->refCount++;
15702 }
15703 else if(member)
15704 {
15705 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
15706 {
15707 FreeExpContents(exp);
15708 exp->type = 0;
15709 exp->identifier = MkIdentifier("class");
15710 ProcessExpressionType(exp);
15711 return ;
15712 }
15713 exp->member.memberType = 3;
15714 DeclareStruct(_class->fullName, 0x0);
15715 if(!member->dataType)
15716 {
15717 struct Context * context = SetupTemplatesContext(_class);
15718
15719 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
15720 FinishTemplatesContext(context);
15721 }
15722 exp->expType = member->dataType;
15723 if(member->dataType)
15724 member->dataType->refCount++;
15725 }
15726 else if(revConvert)
15727 {
15728 exp->member.memberType = 4;
15729 exp->expType = MkClassType(revConvert->_class->fullName);
15730 }
15731 else if(method)
15732 {
15733 {
15734 exp->member.memberType = 2;
15735 }
15736 if(!method->dataType)
15737 ProcessMethodType(method);
15738 exp->expType = __extension__ ({
15739 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15740
15741 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1;
15742 });
15743 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
15744 exp->expType->usedClass = _class;
15745 }
15746 else if(!classProp)
15747 {
15748 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
15749 {
15750 FreeExpContents(exp);
15751 exp->type = 0;
15752 exp->identifier = MkIdentifier("class");
15753 FreeType(exp->expType);
15754 exp->expType = MkClassType("ecere::com::Class");
15755 return ;
15756 }
15757 yylloc = exp->member.member->loc;
15758 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
15759 if(inCompiler)
15760 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
15761 }
15762 if(_class && exp->expType)
15763 {
15764 struct __ecereNameSpace__ecere__com__Class * tClass;
15765
15766 tClass = _class;
15767 while(tClass && !tClass->templateClass)
15768 tClass = tClass->base;
15769 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
15770 {
15771 int id = 0;
15772 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15773 struct __ecereNameSpace__ecere__com__Class * sClass;
15774
15775 for(sClass = tClass; sClass; sClass = sClass->base)
15776 {
15777 id = 0;
15778 if(sClass->templateClass)
15779 sClass = sClass->templateClass;
15780 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15781 {
15782 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
15783 {
15784 for(sClass = sClass->base; sClass; sClass = sClass->base)
15785 id += sClass->templateParams.count;
15786 break;
15787 }
15788 id++;
15789 }
15790 if(curParam)
15791 break;
15792 }
15793 if(curParam && tClass->templateArgs[id].dataTypeString)
15794 {
15795 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
15796 struct Context * context = SetupTemplatesContext(tClass);
15797
15798 FreeType(exp->expType);
15799 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
15800 if(exp->expType)
15801 {
15802 if(exp->expType->kind == 21)
15803 {
15804 FreeType(exp->expType);
15805 exp->expType = ReplaceThisClassType(_class);
15806 }
15807 if(tClass->templateClass)
15808 exp->expType->passAsTemplate = 0x1;
15809 if(!exp->destType)
15810 {
15811 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
15812 if(exp->destType->kind == 21)
15813 {
15814 FreeType(exp->destType);
15815 exp->destType = ReplaceThisClassType(_class);
15816 }
15817 }
15818 }
15819 FinishTemplatesContext(context);
15820 }
15821 }
15822 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
15823 {
15824 int id = 0;
15825 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15826 struct __ecereNameSpace__ecere__com__Class * sClass;
15827
15828 for(sClass = tClass; sClass; sClass = sClass->base)
15829 {
15830 id = 0;
15831 if(sClass->templateClass)
15832 sClass = sClass->templateClass;
15833 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15834 {
15835 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
15836 {
15837 for(sClass = sClass->base; sClass; sClass = sClass->base)
15838 id += sClass->templateParams.count;
15839 break;
15840 }
15841 id++;
15842 }
15843 if(curParam)
15844 break;
15845 }
15846 if(curParam)
15847 {
15848 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
15849 struct Context * context = SetupTemplatesContext(tClass);
15850 struct Type * basicType;
15851
15852 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
15853 if(basicType)
15854 {
15855 if(basicType->kind == 21)
15856 {
15857 FreeType(basicType);
15858 basicType = ReplaceThisClassType(_class);
15859 }
15860 FreeType(exp->expType);
15861 exp->expType = __extension__ ({
15862 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15863
15864 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = basicType, __ecereInstance1;
15865 });
15866 if(!exp->destType)
15867 {
15868 exp->destType = exp->expType;
15869 exp->destType->refCount++;
15870 }
15871 {
15872 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
15873 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15874 struct Declarator * decl;
15875
15876 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
15877 *newExp = *exp;
15878 if(exp->destType)
15879 exp->destType->refCount++;
15880 if(exp->expType)
15881 exp->expType->refCount++;
15882 exp->type = 11;
15883 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
15884 exp->cast.exp = newExp;
15885 }
15886 }
15887 FinishTemplatesContext(context);
15888 }
15889 }
15890 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
15891 {
15892 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
15893
15894 if(expClass)
15895 {
15896 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
15897 int c;
15898 int p = 0;
15899 int paramCount = 0;
15900 int lastParam = -1;
15901 char templateString[1024];
15902 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
15903
15904 sprintf(templateString, "%s<", expClass->templateClass->fullName);
15905 while(cClass != expClass)
15906 {
15907 struct __ecereNameSpace__ecere__com__Class * sClass;
15908
15909 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
15910 ;
15911 cClass = sClass;
15912 for(param = cClass->templateParams.first; param; param = param->next)
15913 {
15914 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
15915 int c;
15916 int cp = 0;
15917 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
15918 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
15919
15920 while(cClassCur != tClass && !paramCur)
15921 {
15922 struct __ecereNameSpace__ecere__com__Class * sClassCur;
15923
15924 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
15925 ;
15926 cClassCur = sClassCur;
15927 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
15928 {
15929 if(!strcmp(paramCur->name, param->name))
15930 {
15931 break;
15932 }
15933 cp++;
15934 }
15935 }
15936 if(paramCur && paramCur->type == 0)
15937 arg = tClass->templateArgs[cp];
15938 else
15939 arg = expClass->templateArgs[p];
15940 {
15941 char argument[256];
15942
15943 argument[0] = '\0';
15944 switch(param->type)
15945 {
15946 case 2:
15947 {
15948 char expString[1024];
15949 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15950 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
15951 struct Expression * exp;
15952 char * string = PrintHexUInt64(arg.expression.ui64);
15953
15954 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
15955 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
15956 ProcessExpressionType(exp);
15957 ComputeExpression(exp);
15958 expString[0] = '\0';
15959 PrintExpression(exp, expString);
15960 strcat(argument, expString);
15961 FreeExpression(exp);
15962 break;
15963 }
15964 case 1:
15965 {
15966 strcat(argument, arg.member->name);
15967 break;
15968 }
15969 case 0:
15970 {
15971 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15972 strcat(argument, arg.dataTypeString);
15973 break;
15974 }
15975 }
15976 if(argument[0])
15977 {
15978 if(paramCount)
15979 strcat(templateString, ", ");
15980 if(lastParam != p - 1)
15981 {
15982 strcat(templateString, param->name);
15983 strcat(templateString, " = ");
15984 }
15985 strcat(templateString, argument);
15986 paramCount++;
15987 lastParam = p;
15988 }
15989 }
15990 p++;
15991 }
15992 }
15993 {
15994 int len = strlen(templateString);
15995
15996 if(templateString[len - 1] == '>')
15997 templateString[len++] = ' ';
15998 templateString[len++] = '>';
15999 templateString[len++] = '\0';
16000 }
16001 FreeType(exp->expType);
16002 {
16003 struct Context * context = SetupTemplatesContext(tClass);
16004
16005 exp->expType = ProcessTypeString(templateString, 0x0);
16006 FinishTemplatesContext(context);
16007 }
16008 }
16009 }
16010 }
16011 }
16012 else
16013 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)");
16014 }
16015 else if(type && (type->kind == 9 || type->kind == 10))
16016 {
16017 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
16018
16019 if(memberType)
16020 {
16021 exp->expType = memberType;
16022 if(memberType)
16023 memberType->refCount++;
16024 }
16025 }
16026 else
16027 {
16028 char expString[10240];
16029
16030 expString[0] = '\0';
16031 if(inCompiler)
16032 {
16033 PrintExpression(exp, expString);
16034 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16035 }
16036 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "member operator on non-structure type expression %s\n", (((void *)0))), expString);
16037 }
16038 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
16039 {
16040 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
16041 {
16042 struct Identifier * id = exp->member.member;
16043 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));
16044
16045 if(_class)
16046 {
16047 FreeType(exp->expType);
16048 exp->expType = ReplaceThisClassType(_class);
16049 }
16050 }
16051 }
16052 yylloc = oldyylloc;
16053 break;
16054 }
16055 case 9:
16056 {
16057 struct Type * destType = exp->destType;
16058
16059 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
16060 {
16061 exp->member.member->classSym = exp->member.member->_class->symbol;
16062 }
16063 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
16064 exp->type = 8;
16065 if(destType)
16066 destType->count++;
16067 ProcessExpressionType(exp);
16068 if(destType)
16069 destType->count--;
16070 break;
16071 }
16072 case 15:
16073 {
16074 struct Symbol * classSym = exp->_class->symbol;
16075
16076 if(classSym && classSym->registered)
16077 {
16078 if(classSym->registered->type == 5)
16079 {
16080 char name[1024];
16081
16082 name[0] = '\0';
16083 DeclareStruct(classSym->string, 0x0);
16084 FreeSpecifier(exp->_class);
16085 exp->type = 10;
16086 FullClassNameCat(name, classSym->string, 0x0);
16087 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
16088 }
16089 else
16090 {
16091 if(classSym->registered->fixed)
16092 {
16093 FreeSpecifier(exp->_class);
16094 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
16095 exp->type = 2;
16096 }
16097 else
16098 {
16099 char className[1024];
16100
16101 strcpy(className, "__ecereClass_");
16102 FullClassNameCat(className, classSym->string, 0x1);
16103 MangleClassName(className);
16104 DeclareClass(classSym, className);
16105 FreeExpContents(exp);
16106 exp->type = 9;
16107 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
16108 exp->member.member = MkIdentifier("structSize");
16109 }
16110 }
16111 }
16112 exp->expType = __extension__ ({
16113 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16114
16115 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
16116 });
16117 break;
16118 }
16119 case 10:
16120 {
16121 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
16122
16123 exp->expType = __extension__ ({
16124 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16125
16126 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
16127 });
16128 exp->isConstant = 0x1;
16129 DeclareType(type, 0x0, 0x0);
16130 FreeType(type);
16131 break;
16132 }
16133 case 11:
16134 {
16135 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
16136
16137 type->count = 1;
16138 FreeType(exp->cast.exp->destType);
16139 exp->cast.exp->destType = type;
16140 type->refCount++;
16141 ProcessExpressionType(exp->cast.exp);
16142 type->count = 0;
16143 exp->expType = type;
16144 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
16145 {
16146 void * prev = exp->prev, * next = exp->next;
16147 struct Type * expType = exp->cast.exp->destType;
16148 struct Expression * castExp = exp->cast.exp;
16149 struct Type * destType = exp->destType;
16150
16151 if(expType)
16152 expType->refCount++;
16153 FreeType(exp->expType);
16154 FreeTypeName(exp->cast.typeName);
16155 *exp = *castExp;
16156 FreeType(exp->expType);
16157 FreeType(exp->destType);
16158 exp->expType = expType;
16159 exp->destType = destType;
16160 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
16161 exp->prev = prev;
16162 exp->next = next;
16163 }
16164 else
16165 {
16166 exp->isConstant = exp->cast.exp->isConstant;
16167 }
16168 break;
16169 }
16170 case 33:
16171 {
16172 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
16173
16174 exp->expType = type;
16175 break;
16176 }
16177 case 34:
16178 {
16179 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
16180
16181 ProcessExpressionType(exp->vaArg.exp);
16182 exp->expType = type;
16183 break;
16184 }
16185 case 12:
16186 {
16187 struct Expression * e;
16188
16189 exp->isConstant = 0x1;
16190 FreeType(exp->cond.cond->destType);
16191 exp->cond.cond->destType = MkClassType("bool");
16192 exp->cond.cond->destType->truth = 0x1;
16193 ProcessExpressionType(exp->cond.cond);
16194 if(!exp->cond.cond->isConstant)
16195 exp->isConstant = 0x0;
16196 for(e = (*exp->cond.exp).first; e; e = e->next)
16197 {
16198 if(!e->next)
16199 {
16200 FreeType(e->destType);
16201 e->destType = exp->destType;
16202 if(e->destType)
16203 e->destType->refCount++;
16204 }
16205 ProcessExpressionType(e);
16206 if(!e->next)
16207 {
16208 exp->expType = e->expType;
16209 if(e->expType)
16210 e->expType->refCount++;
16211 }
16212 if(!e->isConstant)
16213 exp->isConstant = 0x0;
16214 }
16215 FreeType(exp->cond.elseExp->destType);
16216 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
16217 if(exp->cond.elseExp->destType)
16218 exp->cond.elseExp->destType->refCount++;
16219 ProcessExpressionType(exp->cond.elseExp);
16220 if(!exp->cond.elseExp->isConstant)
16221 exp->isConstant = 0x0;
16222 break;
16223 }
16224 case 23:
16225 {
16226 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
16227 {
16228 struct Statement * last = (*exp->compound->compound.statements).last;
16229
16230 if(last->type == 3 && last->expressions && (*last->expressions).last)
16231 {
16232 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
16233 if(exp->destType)
16234 exp->destType->refCount++;
16235 }
16236 ProcessStatement(exp->compound);
16237 exp->expType = (last->expressions && (*last->expressions).last) ? ((struct Expression *)(*last->expressions).last)->expType : (((void *)0));
16238 if(exp->expType)
16239 exp->expType->refCount++;
16240 }
16241 break;
16242 }
16243 case 24:
16244 {
16245 struct Specifier * spec = (*exp->_classExp.specifiers).first;
16246
16247 if(spec && spec->type == 1)
16248 {
16249 exp->expType = MkClassType(spec->name);
16250 exp->expType->kind = 19;
16251 exp->byReference = 0x1;
16252 }
16253 else
16254 {
16255 exp->expType = MkClassType("ecere::com::Class");
16256 exp->byReference = 0x1;
16257 }
16258 break;
16259 }
16260 case 25:
16261 {
16262 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
16263
16264 if(_class)
16265 {
16266 struct Identifier * id = exp->classData.id;
16267 char structName[1024];
16268 struct Expression * classExp;
16269
16270 strcpy(structName, "__ecereClassData_");
16271 FullClassNameCat(structName, _class->fullName, 0x0);
16272 exp->type = 9;
16273 exp->member.member = id;
16274 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
16275 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
16276 else
16277 classExp = MkExpIdentifier(MkIdentifier("class"));
16278 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"))))))));
16279 ProcessExpressionType(exp);
16280 return ;
16281 }
16282 break;
16283 }
16284 case 35:
16285 {
16286 struct Type * type = (((void *)0));
16287 char * typeString = (((void *)0));
16288 char typeStringBuf[1024];
16289
16290 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))
16291 {
16292 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
16293
16294 typeString = templateClass->templateArgs[2].dataTypeString;
16295 }
16296 else if(exp->list)
16297 {
16298 struct Expression * e;
16299
16300 for(e = (*exp->list).first; e; e = e->next)
16301 {
16302 ProcessExpressionType(e);
16303 if(e->expType)
16304 {
16305 if(!type)
16306 {
16307 type = e->expType;
16308 type->refCount++;
16309 }
16310 else
16311 {
16312 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
16313 {
16314 FreeType(type);
16315 type = e->expType;
16316 e->expType = (((void *)0));
16317 e = (*exp->list).first;
16318 ProcessExpressionType(e);
16319 if(e->expType)
16320 {
16321 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
16322 {
16323 FreeType(e->expType);
16324 e->expType = (((void *)0));
16325 FreeType(type);
16326 type = (((void *)0));
16327 break;
16328 }
16329 }
16330 }
16331 }
16332 if(e->expType)
16333 {
16334 FreeType(e->expType);
16335 e->expType = (((void *)0));
16336 }
16337 }
16338 }
16339 if(type)
16340 {
16341 typeStringBuf[0] = '\0';
16342 PrintTypeNoConst(type, typeStringBuf, 0x0, 0x1);
16343 typeString = typeStringBuf;
16344 FreeType(type);
16345 type = (((void *)0));
16346 }
16347 }
16348 if(typeString)
16349 {
16350 char templateString[1024];
16351 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
16352 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
16353 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16354 struct Expression * expExt;
16355 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16356
16357 sprintf(templateString, "Container<%s>", typeString);
16358 if(exp->list)
16359 {
16360 struct Expression * e;
16361
16362 type = ProcessTypeString(typeString, 0x0);
16363 while(e = (*exp->list).first)
16364 {
16365 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
16366 e->destType = type;
16367 type->refCount++;
16368 ProcessExpressionType(e);
16369 ListAdd(initializers, MkInitializerAssignment(e));
16370 }
16371 FreeType(type);
16372 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
16373 }
16374 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
16375 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
16376 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16377 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
16378 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16379 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
16380 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16381 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
16382 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16383 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
16384 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16385
16386 __ecereInstance1->type = 2, __ecereInstance1->constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, (void *)0), __ecereInstance1;
16387 })));
16388 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16389 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
16390 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16391 exp->expType = ProcessTypeString(templateString, 0x0);
16392 exp->type = 5;
16393 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
16394 ProcessExpressionType(expExt);
16395 }
16396 else
16397 {
16398 exp->expType = ProcessTypeString("Container", 0x0);
16399 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
16400 }
16401 break;
16402 }
16403 }
16404 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
16405 {
16406 FreeType(exp->expType);
16407 exp->expType = ReplaceThisClassType(thisClass);
16408 }
16409 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
16410 {
16411 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
16412
16413 if(symbol)
16414 {
16415 if(exp->expType->kind != 15)
16416 {
16417 struct Type * member;
16418 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
16419
16420 FreeType(exp->expType);
16421 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16422 exp->expType->kind = symbol->type->kind;
16423 exp->expType->refCount++;
16424 exp->expType->enumName = enumName;
16425 exp->expType->members = symbol->type->members;
16426 for(member = symbol->type->members.first; member; member = member->next)
16427 member->refCount++;
16428 }
16429 else
16430 {
16431 struct __ecereNameSpace__ecere__sys__NamedLink * member;
16432
16433 for(member = symbol->type->members.first; member; member = member->next)
16434 {
16435 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(structSize_NamedLink), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
16436
16437 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
16438 }
16439 }
16440 }
16441 }
16442 yylloc = exp->loc;
16443 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
16444 ;
16445 else if(exp->destType && !exp->destType->keepCast)
16446 {
16447 if(!CheckExpressionType(exp, exp->destType, 0x0))
16448 {
16449 if(!exp->destType->count || unresolved)
16450 {
16451 if(!exp->expType)
16452 {
16453 yylloc = exp->loc;
16454 if(exp->destType->kind != 14)
16455 {
16456 char type2[1024];
16457
16458 type2[0] = '\0';
16459 if(inCompiler)
16460 {
16461 char expString[10240];
16462
16463 expString[0] = '\0';
16464 PrintType(exp->destType, type2, 0x0, 0x1);
16465 if(inCompiler)
16466 {
16467 PrintExpression(exp, expString);
16468 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16469 }
16470 if(unresolved)
16471 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
16472 else if(exp->type != 16)
16473 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
16474 }
16475 }
16476 else
16477 {
16478 char expString[10240];
16479
16480 expString[0] = '\0';
16481 if(inCompiler)
16482 {
16483 PrintExpression(exp, expString);
16484 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16485 }
16486 if(unresolved)
16487 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), expString);
16488 else if(exp->type != 16)
16489 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16490 }
16491 }
16492 else
16493 {
16494 char type1[1024];
16495 char type2[1024];
16496
16497 type1[0] = '\0';
16498 type2[0] = '\0';
16499 if(inCompiler)
16500 {
16501 PrintType(exp->expType, type1, 0x0, 0x1);
16502 PrintType(exp->destType, type2, 0x0, 0x1);
16503 }
16504 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)))
16505 ;
16506 else
16507 {
16508 char expString[10240];
16509
16510 expString[0] = '\0';
16511 if(inCompiler)
16512 {
16513 PrintExpression(exp, expString);
16514 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16515 }
16516 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
16517 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
16518 FreeType(exp->expType);
16519 exp->destType->refCount++;
16520 exp->expType = exp->destType;
16521 }
16522 }
16523 }
16524 }
16525 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
16526 {
16527 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16528 char typeString[1024];
16529 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16530 struct Declarator * decl;
16531
16532 typeString[0] = '\0';
16533 *newExp = *exp;
16534 if(exp->expType)
16535 exp->expType->refCount++;
16536 if(exp->expType)
16537 exp->expType->refCount++;
16538 exp->type = 11;
16539 newExp->destType = exp->expType;
16540 PrintType(exp->expType, typeString, 0x0, 0x0);
16541 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16542 exp->cast.typeName = MkTypeName(specs, decl);
16543 exp->cast.exp = newExp;
16544 }
16545 }
16546 else if(unresolved)
16547 {
16548 if(exp->identifier->_class && exp->identifier->_class->name)
16549 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
16550 else if(exp->identifier->string && exp->identifier->string[0])
16551 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
16552 }
16553 else if(!exp->expType && exp->type != 16)
16554 {
16555 char expString[10240];
16556
16557 expString[0] = '\0';
16558 if(inCompiler)
16559 {
16560 PrintExpression(exp, expString);
16561 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16562 }
16563 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16564 }
16565 if(inCompiler)
16566 ApplyAnyObjectLogic(exp);
16567 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)))
16568 {
16569 exp->byReference = 0x1;
16570 }
16571 yylloc = oldyylloc;
16572 }
16573
16574 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)
16575 {
16576 if(*curMember)
16577 {
16578 *curMember = (*curMember)->next;
16579 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
16580 {
16581 *curMember = subMemberStack[--(*subMemberStackPos)];
16582 *curMember = (*curMember)->next;
16583 }
16584 while((*curMember) && (*curMember)->isProperty)
16585 *curMember = (*curMember)->next;
16586 if(subMemberStackPos)
16587 {
16588 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
16589 {
16590 subMemberStack[(*subMemberStackPos)++] = *curMember;
16591 *curMember = (*curMember)->members.first;
16592 while(*curMember && (*curMember)->isProperty)
16593 *curMember = (*curMember)->next;
16594 }
16595 }
16596 }
16597 while(!*curMember)
16598 {
16599 if(!*curMember)
16600 {
16601 if(subMemberStackPos && *subMemberStackPos)
16602 {
16603 *curMember = subMemberStack[--(*subMemberStackPos)];
16604 *curMember = (*curMember)->next;
16605 }
16606 else
16607 {
16608 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
16609
16610 if(*curClass == _class)
16611 break;
16612 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
16613 ;
16614 *curMember = (*curClass)->membersAndProperties.first;
16615 }
16616 while((*curMember) && (*curMember)->isProperty)
16617 *curMember = (*curMember)->next;
16618 if(subMemberStackPos)
16619 {
16620 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
16621 {
16622 subMemberStack[(*subMemberStackPos)++] = *curMember;
16623 *curMember = (*curMember)->members.first;
16624 while(*curMember && (*curMember)->isProperty)
16625 *curMember = (*curMember)->next;
16626 }
16627 }
16628 }
16629 }
16630 }
16631
16632 static void ProcessInitializer(struct Initializer * init, struct Type * type)
16633 {
16634 switch(init->type)
16635 {
16636 case 0:
16637 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
16638 {
16639 if(init->exp && !init->exp->destType)
16640 {
16641 FreeType(init->exp->destType);
16642 init->exp->destType = type;
16643 if(type)
16644 type->refCount++;
16645 }
16646 if(init->exp)
16647 {
16648 ProcessExpressionType(init->exp);
16649 init->isConstant = init->exp->isConstant;
16650 }
16651 break;
16652 }
16653 else
16654 {
16655 struct Expression * exp = init->exp;
16656 struct Instantiation * inst = exp->instance;
16657 struct MembersInit * members;
16658
16659 init->type = 1;
16660 init->list = MkList();
16661 if(inst->members)
16662 {
16663 for(members = (*inst->members).first; members; members = members->next)
16664 {
16665 if(members->type == 0)
16666 {
16667 struct MemberInit * member;
16668
16669 for(member = (*members->dataMembers).first; member; member = member->next)
16670 {
16671 ListAdd(init->list, member->initializer);
16672 member->initializer = (((void *)0));
16673 }
16674 }
16675 }
16676 }
16677 FreeExpression(exp);
16678 }
16679 case 1:
16680 {
16681 struct Initializer * i;
16682 struct Type * initializerType = (((void *)0));
16683 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
16684 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
16685 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
16686 int subMemberStackPos = 0;
16687
16688 if(type && type->kind == 12)
16689 initializerType = Dereference(type);
16690 else if(type && (type->kind == 9 || type->kind == 10))
16691 initializerType = type->members.first;
16692 for(i = (*init->list).first; i; i = i->next)
16693 {
16694 if(type && type->kind == 8 && type->_class && type->_class->registered)
16695 {
16696 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
16697 if(curMember)
16698 {
16699 if(!curMember->dataType)
16700 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
16701 initializerType = curMember->dataType;
16702 }
16703 }
16704 ProcessInitializer(i, initializerType);
16705 if(initializerType && type && (type->kind == 9 || type->kind == 10))
16706 initializerType = initializerType->next;
16707 if(!i->isConstant)
16708 init->isConstant = 0x0;
16709 }
16710 if(type && type->kind == 12)
16711 FreeType(initializerType);
16712 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
16713 {
16714 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Assigning list initializer to non list\n", (((void *)0))));
16715 }
16716 break;
16717 }
16718 }
16719 }
16720
16721 extern struct Symbol * FindType(struct Context * ctx, char *  name);
16722
16723 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
16724
16725 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
16726 {
16727 switch(spec->type)
16728 {
16729 case 0:
16730 {
16731 if(spec->specifier == THISCLASS)
16732 {
16733 if(thisClass)
16734 {
16735 spec->type = 1;
16736 spec->name = ReplaceThisClass(thisClass);
16737 spec->symbol = FindClass(spec->name);
16738 ProcessSpecifier(spec, declareStruct);
16739 }
16740 }
16741 break;
16742 }
16743 case 1:
16744 {
16745 struct Symbol * symbol = FindType(curContext, spec->name);
16746
16747 if(symbol)
16748 DeclareType(symbol->type, 0x1, 0x1);
16749 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
16750 DeclareStruct(spec->name, 0x0);
16751 break;
16752 }
16753 case 2:
16754 {
16755 struct Enumerator * e;
16756
16757 if(spec->list)
16758 {
16759 for(e = (*spec->list).first; e; e = e->next)
16760 {
16761 if(e->exp)
16762 ProcessExpressionType(e->exp);
16763 }
16764 }
16765 break;
16766 }
16767 case 3:
16768 case 4:
16769 {
16770 if(spec->definitions)
16771 {
16772 struct ClassDef * def;
16773 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
16774
16775 ProcessClass(spec->definitions, symbol);
16776 }
16777 break;
16778 }
16779 }
16780 }
16781
16782 static void ProcessDeclarator(struct Declarator * decl)
16783 {
16784 switch(decl->type)
16785 {
16786 case 1:
16787 if(decl->identifier->classSym)
16788 {
16789 FreeSpecifier(decl->identifier->_class);
16790 decl->identifier->_class = (((void *)0));
16791 }
16792 break;
16793 case 3:
16794 if(decl->array.exp)
16795 ProcessExpressionType(decl->array.exp);
16796 case 0:
16797 case 2:
16798 case 4:
16799 case 5:
16800 case 6:
16801 case 7:
16802 if(decl->declarator)
16803 ProcessDeclarator(decl->declarator);
16804 if(decl->type == 4)
16805 {
16806 struct Identifier * id = GetDeclId(decl);
16807
16808 if(id && id->_class)
16809 {
16810 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
16811
16812 if(!decl->function.parameters)
16813 decl->function.parameters = MkList();
16814 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
16815 id->_class = (((void *)0));
16816 }
16817 if(decl->function.parameters)
16818 {
16819 struct TypeName * param;
16820
16821 for(param = (*decl->function.parameters).first; param; param = param->next)
16822 {
16823 if(param->qualifiers && (*param->qualifiers).first)
16824 {
16825 struct Specifier * spec = (*param->qualifiers).first;
16826
16827 if(spec && spec->specifier == TYPED_OBJECT)
16828 {
16829 struct Declarator * d = param->declarator;
16830 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);
16831
16832 FreeList(param->qualifiers, FreeSpecifier);
16833 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
16834 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
16835 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
16836 param = newParam;
16837 }
16838 else if(spec && spec->specifier == ANY_OBJECT)
16839 {
16840 struct Declarator * d = param->declarator;
16841
16842 FreeList(param->qualifiers, FreeSpecifier);
16843 param->qualifiers = MkListOne(MkSpecifier(VOID));
16844 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
16845 }
16846 else if(spec->specifier == THISCLASS)
16847 {
16848 if(thisClass)
16849 {
16850 spec->type = 1;
16851 spec->name = ReplaceThisClass(thisClass);
16852 spec->symbol = FindClass(spec->name);
16853 ProcessSpecifier(spec, 0x0);
16854 }
16855 }
16856 }
16857 if(param->declarator)
16858 ProcessDeclarator(param->declarator);
16859 }
16860 }
16861 }
16862 break;
16863 }
16864 }
16865
16866 extern struct Identifier * CopyIdentifier(struct Identifier * id);
16867
16868 extern void FreeInitDeclarator(struct InitDeclarator * decl);
16869
16870 static void ProcessDeclaration(struct Declaration * decl)
16871 {
16872 yylloc = decl->loc;
16873 switch(decl->type)
16874 {
16875 case 1:
16876 {
16877 unsigned int declareStruct = 0x0;
16878
16879 if(decl->declarators)
16880 {
16881 struct InitDeclarator * d;
16882
16883 for(d = (*decl->declarators).first; d; d = d->next)
16884 {
16885 struct Type * type, * subType;
16886
16887 ProcessDeclarator(d->declarator);
16888 type = ProcessType(decl->specifiers, d->declarator);
16889 if(d->initializer)
16890 {
16891 ProcessInitializer(d->initializer, type);
16892 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
16893 {
16894 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
16895 {
16896 struct Instantiation * inst = d->initializer->exp->instance;
16897
16898 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
16899 d->initializer->exp->instance = (((void *)0));
16900 if(decl->specifiers)
16901 FreeList(decl->specifiers, FreeSpecifier);
16902 FreeList(decl->declarators, FreeInitDeclarator);
16903 d = (((void *)0));
16904 decl->type = 2;
16905 decl->inst = inst;
16906 }
16907 }
16908 }
16909 for(subType = type; subType; )
16910 {
16911 if(subType->kind == 8)
16912 {
16913 declareStruct = 0x1;
16914 break;
16915 }
16916 else if(subType->kind == 13)
16917 break;
16918 else if(subType->kind == 12)
16919 subType = subType->arrayType;
16920 else
16921 break;
16922 }
16923 FreeType(type);
16924 if(!d)
16925 break;
16926 }
16927 }
16928 if(decl->specifiers)
16929 {
16930 struct Specifier * s;
16931
16932 for(s = (*decl->specifiers).first; s; s = s->next)
16933 {
16934 ProcessSpecifier(s, declareStruct);
16935 }
16936 }
16937 break;
16938 }
16939 case 2:
16940 {
16941 ProcessInstantiationType(decl->inst);
16942 break;
16943 }
16944 case 0:
16945 {
16946 struct Specifier * spec;
16947 struct Declarator * d;
16948 unsigned int declareStruct = 0x0;
16949
16950 if(decl->declarators)
16951 {
16952 for(d = (*decl->declarators).first; d; d = d->next)
16953 {
16954 struct Type * type = ProcessType(decl->specifiers, d->declarator);
16955 struct Type * subType;
16956
16957 ProcessDeclarator(d);
16958 for(subType = type; subType; )
16959 {
16960 if(subType->kind == 8)
16961 {
16962 declareStruct = 0x1;
16963 break;
16964 }
16965 else if(subType->kind == 13)
16966 break;
16967 else if(subType->kind == 12)
16968 subType = subType->arrayType;
16969 else
16970 break;
16971 }
16972 FreeType(type);
16973 }
16974 }
16975 if(decl->specifiers)
16976 {
16977 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
16978 ProcessSpecifier(spec, declareStruct);
16979 }
16980 break;
16981 }
16982 }
16983 }
16984
16985 static struct FunctionDefinition * curFunction;
16986
16987 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
16988 {
16989 char propName[1024], propNameM[1024];
16990 char getName[1024], setName[1024];
16991 struct __ecereNameSpace__ecere__sys__OldList * args;
16992
16993 DeclareProperty(prop, setName, getName);
16994 strcpy(propName, "__ecereProp_");
16995 FullClassNameCat(propName, prop->_class->fullName, 0x0);
16996 strcat(propName, "_");
16997 FullClassNameCat(propName, prop->name, 0x1);
16998 MangleClassName(propName);
16999 strcpy(propNameM, "__ecerePropM_");
17000 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
17001 strcat(propNameM, "_");
17002 FullClassNameCat(propNameM, prop->name, 0x1);
17003 MangleClassName(propNameM);
17004 if(prop->isWatchable)
17005 {
17006 args = MkList();
17007 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17008 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17009 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17010 args = MkList();
17011 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17012 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17013 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17014 }
17015 {
17016 args = MkList();
17017 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17018 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17019 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17020 args = MkList();
17021 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17022 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17023 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17024 }
17025 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
17026 curFunction->propSet->fireWatchersDone = 0x1;
17027 }
17028
17029 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
17030
17031 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
17032
17033 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
17034
17035 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
17036
17037 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
17038
17039 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
17040
17041 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
17042
17043 extern void FreePropertyWatch(struct PropertyWatch * watcher);
17044
17045 static void ProcessStatement(struct Statement * stmt)
17046 {
17047 yylloc = stmt->loc;
17048 switch(stmt->type)
17049 {
17050 case 0:
17051 ProcessStatement(stmt->labeled.stmt);
17052 break;
17053 case 1:
17054 if(stmt->caseStmt.exp)
17055 {
17056 FreeType(stmt->caseStmt.exp->destType);
17057 stmt->caseStmt.exp->destType = curSwitchType;
17058 if(curSwitchType)
17059 curSwitchType->refCount++;
17060 ProcessExpressionType(stmt->caseStmt.exp);
17061 ComputeExpression(stmt->caseStmt.exp);
17062 }
17063 if(stmt->caseStmt.stmt)
17064 ProcessStatement(stmt->caseStmt.stmt);
17065 break;
17066 case 2:
17067 {
17068 if(stmt->compound.context)
17069 {
17070 struct Declaration * decl;
17071 struct Statement * s;
17072 struct Statement * prevCompound = curCompound;
17073 struct Context * prevContext = curContext;
17074
17075 if(!stmt->compound.isSwitch)
17076 curCompound = stmt;
17077 curContext = stmt->compound.context;
17078 if(stmt->compound.declarations)
17079 {
17080 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
17081 ProcessDeclaration(decl);
17082 }
17083 if(stmt->compound.statements)
17084 {
17085 for(s = (*stmt->compound.statements).first; s; s = s->next)
17086 ProcessStatement(s);
17087 }
17088 curContext = prevContext;
17089 curCompound = prevCompound;
17090 }
17091 break;
17092 }
17093 case 3:
17094 {
17095 struct Expression * exp;
17096
17097 if(stmt->expressions)
17098 {
17099 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
17100 ProcessExpressionType(exp);
17101 }
17102 break;
17103 }
17104 case 4:
17105 {
17106 struct Expression * exp;
17107
17108 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
17109 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
17110 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
17111 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
17112 {
17113 ProcessExpressionType(exp);
17114 }
17115 if(stmt->ifStmt.stmt)
17116 ProcessStatement(stmt->ifStmt.stmt);
17117 if(stmt->ifStmt.elseStmt)
17118 ProcessStatement(stmt->ifStmt.elseStmt);
17119 break;
17120 }
17121 case 5:
17122 {
17123 struct Type * oldSwitchType = curSwitchType;
17124
17125 if(stmt->switchStmt.exp)
17126 {
17127 struct Expression * exp;
17128
17129 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
17130 {
17131 if(!exp->next)
17132 {
17133 ProcessExpressionType(exp);
17134 }
17135 if(!exp->next)
17136 curSwitchType = exp->expType;
17137 }
17138 }
17139 ProcessStatement(stmt->switchStmt.stmt);
17140 curSwitchType = oldSwitchType;
17141 break;
17142 }
17143 case 6:
17144 {
17145 if(stmt->whileStmt.exp)
17146 {
17147 struct Expression * exp;
17148
17149 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
17150 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
17151 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
17152 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
17153 {
17154 ProcessExpressionType(exp);
17155 }
17156 }
17157 if(stmt->whileStmt.stmt)
17158 ProcessStatement(stmt->whileStmt.stmt);
17159 break;
17160 }
17161 case 7:
17162 {
17163 if(stmt->doWhile.exp)
17164 {
17165 struct Expression * exp;
17166
17167 if((*stmt->doWhile.exp).last)
17168 {
17169 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
17170 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
17171 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
17172 }
17173 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
17174 {
17175 ProcessExpressionType(exp);
17176 }
17177 }
17178 if(stmt->doWhile.stmt)
17179 ProcessStatement(stmt->doWhile.stmt);
17180 break;
17181 }
17182 case 8:
17183 {
17184 struct Expression * exp;
17185
17186 if(stmt->forStmt.init)
17187 ProcessStatement(stmt->forStmt.init);
17188 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
17189 {
17190 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
17191 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
17192 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
17193 }
17194 if(stmt->forStmt.check)
17195 ProcessStatement(stmt->forStmt.check);
17196 if(stmt->forStmt.increment)
17197 {
17198 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
17199 ProcessExpressionType(exp);
17200 }
17201 if(stmt->forStmt.stmt)
17202 ProcessStatement(stmt->forStmt.stmt);
17203 break;
17204 }
17205 case 18:
17206 {
17207 struct Identifier * id = stmt->forEachStmt.id;
17208 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
17209 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
17210 struct Statement * block = stmt->forEachStmt.stmt;
17211 char iteratorType[1024];
17212 struct Type * source;
17213 struct Expression * e;
17214 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));
17215 struct Expression * arrayExp;
17216 char * typeString = (((void *)0));
17217 int builtinCount = 0;
17218
17219 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
17220 {
17221 if(!e->next)
17222 {
17223 FreeType(e->destType);
17224 e->destType = ProcessTypeString("Container", 0x0);
17225 }
17226 if(!isBuiltin || e->next)
17227 ProcessExpressionType(e);
17228 }
17229 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
17230 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
17231 {
17232 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
17233 struct Symbol * symbol;
17234 struct Expression * expIt = (((void *)0));
17235 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
17236 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
17237 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
17238 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
17239
17240 stmt->type = 2;
17241 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
17242 stmt->compound.context->parent = curContext;
17243 curContext = stmt->compound.context;
17244 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
17245 {
17246 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
17247 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
17248
17249 isCustomAVLTree = 0x1;
17250 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
17251 isAVLTree = 0x1;
17252 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
17253 isMap = 0x1;
17254 }
17255 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
17256 isArray = 0x1;
17257 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
17258 {
17259 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
17260
17261 isLinkList = 0x1;
17262 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
17263 }
17264 if(isArray)
17265 {
17266 struct Declarator * decl;
17267 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17268
17269 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
17270 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17271 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
17272 }
17273 else if(isBuiltin)
17274 {
17275 struct Type * type = (((void *)0));
17276 char typeStringBuf[1024];
17277
17278 arrayExp = (((struct Expression *)(*exp).last)->type == 35) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
17279 if(((struct Expression *)(*exp).last)->type == 11)
17280 {
17281 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
17282
17283 if(typeName)
17284 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
17285 }
17286 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)
17287 {
17288 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
17289
17290 typeString = templateClass->templateArgs[2].dataTypeString;
17291 }
17292 else if(arrayExp->list)
17293 {
17294 struct Expression * e;
17295
17296 for(e = (*arrayExp->list).first; e; e = e->next)
17297 {
17298 ProcessExpressionType(e);
17299 if(e->expType)
17300 {
17301 if(!type)
17302 {
17303 type = e->expType;
17304 type->refCount++;
17305 }
17306 else
17307 {
17308 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
17309 {
17310 FreeType(type);
17311 type = e->expType;
17312 e->expType = (((void *)0));
17313 e = (*arrayExp->list).first;
17314 ProcessExpressionType(e);
17315 if(e->expType)
17316 {
17317 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
17318 {
17319 FreeType(e->expType);
17320 e->expType = (((void *)0));
17321 FreeType(type);
17322 type = (((void *)0));
17323 break;
17324 }
17325 }
17326 }
17327 }
17328 if(e->expType)
17329 {
17330 FreeType(e->expType);
17331 e->expType = (((void *)0));
17332 }
17333 }
17334 }
17335 if(type)
17336 {
17337 typeStringBuf[0] = '\0';
17338 PrintType(type, typeStringBuf, 0x0, 0x1);
17339 typeString = typeStringBuf;
17340 FreeType(type);
17341 }
17342 }
17343 if(typeString)
17344 {
17345 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
17346 struct Declarator * decl;
17347 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17348
17349 if(arrayExp->list)
17350 {
17351 struct Expression * e;
17352
17353 builtinCount = (*arrayExp->list).count;
17354 type = ProcessTypeString(typeString, 0x0);
17355 while(e = (*arrayExp->list).first)
17356 {
17357 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
17358 e->destType = type;
17359 type->refCount++;
17360 ProcessExpressionType(e);
17361 ListAdd(initializers, MkInitializerAssignment(e));
17362 }
17363 FreeType(type);
17364 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
17365 }
17366 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
17367 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
17368 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
17369 FreeList(exp, FreeExpression);
17370 }
17371 else
17372 {
17373 arrayExp->expType = ProcessTypeString("Container", 0x0);
17374 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
17375 }
17376 }
17377 else if(isLinkList && !isList)
17378 {
17379 struct Declarator * decl;
17380 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17381
17382 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
17383 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17384 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
17385 }
17386 else if(_class->templateArgs)
17387 {
17388 if(isMap)
17389 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
17390 else
17391 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
17392 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
17393 }
17394 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
17395 if(block)
17396 {
17397 switch(block->type)
17398 {
17399 case 2:
17400 if(block->compound.context)
17401 block->compound.context->parent = stmt->compound.context;
17402 break;
17403 case 4:
17404 if(block->ifStmt.stmt && block->ifStmt.stmt->type == 2 && block->ifStmt.stmt->compound.context)
17405 block->ifStmt.stmt->compound.context->parent = stmt->compound.context;
17406 if(block->ifStmt.elseStmt && block->ifStmt.elseStmt->type == 2 && block->ifStmt.elseStmt->compound.context)
17407 block->ifStmt.elseStmt->compound.context->parent = stmt->compound.context;
17408 break;
17409 case 5:
17410 if(block->switchStmt.stmt && block->switchStmt.stmt->type == 2 && block->switchStmt.stmt->compound.context)
17411 block->switchStmt.stmt->compound.context->parent = stmt->compound.context;
17412 break;
17413 case 6:
17414 if(block->whileStmt.stmt && block->whileStmt.stmt->type == 2 && block->whileStmt.stmt->compound.context)
17415 block->whileStmt.stmt->compound.context->parent = stmt->compound.context;
17416 break;
17417 case 7:
17418 if(block->doWhile.stmt && block->doWhile.stmt->type == 2 && block->doWhile.stmt->compound.context)
17419 block->doWhile.stmt->compound.context->parent = stmt->compound.context;
17420 break;
17421 case 8:
17422 if(block->forStmt.stmt && block->forStmt.stmt->type == 2 && block->forStmt.stmt->compound.context)
17423 block->forStmt.stmt->compound.context->parent = stmt->compound.context;
17424 break;
17425 case 18:
17426 if(block->forEachStmt.stmt && block->forEachStmt.stmt->type == 2 && block->forEachStmt.stmt->compound.context)
17427 block->forEachStmt.stmt->compound.context->parent = stmt->compound.context;
17428 break;
17429 }
17430 }
17431 if(filter)
17432 {
17433 block = MkIfStmt(filter, block, (((void *)0)));
17434 }
17435 if(isArray)
17436 {
17437 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));
17438 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17439 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17440 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17441 }
17442 else if(isBuiltin)
17443 {
17444 char count[128];
17445
17446 sprintf(count, "%d", builtinCount);
17447 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));
17448 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17449 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17450 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17451 }
17452 else if(isLinkList && !isList)
17453 {
17454 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
17455 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
17456
17457 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
17458 {
17459 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));
17460 }
17461 else
17462 {
17463 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17464 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
17465
17466 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));
17467 }
17468 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17469 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17470 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17471 }
17472 else
17473 {
17474 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
17475 }
17476 ProcessExpressionType(expIt);
17477 if((*stmt->compound.declarations).first)
17478 ProcessDeclaration((*stmt->compound.declarations).first);
17479 if(symbol)
17480 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
17481 ProcessStatement(stmt);
17482 curContext = stmt->compound.context->parent;
17483 break;
17484 }
17485 else
17486 {
17487 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Expression is not a container\n", (((void *)0))));
17488 }
17489 break;
17490 }
17491 case 9:
17492 break;
17493 case 10:
17494 break;
17495 case 11:
17496 break;
17497 case 12:
17498 {
17499 struct Expression * exp;
17500
17501 if(stmt->expressions)
17502 {
17503 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
17504 {
17505 if(!exp->next)
17506 {
17507 if(curFunction && !curFunction->type)
17508 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
17509 FreeType(exp->destType);
17510 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
17511 if(exp->destType)
17512 exp->destType->refCount++;
17513 }
17514 ProcessExpressionType(exp);
17515 }
17516 }
17517 break;
17518 }
17519 case 14:
17520 {
17521 ProcessDeclaration(stmt->decl);
17522 break;
17523 }
17524 case 13:
17525 {
17526 struct AsmField * field;
17527
17528 if(stmt->asmStmt.inputFields)
17529 {
17530 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
17531 if(field->expression)
17532 ProcessExpressionType(field->expression);
17533 }
17534 if(stmt->asmStmt.outputFields)
17535 {
17536 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
17537 if(field->expression)
17538 ProcessExpressionType(field->expression);
17539 }
17540 if(stmt->asmStmt.clobberedFields)
17541 {
17542 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
17543 {
17544 if(field->expression)
17545 ProcessExpressionType(field->expression);
17546 }
17547 }
17548 break;
17549 }
17550 case 17:
17551 {
17552 struct PropertyWatch * propWatch;
17553 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17554 struct Expression * object = stmt->_watch.object;
17555 struct Expression * watcher = stmt->_watch.watcher;
17556
17557 if(watcher)
17558 ProcessExpressionType(watcher);
17559 if(object)
17560 ProcessExpressionType(object);
17561 if(inCompiler)
17562 {
17563 if(watcher || thisClass)
17564 {
17565 struct External * external = curExternal;
17566 struct Context * context = curContext;
17567
17568 stmt->type = 3;
17569 stmt->expressions = MkList();
17570 curExternal = external->prev;
17571 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
17572 {
17573 struct ClassFunction * func;
17574 char watcherName[1024];
17575 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
17576 struct External * createdExternal;
17577 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
17578
17579 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
17580 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
17581 if(propWatch->deleteWatch)
17582 strcat(watcherName, "_delete");
17583 else
17584 {
17585 struct Identifier * propID;
17586
17587 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
17588 {
17589 strcat(watcherName, "_");
17590 strcat(watcherName, propID->string);
17591 }
17592 }
17593 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
17594 {
17595 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
17596 ProcessClassFunctionBody(func, propWatch->compound);
17597 propWatch->compound = (((void *)0));
17598 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
17599 createdExternal->symbol->idCode = external->symbol->idCode;
17600 curExternal = createdExternal;
17601 ProcessFunction(createdExternal->function);
17602 {
17603 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
17604
17605 externalDecl->declaration = decl;
17606 if(decl->symbol && !decl->symbol->pointerExternal)
17607 decl->symbol->pointerExternal = externalDecl;
17608 }
17609 if(propWatch->deleteWatch)
17610 {
17611 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17612
17613 ListAdd(args, CopyExpression(object));
17614 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17615 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
17616 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
17617 }
17618 else
17619 {
17620 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
17621 struct Identifier * propID;
17622
17623 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
17624 {
17625 char propName[1024];
17626 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17627
17628 if(prop)
17629 {
17630 char getName[1024], setName[1024];
17631 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17632
17633 DeclareProperty(prop, setName, getName);
17634 strcpy(propName, "__ecereProp_");
17635 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17636 strcat(propName, "_");
17637 FullClassNameCat(propName, prop->name, 0x1);
17638 ListAdd(args, CopyExpression(object));
17639 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17640 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17641 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
17642 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
17643 }
17644 else
17645 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
17646 }
17647 }
17648 }
17649 else
17650 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid watched object\n", (((void *)0))));
17651 }
17652 curExternal = external;
17653 curContext = context;
17654 if(watcher)
17655 FreeExpression(watcher);
17656 if(object)
17657 FreeExpression(object);
17658 FreeList(watches, FreePropertyWatch);
17659 }
17660 else
17661 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a _class\n", (((void *)0))));
17662 }
17663 else
17664 {
17665 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
17666 {
17667 ProcessStatement(propWatch->compound);
17668 }
17669 }
17670 break;
17671 }
17672 case 15:
17673 {
17674 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17675 struct Expression * object = stmt->_watch.object;
17676 struct __ecereNameSpace__ecere__com__Class * _class;
17677
17678 if(object)
17679 ProcessExpressionType(object);
17680 if(inCompiler)
17681 {
17682 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
17683 if(_class)
17684 {
17685 struct Identifier * propID;
17686
17687 stmt->type = 3;
17688 stmt->expressions = MkList();
17689 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
17690 {
17691 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
17692 }
17693 else if(!watches)
17694 {
17695 }
17696 if(watches)
17697 {
17698 for(propID = (*watches).first; propID; propID = propID->next)
17699 {
17700 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17701
17702 if(prop)
17703 {
17704 CreateFireWatcher(prop, object, stmt);
17705 }
17706 else
17707 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
17708 }
17709 }
17710 else
17711 {
17712 struct __ecereNameSpace__ecere__com__Property * prop;
17713 struct __ecereNameSpace__ecere__com__Class * base;
17714
17715 for(base = _class; base; base = base->base)
17716 {
17717 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
17718 {
17719 if(prop->isProperty && prop->isWatchable)
17720 {
17721 CreateFireWatcher(prop, object, stmt);
17722 }
17723 }
17724 }
17725 }
17726 if(object)
17727 FreeExpression(object);
17728 FreeList(watches, FreeIdentifier);
17729 }
17730 else
17731 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
17732 }
17733 break;
17734 }
17735 case 16:
17736 {
17737 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17738 struct Expression * object = stmt->_watch.object;
17739 struct Expression * watcher = stmt->_watch.watcher;
17740 struct __ecereNameSpace__ecere__com__Class * _class;
17741
17742 if(object)
17743 ProcessExpressionType(object);
17744 if(watcher)
17745 ProcessExpressionType(watcher);
17746 if(inCompiler)
17747 {
17748 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
17749 if(watcher || thisClass)
17750 {
17751 if(_class)
17752 {
17753 struct Identifier * propID;
17754
17755 stmt->type = 3;
17756 stmt->expressions = MkList();
17757 if(!watches)
17758 {
17759 struct __ecereNameSpace__ecere__sys__OldList * args;
17760
17761 args = MkList();
17762 ListAdd(args, CopyExpression(object));
17763 ListAdd(args, MkExpConstant("0"));
17764 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17765 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
17766 }
17767 else
17768 {
17769 for(propID = (*watches).first; propID; propID = propID->next)
17770 {
17771 char propName[1024];
17772 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17773
17774 if(prop)
17775 {
17776 char getName[1024], setName[1024];
17777 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17778
17779 DeclareProperty(prop, setName, getName);
17780 strcpy(propName, "__ecereProp_");
17781 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17782 strcat(propName, "_");
17783 FullClassNameCat(propName, prop->name, 0x1);
17784 MangleClassName(propName);
17785 ListAdd(args, CopyExpression(object));
17786 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17787 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17788 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
17789 }
17790 else
17791 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
17792 }
17793 }
17794 if(object)
17795 FreeExpression(object);
17796 if(watcher)
17797 FreeExpression(watcher);
17798 FreeList(watches, FreeIdentifier);
17799 }
17800 else
17801 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
17802 }
17803 else
17804 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
17805 }
17806 break;
17807 }
17808 }
17809 }
17810
17811 extern struct Expression * QBrackets(struct Expression * exp);
17812
17813 extern struct TypeName * QMkType(char *  spec, struct Declarator * decl);
17814
17815 extern struct Declarator * QMkPtrDecl(char *  id);
17816
17817 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
17818
17819 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
17820
17821 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
17822
17823 static void ProcessFunction(struct FunctionDefinition * function)
17824 {
17825 struct Identifier * id = GetDeclId(function->declarator);
17826 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
17827 struct Type * type = symbol ? symbol->type : (((void *)0));
17828 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
17829 struct Context * oldTopContext = topContext;
17830
17831 yylloc = function->loc;
17832 if(type && type->thisClass)
17833 {
17834 struct Symbol * classSym = type->thisClass;
17835 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
17836 char className[1024];
17837 char structName[1024];
17838 struct Declarator * funcDecl;
17839 struct Symbol * thisSymbol;
17840 unsigned int typedObject = 0x0;
17841
17842 if(_class && !_class->base)
17843 {
17844 _class = currentClass;
17845 if(_class && !_class->symbol)
17846 _class->symbol = FindClass(_class->fullName);
17847 classSym = _class ? _class->symbol : (((void *)0));
17848 typedObject = 0x1;
17849 }
17850 thisClass = _class;
17851 if(inCompiler && _class)
17852 {
17853 if(type->kind == 11)
17854 {
17855 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
17856 {
17857 struct Type * param = symbol->type->params.first;
17858
17859 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
17860 FreeType(param);
17861 }
17862 if(type->classObjectType != 1)
17863 {
17864 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
17865 symbol->type->staticMethod = 0x1;
17866 symbol->type->thisClass = (((void *)0));
17867 symbol->type->extraParam = 0x0;
17868 }
17869 }
17870 strcpy(className, "__ecereClass_");
17871 FullClassNameCat(className, _class->fullName, 0x1);
17872 MangleClassName(className);
17873 structName[0] = (char)0;
17874 FullClassNameCat(structName, _class->fullName, 0x0);
17875 funcDecl = GetFuncDecl(function->declarator);
17876 if(funcDecl)
17877 {
17878 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
17879 {
17880 struct TypeName * param = (*funcDecl->function.parameters).first;
17881
17882 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
17883 {
17884 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
17885 FreeTypeName(param);
17886 }
17887 }
17888 if(!function->propertyNoThis)
17889 {
17890 struct TypeName * thisParam;
17891
17892 if(type->classObjectType != 1)
17893 {
17894 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
17895 if(!funcDecl->function.parameters)
17896 funcDecl->function.parameters = MkList();
17897 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
17898 }
17899 if(typedObject)
17900 {
17901 if(type->classObjectType != 1)
17902 {
17903 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
17904 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
17905 }
17906 thisParam = __extension__ ({
17907 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
17908
17909 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
17910 });
17911 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
17912 }
17913 }
17914 }
17915 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
17916 {
17917 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
17918
17919 funcDecl = GetFuncDecl(initDecl->declarator);
17920 if(funcDecl)
17921 {
17922 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
17923 {
17924 struct TypeName * param = (*funcDecl->function.parameters).first;
17925
17926 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
17927 {
17928 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
17929 FreeTypeName(param);
17930 }
17931 }
17932 if(type->classObjectType != 1)
17933 {
17934 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
17935 {
17936 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
17937
17938 if(!funcDecl->function.parameters)
17939 funcDecl->function.parameters = MkList();
17940 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
17941 }
17942 }
17943 }
17944 }
17945 }
17946 if(function->body)
17947 {
17948 if(type->classObjectType != 1)
17949 {
17950 thisSymbol = __extension__ ({
17951 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
17952
17953 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
17954 });
17955 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17956 if(typedObject && thisSymbol->type)
17957 {
17958 thisSymbol->type->classObjectType = 2;
17959 thisSymbol->type->byReference = type->byReference;
17960 thisSymbol->type->typedByReference = type->byReference;
17961 }
17962 }
17963 }
17964 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
17965 {
17966 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
17967
17968 {
17969 struct __ecereNameSpace__ecere__com__Class * base;
17970
17971 for(base = _class; base && base->type != 1000; base = base->next)
17972 {
17973 for(member = base->membersAndProperties.first; member; member = member->next)
17974 if(!member->isProperty)
17975 break;
17976 if(member)
17977 break;
17978 }
17979 }
17980 for(member = _class->membersAndProperties.first; member; member = member->next)
17981 if(!member->isProperty)
17982 break;
17983 if(member)
17984 {
17985 char pointerName[1024];
17986 struct Declaration * decl;
17987 struct Initializer * initializer;
17988 struct Expression * exp, * bytePtr;
17989
17990 strcpy(pointerName, "__ecerePointer_");
17991 FullClassNameCat(pointerName, _class->fullName, 0x0);
17992 {
17993 char className[1024];
17994
17995 strcpy(className, "__ecereClass_");
17996 FullClassNameCat(className, classSym->string, 0x1);
17997 MangleClassName(className);
17998 DeclareClass(classSym, className);
17999 }
18000 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
18001 if(_class->fixed)
18002 {
18003 char string[256];
18004
18005 sprintf(string, "%d", _class->offset);
18006 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
18007 }
18008 else
18009 {
18010 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
18011 }
18012 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
18013 exp->expType = __extension__ ({
18014 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18015
18016 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
18017 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18018
18019 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
18020 }), __ecereInstance2;
18021 });
18022 if(function->body)
18023 {
18024 yylloc = function->body->loc;
18025 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
18026 {
18027 struct Context * prevContext = curContext;
18028
18029 curContext = function->body->compound.context;
18030 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
18031 curContext = prevContext;
18032 }
18033 decl->symbol = (((void *)0));
18034 if(!function->body->compound.declarations)
18035 function->body->compound.declarations = MkList();
18036 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
18037 }
18038 }
18039 }
18040 }
18041 else
18042 thisClass = (((void *)0));
18043 if(id)
18044 {
18045 FreeSpecifier(id->_class);
18046 id->_class = (((void *)0));
18047 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
18048 {
18049 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
18050
18051 id = GetDeclId(initDecl->declarator);
18052 FreeSpecifier(id->_class);
18053 id->_class = (((void *)0));
18054 }
18055 }
18056 if(function->body)
18057 topContext = function->body->compound.context;
18058 {
18059 struct FunctionDefinition * oldFunction = curFunction;
18060
18061 curFunction = function;
18062 if(function->body)
18063 ProcessStatement(function->body);
18064 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
18065 {
18066 struct Statement * prevCompound = curCompound;
18067 struct Context * prevContext = curContext;
18068 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
18069
18070 if(!function->body->compound.statements)
18071 function->body->compound.statements = MkList();
18072 ListAdd(function->body->compound.statements, fireWatchers);
18073 curCompound = function->body;
18074 curContext = function->body->compound.context;
18075 ProcessStatement(fireWatchers);
18076 curContext = prevContext;
18077 curCompound = prevCompound;
18078 }
18079 curFunction = oldFunction;
18080 }
18081 if(function->declarator)
18082 {
18083 ProcessDeclarator(function->declarator);
18084 }
18085 topContext = oldTopContext;
18086 thisClass = oldThisClass;
18087 }
18088
18089 extern void FreeSymbol(struct Symbol * symbol);
18090
18091 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
18092
18093 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
18094 {
18095 struct ClassDef * def;
18096 struct External * external = curExternal;
18097 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
18098
18099 for(def = definitions->first; def; def = def->next)
18100 {
18101 if(def->type == 0)
18102 {
18103 if(def->function->declarator)
18104 curExternal = def->function->declarator->symbol->pointerExternal;
18105 else
18106 curExternal = external;
18107 ProcessFunction((struct FunctionDefinition *)def->function);
18108 }
18109 else if(def->type == 2)
18110 {
18111 if(def->decl->type == 2)
18112 {
18113 thisClass = regClass;
18114 ProcessInstantiationType(def->decl->inst);
18115 thisClass = (((void *)0));
18116 }
18117 else
18118 {
18119 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
18120
18121 if(regClass)
18122 thisClass = regClass;
18123 ProcessDeclaration(def->decl);
18124 thisClass = backThisClass;
18125 }
18126 }
18127 else if(def->type == 1 && def->defProperties)
18128 {
18129 struct MemberInit * defProperty;
18130 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);
18131
18132 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18133 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
18134 {
18135 thisClass = regClass;
18136 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
18137 thisClass = (((void *)0));
18138 }
18139 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18140 FreeSymbol(thisSymbol);
18141 }
18142 else if(def->type == 3 && def->propertyDef)
18143 {
18144 struct PropertyDef * prop = def->propertyDef;
18145
18146 thisClass = regClass;
18147 if(prop->setStmt)
18148 {
18149 if(regClass)
18150 {
18151 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18152
18153 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18154 }
18155 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
18156 ProcessStatement(prop->setStmt);
18157 }
18158 if(prop->getStmt)
18159 {
18160 if(regClass)
18161 {
18162 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18163
18164 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18165 }
18166 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
18167 ProcessStatement(prop->getStmt);
18168 }
18169 if(prop->issetStmt)
18170 {
18171 if(regClass)
18172 {
18173 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18174
18175 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18176 }
18177 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
18178 ProcessStatement(prop->issetStmt);
18179 }
18180 thisClass = (((void *)0));
18181 }
18182 else if(def->type == 4 && def->propertyWatch)
18183 {
18184 struct PropertyWatch * propertyWatch = def->propertyWatch;
18185
18186 thisClass = regClass;
18187 if(propertyWatch->compound)
18188 {
18189 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);
18190
18191 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18192 curExternal = (((void *)0));
18193 ProcessStatement(propertyWatch->compound);
18194 }
18195 thisClass = (((void *)0));
18196 }
18197 }
18198 }
18199
18200 void DeclareFunctionUtil(char * s)
18201 {
18202 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
18203
18204 if(function)
18205 {
18206 char name[1024];
18207
18208 name[0] = (char)0;
18209 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
18210 strcpy(name, "__ecereFunction_");
18211 FullClassNameCat(name, s, 0x0);
18212 DeclareFunction(function, name);
18213 }
18214 }
18215
18216 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
18217
18218 void ComputeDataTypes()
18219 {
18220 struct External * external;
18221 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
18222 struct External * after = (((void *)0));
18223
18224 currentClass = (((void *)0));
18225 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
18226 for(external = (*ast).first; external; external = external->next)
18227 {
18228 if(external->type == 1)
18229 {
18230 struct Declaration * decl = external->declaration;
18231
18232 if(decl)
18233 {
18234 struct __ecereNameSpace__ecere__sys__OldList * decls = decl->declarators;
18235
18236 if(decls)
18237 {
18238 struct InitDeclarator * initDecl = (*decls).first;
18239
18240 if(initDecl)
18241 {
18242 struct Declarator * declarator = initDecl->declarator;
18243
18244 if(declarator && declarator->type == 1)
18245 {
18246 struct Identifier * id = declarator->identifier;
18247
18248 if(id && id->string)
18249 {
18250 if(!strcmp(id->string, "uintptr_t") || !strcmp(id->string, "intptr_t") || !strcmp(id->string, "size_t") || !strcmp(id->string, "ssize_t"))
18251 {
18252 external->symbol->id = -1001, external->symbol->idCode = -1001;
18253 after = external;
18254 }
18255 }
18256 }
18257 }
18258 }
18259 }
18260 }
18261 }
18262 temp->symbol = __extension__ ({
18263 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18264
18265 __ecereInstance1->id = -1000, __ecereInstance1->idCode = -1000, __ecereInstance1;
18266 });
18267 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
18268 curExternal = temp;
18269 DeclareFunctionUtil("eSystem_New");
18270 DeclareFunctionUtil("eSystem_New0");
18271 DeclareFunctionUtil("eSystem_Renew");
18272 DeclareFunctionUtil("eSystem_Renew0");
18273 DeclareFunctionUtil("eSystem_Delete");
18274 DeclareFunctionUtil("eClass_GetProperty");
18275 DeclareFunctionUtil("eInstance_FireSelfWatchers");
18276 DeclareStruct("ecere::com::Class", 0x0);
18277 DeclareStruct("ecere::com::Instance", 0x0);
18278 DeclareStruct("ecere::com::Property", 0x0);
18279 DeclareStruct("ecere::com::DataMember", 0x0);
18280 DeclareStruct("ecere::com::Method", 0x0);
18281 DeclareStruct("ecere::com::SerialBuffer", 0x0);
18282 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
18283 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
18284 for(external = (*ast).first; external; external = external->next)
18285 {
18286 afterExternal = curExternal = external;
18287 if(external->type == 0)
18288 {
18289 currentClass = external->function->_class;
18290 ProcessFunction(external->function);
18291 }
18292 else if(external->type == 1)
18293 {
18294 currentClass = (((void *)0));
18295 ProcessDeclaration(external->declaration);
18296 }
18297 else if(external->type == 2)
18298 {
18299 struct ClassDefinition * _class = external->_class;
18300
18301 currentClass = external->symbol->registered;
18302 if(_class->definitions)
18303 {
18304 ProcessClass(_class->definitions, _class->symbol);
18305 }
18306 if(inCompiler)
18307 {
18308 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
18309 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
18310 }
18311 }
18312 else if(external->type == 4)
18313 {
18314 thisNameSpace = external->id->string;
18315 }
18316 }
18317 currentClass = (((void *)0));
18318 thisNameSpace = (((void *)0));
18319 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
18320 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
18321 }
18322
18323 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);
18324
18325 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);
18326
18327 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
18328
18329 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
18330 {
18331 struct __ecereNameSpace__ecere__com__Class * class;
18332
18333 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
18334 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
18335 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
18336 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
18337 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
18338 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
18339 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
18340 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
18341 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
18342 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
18343 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
18344 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
18345 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
18346 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
18347 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
18348 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
18349 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
18350 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
18351 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt", "bool GetOpInt(Operand op2, int * value2)", GetOpInt, module, 1);
18352 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
18353 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt", "bool GetOpUInt(Operand op2, uint * value2)", GetOpUInt, module, 1);
18354 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
18355 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt64", "bool GetOpInt64(Operand op2, int64 * value2)", GetOpInt64, module, 1);
18356 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
18357 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt64", "bool GetOpUInt64(Operand op2, uint64 * value2)", GetOpUInt64, module, 1);
18358 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
18359 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntPtr", "bool GetOpIntPtr(Operand op2, intptr * value2)", GetOpIntPtr, module, 1);
18360 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
18361 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntPtr", "bool GetOpUIntPtr(Operand op2, uintptr * value2)", GetOpUIntPtr, module, 1);
18362 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
18363 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntSize", "bool GetOpIntSize(Operand op2, intsize * value2)", GetOpIntSize, module, 1);
18364 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
18365 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntSize", "bool GetOpUIntSize(Operand op2, uintsize * value2)", GetOpUIntSize, module, 1);
18366 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
18367 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpShort", "bool GetOpShort(Operand op2, short * value2)", GetOpShort, module, 1);
18368 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
18369 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUShort", "bool GetOpUShort(Operand op2, uint16 * value2)", GetOpUShort, module, 1);
18370 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
18371 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpChar", "bool GetOpChar(Operand op2, char * value2)", GetOpChar, module, 1);
18372 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
18373 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUChar", "bool GetOpUChar(Operand op2, byte * value2)", GetOpUChar, module, 1);
18374 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
18375 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpFloat", "bool GetOpFloat(Operand op2, float * value2)", GetOpFloat, module, 1);
18376 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
18377 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpDouble", "bool GetOpDouble(Operand op2, double * value2)", GetOpDouble, module, 1);
18378 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
18379 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
18380 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
18381 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
18382 __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);
18383 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
18384 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
18385 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
18386 __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);
18387 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
18388 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
18389 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
18390 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
18391 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
18392 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
18393 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
18394 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
18395 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
18396 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
18397 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
18398 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
18399 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
18400 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
18401 __ecereClass_Conversion = class;
18402 __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);
18403 __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);
18404 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
18405 __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);
18406 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
18407 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
18408 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("UnescapeString", "int UnescapeString(char * d, char * s, int len)", UnescapeString, module, 1);
18409 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("OffsetEscapedString", "char * OffsetEscapedString(char * s, int len, int offset)", OffsetEscapedString, module, 1);
18410 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
18411 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
18412 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
18413 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
18414 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
18415 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
18416 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
18417 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
18418 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
18419 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
18420 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetParseError", "bool GetParseError(void)", GetParseError, module, 1);
18421 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
18422 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
18423 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
18424 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
18425 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(String s)", DeclareFunctionUtil, module, 1);
18426 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
18427 }
18428
18429 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
18430 {
18431
18432 }
18433